carlosbrando-autotest-notification 0.0.3 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,4 +1,10 @@
1
1
  == 0.0.1 2008-05-11
2
2
 
3
+ * 0.0.7:
4
+ * Added support to Windows.
5
+
6
+ * 0.0.4:
7
+ * Added an-uninstall to remove the autotest hook.
8
+
3
9
  * 1 major enhancement:
4
10
  * Initial release
data/Manifest.txt CHANGED
@@ -24,6 +24,7 @@ website/javascripts/rounded_corners_lite.inc.js
24
24
  website/stylesheets/screen.css
25
25
  website/template.html.erb
26
26
  bin/an-install
27
+ bin/an-uninstall
27
28
  images/pass.png
28
29
  images/fail.png
29
30
  autotest-notification.gemspec
data/PostInstall.txt CHANGED
@@ -1,7 +1,9 @@
1
1
 
2
- For more information on autotest_notification, see http://autotest_notification.rubyforge.org
2
+ For more information on autotest_notification, see http://github.com/carlosbrando/autotest-notification/
3
3
 
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
4
+ To turn on the notifier you need to run the following command:
5
+ an-install
6
6
 
7
+ To turn off:
8
+ an-uninstall
7
9
 
data/README.txt CHANGED
@@ -1,18 +1,14 @@
1
- = autotest_notification
1
+ = The Autotest Notification Gem
2
2
 
3
- * http://www.nomedojogo.com
3
+ * http://www.nomedojogo.com/2008/05/12/autotest-notification-gem/
4
4
 
5
5
  == DESCRIPTION:
6
6
 
7
- Set the autotest to display messages through software such as Growl
7
+ This gem set the autotest (ZenTest) to send messages to software as Growl or LibNotify, displaying a window with the results.
8
8
 
9
9
  == FEATURES/PROBLEMS:
10
10
 
11
- * FIX (list of features or problems)
12
-
13
- == SYNOPSIS:
14
-
15
- FIX (code sample of usage)
11
+ * Running on Mac (Growl), Linux (LibNotify) and Windows (Snarl).
16
12
 
17
13
  == REQUIREMENTS:
18
14
 
@@ -20,8 +16,17 @@ Set the autotest to display messages through software such as Growl
20
16
 
21
17
  == INSTALL:
22
18
 
23
- sudo gem install carlosbrando-autotest-notification --source=http://gems.github.com
24
- an-install
19
+ $ sudo gem install carlosbrando-autotest-notification --source=http://gems.github.com
20
+
21
+ Run it:
22
+
23
+ $ an-install
24
+
25
+ == Contributors
26
+
27
+ * carlosbrando
28
+ * simpsomboy
29
+ * urubatan
25
30
 
26
31
  == LICENSE:
27
32
 
@@ -1,31 +1,33 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{autotest-notification}
3
- s.version = "0.0.3"
3
+ s.version = "0.0.7"
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"]
9
- s.date = %q{2008-05-11}
10
- s.default_executable = %q{an-install}
11
- s.description = %q{Set the autotest to display messages through software such as Growl}
8
+ s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva"]
9
+ s.date = %q{2008-05-12}
10
+ s.description = %q{Set the autotest to display messages on the operating system using software such as Growl and LibNotify.}
12
11
  s.email = ["eduardobrando@gmail.com"]
13
- s.executables = ["an-install"]
12
+ s.executables = ["an-install", "an-uninstall"]
14
13
  s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "website/index.txt"]
15
- 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", "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", "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"]
16
15
  s.has_rdoc = true
17
- s.homepage = %q{http://autotestnotific.rubyforge.org}
16
+ s.homepage = %q{http://github.com/carlosbrando/autotest-notification/}
18
17
  s.post_install_message = %q{
19
- For more information on autotest_notification, see http://autotest_notification.rubyforge.org
18
+ For more information on autotest_notification, see http://github.com/carlosbrando/autotest-notification/
20
19
 
21
- NOTE: Change this information in PostInstall.txt
22
- You can also delete it if you don't want it.
20
+ To turn on the notifier you need to run the following command:
21
+ an-install
23
22
 
23
+ To turn off:
24
+ an-uninstall
24
25
 
25
26
  }
26
27
  s.rdoc_options = ["--main", "README.txt"]
27
28
  s.require_paths = ["lib"]
29
+ s.rubyforge_project = %q{}
28
30
  s.rubygems_version = %q{1.1.1}
29
- s.summary = %q{Set the autotest to display messages through software such as Growl}
31
+ s.summary = %q{Set the autotest to display messages on the operating system using software such as Growl and LibNotify.}
30
32
  s.test_files = ["test/test_autotest_notification.rb", "test/test_helper.rb"]
31
- end
33
+ end
data/bin/an-install CHANGED
@@ -45,4 +45,5 @@ path = OPTIONS[:path]
45
45
  f = File.new(File.expand_path(path) + "/.autotest", "w")
46
46
  f.write "# ~.autotest\n"
47
47
  f.write "require 'autotest_notification'"
48
- f.close
48
+ f.close
49
+ puts "\nAs from now all tests will be notified automatically.\n"
data/bin/an-uninstall ADDED
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created on 2008-5-11.
4
+ # Copyright (c) 2008. All rights reserved.
5
+
6
+ begin
7
+ require 'rubygems'
8
+ rescue LoadError
9
+ # no rubygems to load, so we fail silently
10
+ end
11
+
12
+ require 'optparse'
13
+ require 'ftools'
14
+
15
+ # NOTE: the option -p/--path= is given as an example, and should probably be replaced in your application.
16
+
17
+ OPTIONS = {
18
+ :path => '~'
19
+ }
20
+ MANDATORY_OPTIONS = %w( )
21
+
22
+ parser = OptionParser.new do |opts|
23
+ opts.banner = <<BANNER
24
+ This application is wonderful because...
25
+
26
+ Usage: #{File.basename($0)} [options]
27
+
28
+ Options are:
29
+ BANNER
30
+ opts.separator ""
31
+ opts.on("-p", "--path=PATH", String,
32
+ "The root path for selecting files",
33
+ "Default: ~") { |OPTIONS[:path]| }
34
+ opts.on("-h", "--help",
35
+ "Show this help message.") { puts opts; exit }
36
+ opts.parse!(ARGV)
37
+
38
+ if MANDATORY_OPTIONS && MANDATORY_OPTIONS.find { |option| OPTIONS[option.to_sym].nil? }
39
+ puts opts; exit
40
+ end
41
+ end
42
+
43
+ path = OPTIONS[:path]
44
+
45
+ File.delete(File.expand_path(path) + "/.autotest")
46
+ puts "\nYou no longer receive notifications of your tests.\n"
data/config/hoe.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  require 'autotest_notification/version'
2
2
 
3
- AUTHOR = 'Carlos Brando' # can also be an array of Authors
3
+ AUTHOR = "Carlos Brando"
4
4
  EMAIL = "eduardobrando@gmail.com"
5
- DESCRIPTION = "Set the autotest to display messages through software such as Growl"
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
7
- RUBYFORGE_PROJECT = 'autotestnotific' # The unix name for your project
8
- HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
9
- DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
7
+ RUBYFORGE_PROJECT = '' # The unix name for your project
8
+ HOMEPATH = "http://github.com/carlosbrando/autotest-notification/"
9
+ DOWNLOAD_PATH = "http://github.com/carlosbrando/autotest-notification/tarball/master"
10
10
  EXTRA_DEPENDENCIES = [
11
11
  # ['activesupport', '>= 1.3.1']
12
12
  ] # An array of rubygem dependencies [name, version]
@@ -13,7 +13,7 @@ module AutotestNotification
13
13
  FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png"
14
14
 
15
15
  Autotest.add_hook :ran_command do |at|
16
- result = at.results.last
16
+ result = at.results.split("\n").last.to_s
17
17
  if result
18
18
 
19
19
  # Test::Unit
@@ -54,6 +54,11 @@ module AutotestNotification
54
54
  notify_send(title, msg, img)
55
55
  when /darwin/
56
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)
57
62
  end
58
63
  end
59
64
 
@@ -68,5 +73,10 @@ module AutotestNotification
68
73
  def notify_send(title, msg, img)
69
74
  system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
70
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
71
81
  end
72
82
  end
@@ -2,7 +2,7 @@ module AutotestNotification #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 3
5
+ TINY = 7
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  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.1</a>
36
+ <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">0.0.7</a>
37
37
  </div>
38
38
  <h1>&#x2192; &#8216;autotest_notification&#8217;</h1>
39
39
 
metadata CHANGED
@@ -1,23 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carlosbrando-autotest-notification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Brando
8
+ - Rodrigo Urubatan
9
+ - Alexandre da Silva
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
13
 
12
- date: 2008-05-11 00:00:00 -07:00
13
- default_executable: an-install
14
+ date: 2008-05-12 00:00:00 -07:00
15
+ default_executable:
14
16
  dependencies: []
15
17
 
16
- description: Set the autotest to display messages through software such as Growl
18
+ description: Set the autotest to display messages on the operating system using software such as Growl and LibNotify.
17
19
  email:
18
20
  - eduardobrando@gmail.com
19
21
  executables:
20
22
  - an-install
23
+ - an-uninstall
21
24
  extensions: []
22
25
 
23
26
  extra_rdoc_files:
@@ -54,18 +57,21 @@ files:
54
57
  - website/stylesheets/screen.css
55
58
  - website/template.html.erb
56
59
  - bin/an-install
60
+ - bin/an-uninstall
57
61
  - images/pass.png
58
62
  - images/fail.png
59
63
  - autotest-notification.gemspec
60
64
  has_rdoc: true
61
- homepage: http://autotestnotific.rubyforge.org
65
+ homepage: http://github.com/carlosbrando/autotest-notification/
62
66
  post_install_message: |+
63
67
 
64
- For more information on autotest_notification, see http://autotest_notification.rubyforge.org
68
+ For more information on autotest_notification, see http://github.com/carlosbrando/autotest-notification/
65
69
 
66
- NOTE: Change this information in PostInstall.txt
67
- You can also delete it if you don't want it.
70
+ To turn on the notifier you need to run the following command:
71
+ an-install
68
72
 
73
+ To turn off:
74
+ an-uninstall
69
75
 
70
76
  rdoc_options:
71
77
  - --main
@@ -86,11 +92,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
92
  version:
87
93
  requirements: []
88
94
 
89
- rubyforge_project:
95
+ rubyforge_project: ""
90
96
  rubygems_version: 1.0.1
91
97
  signing_key:
92
98
  specification_version: 2
93
- summary: Set the autotest to display messages through software such as Growl
99
+ summary: Set the autotest to display messages on the operating system using software such as Growl and LibNotify.
94
100
  test_files:
95
101
  - test/test_autotest_notification.rb
96
102
  - test/test_helper.rb