Methods
- C
- D
- E
- F
- R
Constants
DUMMY_SETUP_FILES | = | [ 'config/database.yml', 'config/initializers/devise_token_auth.rb', 'config/initializers/devise.rb', 'app/models/user.rb', 'db/migrate/20210111014230_devise_token_auth_create_users.rhino_engine.rb' ].freeze |
Gross hack for now |
Attributes
[R] | module_name | |
[R] | module_path |
Instance Public methods
create_install_generator()
Link
Source: show
# File rhino/rhino/lib/generators/rhino/module/module_generator.rb 41 def create_install_generator 42 generator_path = "#{module_path}/lib/generators/#{module_name}/install" 43 tasks_path = "#{module_path}/lib/tasks" 44 45 empty_directory "#{generator_path}/templates" 46 create_file("#{generator_path}/templates/.keep") 47 48 template 'install_generator.rb', "#{generator_path}/install_generator.rb" 49 template 'module_tasks.rake', "#{tasks_path}/#{module_name}.rake" 50 51 remove_file "#{tasks_path}/#{module_name}_tasks.rake" 52 end
create_module()
Link
Source: show
# File rhino/rhino/lib/generators/rhino/module/module_generator.rb 16 def create_module 17 @module_name = ask('Module name?') 18 @module_name = "rhino_#{module_name}" unless module_name.starts_with?('rhino_') 19 @module_path = "rhino/#{module_name}" 20 21 return if options[:skip_plugin] 22 23 say "Creating #{module_name}" 24 25 plugin_command = "plugin new #{module_path}" 26 plugin_command = "#{plugin_command} --full" if options[:full] 27 rails_command(plugin_command) 28 end
dummy_setup()
Link
Source: show
# File rhino/rhino/lib/generators/rhino/module/module_generator.rb 73 def dummy_setup 74 return unless options[:full] 75 76 rhino_dummy = Rails.root.join('rhino/rhino/test/dummy') 77 module_dummy = Rails.root.join("#{module_path}/test/dummy") 78 79 remove_file "#{module_dummy}/config/database.yml" 80 81 DUMMY_SETUP_FILES.each do |file| 82 copy_file "#{rhino_dummy}/#{file}", "#{module_dummy}/#{file}" 83 end 84 end
engine_registration()
Link
Source: show
# File rhino/rhino/lib/generators/rhino/module/module_generator.rb 34 def engine_registration 35 engine_file = "#{module_path}/lib/#{module_name}/engine.rb" 36 37 remove_file engine_file 38 template 'engine.rb', engine_file 39 end
fix_gemspec()
Link
Source: show
# File rhino/rhino/lib/generators/rhino/module/module_generator.rb 54 def fix_gemspec 55 gemspec_file = "#{module_path}/#{module_name}.gemspec" 56 57 gsub_file gemspec_file, /spec.homepage.*/, 'spec.homepage = ""' 58 gsub_file gemspec_file, /spec.summary.*/, 'spec.summary = ""' 59 gsub_file gemspec_file, /spec.description.*/, 'spec.description = ""' 60 gsub_file gemspec_file, /spec.license.*/, 'spec.license = ""' 61 gsub_file gemspec_file, 'spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"]', 'spec.files = Dir["{app,config,db,lib}/**/*", "Rakefile", "README.md"]' # rubocop:disable Layout/LineLength 62 end