mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Replace comments' non-breaking spaces with spaces
Sometimes, on Mac OS X, programmers accidentally press Option+Space rather than just Space and don’t see the difference. The problem is that Option+Space writes a non-breaking space (0XA0) rather than a normal space (0x20). This commit removes all the non-breaking spaces inadvertently introduced in the comments of the code.
This commit is contained in:
parent
129eac0243
commit
019df98875
27 changed files with 49 additions and 49 deletions
|
@ -42,7 +42,7 @@ module ActionController
|
||||||
# * <tt>:public</tt> By default the Cache-Control header is private, set this to
|
# * <tt>:public</tt> By default the Cache-Control header is private, set this to
|
||||||
# +true+ if you want your application to be cachable by other devices (proxy caches).
|
# +true+ if you want your application to be cachable by other devices (proxy caches).
|
||||||
#
|
#
|
||||||
# === Example:
|
# === Example:
|
||||||
#
|
#
|
||||||
# def show
|
# def show
|
||||||
# @article = Article.find(params[:id])
|
# @article = Article.find(params[:id])
|
||||||
|
|
|
@ -163,7 +163,7 @@ module ActionController
|
||||||
# }
|
# }
|
||||||
# })
|
# })
|
||||||
#
|
#
|
||||||
# permitted = params.permit(person: [ :name, { pets: :name } ])
|
# permitted = params.permit(person: [ :name, { pets: :name } ])
|
||||||
# permitted.permitted? # => true
|
# permitted.permitted? # => true
|
||||||
# permitted[:person][:name] # => "Francesco"
|
# permitted[:person][:name] # => "Francesco"
|
||||||
# permitted[:person][:age] # => nil
|
# permitted[:person][:age] # => nil
|
||||||
|
@ -228,7 +228,7 @@ module ActionController
|
||||||
# Returns a parameter for the given +key+. If not found,
|
# Returns a parameter for the given +key+. If not found,
|
||||||
# returns +nil+.
|
# returns +nil+.
|
||||||
#
|
#
|
||||||
# params = ActionController::Parameters.new(person: { name: 'Francesco' })
|
# params = ActionController::Parameters.new(person: { name: 'Francesco' })
|
||||||
# params[:person] # => {"name"=>"Francesco"}
|
# params[:person] # => {"name"=>"Francesco"}
|
||||||
# params[:none] # => nil
|
# params[:none] # => nil
|
||||||
def [](key)
|
def [](key)
|
||||||
|
|
|
@ -122,7 +122,7 @@ module ActiveModel
|
||||||
# Delete messages for +key+. Returns the deleted messages.
|
# Delete messages for +key+. Returns the deleted messages.
|
||||||
#
|
#
|
||||||
# person.errors.get(:name) # => ["can not be nil"]
|
# person.errors.get(:name) # => ["can not be nil"]
|
||||||
# person.errors.delete(:name) # => ["can not be nil"]
|
# person.errors.delete(:name) # => ["can not be nil"]
|
||||||
# person.errors.get(:name) # => nil
|
# person.errors.get(:name) # => nil
|
||||||
def delete(key)
|
def delete(key)
|
||||||
messages.delete(key)
|
messages.delete(key)
|
||||||
|
@ -213,7 +213,7 @@ module ActiveModel
|
||||||
# Returns +true+ if no errors are found, +false+ otherwise.
|
# Returns +true+ if no errors are found, +false+ otherwise.
|
||||||
# If the error message is a string it can be empty.
|
# If the error message is a string it can be empty.
|
||||||
#
|
#
|
||||||
# person.errors.full_messages # => ["name can not be nil"]
|
# person.errors.full_messages # => ["name can not be nil"]
|
||||||
# person.errors.empty? # => false
|
# person.errors.empty? # => false
|
||||||
def empty?
|
def empty?
|
||||||
all? { |k, v| v && v.empty? && !v.is_a?(String) }
|
all? { |k, v| v && v.empty? && !v.is_a?(String) }
|
||||||
|
@ -246,7 +246,7 @@ module ActiveModel
|
||||||
to_hash(options && options[:full_messages])
|
to_hash(options && options[:full_messages])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns a Hash of attributes with their error messages. If +full_messages+
|
# Returns a Hash of attributes with their error messages. If +full_messages+
|
||||||
# is +true+, it will contain full messages (see +full_message+).
|
# is +true+, it will contain full messages (see +full_message+).
|
||||||
#
|
#
|
||||||
# person.to_hash # => {:name=>["can not be nil"]}
|
# person.to_hash # => {:name=>["can not be nil"]}
|
||||||
|
|
|
@ -90,7 +90,7 @@ module ActiveModel
|
||||||
# person.name = 'bob'
|
# person.name = 'bob'
|
||||||
# person.age = 22
|
# person.age = 22
|
||||||
# person.serializable_hash # => {"name"=>"bob", "age"=>22}
|
# person.serializable_hash # => {"name"=>"bob", "age"=>22}
|
||||||
# person.serializable_hash(only: :name) # => {"name"=>"bob"}
|
# person.serializable_hash(only: :name) # => {"name"=>"bob"}
|
||||||
# person.serializable_hash(except: :name) # => {"age"=>22}
|
# person.serializable_hash(except: :name) # => {"age"=>22}
|
||||||
# person.serializable_hash(methods: :capitalized_name)
|
# person.serializable_hash(methods: :capitalized_name)
|
||||||
# # => {"name"=>"bob", "age"=>22, "capitalized_name"=>"Bob"}
|
# # => {"name"=>"bob", "age"=>22, "capitalized_name"=>"Bob"}
|
||||||
|
|
|
@ -109,8 +109,8 @@ module ActiveModel
|
||||||
|
|
||||||
# Return the kind for this validator.
|
# Return the kind for this validator.
|
||||||
#
|
#
|
||||||
# PresenceValidator.new.kind # => :presence
|
# PresenceValidator.new.kind # => :presence
|
||||||
# UniquenessValidator.new.kind # => :uniqueness
|
# UniquenessValidator.new.kind # => :uniqueness
|
||||||
def kind
|
def kind
|
||||||
self.class.kind
|
self.class.kind
|
||||||
end
|
end
|
||||||
|
|
|
@ -788,7 +788,7 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
person.pets.delete("1") # => [#<Pet id: 1>]
|
person.pets.delete("1") # => [#<Pet id: 1>]
|
||||||
person.pets.delete(2, 3) # => [#<Pet id: 2>, #<Pet id: 3>]
|
person.pets.delete(2, 3) # => [#<Pet id: 2>, #<Pet id: 3>]
|
||||||
|
|
||||||
*Francesco Rodriguez*
|
*Francesco Rodriguez*
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ module ActiveRecord
|
||||||
# # #<Pet id: 3, name: "Choo-Choo", person_id: 1>
|
# # #<Pet id: 3, name: "Choo-Choo", person_id: 1>
|
||||||
# # ]
|
# # ]
|
||||||
#
|
#
|
||||||
# person.pets.select(:name) { |pet| pet.name =~ /oo/ }
|
# person.pets.select(:name) { |pet| pet.name =~ /oo/ }
|
||||||
# # => [
|
# # => [
|
||||||
# # #<Pet id: 2, name: "Spook">,
|
# # #<Pet id: 2, name: "Spook">,
|
||||||
# # #<Pet id: 3, name: "Choo-Choo">
|
# # #<Pet id: 3, name: "Choo-Choo">
|
||||||
|
@ -824,7 +824,7 @@ module ActiveRecord
|
||||||
#
|
#
|
||||||
# person.pets # => [#<Pet id: 20, name: "Snoop">]
|
# person.pets # => [#<Pet id: 20, name: "Snoop">]
|
||||||
#
|
#
|
||||||
# person.pets.include?(Pet.find(20)) # => true
|
# person.pets.include?(Pet.find(20)) # => true
|
||||||
# person.pets.include?(Pet.find(21)) # => false
|
# person.pets.include?(Pet.find(21)) # => false
|
||||||
def include?(record)
|
def include?(record)
|
||||||
@association.include?(record)
|
@association.include?(record)
|
||||||
|
@ -971,7 +971,7 @@ module ActiveRecord
|
||||||
# person.pets.reload # fetches pets from the database
|
# person.pets.reload # fetches pets from the database
|
||||||
# # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
|
# # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
|
||||||
#
|
#
|
||||||
# person.pets(true) # fetches pets from the database
|
# person.pets(true) # fetches pets from the database
|
||||||
# # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
|
# # => [#<Pet id: 1, name: "Snoop", group: "dogs", person_id: 1>]
|
||||||
def reload
|
def reload
|
||||||
proxy_association.reload
|
proxy_association.reload
|
||||||
|
|
|
@ -116,7 +116,7 @@ module ActiveRecord
|
||||||
# Scopes can also be used while creating/building a record.
|
# Scopes can also be used while creating/building a record.
|
||||||
#
|
#
|
||||||
# class Article < ActiveRecord::Base
|
# class Article < ActiveRecord::Base
|
||||||
# scope :published, -> { where(published: true) }
|
# scope :published, -> { where(published: true) }
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# Article.published.new.published # => true
|
# Article.published.new.published # => true
|
||||||
|
@ -126,7 +126,7 @@ module ActiveRecord
|
||||||
# on scopes. Assuming the following setup:
|
# on scopes. Assuming the following setup:
|
||||||
#
|
#
|
||||||
# class Article < ActiveRecord::Base
|
# class Article < ActiveRecord::Base
|
||||||
# scope :published, -> { where(published: true) }
|
# scope :published, -> { where(published: true) }
|
||||||
# scope :featured, -> { where(featured: true) }
|
# scope :featured, -> { where(featured: true) }
|
||||||
#
|
#
|
||||||
# def self.latest_article
|
# def self.latest_article
|
||||||
|
|
|
@ -582,7 +582,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the size of the cached value. This could be less than
|
# Returns the size of the cached value. This could be less than
|
||||||
# <tt>value.size</tt> if the data is compressed.
|
# <tt>value.size</tt> if the data is compressed.
|
||||||
def size
|
def size
|
||||||
if defined?(@s)
|
if defined?(@s)
|
||||||
@s
|
@s
|
||||||
|
|
|
@ -14,7 +14,7 @@ module ActiveSupport
|
||||||
# Mixing in this module allows you to define the events in the object's
|
# Mixing in this module allows you to define the events in the object's
|
||||||
# lifecycle that will support callbacks (via +ClassMethods.define_callbacks+),
|
# lifecycle that will support callbacks (via +ClassMethods.define_callbacks+),
|
||||||
# set the instance methods, procs, or callback objects to be called (via
|
# set the instance methods, procs, or callback objects to be called (via
|
||||||
# +ClassMethods.set_callback+), and run the installed callbacks at the
|
# +ClassMethods.set_callback+), and run the installed callbacks at the
|
||||||
# appropriate times (via +run_callbacks+).
|
# appropriate times (via +run_callbacks+).
|
||||||
#
|
#
|
||||||
# Three kinds of callbacks are supported: before callbacks, run before a
|
# Three kinds of callbacks are supported: before callbacks, run before a
|
||||||
|
@ -382,7 +382,7 @@ module ActiveSupport
|
||||||
# set_callback :save, :before_meth
|
# set_callback :save, :before_meth
|
||||||
#
|
#
|
||||||
# The callback can specified as a symbol naming an instance method; as a
|
# The callback can specified as a symbol naming an instance method; as a
|
||||||
# proc, lambda, or block; as a string to be instance evaluated; or as an
|
# proc, lambda, or block; as a string to be instance evaluated; or as an
|
||||||
# object that responds to a certain method determined by the <tt>:scope</tt>
|
# object that responds to a certain method determined by the <tt>:scope</tt>
|
||||||
# argument to +define_callback+.
|
# argument to +define_callback+.
|
||||||
#
|
#
|
||||||
|
|
|
@ -38,7 +38,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Allows you to add shortcut so that you don't have to refer to attribute
|
# Allows you to add shortcut so that you don't have to refer to attribute
|
||||||
# through config. Also look at the example for config to contrast.
|
# through config. Also look at the example for config to contrast.
|
||||||
#
|
#
|
||||||
# Defines both class and instance config accessors.
|
# Defines both class and instance config accessors.
|
||||||
#
|
#
|
||||||
|
@ -75,7 +75,7 @@ module ActiveSupport
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# User.allowed_access = false
|
# User.allowed_access = false
|
||||||
# User.allowed_access # => false
|
# User.allowed_access # => false
|
||||||
#
|
#
|
||||||
# User.new.allowed_access = true # => NoMethodError
|
# User.new.allowed_access = true # => NoMethodError
|
||||||
# User.new.allowed_access # => NoMethodError
|
# User.new.allowed_access # => NoMethodError
|
||||||
|
@ -88,7 +88,7 @@ module ActiveSupport
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# User.allowed_access = false
|
# User.allowed_access = false
|
||||||
# User.allowed_access # => false
|
# User.allowed_access # => false
|
||||||
#
|
#
|
||||||
# User.new.allowed_access = true # => NoMethodError
|
# User.new.allowed_access = true # => NoMethodError
|
||||||
# User.new.allowed_access # => NoMethodError
|
# User.new.allowed_access # => NoMethodError
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Array
|
||||||
#
|
#
|
||||||
# [].to_sentence # => ""
|
# [].to_sentence # => ""
|
||||||
# ['one'].to_sentence # => "one"
|
# ['one'].to_sentence # => "one"
|
||||||
# ['one', 'two'].to_sentence # => "one and two"
|
# ['one', 'two'].to_sentence # => "one and two"
|
||||||
# ['one', 'two', 'three'].to_sentence # => "one, two, and three"
|
# ['one', 'two', 'three'].to_sentence # => "one, two, and three"
|
||||||
#
|
#
|
||||||
# ['one', 'two'].to_sentence(passing: 'invalid option')
|
# ['one', 'two'].to_sentence(passing: 'invalid option')
|
||||||
|
@ -41,7 +41,7 @@ class Array
|
||||||
# Examples using <tt>:locale</tt> option:
|
# Examples using <tt>:locale</tt> option:
|
||||||
#
|
#
|
||||||
# # Given this locale dictionary:
|
# # Given this locale dictionary:
|
||||||
# #
|
# #
|
||||||
# # es:
|
# # es:
|
||||||
# # support:
|
# # support:
|
||||||
# # array:
|
# # array:
|
||||||
|
@ -53,7 +53,7 @@ class Array
|
||||||
# # => "uno y dos"
|
# # => "uno y dos"
|
||||||
#
|
#
|
||||||
# ['uno', 'dos', 'tres'].to_sentence(locale: :es)
|
# ['uno', 'dos', 'tres'].to_sentence(locale: :es)
|
||||||
# # => "uno o dos o al menos tres"
|
# # => "uno o dos o al menos tres"
|
||||||
def to_sentence(options = {})
|
def to_sentence(options = {})
|
||||||
options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
|
options.assert_valid_keys(:words_connector, :two_words_connector, :last_word_connector, :locale)
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Class
|
||||||
# class Bar < Foo; end
|
# class Bar < Foo; end
|
||||||
# class Baz < Foo; end
|
# class Baz < Foo; end
|
||||||
#
|
#
|
||||||
# Foo.subclasses # => [Baz, Bar]
|
# Foo.subclasses # => [Baz, Bar]
|
||||||
def subclasses
|
def subclasses
|
||||||
subclasses, chain = [], descendants
|
subclasses, chain = [], descendants
|
||||||
chain.each do |k|
|
chain.each do |k|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class Hash
|
||||||
# converting to an <tt>ActiveSupport::HashWithIndifferentAccess</tt> would not be
|
# converting to an <tt>ActiveSupport::HashWithIndifferentAccess</tt> would not be
|
||||||
# desirable.
|
# desirable.
|
||||||
#
|
#
|
||||||
# b = { b: 1 }
|
# b = { b: 1 }
|
||||||
# { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access
|
# { a: b }.with_indifferent_access['a'] # calls b.nested_under_indifferent_access
|
||||||
alias nested_under_indifferent_access with_indifferent_access
|
alias nested_under_indifferent_access with_indifferent_access
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Hash
|
||||||
|
|
||||||
# Return a new hash with all keys converted to strings.
|
# Return a new hash with all keys converted to strings.
|
||||||
#
|
#
|
||||||
# hash = { name: 'Rob', age: '28' }
|
# hash = { name: 'Rob', age: '28' }
|
||||||
#
|
#
|
||||||
# hash.stringify_keys
|
# hash.stringify_keys
|
||||||
# #=> { "name" => "Rob", "age" => "28" }
|
# #=> { "name" => "Rob", "age" => "28" }
|
||||||
|
@ -44,7 +44,7 @@ class Hash
|
||||||
# hash = { 'name' => 'Rob', 'age' => '28' }
|
# hash = { 'name' => 'Rob', 'age' => '28' }
|
||||||
#
|
#
|
||||||
# hash.symbolize_keys
|
# hash.symbolize_keys
|
||||||
# #=> { name: "Rob", age: "28" }
|
# #=> { name: "Rob", age: "28" }
|
||||||
def symbolize_keys
|
def symbolize_keys
|
||||||
transform_keys{ |key| key.to_sym rescue key }
|
transform_keys{ |key| key.to_sym rescue key }
|
||||||
end
|
end
|
||||||
|
@ -102,7 +102,7 @@ class Hash
|
||||||
# This includes the keys from the root hash and from all
|
# This includes the keys from the root hash and from all
|
||||||
# nested hashes.
|
# nested hashes.
|
||||||
#
|
#
|
||||||
# hash = { person: { name: 'Rob', age: '28' } }
|
# hash = { person: { name: 'Rob', age: '28' } }
|
||||||
#
|
#
|
||||||
# hash.deep_stringify_keys
|
# hash.deep_stringify_keys
|
||||||
# # => { "person" => { "name" => "Rob", "age" => "28" } }
|
# # => { "person" => { "name" => "Rob", "age" => "28" } }
|
||||||
|
@ -121,10 +121,10 @@ class Hash
|
||||||
# they respond to +to_sym+. This includes the keys from the root hash
|
# they respond to +to_sym+. This includes the keys from the root hash
|
||||||
# and from all nested hashes.
|
# and from all nested hashes.
|
||||||
#
|
#
|
||||||
# hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } }
|
# hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } }
|
||||||
#
|
#
|
||||||
# hash.deep_symbolize_keys
|
# hash.deep_symbolize_keys
|
||||||
# # => { person: { name: "Rob", age: "28" } }
|
# # => { person: { name: "Rob", age: "28" } }
|
||||||
def deep_symbolize_keys
|
def deep_symbolize_keys
|
||||||
deep_transform_keys{ |key| key.to_sym rescue key }
|
deep_transform_keys{ |key| key.to_sym rescue key }
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,7 +32,7 @@ end
|
||||||
class Hash
|
class Hash
|
||||||
# Returns a deep copy of hash.
|
# Returns a deep copy of hash.
|
||||||
#
|
#
|
||||||
# hash = { a: { b: 'b' } }
|
# hash = { a: { b: 'b' } }
|
||||||
# dup = hash.deep_dup
|
# dup = hash.deep_dup
|
||||||
# dup[:a][:c] = 'c'
|
# dup[:a][:c] = 'c'
|
||||||
#
|
#
|
||||||
|
|
|
@ -44,7 +44,7 @@ module ActiveSupport #:nodoc:
|
||||||
self.autoload_once_paths = []
|
self.autoload_once_paths = []
|
||||||
|
|
||||||
# An array of qualified constant names that have been loaded. Adding a name
|
# An array of qualified constant names that have been loaded. Adding a name
|
||||||
# to this array will cause it to be unloaded the next time Dependencies are
|
# to this array will cause it to be unloaded the next time Dependencies are
|
||||||
# cleared.
|
# cleared.
|
||||||
mattr_accessor :autoloaded_constants
|
mattr_accessor :autoloaded_constants
|
||||||
self.autoloaded_constants = []
|
self.autoloaded_constants = []
|
||||||
|
@ -344,7 +344,7 @@ module ActiveSupport #:nodoc:
|
||||||
|
|
||||||
# Given +path+, a filesystem path to a ruby file, return an array of
|
# Given +path+, a filesystem path to a ruby file, return an array of
|
||||||
# constant paths which would cause Dependencies to attempt to load this
|
# constant paths which would cause Dependencies to attempt to load this
|
||||||
# file.
|
# file.
|
||||||
def loadable_constants_for_path(path, bases = autoload_paths)
|
def loadable_constants_for_path(path, bases = autoload_paths)
|
||||||
path = $` if path =~ /\.rb\z/
|
path = $` if path =~ /\.rb\z/
|
||||||
expanded_path = File.expand_path(path)
|
expanded_path = File.expand_path(path)
|
||||||
|
@ -394,7 +394,7 @@ module ActiveSupport #:nodoc:
|
||||||
# Attempt to autoload the provided module name by searching for a directory
|
# Attempt to autoload the provided module name by searching for a directory
|
||||||
# matching the expected path suffix. If found, the module is created and
|
# matching the expected path suffix. If found, the module is created and
|
||||||
# assigned to +into+'s constants with the name +const_name+. Provided that
|
# assigned to +into+'s constants with the name +const_name+. Provided that
|
||||||
# the directory was loaded from a reloadable base path, it is added to the
|
# the directory was loaded from a reloadable base path, it is added to the
|
||||||
# set of constants that are to be unloaded.
|
# set of constants that are to be unloaded.
|
||||||
def autoload_module!(into, const_name, qualified_name, path_suffix)
|
def autoload_module!(into, const_name, qualified_name, path_suffix)
|
||||||
return nil unless base_path = autoloadable_module?(path_suffix)
|
return nil unless base_path = autoloadable_module?(path_suffix)
|
||||||
|
|
|
@ -68,7 +68,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Executes the given block and updates the latest watched files and
|
# Executes the given block and updates the latest watched files and
|
||||||
# timestamp.
|
# timestamp.
|
||||||
def execute
|
def execute
|
||||||
@last_watched = watched
|
@last_watched = watched
|
||||||
@last_update_at = updated_at(@last_watched)
|
@last_update_at = updated_at(@last_watched)
|
||||||
|
|
|
@ -36,7 +36,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private, for the test suite.
|
# Private, for the test suite.
|
||||||
def initialize_dup(orig) # :nodoc:
|
def initialize_dup(orig) # :nodoc:
|
||||||
%w(plurals singulars uncountables humans acronyms acronym_regex).each do |scope|
|
%w(plurals singulars uncountables humans acronyms acronym_regex).each do |scope|
|
||||||
instance_variable_set("@#{scope}", orig.send(scope).dup)
|
instance_variable_set("@#{scope}", orig.send(scope).dup)
|
||||||
end
|
end
|
||||||
|
@ -44,7 +44,7 @@ module ActiveSupport
|
||||||
|
|
||||||
# Specifies a new acronym. An acronym must be specified as it will appear
|
# Specifies a new acronym. An acronym must be specified as it will appear
|
||||||
# in a camelized string. An underscore string that contains the acronym
|
# in a camelized string. An underscore string that contains the acronym
|
||||||
# will retain the acronym when passed to +camelize+, +humanize+, or
|
# will retain the acronym when passed to +camelize+, +humanize+, or
|
||||||
# +titleize+. A camelized string that contains the acronym will maintain
|
# +titleize+. A camelized string that contains the acronym will maintain
|
||||||
# the acronym when titleized or humanized, and will convert the acronym
|
# the acronym when titleized or humanized, and will convert the acronym
|
||||||
# into a non-delimited single lowercase word when passed to +underscore+.
|
# into a non-delimited single lowercase word when passed to +underscore+.
|
||||||
|
@ -79,7 +79,7 @@ module ActiveSupport
|
||||||
#
|
#
|
||||||
# +acronym+ may be used to specify any word that contains an acronym or
|
# +acronym+ may be used to specify any word that contains an acronym or
|
||||||
# otherwise needs to maintain a non-standard capitalization. The only
|
# otherwise needs to maintain a non-standard capitalization. The only
|
||||||
# restriction is that the word must begin with a capital letter.
|
# restriction is that the word must begin with a capital letter.
|
||||||
#
|
#
|
||||||
# acronym 'RESTful'
|
# acronym 'RESTful'
|
||||||
# underscore 'RESTful' #=> 'restful'
|
# underscore 'RESTful' #=> 'restful'
|
||||||
|
@ -97,7 +97,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Specifies a new pluralization rule and its replacement. The rule can
|
# Specifies a new pluralization rule and its replacement. The rule can
|
||||||
# either be a string or a regular expression. The replacement should
|
# either be a string or a regular expression. The replacement should
|
||||||
# always be a string that may include references to the matched data from
|
# always be a string that may include references to the matched data from
|
||||||
# the rule.
|
# the rule.
|
||||||
def plural(rule, replacement)
|
def plural(rule, replacement)
|
||||||
|
|
|
@ -33,7 +33,7 @@ module ActiveSupport
|
||||||
# the cipher key size. For the default 'aes-256-cbc' cipher, this is 256
|
# the cipher key size. For the default 'aes-256-cbc' cipher, this is 256
|
||||||
# bits. If you are using a user-entered secret, you can generate a suitable
|
# bits. If you are using a user-entered secret, you can generate a suitable
|
||||||
# key with <tt>OpenSSL::Digest::SHA256.new(user_secret).digest</tt> or
|
# key with <tt>OpenSSL::Digest::SHA256.new(user_secret).digest</tt> or
|
||||||
# similar.
|
# similar.
|
||||||
#
|
#
|
||||||
# Options:
|
# Options:
|
||||||
# * <tt>:cipher</tt> - Cipher to use. Can be any cipher returned by
|
# * <tt>:cipher</tt> - Cipher to use. Can be any cipher returned by
|
||||||
|
@ -50,7 +50,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Encrypt and sign a message. We need to sign the message in order to avoid
|
# Encrypt and sign a message. We need to sign the message in order to avoid
|
||||||
# padding attacks. Reference: http://www.limited-entropy.com/padding-oracle-attacks.
|
# padding attacks. Reference: http://www.limited-entropy.com/padding-oracle-attacks.
|
||||||
def encrypt_and_sign(value)
|
def encrypt_and_sign(value)
|
||||||
verifier.generate(_encrypt(value))
|
verifier.generate(_encrypt(value))
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ module ActiveSupport
|
||||||
# signed to prevent tampering.
|
# signed to prevent tampering.
|
||||||
#
|
#
|
||||||
# This is useful for cases like remember-me tokens and auto-unsubscribe links
|
# This is useful for cases like remember-me tokens and auto-unsubscribe links
|
||||||
# where the session store isn't suitable or available.
|
# where the session store isn't suitable or available.
|
||||||
#
|
#
|
||||||
# Remember Me:
|
# Remember Me:
|
||||||
# cookies[:remember_me] = @verifier.generate([@user.id, 2.weeks.from_now])
|
# cookies[:remember_me] = @verifier.generate([@user.id, 2.weeks.from_now])
|
||||||
|
|
|
@ -5,7 +5,7 @@ module ActiveSupport #:nodoc:
|
||||||
|
|
||||||
# The proxy class returned when calling mb_chars. You can use this accessor
|
# The proxy class returned when calling mb_chars. You can use this accessor
|
||||||
# to configure your own proxy class so you can support other encodings. See
|
# to configure your own proxy class so you can support other encodings. See
|
||||||
# the ActiveSupport::Multibyte::Chars implementation for an example how to
|
# the ActiveSupport::Multibyte::Chars implementation for an example how to
|
||||||
# do this.
|
# do this.
|
||||||
#
|
#
|
||||||
# ActiveSupport::Multibyte.proxy_class = CharsForUTF32
|
# ActiveSupport::Multibyte.proxy_class = CharsForUTF32
|
||||||
|
|
|
@ -11,7 +11,7 @@ module ActiveSupport
|
||||||
# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff"
|
# logger.tagged('BCX') { logger.tagged('Jason') { logger.info 'Stuff' } } # Logs "[BCX] [Jason] Stuff"
|
||||||
#
|
#
|
||||||
# This is used by the default Rails.logger as configured by Railties to make
|
# This is used by the default Rails.logger as configured by Railties to make
|
||||||
# it easy to stamp log lines with subdomains, request ids, and anything else
|
# it easy to stamp log lines with subdomains, request ids, and anything else
|
||||||
# to aid debugging of multi-user production applications.
|
# to aid debugging of multi-user production applications.
|
||||||
module TaggedLogging
|
module TaggedLogging
|
||||||
module Formatter # :nodoc:
|
module Formatter # :nodoc:
|
||||||
|
|
|
@ -69,7 +69,7 @@ module ActiveSupport
|
||||||
alias :assert_no_match :refute_match
|
alias :assert_no_match :refute_match
|
||||||
alias :assert_not_same :refute_same
|
alias :assert_not_same :refute_same
|
||||||
|
|
||||||
# Fails if the block raises an exception.
|
# Fails if the block raises an exception.
|
||||||
#
|
#
|
||||||
# assert_nothing_raised do
|
# assert_nothing_raised do
|
||||||
# ...
|
# ...
|
||||||
|
|
|
@ -326,7 +326,7 @@ module ActiveSupport
|
||||||
end
|
end
|
||||||
|
|
||||||
# Available so that TimeZone instances respond like TZInfo::Timezone
|
# Available so that TimeZone instances respond like TZInfo::Timezone
|
||||||
# instances.
|
# instances.
|
||||||
def period_for_utc(time)
|
def period_for_utc(time)
|
||||||
tzinfo.period_for_utc(time)
|
tzinfo.period_for_utc(time)
|
||||||
end
|
end
|
||||||
|
|
|
@ -60,7 +60,7 @@ when 'console'
|
||||||
require 'rails/commands/console'
|
require 'rails/commands/console'
|
||||||
options = Rails::Console.parse_arguments(ARGV)
|
options = Rails::Console.parse_arguments(ARGV)
|
||||||
|
|
||||||
# RAILS_ENV needs to be set before config/application is required
|
# RAILS_ENV needs to be set before config/application is required
|
||||||
ENV['RAILS_ENV'] = options[:environment] if options[:environment]
|
ENV['RAILS_ENV'] = options[:environment] if options[:environment]
|
||||||
|
|
||||||
# shift ARGV so IRB doesn't freak
|
# shift ARGV so IRB doesn't freak
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'rails/generators/rails/resource/resource_generator'
|
||||||
|
|
||||||
module Rails
|
module Rails
|
||||||
module Generators
|
module Generators
|
||||||
class ScaffoldGenerator < ResourceGenerator # :nodoc:
|
class ScaffoldGenerator < ResourceGenerator # :nodoc:
|
||||||
remove_hook_for :resource_controller
|
remove_hook_for :resource_controller
|
||||||
remove_class_option :actions
|
remove_class_option :actions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue