Class: Memo::Cli::Command::Config

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

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Config.



5
6
7
8
9
10
11
12
# File 'lib/memo/cli/command/config.rb', line 5

def initialize(
  _,
  os: Memo::OS.new
)
  @os = os
  @config = Memo::Config.new
  @file = Default::Configfile.to_s
end

Instance Method Details

#callObject



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

def call
  tomlfile = ENV["MEMO_CONFIG"] ||
    "#{@config.root}/#{@file}"

  @os.exec "#{@config.editor} #{tomlfile}"
end