Class: Globber::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Globber::InstallGenerator
- Defined in:
- lib/generators/globber/install_generator.rb
Instance Method Summary collapse
-
#generate_initializer_file ⇒ Object
I can later access that option using: options.
- #mount_engine ⇒ Object
Instance Method Details
#generate_initializer_file ⇒ Object
I can later access that option using: options
13 14 15 |
# File 'lib/generators/globber/install_generator.rb', line 13 def generate_initializer_file create_file 'config/initializers/globber.rb', "Globber.configure do |config|\n config.base_uri = ''\nend" end |
#mount_engine ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/generators/globber/install_generator.rb', line 17 def mount_engine mount_line = 'mount Globber::Engine => "/"' line = 'routes.draw do' gsub_file 'config/routes.rb', /(#{Regexp.escape(line)})/mi do |match| "#{match}\n #{mount_line}\n" end end |