Methods
- A
- B
- C
- D
- F
- G
- M
- N
- O
- R
- S
- V
Class Public methods
Class Protected methods
Instance Public methods
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 165 def create_root_files build(:readme) build(:rakefile) build(:gemspec) unless options[:skip_gemspec] build(:license) build(:gitignore) unless options[:skip_git] build(:gemfile) unless options[:skip_gemfile] end
Instance Protected methods
Also aliased as: store_application_definition!
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 279 def application_definition @application_definition ||= begin dummy_application_path = File.expand_path("#{dummy_path}/config/application.rb", destination_root) unless options[:pretend] || !File.exists?(dummy_application_path) contents = File.read(dummy_application_path) contents[(contents.index("module Dummy"))..-1] end end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 223 def create_dummy_app(path = nil) dummy_path(path) if path say_status :vendor_app, dummy_path mute do build(:generate_test_dummy) store_application_definition! build(:test_dummy_config) build(:test_dummy_clean) # ensure that script/rails has proper dummy_path build(:script, true) end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 253 def name @name ||= begin # same as ActiveSupport::Inflector#underscore except not replacing '-' underscored = original_name.dup underscored.gsub!(%r([A-Z]+)([A-Z][a-z])/,'\1_\2') underscored.gsub!(%r([a-z\d])([A-Z])/,'\1_\2') underscored.downcase! underscored end end
# File railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb, line 269 def valid_const? if camelized =~ %r^\d/ raise Error, "Invalid plugin name #{original_name}. Please give a name which does not start with numbers." elsif RESERVED_NAMES.include?(name) raise Error, "Invalid plugin name #{original_name}. Please give a name which does not match one of the reserved rails words." elsif Object.const_defined?(camelized) raise Error, "Invalid plugin name #{original_name}, constant #{camelized} is already in use. Please choose another plugin name." end end