diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-15 20:16:37 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-15 20:16:37 +0200 |
commit | b4ef958de6b16294094de28d00ba25fe2f48accc (patch) | |
tree | 89ccd25109c5095125faeab8d5fcc318fa94ceb2 /railties/lib/generators | |
parent | baa4781ac7174e527c2471b4c86ea51c0f65cf6b (diff) | |
download | rails-b4ef958de6b16294094de28d00ba25fe2f48accc.tar.gz rails-b4ef958de6b16294094de28d00ba25fe2f48accc.tar.bz2 rails-b4ef958de6b16294094de28d00ba25fe2f48accc.zip |
Change false to :verbose => false as in new Thor version.
Diffstat (limited to 'railties/lib/generators')
-rw-r--r-- | railties/lib/generators/actions.rb | 37 | ||||
-rw-r--r-- | railties/lib/generators/migration.rb | 4 | ||||
-rw-r--r-- | railties/lib/generators/rails/app/app_generator.rb | 12 | ||||
-rw-r--r-- | railties/lib/generators/rails/plugin/plugin_generator.rb | 4 |
4 files changed, 29 insertions, 28 deletions
diff --git a/railties/lib/generators/actions.rb b/railties/lib/generators/actions.rb index 34c78aaad8..81db0b7c37 100644 --- a/railties/lib/generators/actions.rb +++ b/railties/lib/generators/actions.rb @@ -16,12 +16,13 @@ module Rails # # apply "recipes/jquery.rb" # - def apply(path, log_status=true) + def apply(path) path = find_in_source_paths(path) unless path =~ /^http\:\/\// - log :apply, path, log_status + log :apply, path + shell.padding += 1 instance_eval(open(path).read) - log :applied, path, log_status + shell.padding -= 1 end # Install a plugin. You must provide either a Subversion url or Git url. @@ -38,11 +39,11 @@ module Rails if options[:git] && options[:submodule] in_root do - run "git submodule add #{options[:git]} vendor/plugins/#{name}", false + run "git submodule add #{options[:git]} vendor/plugins/#{name}", :verbose => false end elsif options[:git] || options[:svn] in_root do - run_ruby_script "script/plugin install #{options[:svn] || options[:git]}", false + run_ruby_script "script/plugin install #{options[:svn] || options[:git]}", :verbose => false end else log "! no git or svn provided for #{name}. Skipping..." @@ -57,7 +58,7 @@ module Rails # gem "rspec", :env => :test # gem "technoweenie-restful-authentication", :lib => "restful-authentication", :source => "http://gems.github.com/" # - def gem(name, options = {}) + def gem(name, options={}) log :gem, name env = options.delete(:env) @@ -82,10 +83,10 @@ module Rails in_root do if options[:env].nil? - inject_into_file 'config/environment.rb', "\n #{data}", { :after => sentinel }, false + inject_into_file 'config/environment.rb', "\n #{data}", :after => sentinel, :verbose => false else Array.wrap(options[:env]).each do|env| - append_file "config/environments/#{env}.rb", "\n#{data}", false + append_file "config/environments/#{env}.rb", "\n#{data}", :verbose => false end end end @@ -99,7 +100,7 @@ module Rails # git :add => "this.file that.rb" # git :add => "onefile.rb", :rm => "badfile.cxx" # - def git(command = {}) + def git(command={}) in_root do if command.is_a?(Symbol) run "git #{command}" @@ -125,7 +126,7 @@ module Rails # def vendor(filename, data=nil, &block) log :vendor, filename - create_file("vendor/#{filename}", data, false, &block) + create_file("vendor/#{filename}", data, :verbose => false, &block) end # Create a new file in the lib/ directory. Code can be specified @@ -141,7 +142,7 @@ module Rails # def lib(filename, data=nil, &block) log :lib, filename - create_file("lib/#{filename}", data, false, &block) + create_file("lib/#{filename}", data, :verbose => false, &block) end # Create a new Rakefile with the provided code (either in a block or a string). @@ -164,7 +165,7 @@ module Rails # def rakefile(filename, data=nil, &block) log :rakefile, filename - create_file("lib/tasks/#{filename}", data, false, &block) + create_file("lib/tasks/#{filename}", data, :verbose => false, &block) end # Create a new initializer with the provided code (either in a block or a string). @@ -185,7 +186,7 @@ module Rails # def initializer(filename, data=nil, &block) log :initializer, filename - create_file("config/initializers/#{filename}", data, false, &block) + create_file("config/initializers/#{filename}", data, :verbose => false, &block) end # Generate something using a generator from Rails or a plugin. @@ -200,7 +201,7 @@ module Rails log :generate, what argument = args.map {|arg| arg.to_s }.flatten.join(" ") - in_root { run_ruby_script("script/generate #{what} #{argument}", false) } + in_root { run_ruby_script("script/generate #{what} #{argument}", :verbose => false) } end # Runs the supplied rake task @@ -215,7 +216,7 @@ module Rails log :rake, command env = options[:env] || 'development' sudo = options[:sudo] && RUBY_PLATFORM !~ /mswin|mingw/ ? 'sudo ' : '' - in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", false) } + in_root { run("#{sudo}#{extify(:rake)} #{command} RAILS_ENV=#{env}", :verbose => false) } end # Just run the capify command in root @@ -226,7 +227,7 @@ module Rails # def capify! log :capify, "" - in_root { run("#{extify(:capify)} .", false) } + in_root { run("#{extify(:capify)} .", :verbose => false) } end # Add Rails to /vendor/rails @@ -237,7 +238,7 @@ module Rails # def freeze!(args = {}) log :vendor, "rails" - in_root { run("#{extify(:rake)} rails:freeze:edge", false) } + in_root { run("#{extify(:rake)} rails:freeze:edge", :verbose => false) } end # Make an entry in Rails routing file conifg/routes.rb @@ -251,7 +252,7 @@ module Rails sentinel = "ActionController::Routing::Routes.draw do |map|" in_root do - inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel }, false + inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false } end end diff --git a/railties/lib/generators/migration.rb b/railties/lib/generators/migration.rb index 7014e6deda..0a9151ecdf 100644 --- a/railties/lib/generators/migration.rb +++ b/railties/lib/generators/migration.rb @@ -22,7 +22,7 @@ module Rails # # migration_template "migration.rb", "db/migrate/add_foo_to_bar.rb" # - def migration_template(source, destination=nil, log_status=true) + def migration_template(source, destination=nil, config={}) destination = File.expand_path(destination || source, self.destination_root) migration_dir = File.dirname(destination) @@ -37,7 +37,7 @@ module Rails destination = File.join(migration_dir, "#{@migration_number}_#{@migration_file_name}.rb") end - template(source, destination, log_status) + template(source, destination, config) end protected diff --git a/railties/lib/generators/rails/app/app_generator.rb b/railties/lib/generators/rails/app/app_generator.rb index 88a52c60b0..eaeb49903a 100644 --- a/railties/lib/generators/rails/app/app_generator.rb +++ b/railties/lib/generators/rails/app/app_generator.rb @@ -100,13 +100,13 @@ module Rails::Generators inside "log" do %w( server production development test ).each do |file| create_file "#{file}.log" - chmod "#{file}.log", 0666, false + chmod "#{file}.log", 0666, :verbose => false end end end def create_public_files - directory "public", "public", false # Non-recursive. Do small steps, so anyone can overwrite it. + directory "public", "public", :recursive => false # Do small steps, so anyone can overwrite it. end def create_dispatch_files @@ -114,13 +114,13 @@ module Rails::Generators copy_file "dispatchers/config.ru", "config.ru" template "dispatchers/dispatch.rb", "public/dispatch.rb" - chmod "public/dispatch.rb", 0755, false + chmod "public/dispatch.rb", 0755, :verbose => false template "dispatchers/dispatch.rb", "public/dispatch.cgi" - chmod "public/dispatch.cgi", 0755, false + chmod "public/dispatch.cgi", 0755, :verbose => false template "dispatchers/dispatch.fcgi", "public/dispatch.fcgi" - chmod "public/dispatch.fcgi", 0755, false + chmod "public/dispatch.fcgi", 0755, :verbose => false end def create_public_image_files @@ -138,7 +138,7 @@ module Rails::Generators def create_script_files directory "script" - chmod "script", 0755, false + chmod "script", 0755, :verbose => false end def create_test_files diff --git a/railties/lib/generators/rails/plugin/plugin_generator.rb b/railties/lib/generators/rails/plugin/plugin_generator.rb index a7417f28c2..dcdc125867 100644 --- a/railties/lib/generators/rails/plugin/plugin_generator.rb +++ b/railties/lib/generators/rails/plugin/plugin_generator.rb @@ -8,11 +8,11 @@ module Rails check_class_collision def create_root_files - directory '.', plugin_dir, false # non-recursive + directory '.', plugin_dir, :recursive => false end def create_lib_files - directory 'lib', plugin_dir('lib'), false # non-recursive + directory 'lib', plugin_dir('lib'), :recursive => false end def create_tasks_files |