Class: Projecto::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Defined in:
lib/projecto/app_builder.rb

Instance Method Summary collapse

Instance Method Details

#custom_application_configObject



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

#gemfileObject



7
8
9
# File 'lib/projecto/app_builder.rb', line 7

def gemfile
  template "Gemfile.erb", "Gemfile"
end

#set_ruby_versionObject



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_assetsObject



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_herokuObject



30
31
32
# File 'lib/projecto/app_builder.rb', line 30

def setup_heroku
  copy_file "Procfile", "Procfile", force: true
end

#setup_rspecObject

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_applicationObject



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