guard-railsbp 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +26 -0
- data/guard-railsbp.gemspec +22 -0
- data/lib/guard/railsbp.rb +64 -0
- data/lib/guard/railsbp/templates/Guardfile +3 -0
- data/lib/guard/railsbp/version.rb +11 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 06e02460e0a9ac3aadfcdf7e9989d78e9ba500b4
|
4
|
+
data.tar.gz: bd9134355cba0695d9b669457b4b18d044b9a821
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 754444920d2d106686e7b9e5ac248cffa9e7601016020624849c8a84704c386dcf9d359428358e35812867466cb6762d11cf4668a6f7bba0c76e68983ab9bb6b
|
7
|
+
data.tar.gz: 7649a6c7441e62a5da71ceaba70bcc3028856f9d86dd82838cc1f6ffde688f472ccdc339533ef58fb7552b7a75ce6a8fc53f5a300f1fc0eff5115ae9c7db7e46
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 anger
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# Guard::Railsbp
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'guard-railsbp'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install guard-railsbp
|
18
|
+
|
19
|
+
## Contributing
|
20
|
+
|
21
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/andreygerasimchuk/guard-railsbp.
|
22
|
+
|
23
|
+
|
24
|
+
## License
|
25
|
+
|
26
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'guard/railsbp/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'guard-railsbp'
|
8
|
+
spec.version = Guard::RailsBPVersion
|
9
|
+
spec.authors = ['Andrey Gerasimchuk']
|
10
|
+
spec.email = ['andrey.gerasimchuk@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = %q{Guard plugin for Rails Best Practices}
|
13
|
+
spec.description = %q{Guard plugin for Rails Best Practices}
|
14
|
+
spec.homepage = 'https://github.com/andreygerasimchuk/guard-railsbp'
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(.idea|test|spec|features)/}) }
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_dependency 'guard-compat', '~> 1.1'
|
21
|
+
spec.add_dependency 'rails_best_practices', '~> 1.15'
|
22
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require 'guard/compat/plugin'
|
2
|
+
require 'guard/railsbp/version'
|
3
|
+
|
4
|
+
module Guard
|
5
|
+
class RailsBP < Plugin
|
6
|
+
|
7
|
+
def initialize(options)
|
8
|
+
super(default_options.merge!(options))
|
9
|
+
end
|
10
|
+
|
11
|
+
def start
|
12
|
+
run_railsbp if options[:run_on_start]
|
13
|
+
end
|
14
|
+
|
15
|
+
def stop
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
def reload
|
20
|
+
run_railsbp
|
21
|
+
end
|
22
|
+
|
23
|
+
def run_all
|
24
|
+
run_railsbp
|
25
|
+
end
|
26
|
+
|
27
|
+
def run_on_changes(_)
|
28
|
+
run_railsbp
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def run_railsbp
|
34
|
+
UI.info "Running Rails Best Practices"
|
35
|
+
|
36
|
+
args = options.map do |key, value|
|
37
|
+
case key
|
38
|
+
when :run_on_start, :notify
|
39
|
+
when :exclude
|
40
|
+
"--exclude #{value}"
|
41
|
+
else
|
42
|
+
"--#{key}" if value
|
43
|
+
end
|
44
|
+
end.compact.join(' ')
|
45
|
+
|
46
|
+
result = system("rails_best_practices #{args}")
|
47
|
+
::Guard::Notifier.notify('Rails Best Practices run has failed!', image: :failed) if options[:notify] && !result
|
48
|
+
|
49
|
+
result
|
50
|
+
end
|
51
|
+
|
52
|
+
def default_options
|
53
|
+
{
|
54
|
+
run_on_start: true,
|
55
|
+
silent: false,
|
56
|
+
vendor: false,
|
57
|
+
spec: false,
|
58
|
+
test: false,
|
59
|
+
features: false,
|
60
|
+
notify: true
|
61
|
+
}
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-railsbp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrey Gerasimchuk
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: guard-compat
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails_best_practices
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.15'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.15'
|
41
|
+
description: Guard plugin for Rails Best Practices
|
42
|
+
email:
|
43
|
+
- andrey.gerasimchuk@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- guard-railsbp.gemspec
|
53
|
+
- lib/guard/railsbp.rb
|
54
|
+
- lib/guard/railsbp/templates/Guardfile
|
55
|
+
- lib/guard/railsbp/version.rb
|
56
|
+
homepage: https://github.com/andreygerasimchuk/guard-railsbp
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.4.7
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: Guard plugin for Rails Best Practices
|
80
|
+
test_files: []
|