Methods
- A
- C
- G
- J
- L
- R
- S
- T
Constants
PASSTHROUGH_OPTIONS | = | [ :skip_active_record, :skip_javascript, :database, :javascript, :quiet, :pretend, :force, :skip ] |
Instance Public methods
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 11 def app if mountable? directory "app" empty_directory_with_gitkeep "app/assets/images/#{name}" elsif full? empty_directory_with_gitkeep "app/models" empty_directory_with_gitkeep "app/controllers" empty_directory_with_gitkeep "app/views" empty_directory_with_gitkeep "app/helpers" empty_directory_with_gitkeep "app/mailers" empty_directory_with_gitkeep "app/assets/images/#{name}" end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 75 def generate_test_dummy(force = false) opts = (options || {}).slice(*PASSTHROUGH_OPTIONS) opts[:force] = force opts[:skip_bundle] = true invoke Rails::Generators::AppGenerator, [ File.expand_path(dummy_path, destination_root) ], opts end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 117 def javascripts return if options.skip_javascript? if mountable? template "#{app_templates_dir}/app/assets/javascripts/application.js.tt", "app/assets/javascripts/#{name}/application.js" elsif full? empty_directory_with_gitkeep "app/assets/javascripts/#{name}" end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 108 def stylesheets if mountable? copy_file "#{app_templates_dir}/app/assets/stylesheets/application.css", "app/assets/stylesheets/#{name}/application.css" elsif full? empty_directory_with_gitkeep "app/assets/stylesheets/#{name}" end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 58 def test template "test/test_helper.rb" template "test/%name%_test.rb" append_file "Rakefile", "#{rakefile_test_tasks} task :default => :test " if full? template "test/integration/navigation_test.rb" end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 92 def test_dummy_clean inside dummy_path do remove_file ".gitignore" remove_file "db/seeds.rb" remove_file "doc" remove_file "Gemfile" remove_file "lib/tasks" remove_file "app/assets/images/rails.png" remove_file "public/index.html" remove_file "public/robots.txt" remove_file "README" remove_file "test" remove_file "vendor" end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 84 def test_dummy_config template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true if mountable? template "rails/routes.rb", "#{dummy_path}/config/routes.rb", :force => true end end