30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/minute-franck/minute_franck.rb', line 30
def add
setup
desc_line = options[:desc]
desc_line += ", #{options[:tags].join(',')}" if options[:tags]
ans = LetsFreckle::Entry.create(:project_id => config["projects"][options[:project]]["id"],
:minutes => options[:time],
:description => desc_line,
:date => options[:date] || Time.now.strftime("%Y-%m-%d"))
case ans.status
when 200
puts "Entry has been added : #{ans['location'].split('/').last}"
when 201
puts "Entry has been added : #{ans['location'].split('/').last}"
else
puts "there was an error : #{ans.status}"
end
end
|