carlosbrando-autotest-notification 0.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,7 @@
1
- == 0.2.2 2008-05-13
1
+ == 0.3.0
2
+ * If a test failed, the computer will speak. Only for Mac.
3
+
4
+ * 0.2.2 2008-05-13
2
5
  * Validating presence of KDialog; Fixing some identations.
3
6
  * Adding some tests.
4
7
 
data/README.txt CHANGED
@@ -67,11 +67,11 @@ Independent of operating system you are using, you must install the ZenTest:
67
67
 
68
68
  Run it to let the notifier in automatic mode:
69
69
 
70
- $ an-install
70
+ $ an-install [--speaking]
71
71
 
72
72
  In Windows without cygwin, it's necessary to install in the directory of the project:
73
73
 
74
- $ an-install -p C:\projects\my_project
74
+ $ an-install --path=C:\projects\my_project
75
75
 
76
76
  To turn off the notifier:
77
77
 
@@ -1,12 +1,12 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{autotest-notification}
3
- s.version = "0.2.2"
3
+ s.version = "1.0.0"
4
4
 
5
5
  s.specification_version = 2 if s.respond_to? :specification_version=
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior", "Davis Zanetti Cabral", "Marcos Tapaj\303\263s"]
9
- s.date = %q{2008-05-14}
9
+ s.date = %q{2008-05-16}
10
10
  s.description = %q{This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.}
11
11
  s.email = ["eduardobrando@gmail.com"]
12
12
  s.executables = ["an-install", "an-uninstall"]
data/bin/an-install CHANGED
@@ -15,7 +15,8 @@ require 'ftools'
15
15
  # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
16
16
 
17
17
  OPTIONS = {
18
- :path => '~'
18
+ :path => '~',
19
+ :speaking => false
19
20
  }
20
21
  MANDATORY_OPTIONS = %w( )
21
22
 
@@ -28,11 +29,18 @@ Usage: #{File.basename($0)} [options]
28
29
  Options are:
29
30
  BANNER
30
31
  opts.separator ""
32
+
31
33
  opts.on("-p", "--path=PATH", String,
32
34
  "The root path for selecting files",
33
35
  "Default: ~") { |OPTIONS[:path]| }
36
+
37
+ opts.on("-s", "--speaking",
38
+ "If a test failed, the computer will speak.",
39
+ "Only for Mac.") { |OPTIONS[:speaking]| OPTIONS[:speaking] = true }
40
+
34
41
  opts.on("-h", "--help",
35
42
  "Show this help message.") { puts opts; exit }
43
+
36
44
  opts.parse!(ARGV)
37
45
 
38
46
  if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
@@ -44,7 +52,8 @@ path = OPTIONS[:path]
44
52
 
45
53
  f = File.new(File.expand_path(path) + "/.autotest", "w")
46
54
  f.write "# ~.autotest\n"
47
- f.write "require 'autotest_notification'"
55
+ f.write "require 'autotest_notification'\n"
56
+ f.write("SPEAKING = #{OPTIONS[:speaking]}\n")
48
57
  f.close
49
58
  puts "\nAs from now all tests will be notified automatically."
50
59
  puts "" # a blank line
@@ -1,8 +1,9 @@
1
1
  module AutotestNotification
2
2
  class Mac
3
3
  class << self
4
- def notify(title, msg, img, pri = 0)
4
+ def notify(title, msg, img, failures = 0, pri = 0)
5
5
  system "growlnotify -n autotest --image #{img} -p #{pri} -m '#{msg}' #{title}"
6
+ system("say #{failures} test#{'s' unless failures == 1} failed.") if SPEAKING && failures > 0
6
7
  end
7
8
  end
8
9
  end
@@ -1,8 +1,8 @@
1
1
  module AutotestNotification #:nodoc:
2
2
  module VERSION #:nodoc:
3
- MAJOR = 0
4
- MINOR = 2
5
- TINY = 2
3
+ MAJOR = 1
4
+ MINOR = 0
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -43,9 +43,9 @@ module AutotestNotification
43
43
  end
44
44
 
45
45
  if failures > 0 || errors > 0
46
- notify "FAIL", msg, FAIL_IMAGE, 2
46
+ notify "FAIL", msg, FAIL_IMAGE, failures, 2
47
47
  else
48
- notify "Pass", msg, SUCCESS_IMAGE
48
+ notify "Pass", msg, SUCCESS_IMAGE, failures
49
49
  end
50
50
 
51
51
  puts "\e[#{code}m#{'=' * 80}\e[0m\n\n"
@@ -53,12 +53,12 @@ module AutotestNotification
53
53
  end
54
54
 
55
55
  class << self
56
- def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
56
+ def notify(title, msg, img = SUCCESS_IMAGE, failures = 0, pri = 0)
57
57
  case RUBY_PLATFORM
58
58
  when /linux/
59
59
  Linux.notify(title, msg, img)
60
60
  when /darwin/
61
- Mac.notify(title, msg, img, pri)
61
+ Mac.notify(title, msg, img, failures, pri)
62
62
  when /cygwin/
63
63
  Cygwin.notify(title, msg, img)
64
64
  when /mswin/
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>autotest_notification</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/autotest_notification"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.2.2</a>
36
+ <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.3.0</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;autotest_notification&#8217;</h1>
39
39
 
@@ -130,7 +130,7 @@ rake install_gem</pre>
130
130
 
131
131
  <p>Comments are welcome. Send an email to <a href="mailto:eduardobrando@gmail.com">Carlos Brando</a> via the <a href="http://groups.google.com/group/autotest_notification">forum</a></p>
132
132
  <p class="coda">
133
- <a href="FIXME email">FIXME full name</a>, 11th May 2008<br>
133
+ <a href="FIXME email">FIXME full name</a>, 16th May 2008<br>
134
134
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
135
135
  </p>
136
136
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carlosbrando-autotest-notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Brando
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2008-05-14 00:00:00 -07:00
17
+ date: 2008-05-16 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency