Class: Roboto::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Roboto::Generators::InstallGenerator
- Defined in:
- lib/generators/roboto/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_roboto_route ⇒ Object
23 24 25 |
# File 'lib/generators/roboto/install_generator.rb', line 23 def add_roboto_route route "mount_roboto" end |
#copy_locale ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/generators/roboto/install_generator.rb', line 8 def copy_locale empty_directory "config/robots" env_list = Dir.glob("#{destination_root}/config/environments/*") env_list.each do |env_file| env_name = File.basename(env_file, ".rb") unless (env_name == "production" && FileTest.exists?("public/robots.txt")) copy_file "robots.txt", "config/robots/#{env_name}.txt" end end if FileTest.exists?("public/robots.txt") copy_file File.join(destination_root + "/public/robots.txt"), "config/robots/production.txt" remove_file "public/robots.txt" end end |
#show_readme ⇒ Object
27 28 29 |
# File 'lib/generators/roboto/install_generator.rb', line 27 def show_readme readme "README" if behavior == :invoke end |