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



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

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

Instance Method Details

#create_boot_fileObject



73
74
75
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 73

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

#finish_templateObject



77
78
79
80
81
82
83
84
85
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 77

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

#run_bundleObject



87
88
89
90
91
92
93
# File 'lib/generators/jobshop/canary/canary_generator.rb', line 87

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