domodoro 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +3 -1
- data/lib/domodoro/client.rb +17 -1
- data/lib/domodoro/version.rb +1 -1
- metadata +2 -28
data/Readme.md
CHANGED
@@ -51,10 +51,11 @@ The clients will receive notifications via sound/growl (configurable in a
|
|
51
51
|
If you're not using OSX, try to install the `afplay` program manually or...
|
52
52
|
send a patch to make it work with your OS :)
|
53
53
|
|
54
|
-
* The pomodoro schedule is (as of v0.0.
|
54
|
+
* The pomodoro schedule is (as of v0.0.3) hard-coded. It starts at 8:00 AM,
|
55
55
|
stops at 13:00 for lunch, and starts again at 13:20. In the following
|
56
56
|
versions this will be freely configurable.
|
57
57
|
|
58
|
+
|
58
59
|
## Configuration
|
59
60
|
|
60
61
|
By default, both sound and visual notifications are displayed on each event.
|
@@ -69,3 +70,4 @@ If you want to configure this, create a file in your home directory named
|
|
69
70
|
|
70
71
|
Copyright (c) 2011 Josep M. Bach. Released under the MIT license.
|
71
72
|
|
73
|
+
|
data/lib/domodoro/client.rb
CHANGED
@@ -4,6 +4,14 @@ module Domodoro
|
|
4
4
|
class Client
|
5
5
|
class << self
|
6
6
|
|
7
|
+
def connected
|
8
|
+
@connected
|
9
|
+
end
|
10
|
+
|
11
|
+
def connected=(value)
|
12
|
+
@connected = true
|
13
|
+
end
|
14
|
+
|
7
15
|
def start(host, port='9111')
|
8
16
|
Config.load
|
9
17
|
puts "#{Time.now} - Domodoro listening on #{host}:#{port}"
|
@@ -13,6 +21,10 @@ module Domodoro
|
|
13
21
|
EM.run do
|
14
22
|
EM.connect(host, port) do |c|
|
15
23
|
c.extend EM::P::LineText2
|
24
|
+
def c.connection_completed
|
25
|
+
puts " - Connected to server!"
|
26
|
+
Client.connected = true
|
27
|
+
end
|
16
28
|
def c.receive_line(line)
|
17
29
|
case line
|
18
30
|
when /start/
|
@@ -26,7 +38,11 @@ module Domodoro
|
|
26
38
|
end
|
27
39
|
EM.add_periodic_timer(1) do
|
28
40
|
EM.next_tick do
|
29
|
-
|
41
|
+
if Client.connected
|
42
|
+
print_time
|
43
|
+
else
|
44
|
+
puts 'Cannot connect to server. Is it running?'
|
45
|
+
end
|
30
46
|
end
|
31
47
|
end
|
32
48
|
end
|
data/lib/domodoro/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domodoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 1317335842608397244
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
5
|
+
version: 0.0.3
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Josep M. Bach
|
@@ -26,9 +21,6 @@ dependencies:
|
|
26
21
|
requirements:
|
27
22
|
- - ">="
|
28
23
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 2002549777813010636
|
30
|
-
segments:
|
31
|
-
- 0
|
32
24
|
version: "0"
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
@@ -40,9 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 2002549777813010636
|
44
|
-
segments:
|
45
|
-
- 0
|
46
35
|
version: "0"
|
47
36
|
type: :runtime
|
48
37
|
version_requirements: *id002
|
@@ -54,9 +43,6 @@ dependencies:
|
|
54
43
|
requirements:
|
55
44
|
- - ">="
|
56
45
|
- !ruby/object:Gem::Version
|
57
|
-
hash: 2002549777813010636
|
58
|
-
segments:
|
59
|
-
- 0
|
60
46
|
version: "0"
|
61
47
|
type: :development
|
62
48
|
version_requirements: *id003
|
@@ -68,9 +54,6 @@ dependencies:
|
|
68
54
|
requirements:
|
69
55
|
- - ">="
|
70
56
|
- !ruby/object:Gem::Version
|
71
|
-
hash: 2002549777813010636
|
72
|
-
segments:
|
73
|
-
- 0
|
74
57
|
version: "0"
|
75
58
|
type: :development
|
76
59
|
version_requirements: *id004
|
@@ -82,9 +65,6 @@ dependencies:
|
|
82
65
|
requirements:
|
83
66
|
- - ">="
|
84
67
|
- !ruby/object:Gem::Version
|
85
|
-
hash: 2002549777813010636
|
86
|
-
segments:
|
87
|
-
- 0
|
88
68
|
version: "0"
|
89
69
|
type: :development
|
90
70
|
version_requirements: *id005
|
@@ -135,23 +115,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
115
|
requirements:
|
136
116
|
- - ">="
|
137
117
|
- !ruby/object:Gem::Version
|
138
|
-
hash: 2002549777813010636
|
139
|
-
segments:
|
140
|
-
- 0
|
141
118
|
version: "0"
|
142
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
120
|
none: false
|
144
121
|
requirements:
|
145
122
|
- - ">="
|
146
123
|
- !ruby/object:Gem::Version
|
147
|
-
hash: 2002549777813010636
|
148
|
-
segments:
|
149
|
-
- 0
|
150
124
|
version: "0"
|
151
125
|
requirements: []
|
152
126
|
|
153
127
|
rubyforge_project: domodoro
|
154
|
-
rubygems_version: 1.
|
128
|
+
rubygems_version: 1.6.1
|
155
129
|
signing_key:
|
156
130
|
specification_version: 3
|
157
131
|
summary: Distributed Pomodoro for the masses
|