autotest-rails-pure 4.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.
@@ -0,0 +1,23 @@
1
+ # -*- ruby -*-
2
+
3
+ require 'autotest/restart'
4
+
5
+ # Autotest.add_hook :initialize do |at|
6
+ # at.extra_files << "../some/external/dependency.rb"
7
+ #
8
+ # at.libs << ":../some/external"
9
+ #
10
+ # at.add_exception 'vendor'
11
+ #
12
+ # at.add_mapping(/dependency.rb/) do |f, _|
13
+ # at.files_matching(/test_.*rb$/)
14
+ # end
15
+ #
16
+ # %w(TestA TestB).each do |klass|
17
+ # at.extra_class_map[klass] = "test/test_misc.rb"
18
+ # end
19
+ # end
20
+
21
+ # Autotest.add_hook :run_command do |at|
22
+ # system "rake build"
23
+ # end
@@ -0,0 +1,2 @@
1
+ - 2010-02-11 Made independent from ZenTest
2
+ - 2009-06-03 Split from ZenTest
@@ -0,0 +1,37 @@
1
+ Autotest for Test::Unit on Rails, including plugins for migrations and fixtures.
2
+
3
+ Install
4
+ =======
5
+
6
+ sudo gem install autotest autotest-rails-pure
7
+
8
+ TODO
9
+ ====
10
+ - add specs, e.g. which file is loaded when x changes
11
+
12
+
13
+ LICENSE
14
+ =======
15
+
16
+ (The MIT License)
17
+
18
+ Copyright (c) 2009 Ryan Davis, seattle.rb
19
+
20
+ Permission is hereby granted, free of charge, to any person obtaining
21
+ a copy of this software and associated documentation files (the
22
+ 'Software'), to deal in the Software without restriction, including
23
+ without limitation the rights to use, copy, modify, merge, publish,
24
+ distribute, sublicense, and/or sell copies of the Software, and to
25
+ permit persons to whom the Software is furnished to do so, subject to
26
+ the following conditions:
27
+
28
+ The above copyright notice and this permission notice shall be
29
+ included in all copies or substantial portions of the Software.
30
+
31
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
32
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
34
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
35
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
36
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
37
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,13 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |gem|
4
+ gem.name = "autotest-rails-pure"
5
+ gem.summary = "Autotest for Test::Unit on Rails, including plugins for migrations and fixtures."
6
+ gem.homepage = "http://github.com/grosser/autotest-rails"
7
+ gem.authors = ["Ryan Davis"]
8
+ end
9
+
10
+ Jeweler::GemcutterTasks.new
11
+ rescue LoadError
12
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
13
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 4.1.0
@@ -0,0 +1,44 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{autotest-rails-pure}
8
+ s.version = "4.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Ryan Davis"]
12
+ s.date = %q{2010-02-11}
13
+ s.extra_rdoc_files = [
14
+ "README.markdown"
15
+ ]
16
+ s.files = [
17
+ ".autotest",
18
+ "History.txt",
19
+ "README.markdown",
20
+ "Rakefile",
21
+ "VERSION",
22
+ "autotest-rails-pure.gemspec",
23
+ "lib/autotest/discover.rb",
24
+ "lib/autotest/fixtures.rb",
25
+ "lib/autotest/migrate.rb",
26
+ "lib/autotest/rails.rb"
27
+ ]
28
+ s.homepage = %q{http://github.com/grosser/autotest-rails}
29
+ s.rdoc_options = ["--charset=UTF-8"]
30
+ s.require_paths = ["lib"]
31
+ s.rubygems_version = %q{1.3.5}
32
+ s.summary = %q{Autotest for Test::Unit on Rails, including plugins for migrations and fixtures.}
33
+
34
+ if s.respond_to? :specification_version then
35
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
36
+ s.specification_version = 3
37
+
38
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
39
+ else
40
+ end
41
+ else
42
+ end
43
+ end
44
+
@@ -0,0 +1,5 @@
1
+ Autotest.add_discovery do
2
+ style = []
3
+ style << "rails" if File.exist? 'config/environment.rb'
4
+ style
5
+ end
@@ -0,0 +1,12 @@
1
+ # -*- ruby -*-
2
+
3
+ # This is an example of how to change the mappings of file that
4
+ # changed to tests to run for a project.
5
+
6
+ module Autotest::Fixtures
7
+ Autotest.add_hook :initialize do |at|
8
+ at.test_mappings['^test/fixtures/(.*)s.yml'] = proc { |filename, matches|
9
+ at.files_matching(/test\/\w+\/#{matches[1]}(_\w+)?.*_test.rb$/)
10
+ }
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ # -*- ruby -*-
2
+
3
+ module Autotest::Migrate
4
+ Autotest.add_hook(:run) do |autotest|
5
+ system "rake db:migrate" if autotest.class.to_s == "RailsAutotest"
6
+ end
7
+ end
@@ -0,0 +1,82 @@
1
+ require 'autotest'
2
+
3
+ class Autotest::Rails < Autotest
4
+ VERSION = File.read( File.join(File.dirname(__FILE__),'..','..','VERSION') ).strip
5
+
6
+ def initialize # :nodoc:
7
+ super
8
+
9
+ add_exception %r%^\./(?:db|doc|log|public|script|tmp|vendor)%
10
+
11
+ clear_mappings
12
+
13
+ self.add_mapping(/^lib\/.*\.rb$/) do |filename, _|
14
+ impl = File.basename(filename, '.rb')
15
+ files_matching %r%^test/unit/#{impl}_test.rb$%
16
+ # TODO: (unit|functional|integration) maybe?
17
+ end
18
+
19
+ add_mapping %r%^test/fixtures/(.*)s.yml% do |_, m|
20
+ ["test/unit/#{m[1]}_test.rb",
21
+ "test/controllers/#{m[1]}_controller_test.rb",
22
+ "test/views/#{m[1]}_view_test.rb",
23
+ "test/functional/#{m[1]}_controller_test.rb"]
24
+ end
25
+
26
+ add_mapping %r%^test/(unit|integration|controllers|views|functional)/.*rb$% do |filename, _|
27
+ filename
28
+ end
29
+
30
+ add_mapping %r%^app/models/(.*)\.rb$% do |_, m|
31
+ "test/unit/#{m[1]}_test.rb"
32
+ end
33
+
34
+ add_mapping %r%^app/helpers/application_helper.rb% do
35
+ files_matching %r%^test/(views|functional)/.*_test\.rb$%
36
+ end
37
+
38
+ add_mapping %r%^app/helpers/(.*)_helper.rb% do |_, m|
39
+ if m[1] == "application" then
40
+ files_matching %r%^test/(views|functional)/.*_test\.rb$%
41
+ else
42
+ ["test/views/#{m[1]}_view_test.rb",
43
+ "test/functional/#{m[1]}_controller_test.rb"]
44
+ end
45
+ end
46
+
47
+ add_mapping %r%^app/views/(.*)/% do |_, m|
48
+ ["test/views/#{m[1]}_view_test.rb",
49
+ "test/functional/#{m[1]}_controller_test.rb"]
50
+ end
51
+
52
+ add_mapping %r%^app/controllers/(.*)\.rb$% do |_, m|
53
+ if m[1] == "application" then
54
+ files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
55
+ else
56
+ ["test/controllers/#{m[1]}_test.rb",
57
+ "test/functional/#{m[1]}_test.rb"]
58
+ end
59
+ end
60
+
61
+ add_mapping %r%^app/views/layouts/% do
62
+ "test/views/layouts_view_test.rb"
63
+ end
64
+
65
+ add_mapping %r%^config/routes.rb$% do # FIX:
66
+ files_matching %r%^test/(controllers|views|functional)/.*_test\.rb$%
67
+ end
68
+
69
+ add_mapping %r%^test/test_helper.rb|config/((boot|environment(s/test)?).rb|database.yml)% do
70
+ files_matching %r%^test/(unit|controllers|views|functional)/.*_test\.rb$%
71
+ end
72
+ end
73
+
74
+ # Convert the pathname s to the name of class.
75
+ def path_to_classname(s)
76
+ sep = File::SEPARATOR
77
+ f = s.sub(/^test#{sep}((unit|functional|integration|views|controllers|helpers)#{sep})?/, '').sub(/\.rb$/, '').split(sep)
78
+ f = f.map { |path| path.split(/_/).map { |seg| seg.capitalize }.join }
79
+ f = f.map { |path| path =~ /Test$/ ? path : "#{path}Test" }
80
+ f.join('::')
81
+ end
82
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: autotest-rails-pure
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Davis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-02-11 00:00:00 +01:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description:
17
+ email:
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.markdown
24
+ files:
25
+ - .autotest
26
+ - History.txt
27
+ - README.markdown
28
+ - Rakefile
29
+ - VERSION
30
+ - autotest-rails-pure.gemspec
31
+ - lib/autotest/discover.rb
32
+ - lib/autotest/fixtures.rb
33
+ - lib/autotest/migrate.rb
34
+ - lib/autotest/rails.rb
35
+ has_rdoc: true
36
+ homepage: http://github.com/grosser/autotest-rails
37
+ licenses: []
38
+
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --charset=UTF-8
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: "0"
49
+ version:
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ requirements: []
57
+
58
+ rubyforge_project:
59
+ rubygems_version: 1.3.5
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Autotest for Test::Unit on Rails, including plugins for migrations and fixtures.
63
+ test_files: []
64
+