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
|