aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2008-05-19 19:34:07 +0200
committerXavier Noria <fxn@hashref.com>2008-05-19 19:34:07 +0200
commitabc42927052969aa878b6f5f83d821f5771fc8c1 (patch)
tree30e4b64603ae85023fc835e4bff7c1c9e83a48cb
parent43d0200d94b7d66cee9ef3d20c376e03f30b1b60 (diff)
downloadrails-abc42927052969aa878b6f5f83d821f5771fc8c1.tar.gz
rails-abc42927052969aa878b6f5f83d821f5771fc8c1.tar.bz2
rails-abc42927052969aa878b6f5f83d821f5771fc8c1.zip
gsub("yaml", "YAML")
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb2
-rw-r--r--activesupport/lib/active_support/json/decoding.rb2
-rw-r--r--railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml2
-rw-r--r--railties/test/generators/generator_test_helper.rb60
4 files changed, 33 insertions, 33 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
index 34627dfaf9..2a8807fb78 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
@@ -193,7 +193,7 @@ module ActiveRecord
# :database => "path/to/dbfile"
# )
#
- # Also accepts keys as strings (for parsing from yaml for example):
+ # Also accepts keys as strings (for parsing from YAML for example):
#
# ActiveRecord::Base.establish_connection(
# "adapter" => "sqlite",
diff --git a/activesupport/lib/active_support/json/decoding.rb b/activesupport/lib/active_support/json/decoding.rb
index c58001f49f..fdb219dbf7 100644
--- a/activesupport/lib/active_support/json/decoding.rb
+++ b/activesupport/lib/active_support/json/decoding.rb
@@ -31,7 +31,7 @@ module ActiveSupport
if json[pos..scanner.pos-2] =~ DATE_REGEX
# found a date, track the exact positions of the quotes so we can remove them later.
# oh, and increment them for each current mark, each one is an extra padded space that bumps
- # the position in the final yaml output
+ # the position in the final YAML output
total_marks = marks.size
times << pos+total_marks << scanner.pos+total_marks
end
diff --git a/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml b/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml
index 79d5721a53..fe80872a16 100644
--- a/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml
+++ b/railties/test/fixtures/about_yml_plugins/bad_about_yml/about.yml
@@ -1 +1 @@
-# an empty yaml file - any content in here seems to get parsed as a string \ No newline at end of file
+# an empty YAML file - any content in here seems to get parsed as a string \ No newline at end of file
diff --git a/railties/test/generators/generator_test_helper.rb b/railties/test/generators/generator_test_helper.rb
index c99df6e2d3..41ddeb7d71 100644
--- a/railties/test/generators/generator_test_helper.rb
+++ b/railties/test/generators/generator_test_helper.rb
@@ -86,19 +86,19 @@ class GeneratorTestCase < Test::Unit::TestCase
# don't complain, test/unit
end
- # Instantiates the Generator
+ # Instantiates the Generator.
def build_generator(name, params)
Rails::Generator::Base.instance(name, params)
end
- # Runs the create command (like the command line does)
+ # Runs the +create+ command (like the command line does).
def run_generator(name, params)
silence_generator do
build_generator(name, params).command(:create).invoke!
end
end
- # Silences the logger temporarily and returns the output as a String
+ # Silences the logger temporarily and returns the output as a String.
def silence_generator
logger_original = Rails::Generator::Base.logger
myout = StringIO.new
@@ -108,7 +108,7 @@ class GeneratorTestCase < Test::Unit::TestCase
myout.string
end
- # asserts that the given controller was generated.
+ # Asserts that the given controller was generated.
# It takes a name or symbol without the <tt>_controller</tt> part and an optional super class.
# The contents of the class source file is passed to a block.
def assert_generated_controller_for(name, parent = "ApplicationController")
@@ -117,44 +117,44 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given model was generated.
+ # Asserts that the given model was generated.
# It takes a name or symbol and an optional super class.
- # the contents of the class source file is passed to a block.
+ # The contents of the class source file is passed to a block.
def assert_generated_model_for(name, parent = "ActiveRecord::Base")
assert_generated_class "app/models/#{name.to_s.underscore}", parent do |body|
yield body if block_given?
end
end
- # asserts that the given helper was generated.
- # It takes a name or symbol without the <tt>_helper</tt> part
- # the contents of the module source file is passed to a block.
+ # Asserts that the given helper was generated.
+ # It takes a name or symbol without the <tt>_helper</tt> part.
+ # The contents of the module source file is passed to a block.
def assert_generated_helper_for(name)
assert_generated_module "app/helpers/#{name.to_s.underscore}_helper" do |body|
yield body if block_given?
end
end
- # asserts that the given functional test was generated.
+ # Asserts that the given functional test was generated.
# It takes a name or symbol without the <tt>_controller_test</tt> part and an optional super class.
- # the contents of the class source file is passed to a block.
+ # The contents of the class source file is passed to a block.
def assert_generated_functional_test_for(name, parent = "ActionController::TestCase")
assert_generated_class "test/functional/#{name.to_s.underscore}_controller_test",parent do |body|
yield body if block_given?
end
end
- # asserts that the given unit test was generated.
+ # Asserts that the given unit test was generated.
# It takes a name or symbol without the <tt>_test</tt> part and an optional super class.
- # the contents of the class source file is passed to a block.
+ # The contents of the class source file is passed to a block.
def assert_generated_unit_test_for(name, parent = "ActiveSupport::TestCase")
assert_generated_class "test/unit/#{name.to_s.underscore}_test", parent do |body|
yield body if block_given?
end
end
- # asserts that the given file was generated.
- # the contents of the file is passed to a block.
+ # Asserts that the given file was generated.
+ # The contents of the file is passed to a block.
def assert_generated_file(path)
assert_file_exists(path)
File.open("#{RAILS_ROOT}/#{path}") do |f|
@@ -168,9 +168,9 @@ class GeneratorTestCase < Test::Unit::TestCase
"The file '#{RAILS_ROOT}/#{path}' should exist"
end
- # asserts that the given class source file was generated.
+ # Asserts that the given class source file was generated.
# It takes a path without the <tt>.rb</tt> part and an optional super class.
- # the contents of the class source file is passed to a block.
+ # The contents of the class source file is passed to a block.
def assert_generated_class(path, parent = nil)
# FIXME: Sucky way to detect namespaced classes
if path.split('/').size > 3
@@ -187,9 +187,9 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given module source file was generated.
+ # Asserts that the given module source file was generated.
# It takes a path without the <tt>.rb</tt> part.
- # the contents of the class source file is passed to a block.
+ # The contents of the class source file is passed to a block.
def assert_generated_module(path)
# FIXME: Sucky way to detect namespaced modules
if path.split('/').size > 3
@@ -206,18 +206,18 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given css stylesheet file was generated.
+ # Asserts that the given css stylesheet file was generated.
# It takes a path without the <tt>.css</tt> part.
- # the contents of the stylesheet source file is passed to a block.
+ # The contents of the stylesheet source file is passed to a block.
def assert_generated_stylesheet(path)
assert_generated_file("public/stylesheets/#{path}.css") do |body|
yield body if block_given?
end
end
- # asserts that the given yaml file was generated.
+ # Asserts that the given YAML file was generated.
# It takes a path without the <tt>.yml</tt> part.
- # the parsed yaml tree is passed to a block.
+ # The parsed YAML tree is passed to a block.
def assert_generated_yaml(path)
assert_generated_file("#{path}.yml") do |body|
yaml = YAML.load(body)
@@ -226,18 +226,18 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given fixtures yaml file was generated.
+ # Asserts that the given fixtures yaml file was generated.
# It takes a fixture name without the <tt>.yml</tt> part.
- # the parsed yaml tree is passed to a block.
+ # The parsed YAML tree is passed to a block.
def assert_generated_fixtures_for(name)
assert_generated_yaml "test/fixtures/#{name.to_s.underscore}" do |yaml|
yield yaml if block_given?
end
end
- # asserts that the given views were generated.
+ # Asserts that the given views were generated.
# It takes a controller name and a list of views (including extensions).
- # The body of each view is passed to a block
+ # The body of each view is passed to a block.
def assert_generated_views_for(name, *actions)
actions.each do |action|
assert_generated_file("app/views/#{name.to_s.underscore}/#{action}") do |body|
@@ -262,7 +262,7 @@ class GeneratorTestCase < Test::Unit::TestCase
assert !File.exist?(migration_file), "should not create migration #{migration_file}"
end
- # asserts that the given resource was added to the routes.
+ # Asserts that the given resource was added to the routes.
def assert_added_route_for(name)
assert_generated_file("config/routes.rb") do |body|
assert_match /map.resources :#{name.to_s.underscore}/, body,
@@ -270,7 +270,7 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given methods are defined in the body.
+ # Asserts that the given methods are defined in the body.
# This does assume standard rails code conventions with regards to the source code.
# The body of each individual method is passed to a block.
def assert_has_method(body, *methods)
@@ -280,7 +280,7 @@ class GeneratorTestCase < Test::Unit::TestCase
end
end
- # asserts that the given column is defined in the migration
+ # Asserts that the given column is defined in the migration.
def assert_generated_column(body, name, type)
assert_match /t\.#{type.to_s} :#{name.to_s}/, body, "should have column #{name.to_s} defined"
end