Class: Disloku::BaseCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/disloku/BaseCommand.rb

Direct Known Subclasses

BaseCoreCommand, Commands::Generate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cliOptions) ⇒ BaseCommand

Returns a new instance of BaseCommand.



9
10
11
# File 'lib/disloku/BaseCommand.rb', line 9

def initialize(cliOptions)
	processGlobalOptions(cliOptions)
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



7
8
9
# File 'lib/disloku/BaseCommand.rb', line 7

def config
  @config
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/disloku/BaseCommand.rb', line 7

def options
  @options
end

#repositoryObject

Returns the value of attribute repository.



7
8
9
# File 'lib/disloku/BaseCommand.rb', line 7

def repository
  @repository
end

Instance Method Details

#processGlobalOptions(cliOptions) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/disloku/BaseCommand.rb', line 13

def processGlobalOptions(cliOptions)
	if (cliOptions[:scm].nil? || cliOptions[:scm] == "git")
		@scmImplementation = Git::Repository
	end

	if (cliOptions[:debug])
		Log.instance.level(:default, Logger::DEBUG)
	elsif (cliOptions[:verbose])
		Log.instance.level(:default, Logger::INFO)
	else
		Log.instance.level(:default, Logger::WARN)
	end
end