dnotify 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -0
- data/lib/dnotify/version.rb +1 -1
- data/lib/dnotify.rb +10 -2
- data/resources/dnotifyrc.sample.yaml +2 -0
- metadata +2 -2
data/README.md
CHANGED
data/lib/dnotify/version.rb
CHANGED
data/lib/dnotify.rb
CHANGED
@@ -22,7 +22,7 @@ module Dnotify
|
|
22
22
|
puts 'setting up cron'
|
23
23
|
tmp_cron_file = Tempfile.new('dnotify_tmp_cron').path
|
24
24
|
File.open(tmp_cron_file, File::WRONLY | File::APPEND) do |file|
|
25
|
-
file << existing_crontab << "* * * * * /bin/bash -l -c 'dnotify'
|
25
|
+
file << existing_crontab << "* * * * * /bin/bash -i -l -c 'dnotify' > /tmp/dnotify.log 2>&1" << '\n'
|
26
26
|
end
|
27
27
|
puts `crontab #{tmp_cron_file}`
|
28
28
|
end
|
@@ -46,6 +46,10 @@ module Dnotify
|
|
46
46
|
|
47
47
|
DefaultNotification = {:body => "Alarm", :summary => "Alarm", :timeout => 2.5, :icon_path => File.join(File.dirname(__FILE__),'../resources/clock.png') }
|
48
48
|
|
49
|
+
def initialize
|
50
|
+
ENV['DISPLAY'] = config[:display]
|
51
|
+
end
|
52
|
+
|
49
53
|
def run
|
50
54
|
return unless Setup.check
|
51
55
|
#check if a reminder aligns with the current time
|
@@ -65,7 +69,11 @@ module Dnotify
|
|
65
69
|
end
|
66
70
|
|
67
71
|
def reminders
|
68
|
-
|
72
|
+
config[:reminders]
|
73
|
+
end
|
74
|
+
|
75
|
+
def config
|
76
|
+
@config ||= YAML::load_file(Setup::ConfigPath)
|
69
77
|
end
|
70
78
|
end
|
71
79
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: dnotify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Khaja Minhajuddin
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-13 00:00:00 +05:30
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|