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.
- data/{History.txt → CHANGELOG.txt} +6 -0
- data/LICENSE +20 -0
- data/README.rdoc +35 -11
- data/lib/autotest/fsevent.rb +21 -25
- data/spec/autotest-fsevent_spec.rb +1 -1
- data/spec/spec_helper.rb +7 -9
- metadata +29 -43
- data/Manifest.txt +0 -16
- data/PostInstall.txt +0 -8
- data/Rakefile +0 -27
- data/autotest-fsevent.gemspec +0 -50
- data/lib/autotest-fsevent.rb +0 -8
- data/script/console +0 -10
- data/script/destroy +0 -14
- data/script/generate +0 -14
- data/spec/spec.opts +0 -1
- data/tasks/rspec.rake +0 -21
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.
|
data/README.rdoc
CHANGED
@@ -6,14 +6,13 @@
|
|
6
6
|
|
7
7
|
== DESCRIPTION:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
*
|
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
|
44
|
-
rake
|
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
|
|
data/lib/autotest/fsevent.rb
CHANGED
@@ -15,31 +15,27 @@ include Sys
|
|
15
15
|
# require 'autotest/fsevent'
|
16
16
|
module Autotest::FSEvent
|
17
17
|
|
18
|
-
|
18
|
+
GEM_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
|
2
|
-
|
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.
|
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:
|
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:
|
17
|
-
type: :
|
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:
|
23
|
+
version: 1.3.0
|
24
24
|
version:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
|
-
name:
|
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:
|
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:
|
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
|
-
-
|
54
|
-
- Manifest.txt
|
55
|
-
- PostInstall.txt
|
56
|
-
files:
|
57
|
-
- History.txt
|
58
|
-
- Manifest.txt
|
59
|
-
- PostInstall.txt
|
42
|
+
- LICENSE
|
60
43
|
- README.rdoc
|
61
|
-
|
62
|
-
-
|
44
|
+
files:
|
45
|
+
- CHANGELOG.txt
|
63
46
|
- fsevent/darwin/fsevent_sleep
|
64
|
-
- lib/autotest-fsevent.rb
|
65
47
|
- lib/autotest/fsevent.rb
|
66
|
-
-
|
67
|
-
-
|
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
|
-
- --
|
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:
|
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
|
data/Manifest.txt
DELETED
@@ -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
|
data/PostInstall.txt
DELETED
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]
|
data/autotest-fsevent.gemspec
DELETED
@@ -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
|
-
[1;32mIn 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
|
-
[0m
|
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
|
data/lib/autotest-fsevent.rb
DELETED
data/script/console
DELETED
@@ -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"
|
data/script/destroy
DELETED
@@ -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)
|
data/script/generate
DELETED
@@ -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)
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--colour
|
data/tasks/rspec.rake
DELETED
@@ -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
|