class Looks::Command::Push

Public Instance Methods

arguments() click to toggle source
# File lib/looks/command/push.rb, line 9
def arguments
  [ '<filename>' ]
end
execute(args) click to toggle source
# File lib/looks/command/push.rb, line 13
def execute(args)
  super

  filename = args.first

  raise Error, "#{filename}: File not found" unless File.exists? filename

  begin
    File.open(filename) do |file|
      puts Gravatar::Account.new(config).save_data(file.read)
    end
  rescue IOError, SystemCallError
    raise Error, "#{filename}: Cannot read file"
  end
end