Class: Jobshop::Dummy

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDummy



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/jobshop/dummy.rb', line 11

def initialize
  options = {
    api: false,
    database: "postgresql",
    skip_gemfile: true,
    skip_git: true,
    skip_bundle: true,
    skip_listen: true,
    skip_test: true,
    template: template_path
  }

  if Dir.exists?(dummy_path)
    FileUtils.rmtree(dummy_path)
    dummy_constant = File.basename(dummy_path).gsub(/\W/, '_').squeeze('_').camelize
    Object.send(:remove_const, dummy_constant)
  end

  Rails::Generators::AppGenerator.new([ dummy_path ], options).invoke_all
end

Class Method Details

.generateObject



6
7
8
# File 'lib/jobshop/dummy.rb', line 6

def generate
  new
end