guard-standardrb 0.1.0.beta4 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a93e41eccda79ac0f698385bb182a7de5fb7117e1c94fea4fe93f9e5b0826e6
4
- data.tar.gz: 2b6087c303908e445d53db12975ac4ad961cee4b3b1842993b4b08a53e48423e
3
+ metadata.gz: dd45cab7d4cf2d0a20c696fd809ea26ddb2992aa42eed30c86369e95c035107c
4
+ data.tar.gz: 6664d9d33ef7647387d6ad377954e3a0b336034ca6a260ace6e5dd67b609c111
5
5
  SHA512:
6
- metadata.gz: 808d88c143566457a5701ef58386f7e30bbbc7c177656d5e61101c05d397b09e6a490c4a0a1df7e90b33b841a2ddbf6f86c8e6c865d6917d8517c18049b9c528
7
- data.tar.gz: a0a94d35f846f83620cc1a81e797bae3846633a5554f1f803d9f47348ab4318500b9d8567139ea30ef8bda18b55890d73a5984ce7c218dc5ce4739e2c4b651aa
6
+ metadata.gz: 94bd9ee1cc22faf5f31b0566185a3751c3d8a969cae55e5bfc72c50a25afd64d8c90b76aee4a59cb7214bd5b7054ff70f3ba12fc5f1973be4936b2e33e036eca
7
+ data.tar.gz: 0b56828f42d8ba6e0b6ac40eb5bb2fbe25cfce4a7aa21de4115674a1a5650477fc0bb50973b1a97a05412773eaa717628083a668e8e2003371a2b86ddc845189
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.1.0)
4
+ guard-standardrb (0.2.0)
5
5
  guard (>= 2.0.0)
6
6
  guard-compat (~> 1.0)
7
7
  standardrb
@@ -9,10 +9,11 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- ast (2.4.0)
13
- coderay (1.1.2)
12
+ ast (2.4.1)
13
+ byebug (11.1.3)
14
+ coderay (1.1.3)
14
15
  diff-lcs (1.3)
15
- ffi (1.12.2)
16
+ ffi (1.13.1)
16
17
  formatador (0.2.5)
17
18
  guard (2.16.2)
18
19
  formatador (>= 0.2.4)
@@ -24,27 +25,30 @@ 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
28
  listen (3.2.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.0)
39
- ast (~> 2.4.0)
37
+ parallel (1.19.2)
38
+ parser (2.7.2.0)
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
47
  rake (13.0.1)
45
- rb-fsevent (0.10.3)
48
+ rb-fsevent (0.10.4)
46
49
  rb-inotify (0.10.1)
47
50
  ffi (~> 1.0)
51
+ regexp_parser (1.8.1)
48
52
  rexml (3.2.4)
49
53
  rspec (3.9.0)
50
54
  rspec-core (~> 3.9.0)
@@ -59,33 +63,38 @@ GEM
59
63
  diff-lcs (>= 1.2.0, < 2.0)
60
64
  rspec-support (~> 3.9.0)
61
65
  rspec-support (3.9.2)
62
- rubocop (0.80.1)
63
- jaro_winkler (~> 1.5.1)
66
+ rubocop (0.92.0)
64
67
  parallel (~> 1.10)
65
- parser (>= 2.7.0.1)
68
+ parser (>= 2.7.1.5)
66
69
  rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.7)
67
71
  rexml
72
+ rubocop-ast (>= 0.5.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)
74
+ unicode-display_width (>= 1.4.0, < 2.0)
75
+ rubocop-ast (0.7.1)
76
+ parser (>= 2.7.1.5)
77
+ rubocop-performance (1.8.1)
78
+ rubocop (>= 0.87.0)
79
+ rubocop-ast (>= 0.4.0)
72
80
  ruby-progressbar (1.10.1)
73
81
  shellany (0.0.1)
74
- standard (0.2.3)
75
- rubocop (~> 0.80.1)
76
- rubocop-performance (~> 1.5.2)
82
+ standard (0.7)
83
+ rubocop (= 0.92)
84
+ rubocop-performance (= 1.8.1)
77
85
  standardrb (1.0.0)
78
86
  standard
79
87
  thor (1.0.1)
80
- unicode-display_width (1.6.1)
88
+ unicode-display_width (1.7.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
@@ -1,8 +1,20 @@
1
1
  # Guard::Standardrb
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/guard/standardrb`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to the new guard plugin `guard-standardrb`!
4
+ This guard is bases on the gem `standardrb`, you can find more information about it https://github.com/testdouble/standard
4
5
 
5
- TODO: Delete this and the text above, and describe your gem
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 errors in the terminal.
8
+
9
+ More Information about StandardRb:
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!
11
+
12
+ This gem saves you (and others!) time in three ways:
13
+
14
+ No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
15
+ Automatically format code. Just run standardrb --fix and say goodbye to messy or inconsistent code.
16
+ Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor.
17
+ Adopting Standard style means ranking the importance of code clarity and community conventions higher than personal style. This might not make sense for 100% of projects and development cultures, however open source can be a hostile place for newbies. Setting up clear, automated contributor expectations makes a project healthier.
6
18
 
7
19
  ## Installation
8
20
 
@@ -26,7 +38,24 @@ To add this guard plugin to your repo, run:
26
38
 
27
39
  ## Usage
28
40
 
29
- TODO: Write usage instructions here
41
+ Once you installed the gem on your repo and initialized it to be added to your GuardFile,
42
+ just run `bundle exec guard` and you should see a line `Standardrb initialized`.
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
+
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
+ ```
30
59
 
31
60
  ## Development
32
61
 
@@ -46,3 +75,11 @@ The gem is available as open source under the terms of the [MIT License](https:/
46
75
  ## Code of Conduct
47
76
 
48
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.beta4".freeze
3
+ VERSION = "0.2.0".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.beta4
4
+ version: 0.2.0
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-04-21 00:00:00.000000000 Z
11
+ date: 2020-10-08 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
@@ -93,12 +135,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
135
  version: '0'
94
136
  required_rubygems_version: !ruby/object:Gem::Requirement
95
137
  requirements:
96
- - - ">"
138
+ - - ">="
97
139
  - !ruby/object:Gem::Version
98
- version: 1.3.1
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: []