trebbiatrice 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8d9ec205fd99b391308137e51a7c121d5936a39
4
- data.tar.gz: 953a6f7fe4a80c99d601f8a9aab204308f1c6bc9
3
+ metadata.gz: 406fae28117d6e6a636ce932e84c4cf548419794
4
+ data.tar.gz: 6434356f77ff6b98155d874a2f328605a709ead9
5
5
  SHA512:
6
- metadata.gz: 773ac236d2f72ee26635070c0d602338fe83fa022c39bc767f379737647fdda2d778a5c332ccac0cf3109c1f68b519214c0ba35454b910eb009b0e4621381098
7
- data.tar.gz: 037494c92697ab0cda72032fd0d951a4ea515f60e6fb86f722798ed1b459d8805cb5c62919a34890bf184af545a26c562594af368979432133786d95f18d3c3b
6
+ metadata.gz: 69a67911c599f29456c1f202512954cc8b229aa10429e7b4fdda7e5d05cc33f0d9dc9b5a031ef08ac1caec3eadf50a0b7f48332866fa7b33befa8650ec92e1f3
7
+ data.tar.gz: 63fd4d0532aa568528d55d0dce9138cfea87d92d9772b59111c9b4478e098333acd25de98401c763f46d6c40b27fed77732c11e506fadf7c7dbdfe2cbdb6670d
data/README.md CHANGED
@@ -40,7 +40,6 @@ TODO
40
40
  - Run as daemon
41
41
  - Logger
42
42
  - More testate
43
- - Resume old timers instead to create new ones
44
43
 
45
44
  Why
46
45
  ---
@@ -20,7 +20,8 @@ module Trebbiatrice
20
20
 
21
21
  def new_entry!(entry_data, find = true)
22
22
  if find
23
- entry = @harvest.time.all.select { |entry| entry[:project_id].to_s == entry_data[:project_id].to_s }.last
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
- trap('INT') do
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 frequency
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
@@ -9,5 +9,5 @@
9
9
  #++
10
10
 
11
11
  module Trebbiatrice
12
- VERSION = '0.3'
12
+ VERSION = '0.3.1'
13
13
  end
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: '0.3'
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-02-21 00:00:00.000000000 Z
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: