autotest-growl 0.2.0 → 0.2.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.
@@ -1,3 +1,8 @@
1
+ == 0.2.1 2010-02-18
2
+
3
+ * 1 minor improvement
4
+ * Better detection of the Windows platform (Charles Roper)
5
+
1
6
  == 0.2.0 2010-02-03
2
7
 
3
8
  * 3 major improvements
@@ -181,6 +181,7 @@ Thanks to the following folks who have contributed to this project:
181
181
  * Konstantin Haase
182
182
  * J. Edward Dewyea
183
183
  * Martin Vielsmaier
184
+ * Charles Roper
184
185
 
185
186
  == LICENSE:
186
187
 
@@ -1,5 +1,6 @@
1
1
  require 'rubygems'
2
2
  require 'autotest'
3
+ require 'rbconfig'
3
4
  require File.join(File.dirname(__FILE__), 'result')
4
5
 
5
6
  ##
@@ -73,20 +74,18 @@ module Autotest::Growl
73
74
  def self.growl(title, message, icon, priority=0, stick="")
74
75
  growl = File.join(GEM_PATH, 'growl', 'growlnotify')
75
76
  image = File.join(@@image_dir, "#{icon}.png")
76
- platform = RUBY_PLATFORM
77
- platform = Java::java.lang.System.getProperty("os.name") if platform =~ /java/i # see http://lopica.sourceforge.net/os.html
78
- case platform
79
- when /mswin|windows/i
80
- growl += '.com'
81
- system %(#{growl} #{message.inspect} /a:"Autotest" /r:"Autotest" /n:"Autotest" /i:"#{image}" /p:#{priority} /t:"#{title}")
82
- when /darwin|mac os/i
77
+ case Config::CONFIG['host_os']
78
+ when /mac os|darwin/i
83
79
  options = "-w -n Autotest --image '#{image}' -p #{priority} -m '#{message}' '#{title}' #{stick}"
84
80
  options << " -H localhost" if @@remote_notification
85
81
  system %(#{growl} #{options} &)
86
82
  when /linux|bsd/i
87
83
  system %(notify-send "#{title}" "#{message}" -i #{image} -t 5000)
84
+ when /windows|mswin|mingw/i
85
+ growl += '.com'
86
+ system %(#{growl} #{message.inspect} /a:"Autotest" /r:"Autotest" /n:"Autotest" /i:"#{image}" /p:#{priority} /t:"#{title}")
88
87
  else
89
- raise "#{platform} is not supported by autotest-growl"
88
+ raise "#{Config::CONFIG['host_os']} is not supported by autotest-growl (feel free to submit a patch)"
90
89
  end
91
90
  end
92
91
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-growl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-02 00:00:00 +01:00
12
+ date: 2010-02-19 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency