watch-me-now 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Rob Sanheim
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 ADDED
@@ -0,0 +1,18 @@
1
+ = watch-me-now
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but
13
+ bump version in a commit by itself I can ignore when I pull)
14
+ * Send me a pull request. Bonus points for topic branches.
15
+
16
+ == Copyright
17
+
18
+ Copyright (c) 2009 Rob Sanheim. See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ require 'rake'
2
+
3
+ begin
4
+ require 'jeweler'
5
+ Jeweler::Tasks.new do |gem|
6
+ gem.name = "watch-me-now"
7
+ gem.summary = %Q{script to continuous test any sort of Ruby project}
8
+ gem.description = %Q{watchr provides flexible continuous testing. watch-me-now is a simple script to try and test most types of Ruby projects}
9
+ gem.email = "rsanheim@gmail.com"
10
+ gem.homepage = "http://github.com/rsanheim/watch-me-now"
11
+ gem.authors = ["Rob Sanheim"]
12
+ gem.add_dependency "watchr"
13
+ end
14
+ Jeweler::GemcutterTasks.new
15
+ rescue LoadError
16
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
17
+ end
18
+
19
+ task :default => :check_dependencies
20
+
21
+ task :push => ['release', 'gemcutter:release']
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.2
data/bin/watchit ADDED
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env ruby
2
+ # For use with http://github.com/mynyml/watchr
3
+ #
4
+ # Run me with:
5
+ #
6
+ # $ watchr watchit.watchr
7
+
8
+ # --------------------------------------------------
9
+ # Convenience Methods
10
+ # --------------------------------------------------
11
+
12
+ if __FILE__ == $0
13
+ exec("watchr #{__FILE__}")
14
+ end
15
+
16
+ def test_folder
17
+ @test_folder ||= %w[spec specs examples test].detect { |p| File.directory?(p) }
18
+ end
19
+
20
+ def test_suffix
21
+ case test_folder
22
+ when "spec", "specs" then "spec"
23
+ when "examples" then "example"
24
+ when "test" then "test"
25
+ end
26
+ end
27
+
28
+ def all_test_files
29
+ Dir["#{test_folder}/**/*_#{test_suffix}.rb"]
30
+ end
31
+
32
+ def run_test_matching(thing_to_match)
33
+ matches = all_test_files.grep /#{thing_to_match}/i
34
+ if matches.empty?
35
+ puts "Sorry, thanks for playing, but there were no matches for #{thing_to_match}"
36
+ else
37
+ run matches.join(' ')
38
+ end
39
+ end
40
+
41
+ def run(files_to_run)
42
+ cmd = "ruby -I#{test_folder} #{files_to_run}"
43
+ puts cmd
44
+ system("ruby -I#{test_folder} #{files_to_run}")
45
+ end
46
+
47
+ def run_all_tests
48
+ run(all_test_files.join(' '))
49
+ end
50
+
51
+
52
+ # --------------------------------------------------
53
+ # Watchr Rules
54
+ # --------------------------------------------------
55
+ watch("^#{test_folder}/(.*)_#{test_suffix}\.rb") { |m| run_test_matching(m[1]) }
56
+ watch("^#{test_folder}/(.*)\.rb") { |m| run_test_matching(m[1]) }
57
+ watch("^lib/(.*)\.rb") { |m| run_test_matching(m[1]) }
58
+ watch("^#{test_folder}/#{test_suffix}_helper\.rb") { run_all_tests }
59
+ watch('^features/(.*)') { system "cucumber --tags @fit features/other/" }
60
+
61
+ # --------------------------------------------------
62
+ # Signal Handling
63
+ # --------------------------------------------------
64
+ Signal.trap 'INT' do
65
+ if @sent_an_int then
66
+ puts " A second INT? Ok, I get the message. Shutting down now."
67
+ exit
68
+ else
69
+ puts " Did you just send me an INT? Ugh. I'll quit for real if you do it again."
70
+ @sent_an_int = true
71
+ Kernel.sleep 1.5
72
+ run_all_tests
73
+ end
74
+ end
@@ -0,0 +1,49 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{watch-me-now}
8
+ s.version = "0.2.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Rob Sanheim"]
12
+ s.date = %q{2009-10-04}
13
+ s.default_executable = %q{watchit}
14
+ s.description = %q{watchr provides flexible continuous testing. watch-me-now is a simple script to try and test most types of Ruby projects}
15
+ s.email = %q{rsanheim@gmail.com}
16
+ s.executables = ["watchit"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "bin/watchit",
29
+ "watch-me-now.gemspec"
30
+ ]
31
+ s.homepage = %q{http://github.com/rsanheim/watch-me-now}
32
+ s.rdoc_options = ["--charset=UTF-8"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = %q{1.3.5}
35
+ s.summary = %q{script to continuous test any sort of Ruby project}
36
+
37
+ if s.respond_to? :specification_version then
38
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
39
+ s.specification_version = 3
40
+
41
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
42
+ s.add_runtime_dependency(%q<watchr>, [">= 0"])
43
+ else
44
+ s.add_dependency(%q<watchr>, [">= 0"])
45
+ end
46
+ else
47
+ s.add_dependency(%q<watchr>, [">= 0"])
48
+ end
49
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: watch-me-now
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.2
5
+ platform: ruby
6
+ authors:
7
+ - Rob Sanheim
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-04 00:00:00 -04:00
13
+ default_executable: watchit
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: watchr
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: watchr provides flexible continuous testing. watch-me-now is a simple script to try and test most types of Ruby projects
26
+ email: rsanheim@gmail.com
27
+ executables:
28
+ - watchit
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README.rdoc
39
+ - Rakefile
40
+ - VERSION
41
+ - bin/watchit
42
+ - watch-me-now.gemspec
43
+ has_rdoc: true
44
+ homepage: http://github.com/rsanheim/watch-me-now
45
+ licenses: []
46
+
47
+ post_install_message:
48
+ rdoc_options:
49
+ - --charset=UTF-8
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.3.5
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: script to continuous test any sort of Ruby project
71
+ test_files: []
72
+