Class: Mami::CLI

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

Instance Method Summary collapse

Instance Method Details



18
19
20
21
22
23
24
25
26
# File 'lib/mami/cli.rb', line 18

def print(opt = {})
  time = opt[:time] || Time.now
  path = options[:directory] || ENV['MAMI_DIR']
  abort("mami requires MAMI_DIR or directory option") unless path
  basename = time.strftime('%Y-%m-%d-%H-%M-%S')
  extension = options[:extension].nil? ? nil : '.' + options[:extension]
  filename = [basename, extension].compact.join
  puts File.join(path, filename)
end

#versionObject



10
11
12
# File 'lib/mami/cli.rb', line 10

def version
  puts "Mami version #{Mami::VERSION}"
end