aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-19 11:49:53 -0700
committerwycats <wycats@gmail.com>2010-03-19 11:50:03 -0700
commit9f92563892007c7f42a51ec7926352d50d596579 (patch)
tree7b35d950f54d8d7599f3d6f2b8ce6b9619c48a31 /actionpack/lib/action_view
parent7f53dca1a13e21ec4400a765f637b73c0f194979 (diff)
downloadrails-9f92563892007c7f42a51ec7926352d50d596579.tar.gz
rails-9f92563892007c7f42a51ec7926352d50d596579.tar.bz2
rails-9f92563892007c7f42a51ec7926352d50d596579.zip
Eliminate an error from an implicit dependency on AV::Base
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/base.rb21
-rw-r--r--actionpack/lib/action_view/template/error.rb24
2 files changed, 22 insertions, 23 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index 66af693cde..9eec8ecce8 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -7,27 +7,6 @@ module ActionView #:nodoc:
class NonConcattingString < ActiveSupport::SafeBuffer
end
- class ActionViewError < StandardError #:nodoc:
- end
-
- class MissingTemplate < ActionViewError #:nodoc:
- attr_reader :path
-
- def initialize(paths, path, details, partial)
- @path = path
- display_paths = paths.compact.map{ |p| p.to_s.inspect }.join(", ")
- template_type = if partial
- "partial"
- elsif path =~ /layouts/i
- 'layout'
- else
- 'template'
- end
-
- super("Missing #{template_type} #{path} with #{details.inspect} in view paths #{display_paths}")
- end
- end
-
# Action View templates can be written in three ways. If the template file has a <tt>.erb</tt> (or <tt>.rhtml</tt>) extension then it uses a mixture of ERb
# (included in Ruby) and HTML. If the template file has a <tt>.builder</tt> (or <tt>.rxml</tt>) extension then Jim Weirich's Builder::XmlMarkup library is used.
# If the template file has a <tt>.rjs</tt> extension then it will use ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.
diff --git a/actionpack/lib/action_view/template/error.rb b/actionpack/lib/action_view/template/error.rb
index 648f708d3d..5222ffa89c 100644
--- a/actionpack/lib/action_view/template/error.rb
+++ b/actionpack/lib/action_view/template/error.rb
@@ -1,6 +1,26 @@
require "active_support/core_ext/enumerable"
module ActionView
+ class ActionViewError < StandardError #:nodoc:
+ end
+
+ class MissingTemplate < ActionViewError #:nodoc:
+ attr_reader :path
+
+ def initialize(paths, path, details, partial)
+ @path = path
+ display_paths = paths.compact.map{ |p| p.to_s.inspect }.join(", ")
+ template_type = if partial
+ "partial"
+ elsif path =~ /layouts/i
+ 'layout'
+ else
+ 'template'
+ end
+
+ super("Missing #{template_type} #{path} with #{details.inspect} in view paths #{display_paths}")
+ end
+ end
class Template
# The Template::Error exception is raised when the compilation of the template fails. This exception then gathers a
# bunch of intimate details and uses it to report a very precise exception message.
@@ -73,11 +93,11 @@ module ActionView
end
def to_s
- "\n#{self.class} (#{message}) #{source_location}:\n" +
+ "\n#{self.class} (#{message}) #{source_location}:\n" +
"#{source_extract}\n #{clean_backtrace.join("\n ")}\n\n"
end
- # don't do anything nontrivial here. Any raised exception from here becomes fatal
+ # don't do anything nontrivial here. Any raised exception from here becomes fatal
# (and can't be rescued).
def backtrace
@backtrace