svoop-autotest-fsevent 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,10 @@
1
+ == 0.1.1 2009-06-02
2
+
3
+ * 1 major improvement
4
+ * Check platform with sys-uname instead of RUBY_PLATFORM
5
+
6
+ == 0.1.0 2009-05-28
7
+
8
+ * Initial release
9
+ * FSEvent instead of filesystem polling on Mac OS X 10.5 or higher
10
+ * Formerly part of autotest-mac which is now deprecated
data/Manifest.txt ADDED
@@ -0,0 +1,16 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ autotest-fsevent.gemspec
7
+ fsevent/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
data/PostInstall.txt ADDED
@@ -0,0 +1,8 @@
1
+ In order to use autotest-fsevent, the following line has to be added *after*
2
+ all other requires in your ~/.autotest file:
3
+
4
+ require 'autotest/fsevent'
5
+
6
+ For more information, feedback and bug submissions, please visit:
7
+
8
+ See http://www.bitcetera.com/products/mac-fsevent
data/README.rdoc ADDED
@@ -0,0 +1,75 @@
1
+ = Autotest FSEvent
2
+
3
+ * Homepage: http://www.bitcetera.com/products/autotest-fsevent
4
+ * Issues and forum: https://forge.bitcetera.com/projects/show/autotest-fsevent
5
+
6
+ == DESCRIPTION:
7
+
8
+ ZenTest's autotest relies on filesystem polling to detect modifications in
9
+ source code files. In other words: The filesytem is constantly being traversed
10
+ which causes quite some load on both the CPU and the harddrive. This is not
11
+ healthy for your Mac and if you are working on a portable computer, it will
12
+ drain your battery in no time. Apple has introduces FSEvent with Mac OS X 10.5
13
+ which is a very efficient way to have the operating system monitor file
14
+ alterations. This gem teaches autotest to use FSEvent and therefore be nice
15
+ to your Mac.
16
+
17
+ Unlike other test runners for the Mac, autotest-mac does not replace but
18
+ extend autotest and does *not* require RubyCocoa to be installed.
19
+
20
+ == REQUIREMENTS:
21
+
22
+ * Mac OS X >= 10.5
23
+ * ZenTest >= 4.0.0
24
+
25
+ == INSTALL:
26
+
27
+ First install the gem:
28
+
29
+ sudo gem install autotest-fsevent
30
+
31
+ Then add the following line *after all other requires* in your ~/.autotest
32
+ file:
33
+
34
+ require 'autotest/fsevent'
35
+
36
+ == DEVELOPMENT:
37
+
38
+ You can install the bleeding-edge version as follows:
39
+
40
+ sudo gem uninstall autotest-fsevent
41
+ sudo gem install svoop-autotest-fsevent --source http://gems.github.com
42
+
43
+ Please submit issues on:
44
+
45
+ https://forge.bitcetera.com/projects/show/autotest-fsevent
46
+
47
+ To contribute code, fork the project on Github, add your code and submit a
48
+ pull request:
49
+
50
+ http://github.com/guides/fork-a-project-and-submit-your-modifications
51
+
52
+ == LICENSE:
53
+
54
+ (The MIT License)
55
+
56
+ Copyright (c) 2009 Sven Schwyn
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining
59
+ a copy of this software and associated documentation files (the
60
+ 'Software'), to deal in the Software without restriction, including
61
+ without limitation the rights to use, copy, modify, merge, publish,
62
+ distribute, sublicense, and/or sell copies of the Software, and to
63
+ permit persons to whom the Software is furnished to do so, subject to
64
+ the following conditions:
65
+
66
+ The above copyright notice and this permission notice shall be
67
+ included in all copies or substantial portions of the Software.
68
+
69
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
70
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
71
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
72
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
73
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
74
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
75
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,28 @@
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'
4
+
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 = "\n\e[1;32m" + File.read('PostInstall.txt') + "\e[0;30m\n"
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
+ ]
20
+
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'
25
+ end
26
+
27
+ require 'newgem/tasks'
28
+ Dir['tasks/**/*.rake'].each { |t| load t }
Binary file
@@ -0,0 +1,30 @@
1
+ require 'rubygems'
2
+ require 'autotest'
3
+ require 'sys/uname'
4
+ include Sys
5
+
6
+ ##
7
+ # Autotest::FSEvent
8
+ #
9
+ # == FEATUERS:
10
+ # * Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling
11
+ #
12
+ # == SYNOPSIS:
13
+ # ~/.autotest
14
+ # require 'autotest/fsevent'
15
+ module Autotest::FSEvent
16
+
17
+ GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../..'))
18
+
19
+ ##
20
+ # 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`
24
+ else
25
+ puts
26
+ puts "autotest-fsevent: platform #{Uname.sysname} #{Uname.release} is not supported"
27
+ end
28
+ end
29
+
30
+ end
@@ -0,0 +1,8 @@
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.1'
7
+
8
+ end
data/script/console ADDED
@@ -0,0 +1,10 @@
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"
data/script/destroy ADDED
@@ -0,0 +1,14 @@
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)
data/script/generate ADDED
@@ -0,0 +1,14 @@
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)
@@ -0,0 +1 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,10 @@
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')
10
+ require 'autotest-fsevent'
data/tasks/rspec.rake ADDED
@@ -0,0 +1,21 @@
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
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: svoop-autotest-fsevent
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Sven Schwyn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-06-03 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ZenTest
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 4.0.0
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: sys-uname
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.3
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
+ - !ruby/object:Gem::Dependency
46
+ name: hoe
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 1.8.0
54
+ version:
55
+ 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
+ email:
57
+ - ruby@bitcetera.com
58
+ executables: []
59
+
60
+ extensions: []
61
+
62
+ extra_rdoc_files:
63
+ - History.txt
64
+ - Manifest.txt
65
+ - PostInstall.txt
66
+ - README.rdoc
67
+ files:
68
+ - History.txt
69
+ - Manifest.txt
70
+ - PostInstall.txt
71
+ - README.rdoc
72
+ - Rakefile
73
+ - fsevent/fsevent_sleep
74
+ - lib/autotest-fsevent.rb
75
+ - lib/autotest/fsevent.rb
76
+ - script/console
77
+ - script/destroy
78
+ - script/generate
79
+ - spec/autotest-fsevent_spec.rb
80
+ - spec/spec.opts
81
+ - spec/spec_helper.rb
82
+ - tasks/rspec.rake
83
+ has_rdoc: false
84
+ homepage: http://www.bitcetera.com/products/autotest-fsevent
85
+ post_install_message: "\n\
86
+ \e[1;32mIn order to use autotest-fsevent, the following line has to be added *after*\n\
87
+ all other requires in your ~/.autotest file:\n\n\
88
+ require 'autotest/fsevent'\n\n\
89
+ For more information, feedback and bug submissions, please visit:\n\n\
90
+ See http://www.bitcetera.com/products/mac-fsevent\n\
91
+ \e[0;30m\n"
92
+ rdoc_options:
93
+ - --main
94
+ - README.rdoc
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: "0"
102
+ version:
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "0"
108
+ version:
109
+ requirements: []
110
+
111
+ rubyforge_project: autotest-fsevent
112
+ rubygems_version: 1.2.0
113
+ signing_key:
114
+ specification_version: 3
115
+ summary: Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.
116
+ test_files: []
117
+