Class: Memo::Cli::Command::Preview
- Inherits:
-
Object
- Object
- Memo::Cli::Command::Preview
- Defined in:
- lib/memo/cli/command/preview.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options, os: Memo::OS.new) ⇒ Preview
constructor
A new instance of Preview.
Constructor Details
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/memo/cli/command/preview.rb', line 16 def call filename = @options[0] path = case filename when "today", "t" @today.fullpath else Memo::File.new( filename, @options.namespace, ).fullpath end cmd ="#{@config.preview} #{@config.root}/#{path}" if @options.copy? @os.exec "#{cmd} | (#{@config.pbcopy})" end @os.exec cmd end |