mynyml-watchr 0.5.4 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -79,6 +79,12 @@ started.
79
79
 
80
80
  gem install watchr --source http://gemcutter.org
81
81
 
82
+ If you're on *nix and have the rev[http://github.com/tarcieri/rev/] gem
83
+ installed, Watchr will detect it and use it automatically. This will make
84
+ Watchr evented.
85
+
86
+ gem install rev
87
+
82
88
 
83
89
  === See Also
84
90
 
data/TODO.txt CHANGED
@@ -1,6 +1,4 @@
1
1
 
2
- * use VERSION file
3
-
4
2
  * refactor Script#parse!
5
3
  * only accept paths in initialize?
6
4
 
data/bin/watchr CHANGED
@@ -4,13 +4,12 @@ require 'pathname'
4
4
  require 'optparse'
5
5
 
6
6
  require 'watchr'
7
- require 'watchr/version'
8
7
 
9
8
  def usage
10
9
  "Usage: watchr [opts] path/to/script"
11
10
  end
12
11
  def version
13
- "watchr version: %s" % Watchr.version
12
+ "watchr version: %s" % Watchr::VERSION
14
13
  end
15
14
 
16
15
  opts = OptionParser.new do |opts|
data/lib/watchr.rb CHANGED
@@ -22,10 +22,17 @@ module Watchr
22
22
  autoload :Portable, 'watchr/event_handlers/portable'
23
23
  end
24
24
 
25
+ VERSION = '0.5.5'
26
+
25
27
  class << self
26
28
  attr_accessor :options
27
29
  attr_accessor :handler
28
30
 
31
+ # backwards compatibility
32
+ def version #:nodoc:
33
+ Watchr::VERSION
34
+ end
35
+
29
36
  # Options proxy.
30
37
  #
31
38
  # Currently supported options:
@@ -84,13 +91,16 @@ module Watchr
84
91
  #
85
92
  def handler
86
93
  @handler ||=
87
- #case ENV['HANDLER'] || RUBY_PLATFORM
88
94
  case ENV['HANDLER'] || Config::CONFIG['host_os']
89
95
  when /mswin|windows|cygwin/i
90
96
  Watchr::EventHandler::Portable
91
97
  when /sunos|solaris|darwin|mach|osx|bsd|linux/i, 'unix'
92
- #Watchr::EventHandler::Unix
93
- Watchr::EventHandler::Portable
98
+ begin
99
+ require 'rev'
100
+ Watchr::EventHandler::Unix
101
+ rescue LoadError, RuntimeError
102
+ Watchr::EventHandler::Portable
103
+ end
94
104
  else
95
105
  Watchr::EventHandler::Portable
96
106
  end
data/specs.watchr CHANGED
@@ -22,10 +22,10 @@ end
22
22
  # --------------------------------------------------
23
23
  # Watchr Rules
24
24
  # --------------------------------------------------
25
- watch( '^test.*/test_.*\.rb' ) { |m| run( "ruby -rubygems %s" % m[0] ) }
26
- watch( '^lib/(.*)\.rb' ) { |m| run( "ruby -rubygems test/test_%s.rb" % m[1] ) }
27
- watch( '^lib/.*/(.*)\.rb' ) { |m| run( "ruby -rubygems test/test_%s.rb" % m[1] ) }
28
- watch( '^test/test_helper\.rb' ) { run_all_tests }
25
+ watch( '^test.*/test_.*\.rb' ) { |m| run( "ruby -rubygems %s" % m[0] ) }
26
+ watch( '^lib/(.*)\.rb' ) { |m| run( "ruby -rubygems test/test_%s.rb" % m[1] ) }
27
+ watch( '^lib/watchr/event_handlers/(.*)\.rb' ) { |m| run( "ruby -rubygems test/event_handlers/test_%s.rb" % m[1] ) }
28
+ watch( '^test/test_helper\.rb' ) { run_all_tests }
29
29
 
30
30
  # --------------------------------------------------
31
31
  # Signal Handling
@@ -1,6 +1,6 @@
1
1
  require 'test/test_helper'
2
2
 
3
- class UnixEventHandlerTest < Test::Unit::TestCase
3
+ class PortableEventHandlerTest < Test::Unit::TestCase
4
4
  include Watchr
5
5
 
6
6
  def setup
data/test/test_watchr.rb CHANGED
@@ -24,42 +24,21 @@ class TestWatchr < Test::Unit::TestCase
24
24
 
25
25
  test "picking handler" do
26
26
 
27
- # temporary workaround to issue #1
28
- # http://github.com/mynyml/watchr/issues#issue/1
29
-
30
- #Watchr.handler = nil
31
- #ENV['HANDLER'] = 'linux'
32
- #Watchr.handler.should be(Watchr::EventHandler::Unix)
33
-
34
- #Watchr.handler = nil
35
- #ENV['HANDLER'] = 'bsd'
36
- #Watchr.handler.should be(Watchr::EventHandler::Unix)
37
-
38
- #Watchr.handler = nil
39
- #ENV['HANDLER'] = 'darwin'
40
- #Watchr.handler.should be(Watchr::EventHandler::Unix)
41
-
42
- #Watchr.handler = nil
43
- #ENV['HANDLER'] = 'unix'
44
- #Watchr.handler.should be(Watchr::EventHandler::Unix)
45
-
46
27
  Watchr.handler = nil
47
28
  ENV['HANDLER'] = 'linux'
48
- Watchr.handler.should be(Watchr::EventHandler::Portable)
29
+ Watchr.handler.should be(Watchr::EventHandler::Unix)
49
30
 
50
31
  Watchr.handler = nil
51
32
  ENV['HANDLER'] = 'bsd'
52
- Watchr.handler.should be(Watchr::EventHandler::Portable)
33
+ Watchr.handler.should be(Watchr::EventHandler::Unix)
53
34
 
54
35
  Watchr.handler = nil
55
36
  ENV['HANDLER'] = 'darwin'
56
- Watchr.handler.should be(Watchr::EventHandler::Portable)
37
+ Watchr.handler.should be(Watchr::EventHandler::Unix)
57
38
 
58
39
  Watchr.handler = nil
59
40
  ENV['HANDLER'] = 'unix'
60
- Watchr.handler.should be(Watchr::EventHandler::Portable)
61
- # end temporary workaround
62
-
41
+ Watchr.handler.should be(Watchr::EventHandler::Unix)
63
42
 
64
43
  Watchr.handler = nil
65
44
  ENV['HANDLER'] = 'mswin'
data/watchr.gemspec CHANGED
@@ -1,8 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'watchr'
4
- s.version = '0.5.4'
5
- s.date = '2009-09-17'
4
+ s.version = '0.5.5'
6
5
  s.summary = "Modern continious testing (flexible alternative to autotest)"
7
6
  s.description = "Modern continious testing (flexible alternative to autotest)."
8
7
  s.author = "mynyml"
@@ -21,7 +20,6 @@ Gem::Specification.new do |s|
21
20
  Rakefile
22
21
  bin/watchr
23
22
  lib/watchr.rb
24
- lib/watchr/version.rb
25
23
  lib/watchr/script.rb
26
24
  lib/watchr/controller.rb
27
25
  lib/watchr/event_handlers/base.rb
@@ -48,12 +46,6 @@ Gem::Specification.new do |s|
48
46
  test/event_handlers/test_portable.rb
49
47
  ]
50
48
 
51
- #require 'rbconfig'
52
- #unless Config::CONFIG['host_os'] =~ /mswin|windows|cygwin/i
53
- #unless RUBY_PLATFORM =~ /mswin|windows|cygwin/i
54
- # s.add_dependency 'rev', '>= 0.3.0'
55
- #end
56
-
57
49
  s.add_development_dependency 'mocha'
58
50
  s.add_development_dependency 'jeremymcanally-matchy'
59
51
  s.add_development_dependency 'jeremymcanally-pending'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mynyml-watchr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - mynyml
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-17 00:00:00 -07:00
12
+ date: 2009-05-16 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -77,7 +77,6 @@ files:
77
77
  - Rakefile
78
78
  - bin/watchr
79
79
  - lib/watchr.rb
80
- - lib/watchr/version.rb
81
80
  - lib/watchr/script.rb
82
81
  - lib/watchr/controller.rb
83
82
  - lib/watchr/event_handlers/base.rb
@@ -1,11 +0,0 @@
1
- module Watchr
2
- module VERSION #:nodoc:
3
- MAJOR = 0
4
- MINOR = 5
5
- TINY = 4
6
- end
7
-
8
- def self.version #:nodoc:
9
- [VERSION::MAJOR, VERSION::MINOR, VERSION::TINY].join('.')
10
- end
11
- end