Class: Pieces::Rails::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Pieces::Rails::InstallGenerator
- Defined in:
- lib/pieces/rails/install_generator.rb
Instance Method Summary collapse
- #gitignore ⇒ Object
- #mount_styleguide ⇒ Object
- #pieces_yml ⇒ Object
- #stylesheet ⇒ Object
- #views ⇒ Object
Instance Method Details
#gitignore ⇒ Object
23 24 25 |
# File 'lib/pieces/rails/install_generator.rb', line 23 def gitignore append_to_file '.gitignore', 'build/' end |
#mount_styleguide ⇒ Object
19 20 21 |
# File 'lib/pieces/rails/install_generator.rb', line 19 def mount_styleguide route "mount Pieces::Rails.new.mount, at: '/styleguide' unless Rails.env.production?" end |
#pieces_yml ⇒ Object
6 7 8 |
# File 'lib/pieces/rails/install_generator.rb', line 6 def pieces_yml copy_file 'rails_app/config/pieces.yml', 'config/pieces.yml' end |
#stylesheet ⇒ Object
10 11 12 |
# File 'lib/pieces/rails/install_generator.rb', line 10 def stylesheet copy_file 'rails_app/app/assets/stylesheets/pieces.css', 'app/assets/stylesheets/pieces.css' end |
#views ⇒ Object
14 15 16 17 |
# File 'lib/pieces/rails/install_generator.rb', line 14 def views copy_file 'rails_app/app/views/layouts/pieces.html.erb', 'app/views/layouts/pieces.html.erb' copy_file 'rails_app/app/views/application/_header.html.erb', 'app/views/application/_header.html.erb' end |