autotest-fsevent 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2009-05-28
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/Manifest.txt ADDED
@@ -0,0 +1,14 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ fsevent/fsevent_sleep
7
+ lib/autotest/fsevent.rb
8
+ script/console
9
+ script/destroy
10
+ script/generate
11
+ spec/autotest-fsevent_spec.rb
12
+ spec/spec.opts
13
+ spec/spec_helper.rb
14
+ tasks/rspec.rake
data/PostInstall.txt ADDED
@@ -0,0 +1,14 @@
1
+
2
+ +--------------------------------------------------------------------------+
3
+ | |
4
+ | In order to use autotest-fsevent, the following line has to be added |
5
+ | to the top of ~/.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
+ +--------------------------------------------------------------------------+
14
+
data/README.rdoc ADDED
@@ -0,0 +1,58 @@
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 to your ~/.autotest file:
32
+
33
+ require 'autotest/fsevent'
34
+
35
+ == LICENSE:
36
+
37
+ (The MIT License)
38
+
39
+ Copyright (c) 2009 Sven Schwyn
40
+
41
+ Permission is hereby granted, free of charge, to any person obtaining
42
+ a copy of this software and associated documentation files (the
43
+ 'Software'), to deal in the Software without restriction, including
44
+ without limitation the rights to use, copy, modify, merge, publish,
45
+ distribute, sublicense, and/or sell copies of the Software, and to
46
+ permit persons to whom the Software is furnished to do so, subject to
47
+ the following conditions:
48
+
49
+ The above copyright notice and this permission notice shall be
50
+ included in all copies or substantial portions of the Software.
51
+
52
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
53
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
54
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
55
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
56
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
57
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
58
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +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'
4
+
5
+ $hoe = Hoe.new('autotest-fsevent', Autotest::FSEvent::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
+ ]
16
+ p.extra_dev_deps = [
17
+ ['newgem', ">= #{::Newgem::VERSION}"]
18
+ ]
19
+
20
+ p.clean_globs |= %w[**/.DS_Store tmp *.log]
21
+ path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
22
+ p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
23
+ p.rsync_args = '-av --delete --ignore-errors'
24
+ end
25
+
26
+ require 'newgem/tasks'
27
+ Dir['tasks/**/*.rake'].each { |t| load t }
Binary file
@@ -0,0 +1,34 @@
1
+ require 'rubygems'
2
+ require 'autotest'
3
+
4
+ $:.unshift(File.dirname(__FILE__)) unless
5
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
6
+
7
+ ##
8
+ # Autotest::FSEvent
9
+ #
10
+ # == FEATUERS:
11
+ # * Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling
12
+ #
13
+ # == SYNOPSIS:
14
+ # ~/.autotest
15
+ # require 'autotest/fsevent'
16
+ module Autotest::FSEvent
17
+
18
+ VERSION = '0.1.0'
19
+ GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '../..'))
20
+
21
+ ##
22
+ # Use FSEvent if possible
23
+ Autotest.add_hook :waiting do
24
+ if RUBY_PLATFORM.match(/darwin(\d+)\.?(\d+)?/) && ($1.to_i >= 9 || ($1.to_i == 8 && $2.to_i >= 9))
25
+ `#{File.join(GEM_PATH, 'fsevent', 'fsevent_sleep')} '#{Dir.pwd}' 2>&1`
26
+
27
+ else
28
+ puts
29
+ puts "autotest-fsevent: #{RUBY_PLATFORM} not supported, please file a bug if you are on Mac OS X 10.5 or above."
30
+ end
31
+ false
32
+ end
33
+
34
+ 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,116 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: autotest-fsevent
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Sven Schwyn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-28 00:00:00 +02: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: newgem
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.1
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: 1.8.0
44
+ 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
48
+ executables: []
49
+
50
+ extensions: []
51
+
52
+ extra_rdoc_files:
53
+ - History.txt
54
+ - Manifest.txt
55
+ - PostInstall.txt
56
+ - README.rdoc
57
+ files:
58
+ - History.txt
59
+ - Manifest.txt
60
+ - PostInstall.txt
61
+ - README.rdoc
62
+ - Rakefile
63
+ - fsevent/fsevent_sleep
64
+ - lib/autotest/fsevent.rb
65
+ - script/console
66
+ - script/destroy
67
+ - script/generate
68
+ - spec/autotest-fsevent_spec.rb
69
+ - spec/spec.opts
70
+ - spec/spec_helper.rb
71
+ - tasks/rspec.rake
72
+ has_rdoc: true
73
+ homepage: http://www.bitcetera.com/products/autotest-fsevent
74
+ licenses: []
75
+
76
+ post_install_message: |+
77
+
78
+ +--------------------------------------------------------------------------+
79
+ | |
80
+ | In order to use autotest-fsevent, the following line has to be added |
81
+ | to the top of ~/.autotest file: |
82
+ | |
83
+ | require 'autotest/fsevent' |
84
+ | |
85
+ | For more information, feedback and bug submissions, please visit: |
86
+ | |
87
+ | See http://www.bitcetera.com/products/mac-fsevent |
88
+ | |
89
+ +--------------------------------------------------------------------------+
90
+
91
+ rdoc_options:
92
+ - --main
93
+ - README.rdoc
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ version:
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
108
+ requirements: []
109
+
110
+ rubyforge_project: autotest-fsevent
111
+ rubygems_version: 1.3.3
112
+ signing_key:
113
+ specification_version: 3
114
+ summary: Use FSEvent (on Mac OS X 10.5 or higher) instead of filesystem polling.
115
+ test_files: []
116
+