autometal-growl 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,12 +23,12 @@ Depends on Bob Harris' growl Shell script http://hints.macworld.com/dlfiles/grow
23
23
 
24
24
  == INSTALL:
25
25
 
26
- sudo gem install growl
26
+ sudo gem install autometal-growl
27
27
 
28
28
  After installation, please run:
29
29
  sudo install_growl
30
30
 
31
- This will install the required shellscript
31
+ This will install the required shell script
32
32
 
33
33
  == LICENSE:
34
34
 
@@ -1,9 +1,10 @@
1
1
  #! /usr/bin/env ruby
2
2
  puts "Checking for existing +growl+ installation..."
3
- test_cmd = %[G_TITLE="Autometal::Growl" growl -nosticky "+growl+ correctly installed and executable."]
3
+ cmd_path = File.join("/","usr","local","bin","growl")
4
+ test_cmd = %[G_TITLE="Autometal::Growl" #{cmd_path} -nosticky "+growl+ correctly installed and executable."]
4
5
  result = system test_cmd
5
6
  unless result
6
- File.open(File.join("/","usr","local","bin","growl"),"w") do |f|
7
+ File.open(cmd_path,"w") do |f|
7
8
  f.puts File.read("./shellscripts/growl")
8
9
  f.chmod 0755
9
10
  end
@@ -1,7 +1,7 @@
1
1
  $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
- module Autometal # :nodoc:
4
+ module Autometal # :nodoc:
5
5
  class GrowlException < Exception # :nodoc:
6
6
  def initialize
7
7
  raise "Something went wrong. Make sure +growl+ is in your path by running +sudo install_growl+"
@@ -22,8 +22,13 @@ $:.unshift(File.dirname(__FILE__)) unless
22
22
  # notification = Autometal::Growl.new(msg, :title => "Welcome to Sky Valley")
23
23
  # notification.transmit!
24
24
  class Growl
25
- VERSION = "1.0.0"
25
+ VERSION = "1.0.1"
26
26
  attr_accessor :body, :sticky, :title
27
+
28
+ def cmd_path
29
+ File.join("/","usr","local","bin","growl")
30
+ end
31
+
27
32
  def initialize body, opts = {}
28
33
  raise ArgumentError.new("Please provide a notification body") if [nil, false, ""].include?(body)
29
34
  @title = opts.delete(:title) || "Script notification"
@@ -37,7 +42,7 @@ $:.unshift(File.dirname(__FILE__)) unless
37
42
  end
38
43
  private
39
44
  def execute_shell_command
40
- system %[G_TITLE="#{title}" growl #{sticky ? "-sticky" : "-nosticky"} "#{body}"]
45
+ system %[G_TITLE="#{title}" #{cmd_path} #{sticky ? "-sticky" : "-nosticky"} "#{body}"]
41
46
  end
42
47
  end
43
48
  end
@@ -1,10 +1,11 @@
1
1
  desc "Install +growl+ executable script if necessary"
2
2
  task :install do
3
3
  puts "Checking for existing +growl+ installation..."
4
- test_cmd = %[G_TITLE="Autometal::Growl" growl -nosticky "+growl+ correctly installed and executable."]
4
+ cmd_path = File.join("/","usr","local","bin","growl")
5
+ test_cmd = %[G_TITLE="Autometal::Growl" #{cmd_path} -nosticky "+growl+ correctly installed and executable."]
5
6
  result = system test_cmd
6
7
  unless result
7
- File.open(File.join("/","usr","local","bin","growl"),"w") do |f|
8
+ File.open(cmd_path,"w") do |f|
8
9
  f.puts File.read("./shellscripts/growl")
9
10
  f.chmod 0755
10
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autometal-growl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 0
10
- version: 1.0.0
9
+ - 1
10
+ version: 1.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Achillefs Charmpilas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-17 00:00:00 +02:00
18
+ date: 2010-11-15 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency