aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xactionmailer/Rakefile1
-rwxr-xr-xactionpack/Rakefile1
-rw-r--r--actionpack/lib/abstract_controller/callbacks.rb10
-rwxr-xr-xactivemodel/Rakefile1
-rwxr-xr-xactiverecord/Rakefile1
-rwxr-xr-xactiveresource/Rakefile1
-rw-r--r--activesupport/CHANGELOG.md2
-rwxr-xr-xactivesupport/Rakefile1
-rwxr-xr-x[-rw-r--r--]activesupport/bin/generate_tables0
-rw-r--r--activesupport/lib/active_support/callbacks.rb4
-rw-r--r--activesupport/lib/active_support/multibyte/unicode.rb2
-rw-r--r--activesupport/lib/active_support/values/unicode_tables.datbin877274 -> 904408 bytes
-rw-r--r--railties/CHANGELOG.md3
-rw-r--r--railties/lib/rails/generators/base.rb6
-rw-r--r--railties/test/generators/named_base_test.rb9
-rw-r--r--railties/test/generators_test.rb8
16 files changed, 40 insertions, 10 deletions
diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile
index e7d8ee299d..8f5aeb9603 100755
--- a/actionmailer/Rakefile
+++ b/actionmailer/Rakefile
@@ -11,6 +11,7 @@ Rake::TestTask.new { |t|
t.libs << "test"
t.pattern = 'test/**/*_test.rb'
t.warning = true
+ t.verbose = true
}
namespace :test do
diff --git a/actionpack/Rakefile b/actionpack/Rakefile
index 32c7cf3108..bb1e704767 100755
--- a/actionpack/Rakefile
+++ b/actionpack/Rakefile
@@ -19,6 +19,7 @@ Rake::TestTask.new(:test_action_pack) do |t|
t.test_files = Dir.glob('test/{abstract,controller,dispatch,template,assertions}/**/*_test.rb').sort
t.warning = true
+ t.verbose = true
end
namespace :test do
diff --git a/actionpack/lib/abstract_controller/callbacks.rb b/actionpack/lib/abstract_controller/callbacks.rb
index 304b4ab817..44c9ea34ba 100644
--- a/actionpack/lib/abstract_controller/callbacks.rb
+++ b/actionpack/lib/abstract_controller/callbacks.rb
@@ -21,11 +21,9 @@ module AbstractController
module ClassMethods
# If :only or :except are used, convert the options into the
- # primitive form (:per_key) used by ActiveSupport::Callbacks.
+ # :unless and :if options of ActiveSupport::Callbacks.
# The basic idea is that :only => :index gets converted to
- # :if => proc {|c| c.action_name == "index" }, but that the
- # proc is only evaluated once per action for the lifetime of
- # a Rails process.
+ # :if => proc {|c| c.action_name == "index" }.
#
# ==== Options
# * <tt>only</tt> - The callback should be run only for this action
@@ -33,11 +31,11 @@ module AbstractController
def _normalize_callback_options(options)
if only = options[:only]
only = Array(only).map {|o| "action_name == '#{o}'"}.join(" || ")
- options[:per_key] = {:if => only}
+ options[:if] = Array(options[:if]) << only
end
if except = options[:except]
except = Array(except).map {|e| "action_name == '#{e}'"}.join(" || ")
- options[:per_key] = {:unless => except}
+ options[:unless] = Array(options[:unless]) << except
end
end
diff --git a/activemodel/Rakefile b/activemodel/Rakefile
index c4b020196d..fc5aaf9f8f 100755
--- a/activemodel/Rakefile
+++ b/activemodel/Rakefile
@@ -8,6 +8,7 @@ Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = Dir.glob("#{dir}/test/cases/**/*_test.rb").sort
t.warning = true
+ t.verbose = true
end
namespace :test do
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index cc3bc4a94f..4090293b56 100755
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
@@ -49,6 +49,7 @@ end
} + Dir.glob("test/cases/adapters/#{adapter_short}/**/*_test.rb")).sort
t.warning = true
+ t.verbose = true
}
task "isolated_test_#{adapter}" do
diff --git a/activeresource/Rakefile b/activeresource/Rakefile
index 042d9fb0c7..b85d8c7eb5 100755
--- a/activeresource/Rakefile
+++ b/activeresource/Rakefile
@@ -12,6 +12,7 @@ Rake::TestTask.new { |t|
t.libs << "test"
t.pattern = 'test/**/*_test.rb'
t.warning = true
+ t.verbose = true
}
namespace :test do
diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md
index c78abdcaee..f3f838ebfd 100644
--- a/activesupport/CHANGELOG.md
+++ b/activesupport/CHANGELOG.md
@@ -18,6 +18,8 @@
* BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
+* Unicode database updated to 6.1.0.
+
## Rails 3.2.0 (January 20, 2012) ##
* Add ActiveSupport::Cache::NullStore for use in development and testing. *Brian Durand*
diff --git a/activesupport/Rakefile b/activesupport/Rakefile
index be3d3deb41..822c9d98ae 100755
--- a/activesupport/Rakefile
+++ b/activesupport/Rakefile
@@ -6,6 +6,7 @@ Rake::TestTask.new do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.warning = true
+ t.verbose = true
end
namespace :test do
diff --git a/activesupport/bin/generate_tables b/activesupport/bin/generate_tables
index 5fefa429df..5fefa429df 100644..100755
--- a/activesupport/bin/generate_tables
+++ b/activesupport/bin/generate_tables
diff --git a/activesupport/lib/active_support/callbacks.rb b/activesupport/lib/active_support/callbacks.rb
index c84742054a..3091a36fa0 100644
--- a/activesupport/lib/active_support/callbacks.rb
+++ b/activesupport/lib/active_support/callbacks.rb
@@ -136,8 +136,8 @@ module ActiveSupport
end
def _update_filter(filter_options, new_options)
- filter_options[:if].push(new_options[:unless]) if new_options.key?(:unless)
- filter_options[:unless].push(new_options[:if]) if new_options.key?(:if)
+ filter_options[:if].concat(Array(new_options[:unless])) if new_options.key?(:unless)
+ filter_options[:unless].concat(Array(new_options[:if])) if new_options.key?(:if)
end
def recompile!(_options, _per_key)
diff --git a/activesupport/lib/active_support/multibyte/unicode.rb b/activesupport/lib/active_support/multibyte/unicode.rb
index a0a8f3c97e..cb89d45c92 100644
--- a/activesupport/lib/active_support/multibyte/unicode.rb
+++ b/activesupport/lib/active_support/multibyte/unicode.rb
@@ -10,7 +10,7 @@ module ActiveSupport
NORMALIZATION_FORMS = [:c, :kc, :d, :kd]
# The Unicode version that is supported by the implementation
- UNICODE_VERSION = '6.0.0'
+ UNICODE_VERSION = '6.1.0'
# The default normalization used for operations that require normalization. It can be set to any of the
# normalizations in NORMALIZATION_FORMS.
diff --git a/activesupport/lib/active_support/values/unicode_tables.dat b/activesupport/lib/active_support/values/unicode_tables.dat
index 7edc4663e8..df17a8cccf 100644
--- a/activesupport/lib/active_support/values/unicode_tables.dat
+++ b/activesupport/lib/active_support/values/unicode_tables.dat
Binary files differ
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 05e94fdfb5..c25d4a889e 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,5 +1,8 @@
## Rails 4.0.0 (unreleased) ##
+* Add convenience `hide!` method to Rails generators to hide current generator
+ namespace from showing when running `rails generate`. *Carlos Antonio da Silva*
+
* Scaffold now uses `content_tag_for` in index.html.erb *José Valim*
* Rails::Plugin has gone. Instead of adding plugins to vendor/plugins use gems or bundler with path or git dependencies. *Santiago Pastorino*
diff --git a/railties/lib/rails/generators/base.rb b/railties/lib/rails/generators/base.rb
index 8f779316c1..60e94486bb 100644
--- a/railties/lib/rails/generators/base.rb
+++ b/railties/lib/rails/generators/base.rb
@@ -48,6 +48,12 @@ module Rails
@namespace ||= super.sub(/_generator$/, '').sub(/:generators:/, ':')
end
+ # Convenience method to hide this generator from the available ones when
+ # running rails generator command.
+ def self.hide!
+ Rails::Generators.hide_namespace self.namespace
+ end
+
# Invoke a generator based on the value supplied by the user to the
# given option named "name". A class option is created when this method
# is invoked and you can set a hash to customize it.
diff --git a/railties/test/generators/named_base_test.rb b/railties/test/generators/named_base_test.rb
index f23701e99e..2bc2c33a72 100644
--- a/railties/test/generators/named_base_test.rb
+++ b/railties/test/generators/named_base_test.rb
@@ -108,6 +108,15 @@ class NamedBaseTest < Rails::Generators::TestCase
assert_name g, 'sheep_index', :index_helper
end
+ def test_hide_namespace
+ g = generator ['Hidden']
+ g.class.stubs(:namespace).returns('hidden')
+
+ assert !Rails::Generators.hidden_namespaces.include?('hidden')
+ g.class.hide!
+ assert Rails::Generators.hidden_namespaces.include?('hidden')
+ end
+
protected
def assert_name(generator, value, method)
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index 5f9ee220dc..60e7e57a91 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -201,10 +201,16 @@ class GeneratorsTest < Rails::Generators::TestCase
mspec = Rails::Generators.find_by_namespace :fixjour
assert mspec.source_paths.include?(File.join(Rails.root, "lib", "templates", "fixjour"))
end
-
+
def test_usage_with_embedded_ruby
require File.expand_path("fixtures/lib/generators/usage_template/usage_template_generator", File.dirname(__FILE__))
output = capture(:stdout) { Rails::Generators.invoke :usage_template, ['--help'] }
assert_match /:: 2 ::/, output
end
+
+ def test_hide_namespace
+ assert !Rails::Generators.hidden_namespaces.include?("special:namespace")
+ Rails::Generators.hide_namespace("special:namespace")
+ assert Rails::Generators.hidden_namespaces.include?("special:namespace")
+ end
end