Class: Geostats::Commands::Init
- Inherits:
-
Base
- Object
- Base
- Geostats::Commands::Init
show all
- Defined in:
- lib/geostats/commands/init.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #invoke
Instance Method Details
#before ⇒ Object
20
21
22
|
# File 'lib/geostats/commands/init.rb', line 20
def before
connect_database(@directory)
end
|
#parse_args ⇒ Object
11
12
13
14
15
16
17
18
|
# File 'lib/geostats/commands/init.rb', line 11
def parse_args
raise UsageError unless @args.length == 2 or @args.length == 3
@username, @password, @directory = @args
@directory ||= File.expand_path("~/.geostats")
FileUtils.mkdir_p(@directory) unless File.exists?(@directory)
end
|
#usage ⇒ Object
7
8
9
|
# File 'lib/geostats/commands/init.rb', line 7
def usage
STDERR.puts "Usage: geostats init <username> <password> [<directory>]"
end
|