autotest-fsevent 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ == 0.1.2 2009-10-04
2
+
3
+ * 1 major improvement
4
+ * Compatibility with Mac OS X 10.6
5
+ * 3 minor improvement
6
+ * Reset the postinstall text color to previous
7
+ * Prepare for multi-platform extension
8
+ * Patch wait_for_changes to prevent fallback to polling (Darrick Wiebe)
9
+
1
10
  == 0.1.1 2009-06-02
2
11
 
3
12
  * 1 major improvement
data/Manifest.txt CHANGED
@@ -3,7 +3,8 @@ Manifest.txt
3
3
  PostInstall.txt
4
4
  README.rdoc
5
5
  Rakefile
6
- fsevent/fsevent_sleep
6
+ autotest-fsevent.gemspec
7
+ fsevent/darwin/fsevent_sleep
7
8
  lib/autotest-fsevent.rb
8
9
  lib/autotest/fsevent.rb
9
10
  script/console
data/PostInstall.txt CHANGED
@@ -1,14 +1,8 @@
1
+ In order to use autotest-fsevent, the following line has to be added to
2
+ your ~/.autotest file:
1
3
 
2
- +--------------------------------------------------------------------------+
3
- | |
4
- | In order to use autotest-fsevent, the following line has to be added |
5
- | *after* all other requires in your ~/.autotest file: |
6
- | |
7
- | require 'autotest/fsevent' |
8
- | |
9
- | For more information, feedback and bug submissions, please visit: |
10
- | |
11
- | See http://www.bitcetera.com/products/mac-fsevent |
12
- | |
13
- +--------------------------------------------------------------------------+
4
+ require 'autotest/fsevent'
14
5
 
6
+ For more information, feedback and bug submissions, please visit:
7
+
8
+ http://www.bitcetera.com/products/autotest-fsevent
data/README.rdoc CHANGED
@@ -1,5 +1,6 @@
1
1
  = Autotest FSEvent
2
2
 
3
+ * Author: Sven Schwyn (http://www.bitcetera.com)
3
4
  * Homepage: http://www.bitcetera.com/products/autotest-fsevent
4
5
  * Issues and forum: https://forge.bitcetera.com/projects/show/autotest-fsevent
5
6
 
@@ -33,6 +34,34 @@ file:
33
34
 
34
35
  require 'autotest/fsevent'
35
36
 
37
+ == DEVELOPMENT:
38
+
39
+ You can install the bleeding edge version as follows:
40
+
41
+ sudo gem uninstall autotest-fsevent
42
+ sudo gem install svoop-autotest-fsevent --source http://gems.github.com
43
+
44
+ Bleeding-edge gems contains a fourth version digit group (e.g. the .8 in
45
+ 0.1.5.8) to make sure Github builds the gem whenever new code is committed.
46
+ If there is no fourth version digit group, the edge version is identical
47
+ to the stable version from Rubyforge.
48
+
49
+ Please submit issues on:
50
+
51
+ https://forge.bitcetera.com/projects/show/autotest-fsevent
52
+
53
+ To contribute code, fork the project on Github, add your code and submit a
54
+ pull request:
55
+
56
+ http://github.com/guides/fork-a-project-and-submit-your-modifications
57
+
58
+ == CONTRIBUTIONS:
59
+
60
+ Thanks to the following folks who have contributed to this project:
61
+
62
+ * Harry Vangberg
63
+ * Darrick Wiebe
64
+
36
65
  == LICENSE:
37
66
 
38
67
  (The MIT License)
data/Rakefile CHANGED
@@ -1,28 +1,27 @@
1
- require 'rubygems' unless ENV['NO_RUBYGEMS']
2
- %w[rake rake/clean fileutils newgem rubigen].each { |f| require f }
3
- require File.dirname(__FILE__) + '/lib/autotest-fsevent'
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require './lib/autotest-fsevent'
4
6
 
5
- $hoe = Hoe.new('autotest-fsevent', AutotestFSEvent::VERSION) do |p|
6
- p.developer('Sven Schwyn', 'ruby@bitcetera.com')
7
- p.summary = %q{Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.}
8
- p.description = %q{ZenTest's autotest relies on filesystem polling to detect modifications in source code files. This is expensive for the CPU, harddrive and battery - and unnecesary on Mac OS X 10.5 or higher which comes with the very efficient FSEvent core service for this purpose. This gem teaches autotest how to use FSEvent.}
9
- p.url = %q{http://www.bitcetera.com/products/autotest-fsevent}
10
- p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
11
- p.post_install_message = File.read('PostInstall.txt')
12
- p.rubyforge_name = p.name
13
- p.extra_deps = [
14
- ['ZenTest','>= 4.0.0'],
15
- ['sys-uname', '>= 0.8.3'],
16
- ]
17
- p.extra_dev_deps = [
18
- ['newgem', ">= #{::Newgem::VERSION}"]
19
- ]
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ # Hoe.plugin :cucumberfeatures
20
10
 
21
- p.clean_globs |= %w[**/.DS_Store tmp *.log]
22
- path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
23
- p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
24
- p.rsync_args = '-av --delete --ignore-errors'
11
+ $hoe = Hoe.spec 'autotest-fsevent' do
12
+ self.developer 'Sven Schwyn', 'ruby@bitcetera.com'
13
+ self.summary = %q{Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.}
14
+ self.description = %q{ZenTest's autotest relies on filesystem polling to detect modifications in source code files. This is expensive for the CPU, harddrive and battery - and unnecesary on Mac OS X 10.5 or higher which comes with the very efficient FSEvent core service for this purpose. This gem teaches autotest how to use FSEvent.}
15
+ self.url = %q{http://www.bitcetera.com/products/autotest-fsevent}
16
+ self.post_install_message = "\n\e[1;32m" + File.read('PostInstall.txt') + "\e[0m\n"
17
+ self.rubyforge_name = self.name
18
+ self.extra_deps = [
19
+ ['ZenTest','>= 4.1.3'],
20
+ ['sys-uname', '>= 0.8.3'],
21
+ ]
25
22
  end
26
23
 
27
24
  require 'newgem/tasks'
28
25
  Dir['tasks/**/*.rake'].each { |t| load t }
26
+
27
+ task :default => [:spec]
@@ -0,0 +1,50 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{autotest-fsevent}
5
+ s.version = "0.1.2"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Sven Schwyn"]
9
+ s.date = %q{2009-10-04}
10
+ s.description = %q{ZenTest's autotest relies on filesystem polling to detect modifications in source code files. This is expensive for the CPU, harddrive and battery - and unnecesary on Mac OS X 10.5 or higher which comes with the very efficient FSEvent core service for this purpose. This gem teaches autotest how to use FSEvent.}
11
+ s.email = ["ruby@bitcetera.com"]
12
+ s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt"]
13
+ s.files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc", "Rakefile", "autotest-fsevent.gemspec", "fsevent/darwin/fsevent_sleep", "lib/autotest-fsevent.rb", "lib/autotest/fsevent.rb", "script/console", "script/destroy", "script/generate", "spec/autotest-fsevent_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/rspec.rake"]
14
+ s.homepage = %q{http://www.bitcetera.com/products/autotest-fsevent}
15
+ s.post_install_message = %q{
16
+ In order to use autotest-fsevent, the following line has to be added to
17
+ your ~/.autotest file:
18
+
19
+ require 'autotest/fsevent'
20
+
21
+ For more information, feedback and bug submissions, please visit:
22
+
23
+ http://www.bitcetera.com/products/autotest-fsevent
24
+ 
25
+ }
26
+ s.rdoc_options = ["--main", "README.rdoc"]
27
+ s.require_paths = ["lib"]
28
+ s.rubyforge_project = %q{autotest-fsevent}
29
+ s.rubygems_version = %q{1.3.5}
30
+ s.summary = %q{Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.}
31
+
32
+ if s.respond_to? :specification_version then
33
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
34
+ s.specification_version = 3
35
+
36
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
37
+ s.add_runtime_dependency(%q<ZenTest>, [">= 4.1.3"])
38
+ s.add_runtime_dependency(%q<sys-uname>, [">= 0.8.3"])
39
+ s.add_development_dependency(%q<hoe>, [">= 2.3.3"])
40
+ else
41
+ s.add_dependency(%q<ZenTest>, [">= 4.1.3"])
42
+ s.add_dependency(%q<sys-uname>, [">= 0.8.3"])
43
+ s.add_dependency(%q<hoe>, [">= 2.3.3"])
44
+ end
45
+ else
46
+ s.add_dependency(%q<ZenTest>, [">= 4.1.3"])
47
+ s.add_dependency(%q<sys-uname>, [">= 0.8.3"])
48
+ s.add_dependency(%q<hoe>, [">= 2.3.3"])
49
+ end
50
+ end
@@ -3,6 +3,6 @@ $:.unshift(File.dirname(__FILE__)) unless
3
3
 
4
4
  module AutotestFSEvent
5
5
 
6
- VERSION = '0.1.1'
6
+ VERSION = '0.1.2'
7
7
 
8
- end
8
+ end
@@ -1,6 +1,7 @@
1
1
  require 'rubygems'
2
2
  require 'autotest'
3
3
  require 'sys/uname'
4
+
4
5
  include Sys
5
6
 
6
7
  ##
@@ -14,17 +15,30 @@ include Sys
14
15
  # require 'autotest/fsevent'
15
16
  module Autotest::FSEvent
16
17
 
17
- GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../..'))
18
+ GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
18
19
 
19
20
  ##
20
21
  # Use FSEvent if possible
21
- Autotest.add_hook :waiting do
22
- if Uname.sysname == 'Darwin' && Uname.release.to_i >= 9
23
- `#{File.join(GEM_PATH, 'fsevent', 'fsevent_sleep')} '#{Dir.pwd}' 2>&1`
22
+ Autotest.add_hook :waiting do
23
+ if (Uname.sysname == 'Darwin' && Uname.release.to_i >= 9) || %w(Linux).include?(Uname.sysname)
24
+ `#{File.join(GEM_PATH, 'fsevent', Uname.sysname.downcase, 'fsevent_sleep')} '#{Dir.pwd}' 2>&1`
24
25
  else
25
26
  puts
26
27
  puts "autotest-fsevent: platform #{Uname.sysname} #{Uname.release} is not supported"
27
28
  end
28
29
  end
29
30
 
31
+ ##
32
+ # Add waiting hook to prevent fallback to polling after ignored files have changed
33
+ Autotest.add_hook :initialize do
34
+ class ::Autotest
35
+ def wait_for_changes
36
+ begin
37
+ hook :waiting
38
+ Kernel.sleep self.sleep
39
+ end until find_files_to_test
40
+ end
41
+ end
42
+ end
43
+
30
44
  end
data/script/console CHANGED
@@ -5,6 +5,6 @@ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
5
5
  libs = " -r irb/completion"
6
6
  # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
7
  # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/autotest-fsevent.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/autotest/fsevent.rb'}"
9
9
  puts "Loading autotest-fsevent gem"
10
10
  exec "#{irb} #{libs} --simple-prompt"
data/spec/spec_helper.rb CHANGED
@@ -7,4 +7,4 @@ rescue LoadError
7
7
  end
8
8
 
9
9
  $:.unshift(File.dirname(__FILE__) + '/../lib')
10
- require 'autotest-fsevent'
10
+ require 'autotest/fsevent'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-fsevent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-02 00:00:00 +02:00
12
+ date: 2009-10-04 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 4.0.0
23
+ version: 4.1.3
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sys-uname
@@ -32,16 +32,6 @@ dependencies:
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.8.3
34
34
  version:
35
- - !ruby/object:Gem::Dependency
36
- name: newgem
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 1.4.1
44
- version:
45
35
  - !ruby/object:Gem::Dependency
46
36
  name: hoe
47
37
  type: :development
@@ -50,7 +40,7 @@ dependencies:
50
40
  requirements:
51
41
  - - ">="
52
42
  - !ruby/object:Gem::Version
53
- version: 1.8.0
43
+ version: 2.3.3
54
44
  version:
55
45
  description: ZenTest's autotest relies on filesystem polling to detect modifications in source code files. This is expensive for the CPU, harddrive and battery - and unnecesary on Mac OS X 10.5 or higher which comes with the very efficient FSEvent core service for this purpose. This gem teaches autotest how to use FSEvent.
56
46
  email:
@@ -63,14 +53,14 @@ extra_rdoc_files:
63
53
  - History.txt
64
54
  - Manifest.txt
65
55
  - PostInstall.txt
66
- - README.rdoc
67
56
  files:
68
57
  - History.txt
69
58
  - Manifest.txt
70
59
  - PostInstall.txt
71
60
  - README.rdoc
72
61
  - Rakefile
73
- - fsevent/fsevent_sleep
62
+ - autotest-fsevent.gemspec
63
+ - fsevent/darwin/fsevent_sleep
74
64
  - lib/autotest-fsevent.rb
75
65
  - lib/autotest/fsevent.rb
76
66
  - script/console
@@ -84,21 +74,13 @@ has_rdoc: true
84
74
  homepage: http://www.bitcetera.com/products/autotest-fsevent
85
75
  licenses: []
86
76
 
87
- post_install_message: |+
88
-
89
- +--------------------------------------------------------------------------+
90
- | |
91
- | In order to use autotest-fsevent, the following line has to be added |
92
- | *after* all other requires in your ~/.autotest file: |
93
- | |
94
- | require 'autotest/fsevent' |
95
- | |
96
- | For more information, feedback and bug submissions, please visit: |
97
- | |
98
- | See http://www.bitcetera.com/products/mac-fsevent |
99
- | |
100
- +--------------------------------------------------------------------------+
101
-
77
+ post_install_message: "\n\
78
+ \e[1;32mIn order to use autotest-fsevent, the following line has to be added to\n\
79
+ your ~/.autotest file:\n\n\
80
+ require 'autotest/fsevent'\n\n\
81
+ For more information, feedback and bug submissions, please visit:\n\n\
82
+ http://www.bitcetera.com/products/autotest-fsevent\n\
83
+ \e[0m\n"
102
84
  rdoc_options:
103
85
  - --main
104
86
  - README.rdoc
@@ -119,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
101
  requirements: []
120
102
 
121
103
  rubyforge_project: autotest-fsevent
122
- rubygems_version: 1.3.3
104
+ rubygems_version: 1.3.5
123
105
  signing_key:
124
106
  specification_version: 3
125
107
  summary: Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.