Class: Commands::InitCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/initcommand.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration) ⇒ InitCommand

Returns a new instance of InitCommand.



7
8
9
# File 'lib/commands/initcommand.rb', line 7

def initialize(configuration)
	@configuration = configuration
end

Instance Method Details

#help(commandcontext) ⇒ Object



17
18
19
20
# File 'lib/commands/initcommand.rb', line 17

def help(commandcontext)
	commandcontext.output 'Use pug init'
	commandcontext.output 'Configures settings file'
end

#run(commandcontext) ⇒ Object



11
12
13
14
15
# File 'lib/commands/initcommand.rb', line 11

def run(commandcontext)
	globalconfiguration = GlobalConfiguration.new
	globalconfiguration.pugspath = commandcontext.prompt "Enter full path to where pugs will be placed"
	@configuration.set_globalconfiguration(globalconfiguration)
end