trebbiatrice 0.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -1
- data/lib/trebbiatrice/harvest.rb +2 -1
- data/lib/trebbiatrice/trebbiatrice.rb +21 -7
- data/lib/trebbiatrice/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 406fae28117d6e6a636ce932e84c4cf548419794
|
4
|
+
data.tar.gz: 6434356f77ff6b98155d874a2f328605a709ead9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69a67911c599f29456c1f202512954cc8b229aa10429e7b4fdda7e5d05cc33f0d9dc9b5a031ef08ac1caec3eadf50a0b7f48332866fa7b33befa8650ec92e1f3
|
7
|
+
data.tar.gz: 63fd4d0532aa568528d55d0dce9138cfea87d92d9772b59111c9b4478e098333acd25de98401c763f46d6c40b27fed77732c11e506fadf7c7dbdfe2cbdb6670d
|
data/README.md
CHANGED
data/lib/trebbiatrice/harvest.rb
CHANGED
@@ -20,7 +20,8 @@ module Trebbiatrice
|
|
20
20
|
|
21
21
|
def new_entry!(entry_data, find = true)
|
22
22
|
if find
|
23
|
-
|
23
|
+
project_id = entry_data[:project_id].to_s
|
24
|
+
entry = @harvest.time.all.select { |entry| entry[:project_id].to_s == project_id }.last
|
24
25
|
|
25
26
|
if entry
|
26
27
|
toggle!(entry[:id])
|
@@ -1,14 +1,20 @@
|
|
1
|
+
#--
|
2
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
3
|
+
# Version 2, December 2004
|
4
|
+
#
|
5
|
+
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
6
|
+
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
7
|
+
#
|
8
|
+
# 0. You just DO WHAT THE FUCK YOU WANT TO.
|
9
|
+
#++
|
10
|
+
|
1
11
|
module Trebbiatrice
|
2
12
|
class << self
|
3
13
|
def run!(login_data, task, testata, frequency)
|
4
14
|
trebbia = Trebbia.new(login_data)
|
5
|
-
last_project, project = nil
|
15
|
+
last_project, project = nil, nil
|
6
16
|
|
7
|
-
|
8
|
-
puts 'Stopping gracefully the trebbiatrice...'
|
9
|
-
trebbia.stop_tracking! if trebbia.tracking?
|
10
|
-
exit
|
11
|
-
end
|
17
|
+
listen_to_int!(trebbia)
|
12
18
|
|
13
19
|
loop do
|
14
20
|
response = Trebbia.invoke!(testata[:engine], testata[:name])
|
@@ -34,7 +40,7 @@ module Trebbiatrice
|
|
34
40
|
end
|
35
41
|
end
|
36
42
|
|
37
|
-
sleep
|
43
|
+
sleep(frequency)
|
38
44
|
end
|
39
45
|
end
|
40
46
|
|
@@ -46,5 +52,13 @@ module Trebbiatrice
|
|
46
52
|
trebbia.stop_tracking!
|
47
53
|
end
|
48
54
|
end
|
55
|
+
|
56
|
+
def listen_to_int!(trebbia)
|
57
|
+
trap('INT') do
|
58
|
+
puts 'Stopping gracefully the trebbiatrice...'
|
59
|
+
trebbia.stop_tracking! if trebbia.tracking?
|
60
|
+
exit
|
61
|
+
end
|
62
|
+
end
|
49
63
|
end
|
50
64
|
end
|
data/lib/trebbiatrice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trebbiatrice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: harvested
|
@@ -71,3 +71,4 @@ signing_key:
|
|
71
71
|
specification_version: 4
|
72
72
|
summary: Track the time on Harvest automatically watching what you're working on.
|
73
73
|
test_files: []
|
74
|
+
has_rdoc:
|