Class: Disloku::Commands::Generate
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Disloku::Commands::Generate
- Defined in:
- lib/disloku/commands/Generate.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
#config, #options, #repository
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(cliOptions) ⇒ Generate
constructor
A new instance of Generate.
Methods inherited from BaseCommand
Constructor Details
#initialize(cliOptions) ⇒ Generate
Returns a new instance of Generate.
8 9 10 11 12 |
# File 'lib/disloku/commands/Generate.rb', line 8 def initialize(cliOptions) super(cliOptions) @repository = @scmImplementation.new(cliOptions[:dir]) end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/disloku/commands/Generate.rb', line 14 def execute() repoConfig = File.join(@repository.root, 'disloku.config') if (File.exists?(repoConfig)) raise DislokuError.new("disloku.config already exists in this repository") else sampleConfig = File.(File.join(File.dirname(__FILE__), "../../../config/sample.config")) FileUtils.cp(sampleConfig, repoConfig) end end |