Class: Mami::CLI
- Inherits:
-
Thor
- Object
- Thor
- Mami::CLI
- Defined in:
- lib/mami/cli.rb
Instance Method Summary collapse
Instance Method Details
#print(opt = {}) ⇒ Object
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 = [:directory] || ENV['MAMI_DIR'] abort("mami requires MAMI_DIR or directory option") unless path basename = time.strftime('%Y-%m-%d-%H-%M-%S') extension = [:extension].nil? ? nil : '.' + [:extension] filename = [basename, extension].compact.join puts File.join(path, filename) end |