guard-standardrb 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -5
- data/Gemfile.lock +49 -40
- data/README.md +24 -1
- data/guard-standardrb.gemspec +5 -1
- data/lib/guard/standardrb.rb +16 -11
- data/lib/guard/standardrb/templates/GuardFile +9 -4
- data/lib/guard/standardrb/version.rb +1 -1
- metadata +46 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f82e9fc56faf953f423f18d189996b83cadb6167fe8a2c4db3e74dbbe12dc07
|
4
|
+
data.tar.gz: afc7c6d9f7597dc5f7e25abeacd71d22a4cbd85850a55aea17121cd7cc41eba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54e8bc0ccc086fc1200842379cc7a260cb656d7a7797dc79d39da237be2f26c058d808402dc0e66d8a42c86718d0dd2239bd34dad826882e23a562f59beb2e10
|
7
|
+
data.tar.gz: 6344b4daa4416e184e77d88d3d4f94caa97a8155536521183284b6977e41917a7d2de7872d148220748b0a644b2bc5febc758c9a0e3d74ed14ab872513de9f9b
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
guard-standardrb (0.1
|
4
|
+
guard-standardrb (0.2.1)
|
5
5
|
guard (>= 2.0.0)
|
6
6
|
guard-compat (~> 1.0)
|
7
7
|
standardrb
|
@@ -9,12 +9,13 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ast (2.4.
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
ast (2.4.2)
|
13
|
+
byebug (11.1.3)
|
14
|
+
coderay (1.1.3)
|
15
|
+
diff-lcs (1.4.4)
|
16
|
+
ffi (1.15.3)
|
17
|
+
formatador (0.3.0)
|
18
|
+
guard (2.17.0)
|
18
19
|
formatador (>= 0.2.4)
|
19
20
|
listen (>= 2.7, < 4.0)
|
20
21
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -24,68 +25,76 @@ GEM
|
|
24
25
|
shellany (~> 0.0)
|
25
26
|
thor (>= 0.18.1)
|
26
27
|
guard-compat (1.2.1)
|
27
|
-
|
28
|
-
listen (3.2.1)
|
28
|
+
listen (3.5.1)
|
29
29
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
30
30
|
rb-inotify (~> 0.9, >= 0.9.10)
|
31
|
-
lumberjack (1.2.
|
31
|
+
lumberjack (1.2.8)
|
32
32
|
method_source (1.0.0)
|
33
33
|
nenv (0.3.0)
|
34
34
|
notiffany (0.1.3)
|
35
35
|
nenv (~> 0.1)
|
36
36
|
shellany (~> 0.0)
|
37
|
-
parallel (1.
|
38
|
-
parser (
|
39
|
-
ast (~> 2.4.
|
37
|
+
parallel (1.20.1)
|
38
|
+
parser (3.0.1.1)
|
39
|
+
ast (~> 2.4.1)
|
40
40
|
pry (0.13.1)
|
41
41
|
coderay (~> 1.1)
|
42
42
|
method_source (~> 1.0)
|
43
|
+
pry-byebug (3.9.0)
|
44
|
+
byebug (~> 11.0)
|
45
|
+
pry (~> 0.13.0)
|
43
46
|
rainbow (3.0.0)
|
44
|
-
rake (13.0.
|
45
|
-
rb-fsevent (0.
|
47
|
+
rake (13.0.3)
|
48
|
+
rb-fsevent (0.11.0)
|
46
49
|
rb-inotify (0.10.1)
|
47
50
|
ffi (~> 1.0)
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
rspec-
|
52
|
-
rspec-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
regexp_parser (2.1.1)
|
52
|
+
rexml (3.2.5)
|
53
|
+
rspec (3.10.0)
|
54
|
+
rspec-core (~> 3.10.0)
|
55
|
+
rspec-expectations (~> 3.10.0)
|
56
|
+
rspec-mocks (~> 3.10.0)
|
57
|
+
rspec-core (3.10.1)
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-expectations (3.10.1)
|
56
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
-
rspec-support (~> 3.
|
58
|
-
rspec-mocks (3.
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-mocks (3.10.2)
|
59
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
60
|
-
rspec-support (~> 3.
|
61
|
-
rspec-support (3.
|
62
|
-
rubocop (
|
63
|
-
jaro_winkler (~> 1.5.1)
|
64
|
+
rspec-support (~> 3.10.0)
|
65
|
+
rspec-support (3.10.2)
|
66
|
+
rubocop (1.18.1)
|
64
67
|
parallel (~> 1.10)
|
65
|
-
parser (>=
|
68
|
+
parser (>= 3.0.0.0)
|
66
69
|
rainbow (>= 2.2.2, < 4.0)
|
70
|
+
regexp_parser (>= 1.8, < 3.0)
|
67
71
|
rexml
|
72
|
+
rubocop-ast (>= 1.7.0, < 2.0)
|
68
73
|
ruby-progressbar (~> 1.7)
|
69
|
-
unicode-display_width (>= 1.4.0, <
|
70
|
-
rubocop-
|
71
|
-
|
72
|
-
|
74
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
75
|
+
rubocop-ast (1.7.0)
|
76
|
+
parser (>= 3.0.1.1)
|
77
|
+
rubocop-performance (1.11.2)
|
78
|
+
rubocop (>= 1.7.0, < 2.0)
|
79
|
+
rubocop-ast (>= 0.4.0)
|
80
|
+
ruby-progressbar (1.11.0)
|
73
81
|
shellany (0.0.1)
|
74
|
-
standard (
|
75
|
-
rubocop (
|
76
|
-
rubocop-performance (
|
82
|
+
standard (1.1.3)
|
83
|
+
rubocop (= 1.18.1)
|
84
|
+
rubocop-performance (= 1.11.2)
|
77
85
|
standardrb (1.0.0)
|
78
86
|
standard
|
79
|
-
thor (1.0
|
80
|
-
unicode-display_width (
|
87
|
+
thor (1.1.0)
|
88
|
+
unicode-display_width (2.0.0)
|
81
89
|
|
82
90
|
PLATFORMS
|
83
91
|
ruby
|
84
92
|
|
85
93
|
DEPENDENCIES
|
86
94
|
guard-standardrb!
|
95
|
+
pry-byebug
|
87
96
|
rake
|
88
97
|
rspec (~> 3.1)
|
89
98
|
|
90
99
|
BUNDLED WITH
|
91
|
-
2.1.
|
100
|
+
2.1.4
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ Welcome to the new guard plugin `guard-standardrb`!
|
|
4
4
|
This guard is bases on the gem `standardrb`, you can find more information about it https://github.com/testdouble/standard
|
5
5
|
|
6
6
|
StandardRB is essentially a wrapper on top of RuboCop, but enforce code convention without much configuration possible.
|
7
|
-
This plugin will run with your guard while you modify your code and output any code conventions
|
7
|
+
This plugin will run with your guard while you modify your code and output any code conventions errors in the terminal.
|
8
8
|
|
9
9
|
More Information about StandardRb:
|
10
10
|
The beauty of Ruby Standard Style is that it's simple. No one wants to maintain multiple hundred-line style configuration files for every module/project they work on. Enough of this madness!
|
@@ -42,6 +42,21 @@ Once you installed the gem on your repo and initialized it to be added to your G
|
|
42
42
|
just run `bundle exec guard` and you should see a line `Standardrb initialized`.
|
43
43
|
This means that the guard will run on all files that will be modified by that point in time and output the erros.
|
44
44
|
|
45
|
+
Please read [Guard usage doc](https://github.com/guard/guard#readme).
|
46
|
+
|
47
|
+
## Add the argument fix
|
48
|
+
|
49
|
+
with the release of the version `0.2.0` the gem gets the possibility to auto fix standardrb errors that could be easily fixed.
|
50
|
+
you can choose to activate or disable it.
|
51
|
+
|
52
|
+
After the initilisation of the guard, jump into the GuardFile and you can modify the argument fix to be `true` or `false`
|
53
|
+
|
54
|
+
```
|
55
|
+
guard :standardrb fix: false do
|
56
|
+
...
|
57
|
+
end
|
58
|
+
```
|
59
|
+
|
45
60
|
## Development
|
46
61
|
|
47
62
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -60,3 +75,11 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
60
75
|
## Code of Conduct
|
61
76
|
|
62
77
|
Everyone interacting in the Guard::Standardrb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/guard-standardrb/blob/master/CODE_OF_CONDUCT.md).
|
78
|
+
|
79
|
+
### Author
|
80
|
+
|
81
|
+
[Jody Vandenschrick](https://github.com/JodyVanden) ([@jodyvanden](https://twitter.com/jodyvanden))
|
82
|
+
|
83
|
+
### Contributors
|
84
|
+
|
85
|
+
[https://github.com/JodyVanden/guard-standardrb/graphs/contributors](https://github.com/JodyVanden/guard-standardrb/graphs/contributors)
|
data/guard-standardrb.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.authors = ["Jody Vandenschrick"]
|
8
8
|
spec.email = ["jody.vanden@gmail.com"]
|
9
9
|
|
10
|
-
spec.summary = %q{add a plugin to
|
10
|
+
spec.summary = %q{add a plugin to guard to work with standardrb.}
|
11
11
|
spec.homepage = "https://github.com/JodyVanden/guard-standardrb"
|
12
12
|
spec.license = "MIT"
|
13
13
|
# spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
@@ -22,6 +22,10 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_dependency 'guard-compat', '~> 1.0'
|
23
23
|
spec.add_dependency 'standardrb'
|
24
24
|
|
25
|
+
spec.add_development_dependency 'rake'
|
26
|
+
spec.add_development_dependency 'rspec', '~> 3.1'
|
27
|
+
spec.add_development_dependency 'pry-byebug'
|
28
|
+
|
25
29
|
# Specify which files should be added to the gem when it is released.
|
26
30
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
27
31
|
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
data/lib/guard/standardrb.rb
CHANGED
@@ -1,29 +1,34 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require
|
4
|
-
require 'guard/plugin'
|
1
|
+
require "guard"
|
2
|
+
require "guard/plugin"
|
3
|
+
require "guard/standardrb/version"
|
5
4
|
|
6
5
|
module Guard
|
7
6
|
class Standardrb < Plugin
|
7
|
+
attr_reader :fix
|
8
8
|
|
9
|
-
def
|
10
|
-
|
9
|
+
def initialize(opts = {})
|
10
|
+
super
|
11
|
+
@fix = opts[:fix]
|
11
12
|
end
|
12
13
|
|
13
|
-
def
|
14
|
+
def start
|
15
|
+
Guard::Compat::UI.info "Inspecting Ruby code style of all files with standardrb"
|
16
|
+
Guard::Compat::UI.info "Standardrb --fix = #{fix}"
|
14
17
|
end
|
15
18
|
|
16
19
|
def run_on_modifications(res)
|
17
|
-
UI.info
|
20
|
+
Guard::Compat::UI.info "StandardRb a file was modified"
|
18
21
|
inspect_with_standardrb(res)
|
19
22
|
|
20
23
|
$stdout.puts res if res
|
21
24
|
end
|
22
25
|
|
23
26
|
def inspect_with_standardrb(paths = [])
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
args = ["bundle", "exec", "standardrb"]
|
28
|
+
args << "--fix" if fix
|
29
|
+
|
30
|
+
args += paths
|
31
|
+
system(*args)
|
27
32
|
end
|
28
33
|
end
|
29
34
|
end
|
@@ -1,7 +1,12 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
|
4
|
-
guard :standardrb do
|
1
|
+
# You can choose to pass an option to the guard-standardrb plugin
|
2
|
+
# to fix easy issues
|
3
|
+
|
4
|
+
# guard :standardrb, fix: true do
|
5
|
+
# UI.info 'StandardRb is initialized'
|
6
|
+
# watch(/.+\.rb$/)
|
7
|
+
# end
|
8
|
+
|
9
|
+
guard :standardrb, fix: false do
|
5
10
|
UI.info 'StandardRb is initialized'
|
6
11
|
watch(/.+\.rb$/)
|
7
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-standardrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jody Vandenschrick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -52,6 +52,48 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
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
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.1'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.1'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
55
97
|
description:
|
56
98
|
email:
|
57
99
|
- jody.vanden@gmail.com
|
@@ -97,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
139
|
- !ruby/object:Gem::Version
|
98
140
|
version: '0'
|
99
141
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
142
|
+
rubygems_version: 3.0.3
|
101
143
|
signing_key:
|
102
144
|
specification_version: 4
|
103
|
-
summary: add a plugin to
|
145
|
+
summary: add a plugin to guard to work with standardrb.
|
104
146
|
test_files: []
|