carlosbrando-autotest-notification 0.0.8 → 0.1.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,8 @@
1
- == 0.0.1 2008-05-11
1
+ == 0.1.0 2008-05-13
2
+ * Separated each operating system into a different file to facilitate maintenance. It's necessary to conduct more tests in each scene.
3
+
4
+ * 0.0.9:
5
+ * Adding KDE (kdialog) support.
2
6
 
3
7
  * 0.0.7:
4
8
  * Added support to Windows.
data/Manifest.txt CHANGED
@@ -8,6 +8,9 @@ config/hoe.rb
8
8
  config/requirements.rb
9
9
  lib/autotest_notification.rb
10
10
  lib/autotest_notification/version.rb
11
+ lib/autotest_notification/linux.rb
12
+ lib/autotest_notification/mac.rb
13
+ lib/autotest_notification/windows.rb
11
14
  script/console
12
15
  script/destroy
13
16
  script/generate
data/README.txt CHANGED
@@ -1,38 +1,47 @@
1
1
  = The Autotest Notification Gem
2
2
 
3
- * http://www.nomedojogo.com/2008/05/12/autotest-notification-gem/
3
+ * http://github.com/carlosbrando/autotest-notification/
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- This gem set the autotest (ZenTest) to send messages to software as Growl or LibNotify, displaying a window with the results.
8
-
9
- == FEATURES/PROBLEMS:
10
-
11
- * Running on Mac (Growl), Linux (LibNotify) and Windows (Snarl).
7
+ This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
12
8
 
13
9
  == REQUIREMENTS:
14
10
 
15
- * FIX (list of requirements)
11
+ * If you're using a Mac:
12
+ You need to have Growl and growlnotify installed on your machine.
13
+
14
+ Download the Growl [http://growl.info/index.php] and install it like any other application on your Mac
15
+
16
+ Then you must install the growlnotify.
17
+
18
+ In your shell, cd to the directory on the Growl disk image containing growlnotify, and type ./install.sh.
19
+ That script will install growlnotify to /usr/local/bin and the manpage to /usr/local/man.
16
20
 
17
21
  == INSTALL:
18
22
 
19
23
  $ sudo gem install carlosbrando-autotest-notification --source=http://gems.github.com
20
24
 
21
- Run it:
25
+ Run it to let the notifier in automatic mode:
22
26
 
23
27
  $ an-install
24
28
 
29
+ To turn off the notifier:
30
+
31
+ $ an-uninstall
32
+
25
33
  == Contributors
26
34
 
27
- * carlosbrando
28
- * simpsomboy
29
- * urubatan
35
+ * carlosbrando [http://www.nomedojogo.com/]
36
+ * simpsomboy [http://alexandredasilva.wordpress.com/]
37
+ * urubatan [http://www.urubatan.info/]
38
+ * chjunior [http://tas.milk-it.net/]
30
39
 
31
40
  == LICENSE:
32
41
 
33
42
  (The MIT License)
34
43
 
35
- Copyright (c) 2008 FIX
44
+ Copyright (c) 2008
36
45
 
37
46
  Permission is hereby granted, free of charge, to any person obtaining
38
47
  a copy of this software and associated documentation files (the
@@ -1,17 +1,17 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{autotest-notification}
3
- s.version = "0.0.8"
3
+ s.version = "0.1.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
- s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva"]
9
- s.date = %q{2008-05-12}
8
+ s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior"]
9
+ s.date = %q{2008-05-13}
10
10
  s.description = %q{Set the autotest to display messages on the operating system using software such as Growl and LibNotify.}
11
11
  s.email = ["eduardobrando@gmail.com"]
12
12
  s.executables = ["an-install", "an-uninstall"]
13
13
  s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "website/index.txt"]
14
- s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "images/pass.png", "images/fail.png", "autotest-notification.gemspec"]
14
+ s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "lib/autotest_notification/linux.rb", "lib/autotest_notification/mac.rb", "lib/autotest_notification/windows.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "images/pass.png", "images/fail.png", "autotest-notification.gemspec"]
15
15
  s.has_rdoc = true
16
16
  s.homepage = %q{http://github.com/carlosbrando/autotest-notification/}
17
17
  s.post_install_message = %q{
data/config/hoe.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'autotest_notification/version'
2
2
 
3
- AUTHOR = "Carlos Brando"
3
+ AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior"
4
4
  EMAIL = "eduardobrando@gmail.com"
5
5
  DESCRIPTION = "Set the autotest to display messages on the operating system using software such as Growl and LibNotify."
6
6
  GEM_NAME = 'autotest-notification' # what ppl will type to install your gem
@@ -1,5 +1,7 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
1
+ $:.unshift(File.dirname(__FILE__))
2
+ require 'autotest_notification/linux'
3
+ require 'autotest_notification/mac'
4
+ require 'autotest_notification/windows'
3
5
 
4
6
  module AutotestNotification
5
7
  FAIL = -1
@@ -13,7 +15,9 @@ module AutotestNotification
13
15
  FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png"
14
16
 
15
17
  Autotest.add_hook :ran_command do |at|
16
- result = at.results.split("\n").last.to_s
18
+
19
+ result = at.results.is_a?(Array) ? at.results.last : at.results.split("\n").last
20
+
17
21
  if result
18
22
 
19
23
  # Test::Unit
@@ -51,32 +55,16 @@ module AutotestNotification
51
55
  def notify(title, msg, img = SUCCESS_IMAGE, pri = 0)
52
56
  case RUBY_PLATFORM
53
57
  when /linux/
54
- notify_send(title, msg, img)
58
+ Linux.notify(title, msg, img)
55
59
  when /darwin/
56
- growl(title, msg, img, pri)
57
- when /cygwin/
58
- img = `cygpath -m #{img}`
59
- snarl(title, msg, img.strip)
60
- when /mswin/
61
- snarl(title, msg, img)
60
+ Mac.notify(title, msg, img, pri)
61
+ when /mswin|cygwin/
62
+ Windows.notify(title, msg, img)
62
63
  end
63
64
  end
64
65
 
65
66
  def pluralize(text, number)
66
67
  "#{number} #{text}#{'s' if number != 1}"
67
68
  end
68
-
69
- def growl(title, msg, img, pri = 0)
70
- system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title}"
71
- end
72
-
73
- def notify_send(title, msg, img)
74
- system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
75
- end
76
-
77
- def snarl(title, msg, img)
78
- message = "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{EXPIRATION_IN_SECONDS}"
79
- system message
80
- end
81
69
  end
82
- end
70
+ end
@@ -0,0 +1,26 @@
1
+ module AutotestNotification
2
+ class Linux
3
+ class << self
4
+ def notify(title, msg, img)
5
+ if has_notify?
6
+ notify_send(title, msg, img)
7
+ else
8
+ kdialog(title, msg, img)
9
+ end
10
+ end
11
+
12
+ protected
13
+ def notify_send(title, msg, img)
14
+ system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
15
+ end
16
+
17
+ def kdialog(title, msg, img)
18
+ system "kdialog --title '#{title}' --passivepopup '#{msg}' #{EXPIRATION_IN_SECONDS}"
19
+ end
20
+
21
+ def has_notify?
22
+ system "which notify-send 2> /dev/null"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,9 @@
1
+ module AutotestNotification
2
+ class Mac
3
+ class << self
4
+ def notify(title, msg, img, pri = 0)
5
+ system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title}"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,8 +1,8 @@
1
1
  module AutotestNotification #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 0
5
- TINY = 8
4
+ MINOR = 1
5
+ TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -0,0 +1,12 @@
1
+ module AutotestNotification
2
+ class Windows
3
+ class << self
4
+ def notify(title, msg, img)
5
+ img = `cygpath -m #{img}` if RUBY_PLATFORM =~ /cygwin/
6
+ img.strip!
7
+
8
+ system "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{EXPIRATION_IN_SECONDS}"
9
+ end
10
+ end
11
+ end
12
+ end
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.0.7</a>
36
+ <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.1.0</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;autotest_notification&#8217;</h1>
39
39
 
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carlosbrando-autotest-notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Brando
8
8
  - Rodrigo Urubatan
9
9
  - Alexandre da Silva
10
+ - "Carlos J\xC3\xBAnior"
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
14
 
14
- date: 2008-05-12 00:00:00 -07:00
15
+ date: 2008-05-13 00:00:00 -07:00
15
16
  default_executable:
16
17
  dependencies: []
17
18
 
@@ -41,6 +42,9 @@ files:
41
42
  - config/requirements.rb
42
43
  - lib/autotest_notification.rb
43
44
  - lib/autotest_notification/version.rb
45
+ - lib/autotest_notification/linux.rb
46
+ - lib/autotest_notification/mac.rb
47
+ - lib/autotest_notification/windows.rb
44
48
  - script/console
45
49
  - script/destroy
46
50
  - script/generate