karl-autotest-growl 0.1.3 → 0.1.4

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{autotest-growl}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sven Schwyn", "Karl O'Keeffe"]
@@ -46,6 +46,11 @@ module Autotest::Growl
46
46
  def self.show_modified_files=(boolean)
47
47
  @@show_modified_files = boolean
48
48
  end
49
+
50
+ def self.is_windows?
51
+ processor, platform, *rest = RUBY_PLATFORM.split("-")
52
+ platform == 'mswin32'
53
+ end
49
54
 
50
55
  ##
51
56
  # Display a message through Growl.
@@ -53,11 +58,19 @@ module Autotest::Growl
53
58
  growl = File.join(GEM_PATH, 'growl', 'growlnotify')
54
59
  image = File.join(ENV['HOME'], '.autotest-growl', "#{icon}.png")
55
60
  image = File.join(GEM_PATH, 'img', "#{icon}.png") unless File.exists?(image)
56
- if @@remote_notification
57
- system "#{growl} -H localhost -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
58
- else
59
- system "#{growl} -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
60
- end
61
+
62
+ if is_windows?
63
+ growl += '.com'
64
+ cmd = "#{growl} #{message.inspect} /a:\"autotest\" /r:\"Autotest\" /n:\"Autotest\" /i:\"#{image}\" /p:#{priority} /t:\"#{title}\""
65
+ else
66
+ if @@remote_notification
67
+ cmd = "#{growl} -H localhost -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
68
+ else
69
+ cmd = "#{growl} -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
70
+ end
71
+ end
72
+
73
+ system cmd
61
74
  end
62
75
 
63
76
  ##
@@ -105,18 +118,21 @@ module Autotest::Growl
105
118
  # Growl results of Cucumber
106
119
  Autotest.add_hook :ran_features do |autotest|
107
120
 
108
- gist = autotest.results.grep(/\d+\s+scenario.*\)/).join(" / ").strip()
109
- if gist == ''
110
- growl @label + 'Cannot run scenarios.', '', 'error'
111
- else
112
- if gist =~ /[1-9]\d*\s+(failed)/
113
- growl @label + 'Some scenarios have failed.', gist, 'failed'
114
- elsif gist =~ /pending/
115
- growl @label + 'Some scenarios are skipped.', gist, 'skipped'
116
- else
117
- growl @label + 'All scenarios have passed.', gist, 'passed'
118
- end
119
- end
121
+ gist = autotest.results.grep(/\d+\s+scenario.*\)/).join(" / ").strip()
122
+ if gist == ''
123
+ growl @label + 'Cannot run scenarios.', '', 'error'
124
+ else
125
+ if gist =~ /[1-9]\d*\s+(failed)/
126
+ growl @label + 'Some scenarios have failed.', gist, 'failed'
127
+ elsif gist =~ /[1-9]\d*\s+(undefined)/
128
+ growl @label + 'Some scenarios are undefinied.', gist, 'pending'
129
+ elsif gist =~ /[1-9]\d*\s+(pending)/
130
+ growl @label + 'Some scenarios are pending.', gist, 'pending'
131
+ else
132
+ growl @label + 'All scenarios have passed.', gist, 'passed'
133
+ end
134
+
135
+ end
120
136
  false
121
137
  end
122
138
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karl-autotest-growl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn