class Mycmd::ConfigCommands

Public Instance Methods

cat() click to toggle source
# File lib/mycmd/cli/config_commands.rb, line 14
def cat
  begin
    conf = Configuration.config_find
    raise "config not found" if conf.nil?
    File.open(conf, "r").each {|line| puts line}
  rescue => e
    puts e.message
  end
end
edit() click to toggle source
# File lib/mycmd/cli/config_commands.rb, line 25
def edit
  begin
    conf = Configuration.config_find
    raise "config not found" if conf.nil?
    Kernel.system("#{ENV['EDITOR']} #{conf}")
  rescue => e
    puts e.message
  end
end
which() click to toggle source
# File lib/mycmd/cli/config_commands.rb, line 8
def which
  conf = Configuration.config_find
  puts conf.nil? ? "config not found" : conf
end