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 11: def app 12: if mountable? 13: directory "app" 14: empty_directory_with_gitkeep "app/assets/images/#{name}" 15: elsif full? 16: empty_directory_with_gitkeep "app/models" 17: empty_directory_with_gitkeep "app/controllers" 18: empty_directory_with_gitkeep "app/views" 19: empty_directory_with_gitkeep "app/helpers" 20: empty_directory_with_gitkeep "app/mailers" 21: empty_directory_with_gitkeep "app/assets/images/#{name}" 22: end 23: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 76 76: def generate_test_dummy(force = false) 77: opts = (options || {}).slice(*PASSTHROUGH_OPTIONS) 78: opts[:force] = force 79: opts[:skip_bundle] = true 80: 81: invoke Rails::Generators::AppGenerator, 82: [ File.expand_path(dummy_path, destination_root) ], opts 83: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 118 118: def javascripts 119: return if options.skip_javascript? 120: 121: if mountable? 122: template "#{app_templates_dir}/app/assets/javascripts/application.js.tt", 123: "app/assets/javascripts/#{name}/application.js" 124: elsif full? 125: empty_directory_with_gitkeep "app/assets/javascripts/#{name}" 126: end 127: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 129 129: def script(force = false) 130: return unless full? 131: 132: directory "script", :force => force do |content| 133: "#{shebang}\n" + content 134: end 135: chmod "script", 0755, :verbose => false 136: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 109 109: def stylesheets 110: if mountable? 111: copy_file "#{app_templates_dir}/app/assets/stylesheets/application.css", 112: "app/assets/stylesheets/#{name}/application.css" 113: elsif full? 114: empty_directory_with_gitkeep "app/assets/stylesheets/#{name}" 115: end 116: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 58 58: def test 59: template "test/test_helper.rb" 60: template "test/%name%_test.rb" 61: append_file "Rakefile", "\#{rakefile_test_tasks}\n\ntask :default => :test\n" 62: if full? 63: template "test/integration/navigation_test.rb" 64: end 65: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 93 93: def test_dummy_clean 94: inside dummy_path do 95: remove_file ".gitignore" 96: remove_file "db/seeds.rb" 97: remove_file "doc" 98: remove_file "Gemfile" 99: remove_file "lib/tasks" 100: remove_file "app/assets/images/rails.png" 101: remove_file "public/index.html" 102: remove_file "public/robots.txt" 103: remove_file "README" 104: remove_file "test" 105: remove_file "vendor" 106: end 107: end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 85 85: def test_dummy_config 86: template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true 87: template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true 88: if mountable? 89: template "rails/routes.rb", "#{dummy_path}/config/routes.rb", :force => true 90: end 91: end