real-growl 0.5.2 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/realgrowl +31 -11
- data/lib/real_growl.rb +1 -1
- metadata +4 -4
data/bin/realgrowl
CHANGED
@@ -4,16 +4,36 @@ require 'rubygems'
|
|
4
4
|
require 'real_growl'
|
5
5
|
require 'slop'
|
6
6
|
|
7
|
-
|
8
|
-
on :s, :sticky, :default => true
|
9
|
-
on :t, :title,
|
10
|
-
on :d, :description,
|
11
|
-
on :i, :icon, :optional => true, :default => RealGrowl::icon
|
12
|
-
on :p, :priority, :optional => true, :default => 0
|
7
|
+
slop = Slop.new(:strict => true, :help => true) do
|
8
|
+
on :s, :sticky, "Sticky notification. Default is true", :default => true
|
9
|
+
on :t, :title, "Title", :optional => false
|
10
|
+
on :d, :description, "Description", :optional => false
|
11
|
+
on :i, :icon, "Icon URL or Path", :optional => true, :default => RealGrowl::icon
|
12
|
+
on :p, :priority, "Priority. Default is 0", :optional => true, :default => 0
|
13
|
+
on :a, :app, "Application Name. Default is RealGrowl", :optional => true, :default => "RealGrowl"
|
14
|
+
banner "Usage: #{File.basename(__FILE__)} -t <title> -d <description>"
|
13
15
|
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
begin
|
18
|
+
values = slop.parse
|
19
|
+
if values.empty?
|
20
|
+
puts slop
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
24
|
+
if !slop.to_hash["help"]
|
25
|
+
if RealGrowl.running?
|
26
|
+
args = {}
|
27
|
+
slop.to_hash.each { |k, v| args[k.to_sym] = v }
|
28
|
+
app = RealGrowl::Application.new(args[:app])
|
29
|
+
app.notify args
|
30
|
+
else
|
31
|
+
puts "It appears Growl is either not installed or is has been stopped."
|
32
|
+
exit 1
|
33
|
+
end
|
34
|
+
end
|
35
|
+
rescue Slop::InvalidOptionError => e
|
36
|
+
puts "\n#{e.message}\n\n"
|
37
|
+
puts slop
|
38
|
+
exit
|
39
|
+
end
|
data/lib/real_growl.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: real-growl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin DeWind
|