Permalink
Browse files

Merge branch 'master' of git://github.com/rails/rails

  • Loading branch information...
2 parents b8fadd7 + 73cc5f2 commit 19f8bb2808316dfca1f009538c3505ba144f614b lholden committed Jan 22, 2009
Showing with 12,855 additions and 14,775 deletions.
  1. +2 −0 .gitignore
  2. +1 −1 actionmailer/MIT-LICENSE
  3. +1 −1 actionmailer/lib/action_mailer.rb
  4. +13 −7 actionmailer/lib/action_mailer/base.rb
  5. +12 −0 actionmailer/test/mail_service_test.rb
  6. +4 −2 actionmailer/test/quoting_test.rb
  7. +1 −1 actionpack/MIT-LICENSE
  8. +3 −3 actionpack/lib/action_controller.rb
  9. +15 −8 actionpack/lib/action_controller/assertions/selector_assertions.rb
  10. +2 −5 actionpack/lib/action_controller/base.rb
  11. +7 −5 actionpack/lib/action_controller/flash.rb
  12. +0 −16 actionpack/lib/action_controller/lock.rb
  13. +10 −5 actionpack/lib/action_controller/middleware_stack.rb
  14. +4 −5 actionpack/lib/action_controller/middlewares.rb
  15. +71 −0 actionpack/lib/action_controller/params_parser.rb
  16. +3 −22 actionpack/lib/action_controller/rack_ext.rb
  17. +21 −0 actionpack/lib/action_controller/rack_ext/lock.rb
  18. +22 −0 actionpack/lib/action_controller/rack_ext/multipart.rb
  19. +18 −0 actionpack/lib/action_controller/rack_ext/parse_query.rb
  20. +31 −15 actionpack/lib/action_controller/request.rb
  21. +0 −315 actionpack/lib/action_controller/request_parser.rb
  22. +0 −168 actionpack/lib/action_controller/request_profiler.rb
  23. +7 −23 actionpack/lib/action_controller/rewindable_input.rb
  24. +2 −3 actionpack/lib/action_controller/routing.rb
  25. +1 −3 actionpack/lib/action_controller/session/cookie_store.rb
  26. +1 −1 actionpack/lib/action_controller/session_management.rb
  27. +7 −0 actionpack/lib/action_controller/uploaded_file.rb
  28. +61 −0 actionpack/lib/action_controller/url_encoded_pair_parser.rb
  29. +1 −1 actionpack/lib/action_pack.rb
  30. +1 −1 actionpack/lib/action_view.rb
  31. +74 −50 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  32. +5 −5 actionpack/lib/action_view/helpers/date_helper.rb
  33. +1 −1 actionpack/lib/action_view/template.rb
  34. +5 −1 actionpack/lib/action_view/template_handlers.rb
  35. +0 −54 actionpack/test/controller/http_authentication_test.rb
  36. +88 −0 actionpack/test/controller/http_basic_authentication_test.rb
  37. +6 −0 actionpack/test/controller/middleware_stack_test.rb
  38. +1 −1 actionpack/test/controller/rack_test.rb
  39. +18 −3 actionpack/test/controller/request/multipart_params_parsing_test.rb
  40. +12 −0 actionpack/test/controller/request/url_encoded_params_parsing_test.rb
  41. +2 −2 actionpack/test/controller/session/cookie_store_test.rb
  42. +10 −0 actionpack/test/fixtures/multipart/empty
  43. +9 −0 actionpack/test/fixtures/multipart/none
  44. +80 −15 actionpack/test/template/date_helper_test.rb
  45. +6 −2 activerecord/CHANGELOG
  46. +1 −1 activerecord/MIT-LICENSE
  47. +1 −1 activerecord/lib/active_record.rb
  48. +2 −2 activerecord/lib/active_record/associations.rb
  49. +9 −3 activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  50. +74 −48 activerecord/lib/active_record/base.rb
  51. +16 −8 activerecord/lib/active_record/calculations.rb
  52. +4 −3 activerecord/lib/active_record/callbacks.rb
  53. +2 −2 activerecord/lib/active_record/dirty.rb
  54. +1 −1 activerecord/lib/active_record/locale/en.yml
  55. +1 −1 activerecord/lib/active_record/named_scope.rb
  56. +8 −0 activerecord/lib/active_record/reflection.rb
  57. +11 −0 activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
  58. +2 −1 activerecord/test/cases/associations/has_many_associations_test.rb
  59. +41 −3 activerecord/test/cases/callbacks_test.rb
  60. +25 −1 activerecord/test/cases/dirty_test.rb
  61. +1 −1 activerecord/test/cases/helper.rb
  62. +1 −1 activerecord/test/cases/json_serialization_test.rb
  63. +1 −0 activerecord/test/schema/schema.rb
  64. +1 −1 activeresource/MIT-LICENSE
  65. +1 −1 activesupport/MIT-LICENSE
  66. +4 −0 activesupport/lib/active_support/cache.rb
  67. +6 −1 activesupport/lib/active_support/cache/mem_cache_store.rb
  68. +104 −0 activesupport/lib/active_support/cache/strategy/local_cache.rb
  69. +3 −3 activesupport/lib/active_support/core_ext/date/conversions.rb
  70. +1 −1 activesupport/lib/active_support/core_ext/date_time/conversions.rb
  71. +1 −1 activesupport/lib/active_support/core_ext/hash/conversions.rb
  72. +1 −1 activesupport/lib/active_support/core_ext/hash/keys.rb
  73. +0 −17 activesupport/lib/active_support/core_ext/object/misc.rb
  74. +1 −1 activesupport/lib/active_support/core_ext/range/conversions.rb
  75. +30 −0 activesupport/lib/active_support/core_ext/try.rb
  76. +1 −1 activesupport/lib/active_support/json/encoders/date.rb
  77. +1 −1 activesupport/lib/active_support/json/encoders/date_time.rb
  78. +2 −2 activesupport/lib/active_support/json/encoders/hash.rb
  79. +1 −1 activesupport/lib/active_support/json/encoders/time.rb
  80. +22 −9 activesupport/lib/active_support/ordered_hash.rb
  81. +1 −1 activesupport/lib/active_support/time_with_zone.rb
  82. +105 −16 activesupport/test/caching_test.rb
  83. +2 −2 activesupport/test/core_ext/integer_ext_test.rb
  84. +2 −2 activesupport/test/json/encoding_test.rb
  85. +9 −1 activesupport/test/ordered_hash_test.rb
  86. +6 −0 railties/CHANGELOG
  87. +1 −1 railties/MIT-LICENSE
  88. +13 −3 railties/Rakefile
  89. +0 −3 railties/bin/performance/request
  90. +2 −5 railties/doc/README_FOR_APP
  91. +229 −413 railties/doc/guides/html/2_2_release_notes.html
  92. +197 −0 railties/doc/guides/html/action_mailer_basics.html
  93. +245 −479 railties/doc/guides/html/actioncontroller_basics.html
  94. +445 −647 railties/doc/guides/html/{finders.html → active_record_querying.html}
  95. +607 −596 railties/doc/guides/html/activerecord_validations_callbacks.html
  96. +461 −734 railties/doc/guides/html/association_basics.html
  97. +45 −203 railties/doc/guides/html/authors.html
  98. +0 −1,018 railties/doc/guides/html/benchmarking_and_profiling.html
  99. +131 −318 railties/doc/guides/html/caching_with_rails.html
  100. +210 −291 railties/doc/guides/html/command_line.html
  101. +261 −355 railties/doc/guides/html/configuring.html
  102. +346 −562 railties/doc/guides/html/creating_plugins.html
  103. +241 −424 railties/doc/guides/html/debugging_rails_applications.html
  104. +652 −320 railties/doc/guides/html/form_helpers.html
  105. +485 −824 railties/doc/guides/html/getting_started_with_rails.html
  106. +534 −762 railties/doc/guides/html/i18n.html
  107. +85 −225 railties/doc/guides/html/index.html
  108. +408 −536 railties/doc/guides/html/layouts_and_rendering.html
  109. +233 −424 railties/doc/guides/html/migrations.html
  110. +728 −0 railties/doc/guides/html/performance_testing.html
  111. +450 −0 railties/doc/guides/html/rails_on_rack.html
  112. +688 −1,310 railties/doc/guides/html/routing_outside_in.html
  113. +423 −616 railties/doc/guides/html/security.html
  114. +1,011 −881 railties/doc/guides/html/testing_rails_applications.html
  115. +133 −0 railties/doc/guides/source/action_mailer_basics.txt
  116. +1 −32 railties/doc/guides/source/actioncontroller_basics/session.txt
  117. +1 −28 railties/doc/guides/source/active_record_basics.txt
  118. +71 −91 railties/doc/guides/source/{finders.txt → active_record_querying.txt}
  119. +260 −106 railties/doc/guides/source/activerecord_validations_callbacks.txt
  120. +12 −0 railties/doc/guides/source/authors.txt
  121. +0 −95 railties/doc/guides/source/benchmarking_and_profiling/appendix.txt
  122. +0 −105 railties/doc/guides/source/benchmarking_and_profiling/digging_deeper.txt
  123. +0 −185 railties/doc/guides/source/benchmarking_and_profiling/edge_rails_features.txt
  124. +0 −27 railties/doc/guides/source/benchmarking_and_profiling/gameplan.txt
  125. +0 −242 railties/doc/guides/source/benchmarking_and_profiling/index.txt
  126. +0 −179 railties/doc/guides/source/benchmarking_and_profiling/rubyprof.txt
  127. +0 −57 railties/doc/guides/source/benchmarking_and_profiling/statistics.txt
  128. +4 −4 railties/doc/guides/source/caching_with_rails.txt
  129. +67 −22 railties/doc/guides/source/configuring.txt
  130. +382 −82 railties/doc/guides/source/form_helpers.txt
  131. +35 −37 railties/doc/guides/source/getting_started_with_rails.txt
  132. +73 −51 railties/doc/guides/source/i18n.txt
  133. BIN railties/doc/guides/source/images/customized_error_messages.png
  134. BIN railties/doc/guides/source/images/error_messages.png
  135. BIN railties/doc/guides/source/images/validation_error_messages.png
  136. +26 −9 railties/doc/guides/source/index.txt
  137. +106 −11 railties/doc/guides/source/layouts_and_rendering.txt
  138. +560 −0 railties/doc/guides/source/performance_testing.txt
  139. +256 −0 railties/doc/guides/source/rails_on_rack.txt
  140. +55 −60 railties/doc/guides/source/routing_outside_in.txt
  141. +160 −160 railties/doc/guides/source/stylesheets/base.css
  142. +4 −4 railties/doc/guides/source/stylesheets/forms.css
  143. +176 −5 railties/doc/guides/source/stylesheets/more.css
  144. +83 −86 railties/doc/guides/source/templates/guides.html.erb
  145. +0 −165 railties/doc/guides/source/templates/inline.css
  146. +96 −87 railties/doc/guides/source/testing_rails_applications.txt
  147. +0 −6 railties/lib/commands/performance/request.rb
  148. +1 −1 railties/lib/dispatcher.rb
  149. +9 −1 railties/lib/initializer.rb
  150. +1 −1 railties/lib/rails_generator/generators/applications/app/app_generator.rb
  151. +7 −1 railties/lib/rails_generator/generators/applications/app/template_runner.rb
View
@@ -15,3 +15,5 @@ railties/test/500.html
railties/doc/guides/html/images
railties/doc/guides/html/stylesheets
*.rbc
+*.swp
+*.swo
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2008 David Heinemeier Hansson
+Copyright (c) 2004-2009 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
#--
-# Copyright (c) 2004-2008 David Heinemeier Hansson
+# Copyright (c) 2004-2009 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -213,6 +213,8 @@ module ActionMailer #:nodoc:
# * <tt>:password</tt> - If your mail server requires authentication, set the password in this setting.
# * <tt>:authentication</tt> - If your mail server requires authentication, you need to specify the authentication type here.
# This is a symbol and one of <tt>:plain</tt>, <tt>:login</tt>, <tt>:cram_md5</tt>.
+ # * <tt>:enable_starttls_auto</tt> - When set to true, detects if STARTTLS is enabled in your SMTP server and starts to use it.
+ # It works only on Ruby >= 1.8.7 and Ruby >= 1.9. Default is true.
#
# * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
# * <tt>:location</tt> - The location of the sendmail executable. Defaults to <tt>/usr/sbin/sendmail</tt>.
@@ -230,10 +232,13 @@ module ActionMailer #:nodoc:
#
# * <tt>default_charset</tt> - The default charset used for the body and to encode the subject. Defaults to UTF-8. You can also
# pick a different charset from inside a method with +charset+.
+ #
# * <tt>default_content_type</tt> - The default content type used for the main part of the message. Defaults to "text/plain". You
# can also pick a different content type from inside a method with +content_type+.
+ #
# * <tt>default_mime_version</tt> - The default mime version used for the message. Defaults to <tt>1.0</tt>. You
# can also pick a different value from inside a method with +mime_version+.
+ #
# * <tt>default_implicit_parts_order</tt> - When a message is built implicitly (i.e. multiple parts are assembled from templates
# which specify the content type in their filenames) this variable controls how the parts are ordered. Defaults to
# <tt>["text/html", "text/enriched", "text/plain"]</tt>. Items that appear first in the array have higher priority in the mail client
@@ -252,12 +257,13 @@ class Base
cattr_accessor :logger
@@smtp_settings = {
- :address => "localhost",
- :port => 25,
- :domain => 'localhost.localdomain',
- :user_name => nil,
- :password => nil,
- :authentication => nil
+ :address => "localhost",
+ :port => 25,
+ :domain => 'localhost.localdomain',
+ :user_name => nil,
+ :password => nil,
+ :authentication => nil,
+ :enable_starttls_auto => true,
}
cattr_accessor :smtp_settings
@@ -669,7 +675,7 @@ def perform_delivery_smtp(mail)
sender = mail['return-path'] || mail.from
smtp = Net::SMTP.new(smtp_settings[:address], smtp_settings[:port])
- smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)
+ smtp.enable_starttls_auto if smtp_settings[:enable_starttls_auto] && smtp.respond_to?(:enable_starttls_auto)
smtp.start(smtp_settings[:domain], smtp_settings[:user_name], smtp_settings[:password],
smtp_settings[:authentication]) do |smtp|
smtp.sendmail(mail.encoded, sender, destinations)
@@ -948,18 +948,30 @@ def test_body_is_stored_as_an_ivar
end
def test_starttls_is_enabled_if_supported
+ ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true
MockSMTP.any_instance.expects(:respond_to?).with(:enable_starttls_auto).returns(true)
MockSMTP.any_instance.expects(:enable_starttls_auto)
ActionMailer::Base.delivery_method = :smtp
TestMailer.deliver_signed_up(@recipient)
end
def test_starttls_is_disabled_if_not_supported
+ ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true
MockSMTP.any_instance.expects(:respond_to?).with(:enable_starttls_auto).returns(false)
MockSMTP.any_instance.expects(:enable_starttls_auto).never
ActionMailer::Base.delivery_method = :smtp
TestMailer.deliver_signed_up(@recipient)
end
+
+ def test_starttls_is_not_enabled
+ ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false
+ MockSMTP.any_instance.expects(:respond_to?).never
+ MockSMTP.any_instance.expects(:enable_starttls_auto).never
+ ActionMailer::Base.delivery_method = :smtp
+ TestMailer.deliver_signed_up(@recipient)
+ ensure
+ ActionMailer::Base.smtp_settings[:enable_starttls_auto] = true
+ end
end
end # uses_mocha
@@ -48,8 +48,10 @@ def test_quote_multibyte_chars
result = execute_in_sandbox(<<-CODE)
$:.unshift(File.dirname(__FILE__) + "/../lib/")
- $KCODE = 'u'
- require 'jcode'
+ if RUBY_VERSION < '1.9'
+ $KCODE = 'u'
+ require 'jcode'
+ end
require 'action_mailer/quoting'
include ActionMailer::Quoting
quoted_printable(#{original.inspect}, "UTF-8")
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2008 David Heinemeier Hansson
+Copyright (c) 2004-2009 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
#--
-# Copyright (c) 2004-2008 David Heinemeier Hansson
+# Copyright (c) 2004-2009 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -56,14 +56,13 @@ def self.load_all!
autoload :Integration, 'action_controller/integration'
autoload :IntegrationTest, 'action_controller/integration'
autoload :Layout, 'action_controller/layout'
- autoload :Lock, 'action_controller/lock'
autoload :MiddlewareStack, 'action_controller/middleware_stack'
autoload :MimeResponds, 'action_controller/mime_responds'
+ autoload :ParamsParser, 'action_controller/params_parser'
autoload :PolymorphicRoutes, 'action_controller/polymorphic_routes'
autoload :RecordIdentifier, 'action_controller/record_identifier'
autoload :Request, 'action_controller/request'
autoload :RequestForgeryProtection, 'action_controller/request_forgery_protection'
- autoload :RequestParser, 'action_controller/request_parser'
autoload :Rescue, 'action_controller/rescue'
autoload :Resources, 'action_controller/resources'
autoload :Response, 'action_controller/response'
@@ -75,6 +74,7 @@ def self.load_all!
autoload :TestCase, 'action_controller/test_case'
autoload :TestProcess, 'action_controller/test_process'
autoload :Translation, 'action_controller/translation'
+ autoload :UploadedFile, 'action_controller/uploaded_file'
autoload :UploadedStringIO, 'action_controller/uploaded_file'
autoload :UploadedTempfile, 'action_controller/uploaded_file'
autoload :UrlEncodedPairParser, 'action_controller/url_encoded_pair_parser'
@@ -109,20 +109,27 @@ def css_select(*args)
# starting from (and including) that element and all its children in
# depth-first order.
#
- # If no element if specified, calling +assert_select+ will select from the
- # response HTML. Calling #assert_select inside an +assert_select+ block will
- # run the assertion for each element selected by the enclosing assertion.
+ # If no element if specified, calling +assert_select+ selects from the
+ # response HTML unless +assert_select+ is called from within an +assert_select+ block.
+ #
+ # When called with a block +assert_select+ passes an array of selected elements
+ # to the block. Calling +assert_select+ from the block, with no element specified,
+ # runs the assertion on the complete set of elements selected by the enclosing assertion.
+ # Alternatively the array may be iterated through so that +assert_select+ can be called
+ # separately for each element.
+ #
#
# ==== Example
- # assert_select "ol>li" do |elements|
+ # If the response contains two ordered lists, each with four list elements then:
+ # assert_select "ol" do |elements|
# elements.each do |element|
- # assert_select element, "li"
+ # assert_select element, "li", 4
# end
# end
#
- # Or for short:
- # assert_select "ol>li" do
- # assert_select "li"
+ # will pass, as will:
+ # assert_select "ol" do
+ # assert_select "li", 8
# end
#
# The selector may be a CSS selector expression (String), an expression
@@ -301,10 +301,7 @@ class Base
# A YAML parser is also available and can be turned on with:
#
# ActionController::Base.param_parsers[Mime::YAML] = :yaml
- @@param_parsers = { Mime::MULTIPART_FORM => :multipart_form,
- Mime::URL_ENCODED_FORM => :url_encoded_form,
- Mime::XML => :xml_simple,
- Mime::JSON => :json }
+ @@param_parsers = {}
cattr_accessor :param_parsers
# Controls the default charset for all renders.
@@ -647,7 +644,7 @@ def controller_path
end
def session_enabled?
- request.session_options && request.session_options[:disabled] != false
+ ActiveSupport::Deprecation.warn("Sessions are now lazy loaded. So if you don't access them, consider them disabled.", caller)
end
self.view_paths = []
@@ -4,20 +4,22 @@ module ActionController #:nodoc:
# action that sets <tt>flash[:notice] = "Successfully created"</tt> before redirecting to a display action that can
# then expose the flash to its template. Actually, that exposure is automatically done. Example:
#
- # class WeblogController < ActionController::Base
+ # class PostsController < ActionController::Base
# def create
# # save post
# flash[:notice] = "Successfully created post"
- # redirect_to :action => "display", :params => { :id => post.id }
+ # redirect_to posts_path(@post)
# end
#
- # def display
+ # def show
# # doesn't need to assign the flash notice to the template, that's done automatically
# end
# end
#
- # display.erb
- # <% if flash[:notice] %><div class="notice"><%= flash[:notice] %></div><% end %>
+ # show.html.erb
+ # <% if flash[:notice] %>
+ # <div class="notice"><%= flash[:notice] %></div>
+ # <% end %>
#
# This example just places a string in the flash, but you can put any object in there. And of course, you can put as
# many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.
@@ -1,16 +0,0 @@
-module ActionController
- class Lock
- FLAG = 'rack.multithread'.freeze
-
- def initialize(app, lock = Mutex.new)
- @app, @lock = app, lock
- end
-
- def call(env)
- old, env[FLAG] = env[FLAG], false
- @lock.synchronize { @app.call(env) }
- ensure
- env[FLAG] = old
- end
- end
-end
@@ -75,17 +75,22 @@ def initialize(*args, &block)
block.call(self) if block_given?
end
- def insert(index, *objs)
+ def insert(index, *args, &block)
index = self.index(index) unless index.is_a?(Integer)
- objs = objs.map { |obj| Middleware.new(obj) }
- super(index, *objs)
+ middleware = Middleware.new(*args, &block)
+ super(index, middleware)
end
alias_method :insert_before, :insert
- def insert_after(index, *objs)
+ def insert_after(index, *args, &block)
index = self.index(index) unless index.is_a?(Integer)
- insert(index + 1, *objs)
+ insert(index + 1, *args, &block)
+ end
+
+ def swap(target, *args, &block)
+ insert_before(target, *args, &block)
+ delete(target)
end
def use(*args, &block)
@@ -1,11 +1,9 @@
-use "ActionController::Lock", :if => lambda {
+use "Rack::Lock", :if => lambda {
!ActionController::Base.allow_concurrency
}
use "ActionController::Failsafe"
-use "ActiveRecord::QueryCache", :if => lambda { defined?(ActiveRecord) }
-
["ActionController::Session::CookieStore",
"ActionController::Session::MemCacheStore",
"ActiveRecord::SessionStore"].each do |store|
@@ -18,5 +16,6 @@
)
end
-use ActionController::RewindableInput
-use Rack::MethodOverride
+use "ActionController::RewindableInput"
+use "ActionController::ParamsParser"
+use "Rack::MethodOverride"
@@ -0,0 +1,71 @@
+module ActionController
+ class ParamsParser
+ ActionController::Base.param_parsers[Mime::XML] = :xml_simple
+ ActionController::Base.param_parsers[Mime::JSON] = :json
+
+ def initialize(app)
+ @app = app
+ end
+
+ def call(env)
+ if params = parse_formatted_parameters(env)
+ env["action_controller.request.request_parameters"] = params
+ end
+
+ @app.call(env)
+ end
+
+ private
+ def parse_formatted_parameters(env)
+ request = Request.new(env)
+
+ return false if request.content_length.zero?
+
+ mime_type = content_type_from_legacy_post_data_format_header(env) || request.content_type
+ strategy = ActionController::Base.param_parsers[mime_type]
+
+ return false unless strategy
+
+ case strategy
+ when Proc
+ strategy.call(request.raw_post)
+ when :xml_simple, :xml_node
+ body = request.raw_post
+ body.blank? ? {} : Hash.from_xml(body).with_indifferent_access
+ when :yaml
+ YAML.load(request.raw_post)
+ when :json
+ body = request.raw_post
+ if body.blank?
+ {}
+ else
+ data = ActiveSupport::JSON.decode(body)
+ data = {:_json => data} unless data.is_a?(Hash)
+ data.with_indifferent_access
+ end
+ else
+ false
+ end
+ rescue Exception => e # YAML, XML or Ruby code block errors
+ raise
+ { "body" => request.raw_post,
+ "content_type" => request.content_type,
+ "content_length" => request.content_length,
+ "exception" => "#{e.message} (#{e.class})",
+ "backtrace" => e.backtrace }
+ end
+
+ def content_type_from_legacy_post_data_format_header(env)
+ if x_post_format = env['HTTP_X_POST_DATA_FORMAT']
+ case x_post_format.to_s.downcase
+ when 'yaml'
+ return Mime::YAML
+ when 'xml'
+ return Mime::XML
+ end
+ end
+
+ nil
+ end
+ end
+end
Oops, something went wrong.

0 comments on commit 19f8bb2

Please sign in to comment.