Class: Projecto::AppBuilder
- Inherits:
-
Rails::AppBuilder
- Object
- Rails::AppBuilder
- Projecto::AppBuilder
- Defined in:
- lib/projecto/app_builder.rb
Instance Method Summary collapse
- #custom_application_config ⇒ Object
- #gemfile ⇒ Object
- #set_ruby_version ⇒ Object
- #setup_assets ⇒ Object
- #setup_heroku ⇒ Object
-
#setup_rspec ⇒ Object
Test environment for projecto.
- #setup_view_application ⇒ Object
Instance Method Details
#custom_application_config ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/projecto/app_builder.rb', line 18 def custom_application_config config = <<-RUBY config.generators do |g| g.orm :active_record g.test_framework :test_unit, fixtures: true g.integration_tool :test_unit end RUBY inject_into_class "config/application.rb", "Application", config end |
#gemfile ⇒ Object
7 8 9 |
# File 'lib/projecto/app_builder.rb', line 7 def gemfile template "Gemfile.erb", "Gemfile" end |
#set_ruby_version ⇒ Object
3 4 5 |
# File 'lib/projecto/app_builder.rb', line 3 def set_ruby_version create_file ".ruby-version", "#{Projecto::RUBY_VERSION}\n", force: true end |
#setup_assets ⇒ Object
34 35 36 37 |
# File 'lib/projecto/app_builder.rb', line 34 def setup_assets copy_file "assets/config/manifest.js", "app/assets/config/manifest.js", force: true copy_file "assets/javascripts/application.js", "app/assets/javascripts/application.js", force: true end |
#setup_heroku ⇒ Object
30 31 32 |
# File 'lib/projecto/app_builder.rb', line 30 def setup_heroku copy_file "Procfile", "Procfile", force: true end |
#setup_rspec ⇒ Object
Test environment for projecto
12 13 14 15 16 |
# File 'lib/projecto/app_builder.rb', line 12 def setup_rspec create_file ".rspec", "--require rails_helper\n", force: true template "rspec/rails_helper", "spec/rails_helper.rb", force: true template "rspec/spec_helper", "spec/spec_helper.rb", force: true end |
#setup_view_application ⇒ Object
39 40 41 |
# File 'lib/projecto/app_builder.rb', line 39 def setup_view_application template "views/application.html.erb", "app/views/layouts/application.html.erb", force: true end |