Class: Jobshop::Generators::CanaryGenerator

Inherits:
AppGenerator
  • Object
show all
Defined in:
lib/generators/jobshop/canary/canary_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AppGenerator

#create_root_files, #initialize, #remove_session_store_initializer_until_rails_5_1, source_root

Constructor Details

This class inherits a constructor from Jobshop::Generators::AppGenerator

Class Method Details

.source_pathsObject



55
56
57
58
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 55

def self.source_paths
  [ Rails::Generators::AppGenerator.source_root,
    Jobshop::Generators::CanaryGenerator.source_root ]
end

Instance Method Details

#create_boot_fileObject



62
63
64
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 62

def create_boot_file
  template "config/boot.rb.tt"
end

#finish_templateObject



66
67
68
69
70
71
72
73
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 66

def finish_template
  build :bin_jobshop
  build :config_database_yml
  build :db_migrate
  build :expose_mailer_previews
  build :localhost_tld_length
  super
end

#run_bundleObject



75
76
77
78
79
80
81
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 75

def run_bundle
  super
  return if options[:pretend]
  bundle_command("exec rails db:drop:all")
  bundle_command("exec rails db:create")
  bundle_command("exec rails db:migrate")
end