aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-03-06 17:52:30 +0100
committerXavier Noria <fxn@hashref.com>2011-03-06 17:52:30 +0100
commit89d825d02172f7c1ba1211119ea9844206aae9c3 (patch)
tree4716db6c964db1b81843523932be4b097b9291db
parent5e7ce47fb9ab50858fe067a6eb6c0462c5c5681e (diff)
parent6ce844a3c1d9c1de4ae54cbe73e0dbd0acbe688a (diff)
downloadrails-89d825d02172f7c1ba1211119ea9844206aae9c3.tar.gz
rails-89d825d02172f7c1ba1211119ea9844206aae9c3.tar.bz2
rails-89d825d02172f7c1ba1211119ea9844206aae9c3.zip
Merge branch 'master' of git://github.com/lifo/docrails
-rw-r--r--actionmailer/lib/rails/generators/mailer/USAGE5
-rw-r--r--activesupport/lib/active_support/backtrace_cleaner.rb2
-rw-r--r--activesupport/lib/active_support/configurable.rb12
-rw-r--r--activesupport/lib/active_support/core_ext/hash/reverse_merge.rb11
-rw-r--r--activesupport/lib/active_support/core_ext/object/blank.rb4
-rw-r--r--activesupport/lib/active_support/hash_with_indifferent_access.rb4
-rw-r--r--activesupport/lib/active_support/i18n_railtie.rb2
-rw-r--r--activesupport/lib/active_support/log_subscriber.rb2
-rw-r--r--activesupport/lib/active_support/message_encryptor.rb2
-rw-r--r--activesupport/lib/active_support/message_verifier.rb2
-rw-r--r--railties/guides/source/active_record_querying.textile2
-rw-r--r--railties/guides/source/contributing_to_ruby_on_rails.textile14
12 files changed, 47 insertions, 15 deletions
diff --git a/actionmailer/lib/rails/generators/mailer/USAGE b/actionmailer/lib/rails/generators/mailer/USAGE
index a08d459739..448ddbd5df 100644
--- a/actionmailer/lib/rails/generators/mailer/USAGE
+++ b/actionmailer/lib/rails/generators/mailer/USAGE
@@ -1,4 +1,5 @@
Description:
+============
Stubs out a new mailer and its views. Pass the mailer name, either
CamelCased or under_scored, and an optional list of emails as arguments.
@@ -6,10 +7,12 @@ Description:
engine and test framework generators.
Example:
- `rails generate mailer Notifications signup forgot_password invoice`
+========
+ rails generate mailer Notifications signup forgot_password invoice
creates a Notifications mailer class, views, test, and fixtures:
Mailer: app/mailers/notifications.rb
Views: app/views/notifications/signup.erb [...]
Test: test/functional/notifications_test.rb
Fixtures: test/fixtures/notifications/signup [...]
+
diff --git a/activesupport/lib/active_support/backtrace_cleaner.rb b/activesupport/lib/active_support/backtrace_cleaner.rb
index 8465bc1e10..0e6bc30fa2 100644
--- a/activesupport/lib/active_support/backtrace_cleaner.rb
+++ b/activesupport/lib/active_support/backtrace_cleaner.rb
@@ -8,7 +8,7 @@ module ActiveSupport
# filter or modify the paths of any lines of the backtrace, you can call BacktraceCleaner#remove_filters! These two methods
# will give you a completely untouched backtrace.
#
- # Example:
+ # ==== Example:
#
# bc = BacktraceCleaner.new
# bc.add_filter { |line| line.gsub(Rails.root, '') }
diff --git a/activesupport/lib/active_support/configurable.rb b/activesupport/lib/active_support/configurable.rb
index be19189c04..8c56a21ef7 100644
--- a/activesupport/lib/active_support/configurable.rb
+++ b/activesupport/lib/active_support/configurable.rb
@@ -64,21 +64,21 @@ module ActiveSupport
end
# Reads and writes attributes from a configuration <tt>OrderedHash</tt>.
- #
- # require 'active_support/configurable'
- #
+ #
+ # require 'active_support/configurable'
+ #
# class User
# include ActiveSupport::Configurable
- # end
+ # end
#
# user = User.new
- #
+ #
# user.config.allowed_access = true
# user.config.level = 1
#
# user.config.allowed_access # => true
# user.config.level # => 1
- #
+ #
def config
@_config ||= self.class.config.inheritable_copy
end
diff --git a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
index 01863a162b..63b4ba49e9 100644
--- a/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
+++ b/activesupport/lib/active_support/core_ext/hash/reverse_merge.rb
@@ -3,12 +3,23 @@ class Hash
#
# options = options.reverse_merge(:size => 25, :velocity => 10)
#
+<<<<<<< HEAD
+ # The default <tt>:size</tt> and <tt>:velocity</tt> are only set if the +options+ hash passed in doesn't already
+ # have the respective key.
+ #
+ # As contrast, using Ruby's built in <tt>merge</tt> would require writing the following:
+ #
+ # def setup(options = {})
+ # options = { :size => 25, :velocity => 10 }.merge(options)
+ # end
+=======
# is equivalent to
#
# options = {:size => 25, :velocity => 10}.merge(options)
#
# This is particularly useful for initializing an options hash
# with default values.
+>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd
def reverse_merge(other_hash)
other_hash.merge(self)
end
diff --git a/activesupport/lib/active_support/core_ext/object/blank.rb b/activesupport/lib/active_support/core_ext/object/blank.rb
index d0c1ea8326..7b5832b51a 100644
--- a/activesupport/lib/active_support/core_ext/object/blank.rb
+++ b/activesupport/lib/active_support/core_ext/object/blank.rb
@@ -13,7 +13,11 @@ class Object
respond_to?(:empty?) ? empty? : !self
end
+<<<<<<< HEAD
+ # An object is present if it's not #blank?.
+=======
# An object is present if it's not <tt>blank?</tt>.
+>>>>>>> 20768176292cbcb883ab152b4aa9ed8c664771cd
def present?
!blank?
end
diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb
index 6a344867ee..79a0de7940 100644
--- a/activesupport/lib/active_support/hash_with_indifferent_access.rb
+++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb
@@ -1,7 +1,7 @@
require 'active_support/core_ext/hash/keys'
# This class has dubious semantics and we only have it so that
-# people can write params[:key] instead of params['key']
+# people can write <tt>params[:key]</tt> instead of <tt>params['key']</tt>
# and they get the same value for both keys.
module ActiveSupport
@@ -109,7 +109,7 @@ module ActiveSupport
end
# Performs the opposite of merge, with the keys and values from the first hash taking precedence over the second.
- # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a HashWithDifferentAccess.
+ # This overloaded definition prevents returning a regular hash, if reverse_merge is called on a <tt>HashWithDifferentAccess</tt>.
def reverse_merge(other_hash)
super self.class.new_from_hash_copying_default(other_hash)
end
diff --git a/activesupport/lib/active_support/i18n_railtie.rb b/activesupport/lib/active_support/i18n_railtie.rb
index 4a9ee5a769..a25e951080 100644
--- a/activesupport/lib/active_support/i18n_railtie.rb
+++ b/activesupport/lib/active_support/i18n_railtie.rb
@@ -14,7 +14,7 @@ module I18n
@reloader ||= ActiveSupport::FileUpdateChecker.new([]){ I18n.reload! }
end
- # Add I18n::Railtie.reloader to ActionDispatch callbacks. Since, at this
+ # Add <tt>I18n::Railtie.reloader</tt> to ActionDispatch callbacks. Since, at this
# point, no path was added to the reloader, I18n.reload! is not triggered
# on to_prepare callbacks. This will only happen on the config.after_initialize
# callback below.
diff --git a/activesupport/lib/active_support/log_subscriber.rb b/activesupport/lib/active_support/log_subscriber.rb
index df335af841..10675edac5 100644
--- a/activesupport/lib/active_support/log_subscriber.rb
+++ b/activesupport/lib/active_support/log_subscriber.rb
@@ -21,7 +21,7 @@ module ActiveSupport
# ActiveRecord::LogSubscriber.attach_to :active_record
#
# Since we need to know all instance methods before attaching the log subscriber,
- # the line above should be called after your ActiveRecord::LogSubscriber definition.
+ # the line above should be called after your <tt>ActiveRecord::LogSubscriber</tt> definition.
#
# After configured, whenever a "sql.active_record" notification is published,
# it will properly dispatch the event (ActiveSupport::Notifications::Event) to
diff --git a/activesupport/lib/active_support/message_encryptor.rb b/activesupport/lib/active_support/message_encryptor.rb
index d21f90f8b7..4f7cd12d48 100644
--- a/activesupport/lib/active_support/message_encryptor.rb
+++ b/activesupport/lib/active_support/message_encryptor.rb
@@ -7,7 +7,7 @@ module ActiveSupport
#
# The cipher text and initialization vector are base64 encoded and returned to you.
#
- # This can be used in situations similar to the MessageVerifier, but where you don't
+ # This can be used in situations similar to the <tt>MessageVerifier</tt>, but where you don't
# want users to be able to determine the value of the payload.
class MessageEncryptor
class InvalidMessage < StandardError; end
diff --git a/activesupport/lib/active_support/message_verifier.rb b/activesupport/lib/active_support/message_verifier.rb
index 9a4468f73c..8f3946325a 100644
--- a/activesupport/lib/active_support/message_verifier.rb
+++ b/activesupport/lib/active_support/message_verifier.rb
@@ -2,7 +2,7 @@ require 'active_support/base64'
require 'active_support/core_ext/object/blank'
module ActiveSupport
- # MessageVerifier makes it easy to generate and verify messages which are signed
+ # +MessageVerifier+ makes it easy to generate and verify messages which are signed
# to prevent tampering.
#
# This is useful for cases like remember-me tokens and auto-unsubscribe links where the
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile
index 64a68f7592..ed3968e226 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/railties/guides/source/active_record_querying.textile
@@ -420,7 +420,7 @@ Client.limit(5).offset(30)
will return instead a maximum of 5 clients beginning with the 31st. The SQL looks like:
<sql>
-SELECT * FROM clients LIMIT 5, 30
+SELECT * FROM clients LIMIT 5 OFFSET 30
</sql>
h3. Group
diff --git a/railties/guides/source/contributing_to_ruby_on_rails.textile b/railties/guides/source/contributing_to_ruby_on_rails.textile
index 3454b8b7a3..82e7edfc84 100644
--- a/railties/guides/source/contributing_to_ruby_on_rails.textile
+++ b/railties/guides/source/contributing_to_ruby_on_rails.textile
@@ -364,6 +364,20 @@ Please make sure the patch does not introduce whitespace errors:
$ git apply --whitespace=error-all mynew_patch.diff
</shell>
+You can check your patches by applying your patch to an different dedicated branch:
+
+<shell>
+$ git checkout -b testing_branch
+$ git apply --check my_new_patch.diff
+</shell>
+
+You can make sure your patches don't add any whitespace by applying it yourself using the --whitespace=error-all option. Make sure you are on your dedicated test branche and:
+
+<shell>
+$ git apply --whitespace=error-all mynew_patch.diff
+</shell>
+
+
h4. Create a Lighthouse Ticket
Now create a ticket with your patch. Go to the "new ticket":http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/new page at Lighthouse. Fill in a reasonable title and description, remember to attach your patch file, and tag the ticket with the ‘patch’ tag and whatever other subject area tags make sense.