guard-jessie 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/.gitignore +4 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +4 -0
- data/LICENSE +20 -0
- data/README.md +130 -0
- data/Rakefile +2 -0
- data/guard-jessie.gemspec +30 -0
- data/lib/guard/jessie/runner.rb +20 -0
- data/lib/guard/jessie/templates/Guardfile +19 -0
- data/lib/guard/jessie/version.rb +5 -0
- data/lib/guard/jessie.rb +21 -0
- data/lib/guard-jessie.rb +0 -0
- data/spec/lib/guard/jessie/runner_spec.rb +24 -0
- data/spec/lib/guard/jessie_spec.rb +19 -0
- data/spec/spec_helper.rb +4 -0
- metadata +142 -0
data/.gitignore
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Michal Taszycki
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
20
|
+
|
data/README.md
ADDED
@@ -0,0 +1,130 @@
|
|
1
|
+
Guard::Jessie
|
2
|
+
=============
|
3
|
+
|
4
|
+
Jessie guard allows to automatically run you jasmine specs under node using jessie runner.
|
5
|
+
|
6
|
+
Install
|
7
|
+
-------
|
8
|
+
|
9
|
+
Please be sure to have [Guard](https://github.com/guard/guard) and [Jessie](https://github.com/futuresimple/jessie) installed before continue.
|
10
|
+
|
11
|
+
You also obviously need ruby and node environments installed.
|
12
|
+
|
13
|
+
Install the gem:
|
14
|
+
|
15
|
+
$ gem install guard-jessie
|
16
|
+
|
17
|
+
Add it to your Gemfile (inside development group):
|
18
|
+
|
19
|
+
``` ruby
|
20
|
+
gem 'guard-jessie'
|
21
|
+
```
|
22
|
+
|
23
|
+
Add guard definition to your Guardfile by running this command:
|
24
|
+
|
25
|
+
$ guard init jessie
|
26
|
+
|
27
|
+
Usage
|
28
|
+
-----
|
29
|
+
|
30
|
+
Please read [Guard usage doc](https://github.com/guard/guard#readme)
|
31
|
+
|
32
|
+
Guardfile
|
33
|
+
---------
|
34
|
+
|
35
|
+
RSpec guard can be really adapted to all kind of projects.
|
36
|
+
|
37
|
+
### Standard node project
|
38
|
+
|
39
|
+
``` ruby
|
40
|
+
guard 'jessie' do
|
41
|
+
watch(%r{^spec/.+(_spec|Spec)\.(js|coffee)})
|
42
|
+
watch(%r{^lib/(.+)\.(js|coffee)}) { |m| "spec/lib/#{m[1]}_spec.js" }
|
43
|
+
watch('spec/spec_helper.js') { "spec" }
|
44
|
+
end
|
45
|
+
```
|
46
|
+
|
47
|
+
### Typical Rails (version < 3.1) app
|
48
|
+
|
49
|
+
``` ruby
|
50
|
+
guard 'jessie' do
|
51
|
+
watch(%r{^spec/javascripts/.+(_spec|Spec)\.js})
|
52
|
+
watch(%r{^public/javascripts/(.+)\.js}) { |m| "spec/javascripts/#{m[1]}_spec.js" }
|
53
|
+
watch('spec/spec_helper.js') { "spec" }
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
### Typical Rails (version >= 3.1) app
|
58
|
+
|
59
|
+
``` ruby
|
60
|
+
guard 'jessie' do
|
61
|
+
watch(%r{^spec/javascripts/.+(_spec|Spec)\.js})
|
62
|
+
watch(%r{^app/assets/javascripts/(.+)\.js}) { |m| "spec/javascripts/#{m[1]}_spec.js" }
|
63
|
+
watch('spec/spec_helper.js') { "spec" }
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
Please read [Guard doc](https://github.com/guard/guard#readme) for more information about the Guardfile DSL.
|
68
|
+
|
69
|
+
Options
|
70
|
+
-------
|
71
|
+
|
72
|
+
You can pass any of the standard RSpec CLI options using the `:cli` option:
|
73
|
+
|
74
|
+
``` ruby
|
75
|
+
guard 'jessie', :cli => "-f nested" do
|
76
|
+
# ...
|
77
|
+
end
|
78
|
+
```
|
79
|
+
|
80
|
+
### List of available options:
|
81
|
+
|
82
|
+
``` ruby
|
83
|
+
:cli => "-f nested" # pass arbitrary Jessie CLI arguments, default: "-f progress"
|
84
|
+
:notification => false # don't display Growl (or Libnotify) notification after the specs are done running, default: true
|
85
|
+
|
86
|
+
|
87
|
+
Development
|
88
|
+
-----------
|
89
|
+
|
90
|
+
* Source hosted at [GitHub](https://github.com/guard/guard-jessie)
|
91
|
+
* Report issues/Questions/Feature requests on [GitHub Issues](https://github.com/guard/guard-jessie/issues)
|
92
|
+
|
93
|
+
Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change
|
94
|
+
you make.
|
95
|
+
|
96
|
+
Testing
|
97
|
+
-------
|
98
|
+
|
99
|
+
rake
|
100
|
+
|
101
|
+
Author
|
102
|
+
------
|
103
|
+
|
104
|
+
[Michał Taszycki](https://github.com/mehowte)
|
105
|
+
|
106
|
+
|
107
|
+
License
|
108
|
+
-------
|
109
|
+
|
110
|
+
Copyright (c) 2011 Michal Taszycki
|
111
|
+
|
112
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
113
|
+
of this software and associated documentation files (the "Software"), to deal
|
114
|
+
in the Software without restriction, including without limitation the rights
|
115
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
116
|
+
copies of the Software, and to permit persons to whom the Software is
|
117
|
+
furnished to do so, subject to the following conditions:
|
118
|
+
|
119
|
+
The above copyright notice and this permission notice shall be included in
|
120
|
+
all copies or substantial portions of the Software.
|
121
|
+
|
122
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
123
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
124
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
125
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
126
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
127
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
128
|
+
THE SOFTWARE.
|
129
|
+
|
130
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "guard/jessie"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "guard-jessie"
|
7
|
+
s.version = Guard::Jessie::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Michał Taszycki"]
|
10
|
+
s.email = ["mtaszycki@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/mehowte/guard-jessie"
|
12
|
+
s.summary = %q{Guard gem for jessie}
|
13
|
+
s.description = %q{Guard::Jessie automatically runs your jasmine specs through jessie driver}
|
14
|
+
|
15
|
+
s.rubyforge_project = "guard-jessie"
|
16
|
+
|
17
|
+
s.add_dependency 'guard', '>= 0.4.0'
|
18
|
+
|
19
|
+
s.add_development_dependency 'bundler', '~> 1.0'
|
20
|
+
s.add_development_dependency 'rspec', '~> 2.6'
|
21
|
+
s.add_development_dependency 'guard-bundler'
|
22
|
+
s.add_development_dependency 'guard-rspec'
|
23
|
+
s.add_development_dependency 'rake'
|
24
|
+
|
25
|
+
|
26
|
+
s.files = `git ls-files`.split("\n")
|
27
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
28
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
29
|
+
s.require_paths = ["lib"]
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Guard
|
2
|
+
class Jessie
|
3
|
+
module Runner
|
4
|
+
def self.run paths
|
5
|
+
return false if paths.empty?
|
6
|
+
system(jessie_command(paths))
|
7
|
+
end
|
8
|
+
|
9
|
+
private
|
10
|
+
def self.jessie_command(paths)
|
11
|
+
cmd_parts = []
|
12
|
+
cmd_parts << "jessie"
|
13
|
+
cmd_parts << "-f progress"
|
14
|
+
cmd_parts << paths.join(" ")
|
15
|
+
|
16
|
+
cmd_parts.join(" ")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
guard 'jessie' do
|
2
|
+
|
3
|
+
# Standard node project
|
4
|
+
watch(%r{^spec/.+(_spec|Spec)\.(js|coffee)$})
|
5
|
+
watch(%r{^lib/(.+)\.(js|coffee)$}) { |m| "spec/lib/#{m[1]}_spec.js" }
|
6
|
+
watch('spec/spec_helper.js') { "spec" }
|
7
|
+
|
8
|
+
# Typical Rails (version < 3.1) app
|
9
|
+
watch(%r{^spec/javascripts/.+(_spec|Spec)\.(js|coffee)$})
|
10
|
+
watch(%r{^public/javascripts/(.+)\.(js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.js" }
|
11
|
+
watch('spec/spec_helper.js') { "spec" }
|
12
|
+
|
13
|
+
# Typical Rails (version >= 3.1) app
|
14
|
+
watch(%r{^spec/javascripts/.+(_spec|Spec)\.(js|coffee)$})
|
15
|
+
# you'll want to make adjustments to the rule below if you don't use coffeescript in your tests ;)
|
16
|
+
watch(%r{^app/assets/javascripts/(.+)\.(js|coffee)$}) { |m| "spec/javascripts/#{m[1]}_spec.coffee" }
|
17
|
+
watch('spec/spec_helper.js') { "spec" }
|
18
|
+
end
|
19
|
+
|
data/lib/guard/jessie.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'guard'
|
2
|
+
require 'guard/guard'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class Jessie < Guard
|
6
|
+
autoload :VERSION, 'guard/jessie/version'
|
7
|
+
autoload :Runner, 'guard/jessie/runner'
|
8
|
+
|
9
|
+
def run_all
|
10
|
+
puts "Running all specs"
|
11
|
+
Runner.run %w[spec]
|
12
|
+
end
|
13
|
+
|
14
|
+
def run_on_change paths
|
15
|
+
paths_string = paths.map {|path| "#{path}" }.join(' ')
|
16
|
+
puts "Running #{paths_string}"
|
17
|
+
Runner.run paths
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
data/lib/guard-jessie.rb
ADDED
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Guard
|
3
|
+
class Jessie
|
4
|
+
describe Runner do
|
5
|
+
let(:multiple_paths) { %w[/spec ./spec/something.js ../spec/something_else.js other_thing.js]}
|
6
|
+
context "when passed an empty paths list" do
|
7
|
+
it "returns false" do
|
8
|
+
subject.run([]).should be_false
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context "when passed multiple paths" do
|
13
|
+
it "runs jessie with those paths" do
|
14
|
+
subject.should_receive(:system).with(
|
15
|
+
"jessie -f progress /spec ./spec/something.js ../spec/something_else.js other_thing.js"
|
16
|
+
)
|
17
|
+
subject.run(multiple_paths)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Guard
|
3
|
+
describe Jessie do
|
4
|
+
let(:paths) { %w[array of changed paths]}
|
5
|
+
|
6
|
+
describe "#run_all" do
|
7
|
+
it "runs all specs" do
|
8
|
+
Jessie::Runner.should_receive(:run).with(["spec"])
|
9
|
+
subject.run_all
|
10
|
+
end
|
11
|
+
end
|
12
|
+
describe "#run_on_change" do
|
13
|
+
it "runs changed files" do
|
14
|
+
Jessie::Runner.should_receive(:run).with(paths)
|
15
|
+
subject.run_on_change paths
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-jessie
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- "Micha\xC5\x82 Taszycki"
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-08-02 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: guard
|
17
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 0.4.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "1.0"
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: "2.6"
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: guard-bundler
|
50
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "0"
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: guard-rspec
|
61
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: "0"
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "0"
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *id006
|
81
|
+
description: Guard::Jessie automatically runs your jasmine specs through jessie driver
|
82
|
+
email:
|
83
|
+
- mtaszycki@gmail.com
|
84
|
+
executables: []
|
85
|
+
|
86
|
+
extensions: []
|
87
|
+
|
88
|
+
extra_rdoc_files: []
|
89
|
+
|
90
|
+
files:
|
91
|
+
- .gitignore
|
92
|
+
- CHANGELOG.md
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- guard-jessie.gemspec
|
98
|
+
- lib/guard-jessie.rb
|
99
|
+
- lib/guard/jessie.rb
|
100
|
+
- lib/guard/jessie/runner.rb
|
101
|
+
- lib/guard/jessie/templates/Guardfile
|
102
|
+
- lib/guard/jessie/version.rb
|
103
|
+
- spec/lib/guard/jessie/runner_spec.rb
|
104
|
+
- spec/lib/guard/jessie_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
homepage: https://github.com/mehowte/guard-jessie
|
107
|
+
licenses: []
|
108
|
+
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
|
112
|
+
require_paths:
|
113
|
+
- lib
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: -2584122660941300579
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
123
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: -2584122660941300579
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
132
|
+
requirements: []
|
133
|
+
|
134
|
+
rubyforge_project: guard-jessie
|
135
|
+
rubygems_version: 1.8.5
|
136
|
+
signing_key:
|
137
|
+
specification_version: 3
|
138
|
+
summary: Guard gem for jessie
|
139
|
+
test_files:
|
140
|
+
- spec/lib/guard/jessie/runner_spec.rb
|
141
|
+
- spec/lib/guard/jessie_spec.rb
|
142
|
+
- spec/spec_helper.rb
|