Permalink
Browse files

Revert "Remove blank trailing comments"

This reverts commit fa6d921.

Reason: Not a fan of such massive changes. We usually close such changes
if made to Rails master as a pull request. Following the same principle
here and reverting.

[ci skip]
  • Loading branch information...
1 parent 2642c29 commit 1ad0b378cc081937c117577ab628f2160fcc448d @vijaydev vijaydev committed May 23, 2012
Showing with 192 additions and 0 deletions.
  1. +1 −0 Rakefile
  2. +1 −0 actionmailer/lib/action_mailer/delivery_methods.rb
  3. +1 −0 actionmailer/lib/rails/generators/mailer/templates/mailer.rb
  4. +1 −0 actionpack/lib/abstract_controller/helpers.rb
  5. +1 −0 actionpack/lib/action_controller/base.rb
  6. +2 −0 actionpack/lib/action_controller/metal.rb
  7. +1 −0 actionpack/lib/action_controller/metal/helpers.rb
  8. +1 −0 actionpack/lib/action_controller/metal/mime_responds.rb
  9. +10 −0 actionpack/lib/action_controller/metal/responder.rb
  10. +1 −0 actionpack/lib/action_controller/metal/streaming.rb
  11. +2 −0 actionpack/lib/action_dispatch/http/mime_negotiation.rb
  12. +1 −0 actionpack/lib/action_dispatch/middleware/reloader.rb
  13. +1 −0 actionpack/lib/action_dispatch/routing.rb
  14. +1 −0 actionpack/lib/action_dispatch/routing/mapper.rb
  15. +2 −0 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
  16. +1 −0 actionpack/lib/action_dispatch/routing/redirection.rb
  17. +1 −0 actionpack/lib/action_dispatch/routing/route_set.rb
  18. +1 −0 actionpack/lib/action_dispatch/routing/url_for.rb
  19. +1 −0 actionpack/lib/action_dispatch/testing/assertions/routing.rb
  20. +1 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
  21. +1 −0 actionpack/lib/action_view/helpers/capture_helper.rb
  22. +11 −0 actionpack/lib/action_view/helpers/form_helper.rb
  23. +3 −0 actionpack/lib/action_view/helpers/form_options_helper.rb
  24. +3 −0 actionpack/lib/action_view/helpers/form_tag_helper.rb
  25. +1 −0 actionpack/lib/action_view/helpers/number_helper.rb
  26. +1 −0 actionpack/lib/action_view/helpers/output_safety_helper.rb
  27. +2 −0 actionpack/lib/action_view/helpers/record_tag_helper.rb
  28. +1 −0 actionpack/lib/action_view/helpers/rendering_helper.rb
  29. +12 −0 actionpack/lib/action_view/helpers/sanitize_helper.rb
  30. +1 −0 actionpack/lib/action_view/helpers/tags/select.rb
  31. +1 −0 actionpack/lib/action_view/helpers/url_helper.rb
  32. +1 −0 actionpack/lib/action_view/template/resolver.rb
  33. +1 −0 activemodel/lib/active_model/attribute_methods.rb
  34. +1 −0 activemodel/lib/active_model/callbacks.rb
  35. +1 −0 activemodel/lib/active_model/conversion.rb
  36. +1 −0 activemodel/lib/active_model/errors.rb
  37. +2 −0 activemodel/lib/active_model/lint.rb
  38. +2 −0 activemodel/lib/active_model/mass_assignment_security.rb
  39. +2 −0 activemodel/lib/active_model/observing.rb
  40. +1 −0 activemodel/lib/active_model/serialization.rb
  41. +2 −0 activemodel/lib/active_model/validations.rb
  42. +1 −0 activemodel/lib/active_model/validations/validates.rb
  43. +2 −0 activemodel/lib/active_model/validator.rb
  44. +1 −0 activemodel/test/cases/validations/i18n_validation_test.rb
  45. +2 −0 activerecord/lib/active_record/aggregations.rb
  46. +1 −0 activerecord/lib/active_record/associations/association.rb
  47. +1 −0 activerecord/lib/active_record/callbacks.rb
  48. +1 −0 activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
  49. +1 −0 activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
  50. +1 −0 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  51. +1 −0 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  52. +1 −0 activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
  53. +1 −0 activerecord/lib/active_record/locking/optimistic.rb
  54. +1 −0 activerecord/lib/active_record/model.rb
  55. +1 −0 activerecord/lib/active_record/observer.rb
  56. +1 −0 activerecord/lib/active_record/persistence.rb
  57. +6 −0 activerecord/lib/active_record/reflection.rb
  58. +1 −0 activerecord/lib/active_record/relation/calculations.rb
  59. +1 −0 activerecord/lib/active_record/relation/finder_methods.rb
  60. +3 −0 activerecord/lib/active_record/relation/query_methods.rb
  61. +3 −0 activerecord/lib/active_record/relation/spawn_methods.rb
  62. +1 −0 activerecord/lib/active_record/validations/uniqueness.rb
  63. +1 −0 activerecord/test/cases/attribute_methods_test.rb
  64. +1 −0 activerecord/test/cases/validations/i18n_validation_test.rb
  65. +1 −0 activerecord/test/models/subject.rb
  66. +1 −0 activesupport/lib/active_support/benchmarkable.rb
  67. +1 −0 activesupport/lib/active_support/callbacks.rb
  68. +1 −0 activesupport/lib/active_support/concern.rb
  69. +2 −0 activesupport/lib/active_support/configurable.rb
  70. +1 −0 activesupport/lib/active_support/core_ext/array/conversions.rb
  71. +1 −0 activesupport/lib/active_support/core_ext/array/uniq_by.rb
  72. +2 −0 activesupport/lib/active_support/core_ext/enumerable.rb
  73. +1 −0 activesupport/lib/active_support/core_ext/hash/except.rb
  74. +2 −0 activesupport/lib/active_support/core_ext/hash/indifferent_access.rb
  75. +2 −0 activesupport/lib/active_support/core_ext/integer/inflections.rb
  76. +2 −0 activesupport/lib/active_support/core_ext/kernel/reporting.rb
  77. +1 −0 activesupport/lib/active_support/core_ext/module/anonymous.rb
  78. +1 −0 activesupport/lib/active_support/core_ext/module/delegation.rb
  79. +2 −0 activesupport/lib/active_support/core_ext/module/introspection.rb
  80. +7 −0 activesupport/lib/active_support/core_ext/object/blank.rb
  81. +5 −0 activesupport/lib/active_support/core_ext/object/duplicable.rb
  82. +1 −0 activesupport/lib/active_support/core_ext/object/with_options.rb
  83. +1 −0 activesupport/lib/active_support/core_ext/string/inflections.rb
  84. +1 −0 activesupport/lib/active_support/core_ext/string/output_safety.rb
  85. +1 −0 activesupport/lib/active_support/file_update_checker.rb
  86. +4 −0 activesupport/lib/active_support/hash_with_indifferent_access.rb
  87. +1 −0 activesupport/lib/active_support/inflector/methods.rb
  88. +1 −0 activesupport/lib/active_support/lazy_load_hooks.rb
  89. +1 −0 activesupport/lib/active_support/log_subscriber.rb
  90. +2 −0 activesupport/lib/active_support/log_subscriber/test_helper.rb
  91. +1 −0 activesupport/lib/active_support/message_encryptor.rb
  92. +1 −0 activesupport/lib/active_support/notifications.rb
  93. +1 −0 activesupport/lib/active_support/ordered_options.rb
  94. +1 −0 activesupport/lib/active_support/string_inquirer.rb
  95. +2 −0 activesupport/lib/active_support/time_with_zone.rb
  96. +1 −0 railties/lib/rails/application.rb
  97. +1 −0 railties/lib/rails/configuration.rb
  98. +1 −0 railties/lib/rails/engine/configuration.rb
  99. +1 −0 railties/lib/rails/generators/active_model.rb
  100. +1 −0 railties/lib/rails/generators/base.rb
  101. +1 −0 railties/lib/rails/generators/named_base.rb
  102. +2 −0 railties/lib/rails/generators/resource_helpers.rb
  103. +13 −0 railties/lib/rails/generators/test_case.rb
  104. +1 −0 railties/lib/rails/railtie.rb
  105. +1 −0 railties/test/generators/shared_generator_tests.rb
View
@@ -179,6 +179,7 @@ end
# We publish a new version by tagging, and pushing a tag does not trigger
# that webhook. Stable docs would be updated by any subsequent regular
# push, but if you want that to happen right away just run this.
+#
desc 'Publishes docs, run this AFTER a new stable tag has been pushed'
task :publish_docs do
Net::HTTP.new('api.rubyonrails.org', 8080).start do |http|
@@ -50,6 +50,7 @@ module ClassMethods
# add_delivery_method :sendmail, Mail::Sendmail,
# :location => '/usr/sbin/sendmail',
# :arguments => '-i -t'
+ #
def add_delivery_method(symbol, klass, default_options={})
class_attribute(:"#{symbol}_settings") unless respond_to?(:"#{symbol}_settings")
send(:"#{symbol}_settings=", default_options)
@@ -7,6 +7,7 @@ class <%= class_name %> < ActionMailer::Base
# with the following lookup:
#
# en.<%= file_path.tr("/",".") %>.<%= action %>.subject
+ #
def <%= action %>
@greeting = "Hi"
@@ -90,6 +90,7 @@ def #{meth}(*args, &blk) # def current_user(*args,
# +symbols+, +strings+, +modules+ and blocks.
#
# helper(:three, BlindHelper) { def mice() 'mice' end }
+ #
def helper(*args, &block)
modules_for_helpers(args).each do |mod|
add_template_helper(mod)
@@ -167,6 +167,7 @@ module ActionController
# redirect_to(:action => "elsewhere") and return if monkeys.nil?
# render :action => "overthere" # won't be called if monkeys is nil
# end
+ #
class Base < Metal
abstract!
@@ -9,6 +9,7 @@ module ActionController
# class PostsController < ApplicationController
# use AuthenticationMiddleware, :except => [:index, :show]
# end
+ #
class MiddlewareStack < ActionDispatch::MiddlewareStack #:nodoc:
class Middleware < ActionDispatch::MiddlewareStack::Middleware #:nodoc:
def initialize(klass, *args, &block)
@@ -96,6 +97,7 @@ def build(action, app=nil, &block)
#
# You can refer to the modules included in <tt>ActionController::Base</tt> to see
# other features you can bring into your metal controller.
+ #
class Metal < AbstractController::Base
abstract!
@@ -47,6 +47,7 @@ module ActionController
#
# 23 Aug 11:30 | Carolina Railhawks Soccer Match
# N/A | Carolina Railhaws Training Workshop
+ #
module Helpers
extend ActiveSupport::Concern
@@ -52,6 +52,7 @@ def respond_to(*mimes)
end
# Clear all mime types in <tt>respond_to</tt>.
+ #
def clear_respond_to
self.mimes_for_respond_to = Hash.new.freeze
end
@@ -142,18 +142,21 @@ def initialize(controller, resources, options={})
# Initializes a new responder an invoke the proper format. If the format is
# not defined, call to_format.
+ #
def self.call(*args)
new(*args).respond
end
# Main entry point for responder responsible to dispatch to the proper format.
+ #
def respond
method = "to_#{format}"
respond_to?(method) ? send(method) : to_format
end
# HTML format does not render the resource, it always attempt to render a
# template.
+ #
def to_html
default_render
rescue ActionView::MissingTemplate => e
@@ -168,6 +171,7 @@ def to_js
# All other formats follow the procedure below. First we try to render a
# template, if the template is not available, we verify if the resource
# responds to :to_format and display it.
+ #
def to_format
if get? || !has_errors? || response_overridden?
default_render
@@ -205,12 +209,14 @@ def api_behavior(error)
end
# Checks whether the resource responds to the current format or not.
+ #
def resourceful?
resource.respond_to?("to_#{format}")
end
# Returns the resource location by retrieving it from the options or
# returning the resources array.
+ #
def resource_location
options[:location] || resources
end
@@ -219,6 +225,7 @@ def resource_location
# If a response block was given, use it, otherwise call render on
# controller.
+ #
def default_render
if @default_response
@default_response.call(options)
@@ -243,6 +250,7 @@ def default_render
# Results in:
#
# render :xml => @user, :status => :created
+ #
def display(resource, given_options={})
controller.render given_options.merge!(options).merge!(format => resource)
end
@@ -252,12 +260,14 @@ def display_errors
end
# Check whether the resource has errors.
+ #
def has_errors?
resource.respond_to?(:errors) && !resource.errors.empty?
end
# By default, render the <code>:edit</code> action for HTML requests with errors, unless
# the verb was POST.
+ #
def default_action
@action ||= DEFAULT_ACTIONS_FOR_VERBS[request.request_method_symbol]
end
@@ -194,6 +194,7 @@ module ActionController #:nodoc:
# ==== Passenger
#
# To be described.
+ #
module Streaming
extend ActiveSupport::Concern
@@ -46,6 +46,7 @@ def accepts
# GET /posts/5.xml | request.format => Mime::XML
# GET /posts/5.xhtml | request.format => Mime::HTML
# GET /posts/5 | request.format => Mime::HTML or MIME::JS, or request.accepts.first
+ #
def format(view_path = [])
formats.first
end
@@ -81,6 +82,7 @@ def format=(extension)
# Receives an array of mimes and return the first user sent mime that
# matches the order array.
+ #
def negotiate_mime(order)
formats.each do |priority|
if priority == Mime::ALL
@@ -22,6 +22,7 @@ module ActionDispatch
# is false. Callbacks may be registered even when it is not included in the
# middleware stack, but are executed only when <tt>ActionDispatch::Reloader.prepare!</tt>
# or <tt>ActionDispatch::Reloader.cleanup!</tt> are called manually.
+ #
class Reloader
include ActiveSupport::Callbacks
@@ -277,6 +277,7 @@ module ActionDispatch
# rake routes
#
# Target specific controllers by prefixing the command with <tt>CONTROLLER=x</tt>.
+ #
module Routing
autoload :Mapper, 'action_dispatch/routing/mapper'
autoload :RouteSet, 'action_dispatch/routing/route_set'
@@ -897,6 +897,7 @@ def defaults_from_constraints(constraints)
# resources :articles, :id => /[^\/]+/
#
# This allows any character other than a slash as part of your +:id+.
+ #
module Resources
# CANONICAL_ACTIONS holds all actions that does not need a prefix or
# a path appended since they fit properly in their scope level.
@@ -51,6 +51,7 @@ module Routing
#
# polymorphic_url([blog, @post]) # calls blog.post_path(@post)
# form_for([blog, @post]) # => "/blog/posts/1"
+ #
module PolymorphicRoutes
# Constructs a call to a named RESTful route for the given record and returns the
# resulting URL string. For example:
@@ -83,6 +84,7 @@ module PolymorphicRoutes
#
# # the class of a record will also map to the collection
# polymorphic_url(Comment) # same as comments_url()
+ #
def polymorphic_url(record_or_hash_or_array, options = {})
if record_or_hash_or_array.kind_of?(Array)
record_or_hash_or_array = record_or_hash_or_array.compact
@@ -121,6 +121,7 @@ module Redirection
# a string.
#
# match 'accounts/:name' => redirect(SubdomainRedirector.new('api'))
+ #
def redirect(*args, &block)
options = args.extract_options!
status = options.delete(:status) || 301
@@ -180,6 +180,7 @@ def define_named_route_methods(name, route)
# Also allow options hash, so you can do:
#
# foo_url(bar, baz, bang, :sort_by => 'baz')
+ #
def define_url_helper(route, name, options)
selector = url_helper_name(name, options[:only_path])
@@ -79,6 +79,7 @@ module Routing
# end
#
# User.find(1).base_uri # => "/users/1"
+ #
module UrlFor
extend ActiveSupport::Concern
include PolymorphicRoutes
@@ -140,6 +140,7 @@ def assert_routing(path, options, defaults={}, extras={}, message=nil)
# end
# end
# end
+ #
def with_routing
old_routes, @routes = @routes, ActionDispatch::Routing::RouteSet.new
if defined?(@controller) && @controller
@@ -139,6 +139,7 @@ def stylesheet_url(source)
# you have too many stylesheets for IE to load.
#
# stylesheet_link_tag :all, :concat => true
+ #
def stylesheet_link_tag(*sources)
@stylesheet_include ||= StylesheetIncludeTag.new(config, asset_paths)
@stylesheet_include.include_tag(*sources)
@@ -33,6 +33,7 @@ module CaptureHelper
# <body>
# <b><%= @greeting %></b>
# </body></html>
+ #
def capture(*args)
value = nil
buffer = with_output_buffer { value = yield(*args) }
@@ -763,6 +763,7 @@ def label(object_name, method, content_or_options = nil, options = nil, &block)
#
# text_field(:snippet, :code, :size => 20, :class => 'code_input')
# # => <input type="text" id="snippet_code" name="snippet[code]" size="20" value="#{@snippet.code}" class="code_input" />
+ #
def text_field(object_name, method, options = {})
Tags::TextField.new(object_name, method, self, options).render
end
@@ -784,6 +785,7 @@ def text_field(object_name, method, options = {})
#
# password_field(:account, :pin, :size => 20, :class => 'form_input')
# # => <input type="password" id="account_pin" name="account[pin]" size="20" class="form_input" />
+ #
def password_field(object_name, method, options = {})
Tags::PasswordField.new(object_name, method, self, options).render
end
@@ -822,6 +824,7 @@ def hidden_field(object_name, method, options = {})
#
# file_field(:attachment, :file, :class => 'file_input')
# # => <input type="file" id="attachment_file" name="attachment[file]" class="file_input" />
+ #
def file_field(object_name, method, options = {})
Tags::FileField.new(object_name, method, self, options).render
end
@@ -910,6 +913,7 @@ def text_area(object_name, method, options = {})
# check_box("eula", "accepted", { :class => 'eula_check' }, "yes", "no")
# # => <input name="eula[accepted]" type="hidden" value="no" />
# # <input type="checkbox" class="eula_check" id="eula_accepted" name="eula[accepted]" value="yes" />
+ #
def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
Tags::CheckBox.new(object_name, method, self, checked_value, unchecked_value, options).render
end
@@ -962,6 +966,7 @@ def search_field(object_name, method, options = {})
#
# telephone_field("user", "phone")
# # => <input id="user_phone" name="user[phone]" type="tel" />
+ #
def telephone_field(object_name, method, options = {})
Tags::TelField.new(object_name, method, self, options).render
end
@@ -980,6 +985,7 @@ def telephone_field(object_name, method, options = {})
# @user.born_on = Date.new(1984, 1, 27)
# date_field("user", "born_on", value: "1984-05-12")
# # => <input id="user_born_on" name="user[born_on]" type="date" value="1984-05-12" />
+ #
def date_field(object_name, method, options = {})
Tags::DateField.new(object_name, method, self, options).render
end
@@ -996,6 +1002,7 @@ def date_field(object_name, method, options = {})
# === Example
# time_field("task", "started_at")
# # => <input id="task_started_at" name="task[started_at]" type="time" />
+ #
def time_field(object_name, method, options = {})
Tags::TimeField.new(object_name, method, self, options).render
end
@@ -1004,6 +1011,7 @@ def time_field(object_name, method, options = {})
#
# url_field("user", "homepage")
# # => <input id="user_homepage" name="user[homepage]" type="url" />
+ #
def url_field(object_name, method, options = {})
Tags::UrlField.new(object_name, method, self, options).render
end
@@ -1012,6 +1020,7 @@ def url_field(object_name, method, options = {})
#
# email_field("user", "address")
# # => <input id="user_address" name="user[address]" type="email" />
+ #
def email_field(object_name, method, options = {})
Tags::EmailField.new(object_name, method, self, options).render
end
@@ -1191,6 +1200,7 @@ def file_field(method, options = {})
# submit:
# post:
# create: "Add %{model}"
+ #
def submit(value=nil, options={})
value, options = nil, value if value.is_a?(Hash)
value ||= submit_default_value
@@ -1223,6 +1233,7 @@ def submit(value=nil, options={})
# submit:
# post:
# create: "Add %{model}"
+ #
def button(value=nil, options={})
value, options = nil, value if value.is_a?(Hash)
value ||= submit_default_value
@@ -98,6 +98,7 @@ module Helpers
# <option value="3">Jokes</option>
# <option value="4">Poems</option>
# </select>
+ #
module FormOptionsHelper
# ERB::Util can mask some helpers like textilize. Make sure to include them.
include TextHelper
@@ -153,6 +154,7 @@ module FormOptionsHelper
# key in the query string, that works for ordinary forms.
#
# In case if you don't want the helper to generate this hidden field you can specify <tt>:include_blank => false</tt> option.
+ #
def select(object, method, choices, options = {}, html_options = {})
Tags::Select.new(object, method, self, choices, options, html_options).render
end
@@ -239,6 +241,7 @@ def collection_select(object, method, collection, value_method, text_method, opt
# <option value="2">Ireland</option>
# </optgroup>
# </select>
+ #
def grouped_collection_select(object, method, collection, group_method, group_label_method, option_key_method, option_value_method, options = {}, html_options = {})
Tags::GroupedCollectionSelect.new(object, method, self, collection, group_method, group_label_method, option_key_method, option_value_method, options, html_options).render
end
@@ -63,6 +63,7 @@ module FormTagHelper
#
# form_tag('http://far.away.com/form', :authenticity_token => "cf50faa3fe97702ca1ae")
# # form with custom authenticity token
+ #
def form_tag(url_for_options = {}, options = {}, &block)
html_options = html_options_for_form(url_for_options, options)
if block_given?
@@ -408,6 +409,7 @@ def radio_button_tag(name, value, checked = false, options = {})
#
# submit_tag "Save", :confirm => "Are you sure?"
# # => <input name='commit' type='submit' value='Save' data-confirm="Are you sure?" />
+ #
def submit_tag(value = "Save changes", options = {})
options = options.stringify_keys
@@ -444,6 +446,7 @@ def submit_tag(value = "Save changes", options = {})
# # => <button name="button" type="button">
# # <strong>Ask me!</strong>
# # </button>
+ #
def button_tag(content_or_options = nil, options = nil, &block)
options = content_or_options if block_given? && content_or_options.is_a?(Hash)
options ||= {}
Oops, something went wrong.

0 comments on commit 1ad0b37

Please sign in to comment.