class Epi::Cli::Commands::Config

Public Instance Methods

run() click to toggle source
# File lib/epi/cli/commands/config.rb, line 6
def run
  case args.shift
    when 'add' then add
    when 'remove' then remove
    else raise Exceptions::Fatal, 'Unknown config command, use [ add | remove ]'
  end
end

Private Instance Methods

add() click to toggle source
# File lib/epi/cli/commands/config.rb, line 16
def add
  Epi::Daemon.send config: {add_paths: paths}
end
paths() click to toggle source
# File lib/epi/cli/commands/config.rb, line 24
def paths
  raise Exceptions::Fatal, 'No path given' unless args.first
  @paths ||= args.map do |path|
    path = Pathname(path)
    path = Pathname('.').realpath.join(path) unless path.absolute?
    path.to_s
  end
end
remove() click to toggle source
# File lib/epi/cli/commands/config.rb, line 20
def remove
  Epi::Daemon.send config: {remove_paths: paths}
end