Class: Memo::Cli::Command::Today

Inherits:
Object
  • Object
show all
Defined in:
lib/memo/cli/command/today.rb

Instance Method Summary collapse

Constructor Details

#initialize(_, os: Memo::OS.new) ⇒ Today

Returns a new instance of Today.



7
8
9
10
11
12
13
14
# File 'lib/memo/cli/command/today.rb', line 7

def initialize(
  _,
  os: Memo::OS.new
)
  @os = os
  @config = Memo::Config.new
  @today = Memo::Today.new
end

Instance Method Details

#callObject



16
17
18
19
# File 'lib/memo/cli/command/today.rb', line 16

def call
  @os.exec "mkdir -p #{@config.root}/#{@today.dir}"
  @os.exec "#{@config.editor} #{@config.root}/#{@today.fullpath}"
end