spectator 1.1.a2 → 1.1.a3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,7 +2,11 @@
2
2
 
3
3
  In your specs.watchr file just add:
4
4
 
5
+ ```ruby
6
+ require 'rspec-rails-watchr'
7
+
5
8
  @specs_watchr ||= Rspec::Rails::Watchr.new(self)
9
+ ```
6
10
 
7
11
  Then launch `watchr` as usual (probably `bundle exec watchr`).
8
12
 
@@ -19,6 +23,7 @@ you get the following prompt:
19
23
 
20
24
  If you want to override some path matching:
21
25
 
26
+ ```ruby
22
27
  @specs_watchr ||= Rspec::Rails::Watchr.new(self) do |path, specs|
23
28
  case path
24
29
  when %r{lib/calibration_with_coefficients}
@@ -27,7 +32,7 @@ If you want to override some path matching:
27
32
  specs.grep(%r{models/telemetry_parameter})
28
33
  end
29
34
  end
30
-
35
+ ```
31
36
 
32
37
 
33
38
 
data/bin/spectator CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # coding: utf-8
3
3
 
4
- require 'rb-fsevent'
4
+ require 'fssm'
5
5
  require 'rspec-rails-watchr'
6
6
  require 'pathname'
7
7
 
@@ -30,7 +30,7 @@ class Peepr
30
30
  end
31
31
 
32
32
  peepr = Peepr.new
33
- fsevent = FSEvent.new
33
+ # fsevent = FSEvent .new
34
34
  watchr = SpecWatchr.new(peepr)
35
35
 
36
36
  def watchr.reload!
@@ -38,30 +38,19 @@ end
38
38
 
39
39
  peepr.set_files Dir[File.join(Dir.pwd, '{app,spec,lib,script}/**/*')]
40
40
 
41
- fsevent.watch Dir.pwd do |directories|
42
-
43
- directories.each do |directory|
44
- # puts "Detected change inside: #{directory}"
45
- pwd = Pathname(Dir.pwd)
46
-
47
- Dir[File.join(directory, '/**/*')].each do |file|
48
- # puts "checking: #{file}"
49
- if peepr.changed? file
50
- file = Pathname(file).relative_path_from(pwd).to_s
51
- # puts "CHANGED!"
52
- peepr.rules.each do |(regexp, action)|
53
- # puts "RULE: #{regexp} =~ #{file} => #{action.inspect}"
54
- regexp = Regexp.new(regexp)
55
- if file =~ regexp
56
- m = regexp.match(file)
57
- # puts "CALLING!"
58
- action.call(m)
59
- end
60
- end
61
- end
41
+ launcher = lambda do |_, file|
42
+ peepr.rules.each do |(regexp, action)|
43
+ regexp = Regexp.new(regexp)
44
+ if file =~ regexp
45
+ m = regexp.match(file)
46
+ action.call(m)
62
47
  end
63
48
  end
64
-
65
49
  end
66
50
 
67
- fsevent.run
51
+
52
+ FSSM.monitor(Dir.pwd, '{app,spec,lib,script}/**/*') do
53
+ update {|base, relative| launcher(base, relative) }
54
+ create {|base, relative| launcher(base, relative) }
55
+ delete {|base, relative| '''do nothing''' }
56
+ end
@@ -151,4 +151,4 @@ class Object
151
151
  end
152
152
  end
153
153
  end
154
- end
154
+ end
@@ -1,3 +1,3 @@
1
1
  module Spectator
2
- VERSION = '1.1.a2'
2
+ VERSION = '1.1.a3'
3
3
  end
data/spectator.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = %w[lib]
22
22
 
23
- s.add_dependency 'rb-fsevent'
23
+ s.add_dependency 'fssm'
24
24
  s.add_dependency 'term-ansicolor'
25
25
  s.add_dependency 'notify'
26
26
  s.add_development_dependency 'rake', '~> 0.9'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spectator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 153
4
+ hash: 155
5
5
  prerelease: 4
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
9
  - a
10
- - 2
11
- version: 1.1.a2
10
+ - 3
11
+ version: 1.1.a3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Elia
@@ -17,10 +17,10 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-12-30 00:00:00 Z
20
+ date: 2012-02-20 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: rb-fsevent
23
+ name: fssm
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  none: false