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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12579cf3a887dedc2f77576057ad6798c666cc4caf6f27fc29b5d0211cae3b08
4
- data.tar.gz: 866e54fe4a37a61bc48b2242aa284504fb7a5e673ca6b5f0d609d21e8cf5502c
3
+ metadata.gz: 8f82e9fc56faf953f423f18d189996b83cadb6167fe8a2c4db3e74dbbe12dc07
4
+ data.tar.gz: afc7c6d9f7597dc5f7e25abeacd71d22a4cbd85850a55aea17121cd7cc41eba0
5
5
  SHA512:
6
- metadata.gz: 94415c6863f8d68d2dd62462d345c457b7252c8a4896c4104eeb745295b163b277772a7d8e2afab48f342ce7b6d53d4292c968096611f628c81bbefbb6116331
7
- data.tar.gz: 43aa19629c15c16141930d22aec892315a759cc2a7501225ba54d8a9b0b911ce7621f8a560822ac81cd908d6cc4162e01409da2ceadd040e0b8e0a85b63e2e51
6
+ metadata.gz: 54e8bc0ccc086fc1200842379cc7a260cb656d7a7797dc79d39da237be2f26c058d808402dc0e66d8a42c86718d0dd2239bd34dad826882e23a562f59beb2e10
7
+ data.tar.gz: 6344b4daa4416e184e77d88d3d4f94caa97a8155536521183284b6977e41917a7d2de7872d148220748b0a644b2bc5febc758c9a0e3d74ed14ab872513de9f9b
data/Gemfile CHANGED
@@ -2,8 +2,3 @@ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in guard-standardrb.gemspec
4
4
  gemspec
5
-
6
- group :development, :test do
7
- gem 'rake'
8
- gem 'rspec', '~> 3.1'
9
- end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.1.0.beta4)
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.0)
13
- coderay (1.1.2)
14
- diff-lcs (1.3)
15
- ffi (1.12.2)
16
- formatador (0.2.5)
17
- guard (2.16.2)
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
- jaro_winkler (1.5.4)
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.4)
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.19.1)
38
- parser (2.7.1.1)
39
- ast (~> 2.4.0)
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.1)
45
- rb-fsevent (0.10.3)
47
+ rake (13.0.3)
48
+ rb-fsevent (0.11.0)
46
49
  rb-inotify (0.10.1)
47
50
  ffi (~> 1.0)
48
- rexml (3.2.4)
49
- rspec (3.9.0)
50
- rspec-core (~> 3.9.0)
51
- rspec-expectations (~> 3.9.0)
52
- rspec-mocks (~> 3.9.0)
53
- rspec-core (3.9.1)
54
- rspec-support (~> 3.9.1)
55
- rspec-expectations (3.9.1)
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.9.0)
58
- rspec-mocks (3.9.1)
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.9.0)
61
- rspec-support (3.9.2)
62
- rubocop (0.80.1)
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 (>= 2.7.0.1)
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, < 1.7)
70
- rubocop-performance (1.5.2)
71
- rubocop (>= 0.71.0)
72
- ruby-progressbar (1.10.1)
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 (0.2.4)
75
- rubocop (~> 0.80.1)
76
- rubocop-performance (~> 1.5.2)
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.1)
80
- unicode-display_width (1.6.1)
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.0
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 erros
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)
@@ -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 gard to work with standardrb.}
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
@@ -1,29 +1,34 @@
1
- # coding: utf-8
2
-
3
- require 'guard'
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 start
10
- UI.info 'Inspecting Ruby code style of all files with standardrb'
9
+ def initialize(opts = {})
10
+ super
11
+ @fix = opts[:fix]
11
12
  end
12
13
 
13
- def stop
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 'StandardRb a file was modified'
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
- paths.each do |path|
25
- system("bundle exec standardrb #{path}")
26
- end
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
- # Add files and commands to this file, like the example:
2
- # watch(%r{file/path}) { `command(s)` }
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
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module StandardrbVersion
3
- VERSION = "0.1.0".freeze
3
+ VERSION = "0.2.1".freeze
4
4
  end
5
5
  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.0
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: 2020-05-01 00:00:00.000000000 Z
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.1.2
142
+ rubygems_version: 3.0.3
101
143
  signing_key:
102
144
  specification_version: 4
103
- summary: add a plugin to gard to work with standardrb.
145
+ summary: add a plugin to guard to work with standardrb.
104
146
  test_files: []