Class: Rails::StencilGenerator
- Inherits:
-
Generators::Base
- Object
- Generators::Base
- Rails::StencilGenerator
- Defined in:
- lib/generators/rails/stencil/stencil_generator.rb
Instance Method Summary collapse
- #basic_css_file ⇒ Object
- #gemfile_cleanup ⇒ Object
- #gems_add ⇒ Object
- #gems_install ⇒ Object
- #git_repo ⇒ Object
- #gitignore_file ⇒ Object
- #guard_install ⇒ Object
- #home_controller_generate ⇒ Object
- #normalize_css_file ⇒ Object
- #rspec_install ⇒ Object
- #unnecessary_remove ⇒ Object
Instance Method Details
#basic_css_file ⇒ Object
54 55 56 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 54 def basic_css_file copy_file 'screen.css.scss', 'app/assets/stylesheets/screen.css.scss' end |
#gemfile_cleanup ⇒ Object
22 23 24 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 22 def gemfile_cleanup gsub_file 'Gemfile', /#.*\n/, "" end |
#gems_add ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 4 def gems_add gem 'pg' gem 'haml' gem_group :development do gem 'passenger' gem 'ruby-debug' end gem_group :development, :test do gem 'rspec-rails' gem 'guard-rspec' gem 'rb-inotify' gem 'libnotify' gem 'factory_girl_rails' end end |
#gems_install ⇒ Object
26 27 28 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 26 def gems_install run 'bundle install' end |
#git_repo ⇒ Object
63 64 65 66 67 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 63 def git_repo git :init git :add => '.' git :commit => '-am "initial app stencil" --quiet' end |
#gitignore_file ⇒ Object
58 59 60 61 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 58 def gitignore_file remove_file '.gitignore' copy_file 'gitignore.txt', '.gitignore' end |
#guard_install ⇒ Object
35 36 37 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 35 def guard_install run 'guard init rspec' end |
#home_controller_generate ⇒ Object
44 45 46 47 48 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 44 def home_controller_generate remove_file 'public/index.html' generate(:controller, "home index --assets=false") gsub_file 'config/routes.rb', /get \"home\/index\"/, 'root :to => "home#index"' end |
#normalize_css_file ⇒ Object
50 51 52 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 50 def normalize_css_file copy_file 'normalize.css', 'vendor/assets/stylesheets/normalize.css' end |
#rspec_install ⇒ Object
30 31 32 33 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 30 def rspec_install remove_dir 'test/' generate 'rspec:install' end |
#unnecessary_remove ⇒ Object
39 40 41 42 |
# File 'lib/generators/rails/stencil/stencil_generator.rb', line 39 def unnecessary_remove remove_dir 'doc/' remove_file 'app/assets/images/rails.png' end |