class Tirantes::AppGenerator

Public Instance Methods

configure_app() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 112
def configure_app
  say 'Configuring app'
  build :configure_action_mailer
  build :blacklist_active_record_attributes
  build :configure_strong_parameters
  build :configure_time_zone
  build :configure_time_formats
  build :configure_pretty_formatter
  build :configure_simple_form
  build :configure_rack_timeout
  build :disable_xml_params
  build :setup_secret_token
  build :setup_default_rake_task
  build :configure_puma
  build :setup_foreman
end
copy_libraries() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 165
def copy_libraries
  say 'Copying libraries'
  build :copy_libraries
end
copy_miscellaneous_files() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 170
def copy_miscellaneous_files
  say 'Copying miscellaneous support files'
  build :copy_miscellaneous_files
end
create_github_repo() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 150
def create_github_repo
  if !options[:skip_git] && options[:github]
    say 'Creating Github repo'
    build :create_github_repo, options[:github]
  end
end
create_heroku_apps() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 142
def create_heroku_apps
  if options[:heroku]
    say 'Creating Heroku apps'
    build :create_heroku_apps
    build :set_heroku_remotes
  end
end
create_tirantes_views() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 98
def create_tirantes_views
  say 'Creating tirantes views'
  build :create_partials_directory
  build :create_shared_flashes
  build :create_shared_javascripts
  build :create_application_layout
end
customize_error_pages() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 175
def customize_error_pages
  say 'Customizing the 500/404/422 pages'
  build :customize_error_pages
end
customize_gemfile() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 49
def customize_gemfile
  build :replace_gemfile
  build :set_ruby_to_version_being_used
  bundle_command 'install'
end
finish_template() click to toggle source
Calls superclass method
# File lib/tirantes/generators/app_generator.rb, line 18
def finish_template
  invoke :tirantes_customization
  super
end
init_git() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 161
def init_git
  build :init_git
end
outro() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 184
def outro
  say 'Congratulations! You just pulled our tirantes.'
  say 'Please execute bin/setup to complete this application setup'
end
remove_files_we_dont_need() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 44
def remove_files_we_dont_need
  build :remove_public_index
  build :remove_rails_logo_image
end
remove_routes_comment_lines() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 180
def remove_routes_comment_lines
  build :remove_routes_comment_lines
end
run_bundle() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 189
def run_bundle
  # Let's not: We'll bundle manually at the right spot
end
setup_coffeescript() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 106
def setup_coffeescript
  say 'Setting up CoffeeScript defaults'
  build :remove_turbolinks
  build :create_common_javascripts
end
setup_database() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 55
def setup_database
  say 'Setting up database'

  if 'postgresql' == options[:database]
    build :use_postgres_config_template
  end

  build :create_database

  say 'If you want to use pg text search, remember to'
  say 'to generate and migrate pg_search_documents table'
  say 'rails g pg_search:migration:multisearch'
  say 'rake db:migrate'
end
setup_development_environment() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 70
def setup_development_environment
  say 'Setting up the development environment'
  build :raise_on_delivery_errors
  build :raise_on_unpermitted_parameters
  build :provide_setup_script
  build :configure_generators
end
setup_git() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 134
def setup_git
  if !options[:skip_git]
    say 'Initializing git'
    invoke :setup_gitignore
    invoke :init_git
  end
end
setup_gitignore() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 157
def setup_gitignore
  build :gitignore_files
end
setup_production_environment() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 87
def setup_production_environment
  say 'Setting up the production environment'
  build :configure_smtp
  build :configure_exception_notifier
end
setup_staging_environment() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 93
def setup_staging_environment
  say 'Setting up the staging environment'
  build :setup_staging_environment
end
setup_stylesheets() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 129
def setup_stylesheets
  say 'Set up stylesheets'
  build :setup_stylesheets
end
setup_test_environment() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 78
def setup_test_environment
  say 'Setting up the test environment'
  build :generate_minitest
  build :configure_minitest
  build :configure_background_jobs_for_minitest
  build :enable_database_cleaner
  build :configure_capybara_webkit
end
tirantes_customization() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 23
def tirantes_customization
  invoke :remove_files_we_dont_need
  invoke :customize_gemfile
  invoke :setup_database
  invoke :setup_development_environment
  invoke :setup_test_environment
  invoke :setup_production_environment
  invoke :setup_staging_environment
  invoke :create_tirantes_views
  invoke :setup_coffeescript
  invoke :configure_app
  invoke :setup_stylesheets
  invoke :copy_miscellaneous_files
  invoke :customize_error_pages
  invoke :remove_routes_comment_lines
  invoke :setup_git
  invoke :create_heroku_apps
  invoke :create_github_repo
  invoke :outro
end

Protected Instance Methods

get_builder_class() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 195
def get_builder_class
  Tirantes::AppBuilder
end
using_active_record?() click to toggle source
# File lib/tirantes/generators/app_generator.rb, line 199
def using_active_record?
  !options[:skip_active_record]
end