Class: Jobshop::Generators::DummyGenerator

Inherits:
AppGenerator
  • Object
show all
Defined in:
lib/generators/jobshop/dummy/dummy_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AppGenerator

#remove_session_store_initializer_until_rails_5_1

Constructor Details

#initializeDummyGenerator

Returns a new instance of DummyGenerator.



66
67
68
69
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 66

def initialize(*)
  DummyApp.destroy! if Jobshop::DummyApp.exist?
  super
end

Class Method Details



71
72
73
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 71

def self.banner
  "jobshop dummy [options]"
end

.source_pathsObject



54
55
56
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 54

def self.source_paths
  Array(super) | [ Jobshop::Generators::DummyGenerator.source_root ]
end

.source_rootObject



50
51
52
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 50

def self.source_root
  File.expand_path("templates", __dir__)
end

Instance Method Details

#create_boot_fileObject



75
76
77
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 75

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

#finish_templateObject



79
80
81
82
83
84
85
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 79

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

#run_bundleObject



87
88
89
90
91
92
93
94
# File 'lib/generators/jobshop/dummy/dummy_generator.rb', line 87

def run_bundle
  super
  bundle_command("exec rails db:drop:all")
  bundle_command("exec rails db:create")
  bundle_command("exec rails db:migrate")
  bundle_command("exec rails db:test:load_schema")
  bundle_command("exec rails g jobshop:team")
end