pomato 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pomato_daemon +12 -0
- data/lib/pomato/configure.rb +12 -0
- data/lib/pomato/paths.rb +11 -7
- data/lib/pomato/run.rb +14 -0
- data/lib/pomato/version.rb +1 -1
- data/pomato.gemspec +2 -0
- metadata +19 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9be8524db2da9247a63d00806f7ab672bbbdbea
|
4
|
+
data.tar.gz: a8776fbdb2e6277b47942fca4049511bc50a8cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4c2cf32956c744e23215b1360350749a982f7c71796294662abcae8d38a4af3fe28e82b8b0fb2a92f479ef9e03815cb69afcd20f12b4b8cf0519f86407fadcc
|
7
|
+
data.tar.gz: 4c557678d524fba9f075f5ab73a76050daccca78ba38c990c0a24896335e49a10d48885f3ea028357fd29b757b183816a39dc9f2804271cc12d139ba6f51fa77
|
data/bin/pomato_daemon
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$LOAD_PATH << File.dirname(__FILE__)+'/../lib'
|
4
|
+
|
5
|
+
require 'daemons'
|
6
|
+
require 'pomato/report'
|
7
|
+
require 'pomato/run'
|
8
|
+
|
9
|
+
Pomato::Report.new.execute
|
10
|
+
Daemons.run_proc('pomato', dir_mode: :normal, dir: '~/.pomato') do
|
11
|
+
Pomato::Run.new.execute
|
12
|
+
end
|
data/lib/pomato/paths.rb
CHANGED
@@ -16,20 +16,24 @@ module Pomato
|
|
16
16
|
@now ||= Time.now.to_i
|
17
17
|
end
|
18
18
|
|
19
|
+
def config
|
20
|
+
load_yaml path_to 'config'
|
21
|
+
end
|
22
|
+
|
23
|
+
def config=(data)
|
24
|
+
dump_yaml path_to('config'), data
|
25
|
+
end
|
26
|
+
|
19
27
|
def play_alert
|
20
|
-
`afplay #{
|
28
|
+
`afplay #{config[:track]}`
|
21
29
|
end
|
22
30
|
|
23
31
|
def history(message)
|
24
|
-
append_to
|
32
|
+
append_to path_to('history'), "#{now} #{message}"
|
25
33
|
end
|
26
34
|
|
27
35
|
def history_items
|
28
|
-
File.exist?(
|
29
|
-
end
|
30
|
-
|
31
|
-
def history_path
|
32
|
-
File.join home, 'history'
|
36
|
+
File.exist?(path_to('history')) ? File.readlines(path_to('history')) : []
|
33
37
|
end
|
34
38
|
|
35
39
|
def path_to(name)
|
data/lib/pomato/run.rb
ADDED
data/lib/pomato/version.rb
CHANGED
data/pomato.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
+
spec.add_dependency 'daemons', '~> 1.1'
|
21
|
+
|
20
22
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
21
23
|
spec.add_development_dependency 'rake', '~> 10.0'
|
22
24
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pomato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Ryall
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2015-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: daemons
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.1'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,6 +57,7 @@ email:
|
|
43
57
|
- mark@ryall.name
|
44
58
|
executables:
|
45
59
|
- pomato
|
60
|
+
- pomato_daemon
|
46
61
|
extensions: []
|
47
62
|
extra_rdoc_files: []
|
48
63
|
files:
|
@@ -52,10 +67,13 @@ files:
|
|
52
67
|
- README.md
|
53
68
|
- Rakefile
|
54
69
|
- bin/pomato
|
70
|
+
- bin/pomato_daemon
|
55
71
|
- lib/pomato.rb
|
72
|
+
- lib/pomato/configure.rb
|
56
73
|
- lib/pomato/history.rb
|
57
74
|
- lib/pomato/paths.rb
|
58
75
|
- lib/pomato/report.rb
|
76
|
+
- lib/pomato/run.rb
|
59
77
|
- lib/pomato/start.rb
|
60
78
|
- lib/pomato/stop.rb
|
61
79
|
- lib/pomato/tick.rb
|