Class: OdaniaStaticPages::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/odania_static_pages/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli

Returns a new instance of Cli.



8
9
10
11
12
# File 'lib/odania_static_pages/cli.rb', line 8

def initialize(*args)
	super

	OdaniaStaticPages.config.environment = options[:environment]
end

Instance Method Details

#new(path = '.') ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/odania_static_pages/cli.rb', line 15

def new(path='.')
	path = File.absolute_path path
	puts "Generating project under #{path}"

	FileUtils.mkdir_p path unless File.exist? path
	config = OdaniaStaticPages.config path
	config.save!
end