autotest-fsevent 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ == 0.2.0 2010-02-03
2
+
3
+ * 2 major improvement
4
+ * Change dependency from "ZenTest" to lightweight "autotest"
5
+ * Move waiting hook outside the loop (Sean DeNigris)
6
+
1
7
  == 0.1.3 2009-10-12
2
8
 
3
9
  * 1 major improvement
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Sven Schwyn
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -6,14 +6,13 @@
6
6
 
7
7
  == DESCRIPTION:
8
8
 
9
- ZenTest's autotest relies on filesystem polling to detect modifications in
10
- source code files. In other words: The filesytem is constantly being traversed
11
- which causes quite some load on both the CPU and the harddrive. This is not
12
- healthy for your Mac and if you are working on a portable computer, it will
13
- drain your battery in no time. Apple has introduces FSEvent with Mac OS X 10.5
14
- which is a very efficient way to have the operating system monitor file
15
- alterations. This gem teaches autotest to use FSEvent and therefore be nice
16
- to your Mac.
9
+ Autotest relies on filesystem polling to detect modifications in source code
10
+ files. In other words: The filesytem is constantly being traversed which causes
11
+ quite some load on both the CPU and the harddrive. This is not healthy for your
12
+ Mac and if you are working on a portable computer, it will drain your battery.
13
+ Apple has introduces FSEvent with Mac OS X 10.5 which is a very efficient way
14
+ to have the operating system monitor file alterations. This gem teaches autotest
15
+ to use FSEvent and therefore be nice to your Mac.
17
16
 
18
17
  Unlike other test runners for the Mac, autotest-mac does not replace but
19
18
  extend autotest and does *not* require RubyCocoa to be installed.
@@ -21,7 +20,7 @@ extend autotest and does *not* require RubyCocoa to be installed.
21
20
  == REQUIREMENTS:
22
21
 
23
22
  * Mac OS X >= 10.5
24
- * ZenTest >= 4.0.0
23
+ * autotest >= 4.2.4
25
24
 
26
25
  == INSTALL:
27
26
 
@@ -34,14 +33,38 @@ file:
34
33
 
35
34
  require 'autotest/fsevent'
36
35
 
36
+ If you like this gem, please consider to recommend me on Working with
37
+ Rails, thank you!
38
+
39
+ http://workingwithrails.com/recommendation/new/person/11706-sven-schwyn
40
+
41
+ == UPDATE FROM 0.1.X
42
+
43
+ As of version 0.2.0 autotest-fsevent no longer requires the ZenTest gem but
44
+ the lighter and improved autotest gem. To update do the following:
45
+
46
+ sudo gem uninstall ZenTest
47
+ sudo gem update autotest-fsevent
48
+
49
+ And only if you need all the functionality of ZenTest:
50
+
51
+ sudo gem install zentest-without-autotest
52
+
53
+ == TROUBLESHOOTING:
54
+
55
+ === Loading the Plugin Seems to Fail
56
+
57
+ The reason may be ZenTest which must not be installed. See "Update from
58
+ 0.1.X" for more on this.
59
+
37
60
  == DEVELOPMENT:
38
61
 
39
62
  You can install the bleeding edge version as follows:
40
63
 
41
64
  git clone git://github.com/svoop/autotest-fsevent.git
42
65
  cd autotest-fsevent
43
- rake gem
44
- rake install_gem
66
+ rake build
67
+ sudo rake install
45
68
 
46
69
  Please submit issues on:
47
70
 
@@ -58,6 +81,7 @@ Thanks to the following folks who have contributed to this project:
58
81
 
59
82
  * Harry Vangberg
60
83
  * Darrick Wiebe
84
+ * Sean DeNigris
61
85
 
62
86
  == LICENSE:
63
87
 
@@ -15,31 +15,27 @@ include Sys
15
15
  # require 'autotest/fsevent'
16
16
  module Autotest::FSEvent
17
17
 
18
- GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
18
+ GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
19
19
 
20
- ##
21
- # Use FSEvent if possible
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`
25
- `cd '#{Dir.pwd}'; #{File.join(GEM_PATH, 'fsevent', Uname.sysname.downcase, 'fsevent_sleep')} . 2>&1`
26
- else
27
- puts
28
- puts "autotest-fsevent: platform #{Uname.sysname} #{Uname.release} is not supported"
29
- end
30
- end
31
-
32
- ##
33
- # Add waiting hook to prevent fallback to polling after ignored files have changed
34
- Autotest.add_hook :initialize do
35
- class ::Autotest
36
- def wait_for_changes
37
- begin
38
- hook :waiting
39
- Kernel.sleep self.sleep
40
- end until find_files_to_test
41
- end
42
- end
43
- end
20
+ ##
21
+ # Use FSEvent if possible
22
+ # Add waiting hook to prevent fallback to polling after ignored files have changed
23
+ Autotest.add_hook :initialize do
24
+ if (Uname.sysname == 'Darwin' && Uname.release.to_i >= 9) || %w(Linux).include?(Uname.sysname)
25
+ class ::Autotest
26
+ def wait_for_changes
27
+ hook :waiting
28
+ begin
29
+ # `#{File.join(GEM_PATH, 'fsevent', Uname.sysname.downcase, 'fsevent_sleep')} '#{Dir.pwd}' 2>&1`
30
+ `cd '#{Dir.pwd}'; #{File.join(GEM_PATH, 'fsevent', Uname.sysname.downcase, 'fsevent_sleep')} . 2>&1`
31
+ Kernel.sleep self.sleep
32
+ end until find_files_to_test
33
+ end
34
+ end
35
+ else
36
+ puts
37
+ puts "autotest-fsevent: platform #{Uname.sysname} #{Uname.release} is not supported"
38
+ end
39
+ end
44
40
 
45
41
  end
@@ -1 +1 @@
1
- require File.dirname(__FILE__) + '/spec_helper.rb'
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
@@ -1,10 +1,8 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- gem 'rspec'
6
- require 'spec'
7
- end
8
-
9
- $:.unshift(File.dirname(__FILE__) + '/../lib')
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
10
3
  require 'autotest/fsevent'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
7
+ Spec::Runner.configure do |config|
8
+ end
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.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -9,67 +9,44 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-12 00:00:00 +02:00
12
+ date: 2010-02-03 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: ZenTest
17
- type: :runtime
16
+ name: rspec
17
+ type: :development
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 4.1.3
23
+ version: 1.3.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
- name: sys-uname
26
+ name: autotest
27
27
  type: :runtime
28
28
  version_requirement:
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.3
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: hoe
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 2.3.3
33
+ version: 4.2.4
44
34
  version:
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.
46
- email:
47
- - ruby@bitcetera.com
35
+ description: 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 very purpose. This gem teaches autotest how to use FSEvent.
36
+ email: ruby@bitcetera.com
48
37
  executables: []
49
38
 
50
39
  extensions: []
51
40
 
52
41
  extra_rdoc_files:
53
- - History.txt
54
- - Manifest.txt
55
- - PostInstall.txt
56
- files:
57
- - History.txt
58
- - Manifest.txt
59
- - PostInstall.txt
42
+ - LICENSE
60
43
  - README.rdoc
61
- - Rakefile
62
- - autotest-fsevent.gemspec
44
+ files:
45
+ - CHANGELOG.txt
63
46
  - fsevent/darwin/fsevent_sleep
64
- - lib/autotest-fsevent.rb
65
47
  - lib/autotest/fsevent.rb
66
- - script/console
67
- - script/destroy
68
- - script/generate
69
- - spec/autotest-fsevent_spec.rb
70
- - spec/spec.opts
71
- - spec/spec_helper.rb
72
- - tasks/rspec.rake
48
+ - LICENSE
49
+ - README.rdoc
73
50
  has_rdoc: true
74
51
  homepage: http://www.bitcetera.com/products/autotest-fsevent
75
52
  licenses: []
@@ -79,11 +56,19 @@ post_install_message: "\n\
79
56
  your ~/.autotest file:\n\n\
80
57
  require 'autotest/fsevent'\n\n\
81
58
  For more information, feedback and bug submissions, please visit:\n\n\
82
- http://www.bitcetera.com/products/autotest-fsevent\n\
59
+ http://www.bitcetera.com/products/autotest-fsevent\n\n\
60
+ If you like this gem, please consider to recommend me on Working with\n\
61
+ Rails, thank you!\n\n\
62
+ http://workingwithrails.com/recommendation/new/person/11706-sven-schwyn\n\n\
63
+ +-------------------------------------------------------------------------+\n\
64
+ | READ THIS IF YOU ARE UPGRADING FROM 0.1.X |\n\
65
+ | As of 0.2.0 this gem no longer depends on the rather heavy ZenTest gem |\n\
66
+ | but the more lightweight autotest gem. You MUST uninstall ZenTest now! |\n\
67
+ | Please refer to the README in case you need more ZenTest functionality. |\n\
68
+ +-------------------------------------------------------------------------+\n\
83
69
  \e[0m\n"
84
70
  rdoc_options:
85
- - --main
86
- - README.rdoc
71
+ - --charset=UTF-8
87
72
  require_paths:
88
73
  - lib
89
74
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -100,10 +85,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
85
  version:
101
86
  requirements: []
102
87
 
103
- rubyforge_project: autotest-fsevent
88
+ rubyforge_project:
104
89
  rubygems_version: 1.3.5
105
90
  signing_key:
106
91
  specification_version: 3
107
92
  summary: Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.
108
- test_files: []
109
-
93
+ test_files:
94
+ - spec/autotest-fsevent_spec.rb
95
+ - spec/spec_helper.rb
@@ -1,16 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- PostInstall.txt
4
- README.rdoc
5
- Rakefile
6
- autotest-fsevent.gemspec
7
- fsevent/darwin/fsevent_sleep
8
- lib/autotest-fsevent.rb
9
- lib/autotest/fsevent.rb
10
- script/console
11
- script/destroy
12
- script/generate
13
- spec/autotest-fsevent_spec.rb
14
- spec/spec.opts
15
- spec/spec_helper.rb
16
- tasks/rspec.rake
@@ -1,8 +0,0 @@
1
- In order to use autotest-fsevent, the following line has to be added to
2
- your ~/.autotest file:
3
-
4
- require 'autotest/fsevent'
5
-
6
- For more information, feedback and bug submissions, please visit:
7
-
8
- http://www.bitcetera.com/products/autotest-fsevent
data/Rakefile DELETED
@@ -1,27 +0,0 @@
1
- require 'rubygems'
2
- gem 'hoe', '>= 2.1.0'
3
- require 'hoe'
4
- require 'fileutils'
5
- require './lib/autotest-fsevent'
6
-
7
- Hoe.plugin :newgem
8
- # Hoe.plugin :website
9
- # Hoe.plugin :cucumberfeatures
10
-
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
- ]
22
- end
23
-
24
- require 'newgem/tasks'
25
- Dir['tasks/**/*.rake'].each { |t| load t }
26
-
27
- task :default => [:spec]
@@ -1,50 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{autotest-fsevent}
5
- s.version = "0.1.3"
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-12}
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
@@ -1,8 +0,0 @@
1
- $:.unshift(File.dirname(__FILE__)) unless
2
- $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
-
4
- module AutotestFSEvent
5
-
6
- VERSION = '0.1.3'
7
-
8
- end
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # File: script/console
3
- irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
-
5
- libs = " -r irb/completion"
6
- # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
- # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
- libs << " -r #{File.dirname(__FILE__) + '/../lib/autotest/fsevent.rb'}"
9
- puts "Loading autotest-fsevent gem"
10
- exec "#{irb} #{libs} --simple-prompt"
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/destroy'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
-
4
- begin
5
- require 'rubigen'
6
- rescue LoadError
7
- require 'rubygems'
8
- require 'rubigen'
9
- end
10
- require 'rubigen/scripts/generate'
11
-
12
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
- RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1 +0,0 @@
1
- --colour
@@ -1,21 +0,0 @@
1
- begin
2
- require 'spec'
3
- rescue LoadError
4
- require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- require 'spec'
6
- end
7
- begin
8
- require 'spec/rake/spectask'
9
- rescue LoadError
10
- puts <<-EOS
11
- To use rspec for testing you must install rspec gem:
12
- gem install rspec
13
- EOS
14
- exit(0)
15
- end
16
-
17
- desc "Run the specs under spec/models"
18
- Spec::Rake::SpecTask.new do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/**/*_spec.rb']
21
- end