guard-jaspec 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +25 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +52 -0
- data/Rakefile +2 -0
- data/guard-jaspec.gemspec +26 -0
- data/lib/guard/jaspec.rb +40 -0
- data/lib/guard/jaspec/templates/Guardfile +4 -0
- data/lib/guard/jaspec/version.rb +5 -0
- metadata +109 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 343ce7d94135403b33f96b5480dd3e0652f16b26
|
4
|
+
data.tar.gz: e8595df09029e91132d11d23656080fa11b8b99d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a050a631d218a7fceb009d473e77370dd92c8e486d83f6317a86020a0cab235f17c9d1cabe69ca591591a1b4ee926441fa71f992c87668a5f9eee00837e646a0
|
7
|
+
data.tar.gz: eba30d0dcf369037656c9419cdcad37fb61e9c35cf48aa9ca81fd259d2d9c2535299a0daf805e5129f3c1c350dde9c82587766853a74868d2166e5d12932c233
|
data/.gitignore
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
*.swp
|
4
|
+
*.swo
|
5
|
+
*.DS_Store*
|
6
|
+
.bundle
|
7
|
+
.config
|
8
|
+
.yardoc
|
9
|
+
Gemfile.lock
|
10
|
+
InstalledFiles
|
11
|
+
_yardoc
|
12
|
+
coverage
|
13
|
+
doc/
|
14
|
+
lib/bundler/man
|
15
|
+
pkg
|
16
|
+
rdoc
|
17
|
+
spec/reports
|
18
|
+
test/tmp
|
19
|
+
test/version_tmp
|
20
|
+
tmp
|
21
|
+
*.bundle
|
22
|
+
*.so
|
23
|
+
*.o
|
24
|
+
*.a
|
25
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Kevin Gisi
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Guard::Jaspec [![Gem Version](https://badge.fury.io/rb/guard-jaspec.png)](http://badge.fury.io/rb/guard-jaspec)
|
2
|
+
|
3
|
+
Guard::Jaspec supports the automatic running of [Jaspec](https://github.com/gisikw/jaspec) JavaScript specs.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Please ensure you have [Guard](http://github.com/guard/guard) installed before you continue.
|
8
|
+
|
9
|
+
Add the following to your application's Gemfile:
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
gem 'guard-jaspec'
|
13
|
+
end
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Add Guard::Jaspec to your Guardfile by running:
|
20
|
+
|
21
|
+
$ guard init jaspec
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Please refer to the [Guard usage doc](http://github.com/guard/guard#readme)
|
26
|
+
|
27
|
+
## Example Guardfile
|
28
|
+
|
29
|
+
This is the default Guardfile configuration, and it assumes a Rails-like asset structure. If your JavaScript source files or specs are in different directories, you'll want to modify this. This configuration likewise assumes that you're using the same language (JavaScript or CoffeeScript) between your source files and specs.
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
guard :jaspec do
|
33
|
+
watch(%r{^spec/javascripts/(.\*)Spec\.(js|coffee)$})
|
34
|
+
watch(%r{^app/assets/javascripts/(.\*)\.(js|coffee)$}) { |m| "spec/javascripts/#{m[1]}Spec.#{m[2]}" }
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
## Options
|
39
|
+
|
40
|
+
### List of available options
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
all_on_start: false # run all specs on startup, default: true
|
44
|
+
```
|
45
|
+
|
46
|
+
## Contributing
|
47
|
+
|
48
|
+
1. Fork it ( https://github.com/gisikw/guard-jaspec/fork )
|
49
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
50
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
51
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
52
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'guard/jaspec/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "guard-jaspec"
|
8
|
+
spec.version = Guard::JaspecVersion::VERSION
|
9
|
+
spec.authors = ["Kevin Gisi"]
|
10
|
+
spec.email = ["kevin@kevingisi.com"]
|
11
|
+
spec.summary = %q{Guard plugin for Jaspec}
|
12
|
+
spec.homepage = "https://github.com/gisikw/guard-jaspec"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency 'guard', '~> 2.0'
|
21
|
+
spec.add_runtime_dependency 'jaspec', '~> 0.2'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
|
26
|
+
end
|
data/lib/guard/jaspec.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require "guard/jaspec/version"
|
2
|
+
require 'jaspec'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class Jaspec < Guard::Plugin
|
6
|
+
|
7
|
+
def initialize(options = {})
|
8
|
+
@safe_options = {
|
9
|
+
all_on_start: true
|
10
|
+
}.merge(options)
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
run_all if @safe_options[:all_on_start]
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_all
|
19
|
+
files = Guard::Watcher.match_files(self, Dir.glob('**{,/*/**}/*Spec.{js,coffee}'))
|
20
|
+
throw_on_failed_tests do
|
21
|
+
::Jaspec::Runner.run_all(files.compact.uniq.map{|f| File.expand_path(f)})
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def run_on_modifications(paths)
|
26
|
+
throw_on_failed_tests do
|
27
|
+
paths.compact.uniq.each do |p|
|
28
|
+
::Jaspec::Runner.run(File.expand_path(p))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def throw_on_failed_tests
|
36
|
+
throw :task_has_failed unless yield
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-jaspec
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kevin Gisi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: guard
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: jaspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.2'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description:
|
70
|
+
email:
|
71
|
+
- kevin@kevingisi.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- guard-jaspec.gemspec
|
82
|
+
- lib/guard/jaspec.rb
|
83
|
+
- lib/guard/jaspec/templates/Guardfile
|
84
|
+
- lib/guard/jaspec/version.rb
|
85
|
+
homepage: https://github.com/gisikw/guard-jaspec
|
86
|
+
licenses:
|
87
|
+
- MIT
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 2.2.2
|
106
|
+
signing_key:
|
107
|
+
specification_version: 4
|
108
|
+
summary: Guard plugin for Jaspec
|
109
|
+
test_files: []
|