diff options
-rw-r--r-- | railties/lib/generators/actions.rb | 11 | ||||
-rw-r--r-- | railties/lib/generators/rails/app/app_generator.rb | 5 | ||||
-rw-r--r-- | railties/lib/generators/rails/metal/metal_generator.rb | 2 | ||||
-rw-r--r-- | railties/lib/generators/rails/plugin/plugin_generator.rb | 4 | ||||
-rw-r--r-- | railties/lib/tasks/framework.rake | 68 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/CHANGELOG.rdoc (renamed from railties/lib/vendor/thor-0.11.1/CHANGELOG.rdoc) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/LICENSE (renamed from railties/lib/vendor/thor-0.11.1/LICENSE) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/README.markdown (renamed from railties/lib/vendor/thor-0.11.1/README.markdown) | 0 | ||||
-rwxr-xr-x | railties/lib/vendor/thor-0.11.2/bin/rake2thor (renamed from railties/lib/vendor/thor-0.11.1/bin/rake2thor) | 0 | ||||
-rwxr-xr-x | railties/lib/vendor/thor-0.11.2/bin/thor (renamed from railties/lib/vendor/thor-0.11.1/bin/thor) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions.rb) | 26 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions/create_file.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions/create_file.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions/directory.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions/directory.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions/empty_directory.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions/empty_directory.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions/file_manipulation.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions/file_manipulation.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/actions/inject_into_file.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/actions/inject_into_file.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/base.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/base.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/hash_with_indifferent_access.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/hash_with_indifferent_access.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/ordered_hash.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/ordered_hash.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/error.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/error.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/group.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/group.rb) | 26 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/invocation.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/invocation.rb) | 20 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/parser.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/parser.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/parser/argument.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/parser/argument.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/parser/arguments.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/parser/arguments.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/parser/option.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/parser/option.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/parser/options.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/parser/options.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/runner.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/runner.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/shell.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/shell.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/shell/basic.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/shell/basic.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/shell/color.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/shell/color.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/task.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/task.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/tasks.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/tasks.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/tasks/install.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/tasks/install.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/tasks/package.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/tasks/package.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/tasks/spec.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/tasks/spec.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor-0.11.2/lib/thor/util.rb (renamed from railties/lib/vendor/thor-0.11.1/lib/thor/util.rb) | 0 | ||||
-rw-r--r-- | railties/lib/vendor/thor.rb | 4 | ||||
-rw-r--r-- | railties/test/generators/actions_test.rb | 13 |
40 files changed, 92 insertions, 87 deletions
diff --git a/railties/lib/generators/actions.rb b/railties/lib/generators/actions.rb index 81db0b7c37..795d420229 100644 --- a/railties/lib/generators/actions.rb +++ b/railties/lib/generators/actions.rb @@ -16,13 +16,14 @@ module Rails # # apply "recipes/jquery.rb" # - def apply(path) - path = find_in_source_paths(path) unless path =~ /^http\:\/\// + def apply(path, options={}) + verbose = options.fetch(:verbose, true) + path = find_in_source_paths(path) unless path =~ /^http\:\/\// - log :apply, path - shell.padding += 1 + log :apply, path, verbose + shell.padding += 1 if verbose instance_eval(open(path).read) - shell.padding -= 1 + shell.padding -= 1 if verbose end # Install a plugin. You must provide either a Subversion url or Git url. diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb index eaeb49903a..0c9bbeb847 100644 --- a/railties/lib/generators/rails/app/app_generator.rb +++ b/railties/lib/generators/rails/app/app_generator.rb @@ -66,7 +66,6 @@ module Rails::Generators empty_directory "config" inside "config" do - copy_file "boot.rb" copy_file "routes.rb" template "environment.rb" @@ -76,6 +75,10 @@ module Rails::Generators end end + def create_boot_file + copy_file "config/boot.rb" + end + def create_activerecord_files return if options[:skip_activerecord] template "config/databases/#{options[:database]}.yml", "config/database.yml" diff --git a/railties/lib/generators/rails/metal/metal_generator.rb b/railties/lib/generators/rails/metal/metal_generator.rb index d814b6c38b..fe4f945cad 100644 --- a/railties/lib/generators/rails/metal/metal_generator.rb +++ b/railties/lib/generators/rails/metal/metal_generator.rb @@ -3,7 +3,7 @@ module Rails class MetalGenerator < NamedBase check_class_collision - def create_file + def create_metal_file template "metal.rb", "app/metal/#{file_name}.rb" end end diff --git a/railties/lib/generators/rails/plugin/plugin_generator.rb b/railties/lib/generators/rails/plugin/plugin_generator.rb index dcdc125867..ee785caf7d 100644 --- a/railties/lib/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/generators/rails/plugin/plugin_generator.rb @@ -21,13 +21,13 @@ module Rails end hook_for :generator do |instance, generator| - instance.inside_with_padding instance.send(:plugin_dir) do + instance.inside instance.send(:plugin_dir), :verbose => true do instance.invoke generator, [ instance.name ], :namespace => false end end hook_for :test_framework do |instance, test_framework| - instance.inside_with_padding instance.send(:plugin_dir) do + instance.inside instance.send(:plugin_dir), :verbose => true do instance.invoke test_framework end end diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index b6f2f2bc18..72cba5ce8b 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -78,51 +78,48 @@ namespace :rails do end desc "Update both configs, scripts and public/javascripts from Rails" - task :update => [ "update:scripts", "update:javascripts", "update:configs", "update:application_controller" ] + task :update => [ "update:configs", "update:javascripts", "update:scripts", "update:application_controller" ] desc "Applies the template supplied by LOCATION=/path/to/template" task :template do - require 'rails_generator/generators/applications/app/template_runner' template = ENV["LOCATION"] template = File.expand_path(template) if template !~ %r{\A[A-Za-z][A-Za-z0-9+\-\.]*://} - Rails::TemplateRunner.new(template) + + require 'generators' + generator = Rails::Generators::Base.new [], {}, :destination_root => RAILS_ROOT + generator.apply template, :verbose => false end namespace :update do - desc "Add new scripts to the application script/ directory" - task :scripts do - local_base = "script" - edge_base = "#{File.dirname(__FILE__)}/../../bin" - - local = Dir["#{local_base}/**/*"].reject { |path| File.directory?(path) } - edge = Dir["#{edge_base}/**/*"].reject { |path| File.directory?(path) } - - edge.each do |script| - base_name = script[(edge_base.length+1)..-1] - next if base_name == "rails" - next if local.detect { |path| base_name == path[(local_base.length+1)..-1] } - if !File.directory?("#{local_base}/#{File.dirname(base_name)}") - mkdir_p "#{local_base}/#{File.dirname(base_name)}" - end - install script, "#{local_base}/#{base_name}", :mode => 0755 - end - end + def invoke_from_app_generator(method) + require 'generators' + require 'generators/rails/app/app_generator' - desc "Update your javascripts from your current rails install" - task :javascripts do - require 'railties_path' - project_dir = RAILS_ROOT + '/public/javascripts/' - scripts = Dir[RAILTIES_PATH + '/html/javascripts/*.js'] - scripts.reject!{|s| File.basename(s) == 'application.js'} if File.exist?(project_dir + 'application.js') - FileUtils.cp(scripts, project_dir) + generator = Rails::Generators::AppGenerator.new ["rails"], { :with_dispatchers => true }, + :destination_root => RAILS_ROOT + generator.invoke(method) end desc "Update config/boot.rb from your current rails install" task :configs do - require 'railties_path' - FileUtils.cp(RAILTIES_PATH + '/environments/boot.rb', RAILS_ROOT + '/config/boot.rb') + invoke_from_app_generator :create_boot_file + end + + desc "Update Prototype javascripts from your current rails install" + task :javascripts do + invoke_from_app_generator :create_prototype_files + end + + desc "Generate dispatcher files in RAILS_ROOT/public" + task :generate_dispatchers do + invoke_from_app_generator :create_dispatch_files end - + + desc "Add new scripts to the application script/ directory" + task :scripts do + invoke_from_app_generator :create_script_files + end + desc "Rename application.rb to application_controller.rb" task :application_controller do old_style = RAILS_ROOT + '/app/controllers/application.rb' @@ -132,14 +129,5 @@ namespace :rails do puts "#{old_style} has been renamed to #{new_style}, update your SCM as necessary" end end - - desc "Generate dispatcher files in RAILS_ROOT/public" - task :generate_dispatchers do - require 'railties_path' - FileUtils.cp(RAILTIES_PATH + '/dispatches/config.ru', RAILS_ROOT + '/config.ru') - FileUtils.cp(RAILTIES_PATH + '/dispatches/dispatch.fcgi', RAILS_ROOT + '/public/dispatch.fcgi') - FileUtils.cp(RAILTIES_PATH + '/dispatches/dispatch.rb', RAILS_ROOT + '/public/dispatch.rb') - FileUtils.cp(RAILTIES_PATH + '/dispatches/dispatch.rb', RAILS_ROOT + '/public/dispatch.cgi') - end end end diff --git a/railties/lib/vendor/thor-0.11.1/CHANGELOG.rdoc b/railties/lib/vendor/thor-0.11.2/CHANGELOG.rdoc index 544dde8c02..544dde8c02 100644 --- a/railties/lib/vendor/thor-0.11.1/CHANGELOG.rdoc +++ b/railties/lib/vendor/thor-0.11.2/CHANGELOG.rdoc diff --git a/railties/lib/vendor/thor-0.11.1/LICENSE b/railties/lib/vendor/thor-0.11.2/LICENSE index 98722da459..98722da459 100644 --- a/railties/lib/vendor/thor-0.11.1/LICENSE +++ b/railties/lib/vendor/thor-0.11.2/LICENSE diff --git a/railties/lib/vendor/thor-0.11.1/README.markdown b/railties/lib/vendor/thor-0.11.2/README.markdown index a1d7259775..a1d7259775 100644 --- a/railties/lib/vendor/thor-0.11.1/README.markdown +++ b/railties/lib/vendor/thor-0.11.2/README.markdown diff --git a/railties/lib/vendor/thor-0.11.1/bin/rake2thor b/railties/lib/vendor/thor-0.11.2/bin/rake2thor index 50c7410d80..50c7410d80 100755 --- a/railties/lib/vendor/thor-0.11.1/bin/rake2thor +++ b/railties/lib/vendor/thor-0.11.2/bin/rake2thor diff --git a/railties/lib/vendor/thor-0.11.1/bin/thor b/railties/lib/vendor/thor-0.11.2/bin/thor index eaf849fb4a..eaf849fb4a 100755 --- a/railties/lib/vendor/thor-0.11.1/bin/thor +++ b/railties/lib/vendor/thor-0.11.2/bin/thor diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor.rb b/railties/lib/vendor/thor-0.11.2/lib/thor.rb index ee4ef23309..ee4ef23309 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions.rb index ff0592ea1b..f7b271dbe1 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions.rb @@ -136,21 +136,20 @@ class Thor # # ==== Parameters # dir<String>:: the directory to move to. + # config<Hash>:: give :verbose => true to log and use padding. # - def inside(dir='', &block) + def inside(dir='', config={}, &block) + verbose = config.fetch(:verbose, false) + + say_status :inside, dir, verbose + shell.padding += 1 if verbose @destination_stack.push File.expand_path(dir, destination_root) + FileUtils.mkdir_p(destination_root) unless File.exist?(destination_root) FileUtils.cd(destination_root) { block.arity == 1 ? yield(destination_root) : yield } - @destination_stack.pop - end - # Same as inside, but log status and use padding. - # - def inside_with_padding(dir='', config={}, &block) - say_status :inside, dir, config.fetch(:verbose, true) - shell.padding += 1 - inside(dir, &block) - shell.padding -= 1 + @destination_stack.pop + shell.padding -= 1 if verbose end # Goes to the root and execute the given block. @@ -173,8 +172,7 @@ class Thor # def run(command, config={}) return unless behavior == :invoke - description = "#{command.inspect} from #{relative_to_original_destination_root(destination_root, false)}" - say_status :run, description, config.fetch(:verbose, true) + say_status :run, command, config.fetch(:verbose, true) `#{command}` unless options[:pretend] end @@ -196,8 +194,8 @@ class Thor # ==== Parameters # task<String>:: the task to be invoked # args<Array>:: arguments to the task - # options<Hash>:: give :verbose => false to not log the status. Other options - # are given as parameter to Thor. + # config<Hash>:: give :verbose => false to not log the status. Other options + # are given as parameter to Thor. # # ==== Examples # diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/create_file.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/create_file.rb index 8f6badee27..8f6badee27 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/create_file.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/create_file.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/directory.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/directory.rb index e33639f4e5..e33639f4e5 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/directory.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/directory.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/empty_directory.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/empty_directory.rb index 03c1fe4af1..03c1fe4af1 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/empty_directory.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/empty_directory.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/file_manipulation.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/file_manipulation.rb index 5a39840404..5a39840404 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/file_manipulation.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/file_manipulation.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/inject_into_file.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/inject_into_file.rb index 089bd894e4..089bd894e4 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/actions/inject_into_file.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/actions/inject_into_file.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/base.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/base.rb index caf298dda8..caf298dda8 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/base.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/base.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/hash_with_indifferent_access.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/hash_with_indifferent_access.rb index 3213961fe4..3213961fe4 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/hash_with_indifferent_access.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/hash_with_indifferent_access.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/ordered_hash.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/ordered_hash.rb index 5e4ad5609f..5e4ad5609f 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/core_ext/ordered_hash.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/core_ext/ordered_hash.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/error.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/error.rb index c846e9ce74..c846e9ce74 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/error.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/error.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/group.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/group.rb index 63267934c7..ef1476a694 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/group.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/group.rb @@ -87,7 +87,7 @@ class Thor::Group if klass say_status :invoke, #{name.inspect}, #{verbose.inspect} block = self.class.invocation_blocks[#{name.inspect}] - invoke_with_padding klass, task, &block + _invoke_for_class_method klass, task, &block else say_status :error, %(#{name.inspect} [not found]), :red end @@ -150,7 +150,7 @@ class Thor::Group if klass say_status :invoke, value, #{verbose.inspect} block = self.class.invocation_blocks[#{name.inspect}] - invoke_with_padding klass, task, &block + _invoke_for_class_method klass, task, &block else say_status :error, %(\#{value} [not found]), :red end @@ -237,4 +237,26 @@ class Thor::Group end include Thor::Base + + protected + + # Shortcut to invoke with padding and block handling. Use internally by + # invoke and invoke_from_option class methods. + # + def _invoke_for_class_method(klass, task=nil, *args, &block) + shell.padding += 1 + + result = if block_given? + if block.arity == 2 + block.call(self, klass) + else + block.call(self, klass, task) + end + else + invoke klass, task, *args + end + + shell.padding -= 1 + result + end end diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/invocation.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/invocation.rb index 4e8a7e578d..34e7a4b911 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/invocation.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/invocation.rb @@ -130,26 +130,6 @@ class Thor end end - # Shortcut for invoke with padding and status handling. Used internally by - # class options invoke and invoke_from_option. - # - def invoke_with_padding(klass, task=nil, *args, &block) - shell.padding += 1 - - result = if block_given? - if block.arity == 2 - block.call(self, klass) - else - block.call(self, klass, task) - end - else - invoke klass, task, *args - end - - shell.padding -= 1 - result - end - protected # Configuration values that are shared between invocations. diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/parser.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/parser.rb index 57a3f6e1a5..57a3f6e1a5 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/parser.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/parser.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/argument.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/argument.rb index 2d7f4dbafb..2d7f4dbafb 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/argument.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/argument.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/arguments.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/arguments.rb index 9a2262d6f7..9a2262d6f7 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/arguments.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/arguments.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/option.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/option.rb index 5c43f6b18f..5c43f6b18f 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/option.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/option.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/options.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/options.rb index 01c86b7b27..01c86b7b27 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/parser/options.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/parser/options.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/runner.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/runner.rb index 330de38449..330de38449 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/runner.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/runner.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/shell.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/shell.rb index 7ed4a24bfb..7ed4a24bfb 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/shell.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/shell.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/shell/basic.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/shell/basic.rb index 6f1a2ade07..6f1a2ade07 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/shell/basic.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/shell/basic.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/shell/color.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/shell/color.rb index 67afa65ed2..67afa65ed2 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/shell/color.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/shell/color.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/task.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/task.rb index 92c0776c04..92c0776c04 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/task.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/task.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks.rb index d1a7b1c673..d1a7b1c673 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/install.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/install.rb index 6b20ff1634..6b20ff1634 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/install.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/install.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/package.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/package.rb index 603d61b4ab..603d61b4ab 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/package.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/package.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/spec.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/spec.rb index c7d00968e8..c7d00968e8 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/tasks/spec.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/tasks/spec.rb diff --git a/railties/lib/vendor/thor-0.11.1/lib/thor/util.rb b/railties/lib/vendor/thor-0.11.2/lib/thor/util.rb index 26db24aadb..26db24aadb 100644 --- a/railties/lib/vendor/thor-0.11.1/lib/thor/util.rb +++ b/railties/lib/vendor/thor-0.11.2/lib/thor/util.rb diff --git a/railties/lib/vendor/thor.rb b/railties/lib/vendor/thor.rb index 89201313cd..9919497c8f 100644 --- a/railties/lib/vendor/thor.rb +++ b/railties/lib/vendor/thor.rb @@ -1,9 +1,9 @@ begin # Prefer gems to the bundled libs. require 'rubygems' - gem 'thor', '>= 0.11.1' + gem 'thor', '>= 0.11.2' rescue Gem::LoadError - $:.unshift "#{File.dirname(__FILE__)}/thor-0.11.1/lib" + $:.unshift "#{File.dirname(__FILE__)}/thor-0.11.2/lib" end require 'thor' diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index 9a8d8075a1..aeddb21d1f 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -31,6 +31,19 @@ class ActionsTest < GeneratorsTestCase assert_match /cool padding/, content end + def test_apply_does_not_log_status_if_required + template = <<-TEMPLATE + say_status :cool, :padding + TEMPLATE + template.instance_eval "def read; self; end" + + generator.expects(:open).with("http://gist.github.com/103208.txt").returns(template) + content = action(:apply, "http://gist.github.com/103208.txt", :verbose => false) + + assert_match /cool padding/, content + assert_no_match /apply http/, content + end + def test_create_file_should_write_data_to_file_path action :create_file, 'lib/test_file.rb', 'heres test data' assert_file 'lib/test_file.rb', 'heres test data' |