guard-yeti 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/guard-yeti.gemspec +1 -1
- data/lib/guard/yeti.rb +9 -3
- data/lib/guard/yeti/dependency.rb +12 -0
- data/spec/fixtures/yui_test_file.html +1 -0
- data/spec/guard_yeti_spec.rb +10 -4
- metadata +12 -9
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Add guard definition to your Guardfile with:
|
|
20
20
|
|
21
21
|
Please read the [Guard usage documentation](https://github.com/guard/guard#readme).
|
22
22
|
|
23
|
-
|
23
|
+
Start the yeti server and open http://localhost:8000 in a browser
|
24
24
|
|
25
25
|
|
26
26
|
```
|
data/guard-yeti.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "guard-yeti"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.3"
|
6
6
|
s.authors = ["Simon Højberg", "Christopher Meiklejohn"]
|
7
7
|
s.email = ["r.hackr@gmail.com", "christopher.meiklejohn@gmail.com"]
|
8
8
|
s.homepage = "https://github.com/hojberg/guard-yeti"
|
data/lib/guard/yeti.rb
CHANGED
@@ -5,10 +5,16 @@ module Guard
|
|
5
5
|
class Yeti < Guard
|
6
6
|
|
7
7
|
autoload :Notifier, 'guard/yeti/notifier'
|
8
|
+
autoload :Dependency, 'guard/yeti/dependency'
|
8
9
|
|
9
10
|
def initialize(watches = [], options = {})
|
10
11
|
super
|
11
|
-
|
12
|
+
|
13
|
+
['yeti', 'node'].each do |command|
|
14
|
+
Dependency.verify_or_raise(command)
|
15
|
+
end
|
16
|
+
|
17
|
+
UI.info "Guard::Yeti has started!"
|
12
18
|
@latest_output = "sucks"
|
13
19
|
end
|
14
20
|
|
@@ -17,9 +23,9 @@ module Guard
|
|
17
23
|
end
|
18
24
|
|
19
25
|
def run_on_change(paths)
|
20
|
-
return false if paths.empty?
|
26
|
+
return false if paths.empty? || !File.exist?(paths[0])
|
21
27
|
|
22
|
-
UI.
|
28
|
+
UI.debug("yeti #{paths[0]} --solo=1", :reset => true)
|
23
29
|
|
24
30
|
output = %x[yeti #{paths[0]} --solo=1]
|
25
31
|
result = $?.success?
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module Guard
|
2
|
+
class Yeti
|
3
|
+
class Dependency
|
4
|
+
def self.verify_or_raise(command)
|
5
|
+
output = system("which #{command} >/dev/null")
|
6
|
+
unless $?.to_i == 0
|
7
|
+
raise "Error: #{command} is not installed, which is a requirement of guard-yeti"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
yui_test_file.html
|
data/spec/guard_yeti_spec.rb
CHANGED
@@ -11,12 +11,18 @@ describe "guard-yeti" do
|
|
11
11
|
cmd
|
12
12
|
end
|
13
13
|
end
|
14
|
+
|
15
|
+
@yeti = Guard::Yeti.new
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should run yeti on update" do
|
19
|
+
@yeti.run_on_change(["spec/fixtures/yui_test_file.html"]).
|
20
|
+
must_equal [true, "yeti spec/fixtures/yui_test_file.html --solo=1"]
|
14
21
|
end
|
15
22
|
|
16
|
-
it "
|
17
|
-
yeti
|
18
|
-
|
19
|
-
must_equal [true, "yeti yui_test_file.html --solo=1"]
|
23
|
+
it "should not run yeti if file doesn't exist" do
|
24
|
+
@yeti.run_on_change(["spec/fixtures/bogus_yui_test_file.html"]).
|
25
|
+
must_equal false
|
20
26
|
end
|
21
27
|
|
22
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-yeti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2011-10-07 00:00:00.000000000Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: guard
|
17
|
-
requirement: &
|
17
|
+
requirement: &2153483380 !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: *
|
25
|
+
version_requirements: *2153483380
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rake
|
28
|
-
requirement: &
|
28
|
+
requirement: &2153482940 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *2153482940
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: minitest
|
39
|
-
requirement: &
|
39
|
+
requirement: &2153482520 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *2153482520
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: guard-minitest
|
50
|
-
requirement: &
|
50
|
+
requirement: &2153482100 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *2153482100
|
59
59
|
description: Guard watches files. Use guard-yeti to run your YUI unit test via Yeti,
|
60
60
|
when your implementation files change
|
61
61
|
email:
|
@@ -74,7 +74,9 @@ files:
|
|
74
74
|
- Rakefile
|
75
75
|
- guard-yeti.gemspec
|
76
76
|
- lib/guard/yeti.rb
|
77
|
+
- lib/guard/yeti/dependency.rb
|
77
78
|
- lib/guard/yeti/notifier.rb
|
79
|
+
- spec/fixtures/yui_test_file.html
|
78
80
|
- spec/guard_yeti_spec.rb
|
79
81
|
- spec/spec_helper.rb
|
80
82
|
homepage: https://github.com/hojberg/guard-yeti
|
@@ -102,5 +104,6 @@ signing_key:
|
|
102
104
|
specification_version: 3
|
103
105
|
summary: Guard::Yeti automatically run's your YUI tests via Yeti
|
104
106
|
test_files:
|
107
|
+
- spec/fixtures/yui_test_file.html
|
105
108
|
- spec/guard_yeti_spec.rb
|
106
109
|
- spec/spec_helper.rb
|