Class: Generapp::AppBuilder

Inherits:
Rails::AppBuilder
  • Object
show all
Includes:
Generapp::Actions::Configuration, Generapp::Actions::Database, Generapp::Actions::Develop, Generapp::Actions::Production, Generapp::Actions::Test, Generapp::Actions::Views
Defined in:
lib/generapp/app_builder.rb

Overview

Rails app builder customizations

Instance Method Summary collapse

Methods included from Generapp::Actions::Database

#create_database, #use_postgres_config_template

Methods included from Generapp::Actions::Configuration

#set_up_procfile, #set_up_version, #setup_default_rake_task

Methods included from Generapp::Actions::Views

#create_application_layout, #create_humans_txt, #create_manifest, #create_shared_directory, #create_shared_flashes, #create_shared_head, #create_shared_javascripts

Methods included from Generapp::Actions::Production

#configure_newrelic, #configure_rack_timeout

Methods included from Generapp::Actions::Test

#configure_ci, #configure_coverage, #configure_rspec, #enable_database_cleaner, #enable_devise_tests, #generate_rspec, #provide_shoulda_matchers_config, #spec_folders

Methods included from Generapp::Actions::Develop

#add_bullet_gem_configuration, #add_rubocop, #add_secrets, #configure_generators, #generate_annotate, #provide_setup_script, #raise_on_delivery_errors

Instance Method Details

#gemfileObject



24
25
26
# File 'lib/generapp/app_builder.rb', line 24

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

#generate_spring_binstubsObject



54
55
56
57
# File 'lib/generapp/app_builder.rb', line 54

def generate_spring_binstubs
  return unless spring_install?
  bundle_command 'exec spring binstub --all'
end

#gitignoreObject



20
21
22
# File 'lib/generapp/app_builder.rb', line 20

def gitignore
  copy_file 'generapp_gitignore', '.gitignore'
end

#init_gitObject



38
39
40
# File 'lib/generapp/app_builder.rb', line 38

def init_git
  git :init
end

#readmeObject



14
15
16
17
18
# File 'lib/generapp/app_builder.rb', line 14

def readme
  template 'README.md.erb', 'README.md'
  copy_file 'RELEASING.md', 'RELEASING.md'
  copy_file 'CONTRIBUTING.md', 'CONTRIBUTING.md'
end

#set_ruby_versionObject



28
29
30
# File 'lib/generapp/app_builder.rb', line 28

def set_ruby_version
  create_file '.ruby-version', "#{Generapp::RUBY_VERSION}\n"
end

#setup_bundler_auditObject



42
43
44
45
46
# File 'lib/generapp/app_builder.rb', line 42

def setup_bundler_audit
  copy_file 'tasks/bundler_audit.rake',
            'lib/tasks/bundler_audit.rake'
  append_file 'Rakefile', "\ntask default: 'bundler:audit'\n"
end

#setup_rubocopObject



48
49
50
51
52
# File 'lib/generapp/app_builder.rb', line 48

def setup_rubocop
  copy_file 'tasks/rubocop.rake',
            'lib/tasks/rubocop.rake'
  append_file 'Rakefile', "\ntask default: 'rubocop'\n"
end

#setup_stylesheetsObject



32
33
34
35
36
# File 'lib/generapp/app_builder.rb', line 32

def setup_stylesheets
  remove_file 'app/assets/stylesheets/application.css'
  copy_file 'application.scss',
            'app/assets/stylesheets/application.scss'
end