guard-spin 0.0.1 → 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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  Guard::Spin
2
2
  ===========
3
3
 
4
+ Guard::Spin automatically starts and stops [Spin](https://github.com/jstorimer/spin) server.
5
+
4
6
  Install
5
7
  -------
6
8
 
@@ -27,7 +27,11 @@ module Guard
27
27
  end
28
28
 
29
29
  def run_all
30
- run(['spec'])
30
+ if rspec?
31
+ run(['spec'])
32
+ elsif test_unit?
33
+ run(['test'])
34
+ end
31
35
  end
32
36
 
33
37
  private
@@ -57,6 +61,8 @@ module Guard
57
61
  cmd_parts = []
58
62
  cmd_parts << "bundle exec" if bundler?
59
63
  cmd_parts << "spin serve"
64
+
65
+ cmd_parts << "-Itest" if test_unit?
60
66
 
61
67
  cmd_parts.join(' ')
62
68
  end
@@ -64,6 +70,14 @@ module Guard
64
70
  def bundler?
65
71
  @bundler ||= File.exist?("#{Dir.pwd}/Gemfile") && options[:bundler] != false
66
72
  end
73
+
74
+ def test_unit?
75
+ @test_unit ||= File.exist?("#{Dir.pwd}/test/test_helper.rb") && options[:test_unit] != false
76
+ end
77
+
78
+ def rspec?
79
+ @rspec ||= File.exist?("#{Dir.pwd}/spec") && options[:rspec] != false
80
+ end
67
81
  end
68
82
  end
69
83
  end
@@ -6,4 +6,11 @@ guard 'spin' do
6
6
  watch(%r{^app/(.+)\.haml}) { |m| "spec/#{m[1]}.haml_spec.rb" }
7
7
  watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
8
8
  watch(%r{^app/controllers/(.+)_(controller)\.rb}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] }
9
+
10
+ # TestUnit
11
+ # watch(%r|^test/(.*)_test\.rb|)
12
+ # watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
13
+ # watch(%r|^test/test_helper\.rb|) { "test" }
14
+ # watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
15
+ # watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
9
16
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module SpinVersion
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-spin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-08 00:00:00.000000000 Z
13
+ date: 2011-11-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: guard
17
- requirement: &17190048100 !ruby/object:Gem::Requirement
17
+ requirement: &17190040760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *17190048100
25
+ version_requirements: *17190040760
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: spin
28
- requirement: &17190047580 !ruby/object:Gem::Requirement
28
+ requirement: &17190039960 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *17190047580
36
+ version_requirements: *17190039960
37
37
  description: Guard gem for Spin
38
38
  email:
39
39
  - greenberg@entryway.net