guard-standardrb 0.1.0.beta2 → 0.2.0b

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: 985435e5bdd76921f98e77fb3c8b471bb07f5d55aa8a8133e9244788801eca56
4
- data.tar.gz: 291007f910d5a6d94c9902597705bbec7de416c28d48fb111785bd5722d0608d
3
+ metadata.gz: d093365f48f1ffdca857ed25348dc652a4603b02f94ebc651fc800d62d9284ea
4
+ data.tar.gz: 75eee534aeed90234a9698efd40ec9c12a0a85e6e1a9ef58ee8fdc535e8336a9
5
5
  SHA512:
6
- metadata.gz: d224b8340d8f61775030b53425721f2bb313e49577782ec345af6008c353061cdfaed108d16ce004a7798f27a27933953dcffb456c4bdfbb923d771cd464a7f8
7
- data.tar.gz: 798b449bc03c34550494b8e8567e7aa4a0198dede9c456b90cfc22a699e88c6520ea6a440b54014c94c115aba59e4bf00a52984242885c395364995d1adc9d7d
6
+ metadata.gz: 9b9a885f459b0e49a039d087bc05133af98dc8ca63ad07edd8ea789c3fd4b8da61948725cf308d919abffa1a8e01e1917801d701c279dfc68d23fbf189a13fae
7
+ data.tar.gz: 8cfbbce71a7891f200c44b866f6958c1732de718546240bc12b4eb4866e72e8f9d1aa6bfb21f8e2b49eb5819786bd50e7f4a0c5ebfabf9713dec700a6e464e25
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,17 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.1.0.beta1)
4
+ guard-standardrb (0.2.0)
5
5
  guard (>= 2.0.0)
6
+ guard-compat (~> 1.0)
6
7
  standardrb
7
8
 
8
9
  GEM
9
10
  remote: https://rubygems.org/
10
11
  specs:
11
- ast (2.4.0)
12
- coderay (1.1.2)
12
+ ast (2.4.1)
13
+ byebug (11.1.3)
14
+ coderay (1.1.3)
13
15
  diff-lcs (1.3)
14
- ffi (1.12.2)
16
+ ffi (1.13.1)
15
17
  formatador (0.2.5)
16
18
  guard (2.16.2)
17
19
  formatador (>= 0.2.4)
@@ -22,27 +24,31 @@ GEM
22
24
  pry (>= 0.9.12)
23
25
  shellany (~> 0.0)
24
26
  thor (>= 0.18.1)
25
- jaro_winkler (1.5.4)
27
+ guard-compat (1.2.1)
26
28
  listen (3.2.1)
27
29
  rb-fsevent (~> 0.10, >= 0.10.3)
28
30
  rb-inotify (~> 0.9, >= 0.9.10)
29
- lumberjack (1.2.4)
31
+ lumberjack (1.2.8)
30
32
  method_source (1.0.0)
31
33
  nenv (0.3.0)
32
34
  notiffany (0.1.3)
33
35
  nenv (~> 0.1)
34
36
  shellany (~> 0.0)
35
- parallel (1.19.1)
36
- parser (2.7.1.0)
37
- ast (~> 2.4.0)
37
+ parallel (1.19.2)
38
+ parser (2.7.1.4)
39
+ ast (~> 2.4.1)
38
40
  pry (0.13.1)
39
41
  coderay (~> 1.1)
40
42
  method_source (~> 1.0)
43
+ pry-byebug (3.9.0)
44
+ byebug (~> 11.0)
45
+ pry (~> 0.13.0)
41
46
  rainbow (3.0.0)
42
47
  rake (13.0.1)
43
- rb-fsevent (0.10.3)
48
+ rb-fsevent (0.10.4)
44
49
  rb-inotify (0.10.1)
45
50
  ffi (~> 1.0)
51
+ regexp_parser (1.7.1)
46
52
  rexml (3.2.4)
47
53
  rspec (3.9.0)
48
54
  rspec-core (~> 3.9.0)
@@ -57,34 +63,38 @@ GEM
57
63
  diff-lcs (>= 1.2.0, < 2.0)
58
64
  rspec-support (~> 3.9.0)
59
65
  rspec-support (3.9.2)
60
- rubocop (0.80.1)
61
- jaro_winkler (~> 1.5.1)
66
+ rubocop (0.91.0)
62
67
  parallel (~> 1.10)
63
- parser (>= 2.7.0.1)
68
+ parser (>= 2.7.1.1)
64
69
  rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.7)
65
71
  rexml
72
+ rubocop-ast (>= 0.4.0, < 1.0)
66
73
  ruby-progressbar (~> 1.7)
67
- unicode-display_width (>= 1.4.0, < 1.7)
68
- rubocop-performance (1.5.2)
69
- rubocop (>= 0.71.0)
74
+ unicode-display_width (>= 1.4.0, < 2.0)
75
+ rubocop-ast (0.4.2)
76
+ parser (>= 2.7.1.4)
77
+ rubocop-performance (1.8.1)
78
+ rubocop (>= 0.87.0)
79
+ rubocop-ast (>= 0.4.0)
70
80
  ruby-progressbar (1.10.1)
71
81
  shellany (0.0.1)
72
- standard (0.2.3)
73
- rubocop (~> 0.80.1)
74
- rubocop-performance (~> 1.5.2)
82
+ standard (0.6.1)
83
+ rubocop (~> 0.90)
84
+ rubocop-performance (~> 1.8.0)
75
85
  standardrb (1.0.0)
76
86
  standard
77
87
  thor (1.0.1)
78
- unicode-display_width (1.6.1)
88
+ unicode-display_width (1.7.0)
79
89
 
80
90
  PLATFORMS
81
91
  ruby
82
92
 
83
93
  DEPENDENCIES
84
- bundler (~> 2.1)
85
94
  guard-standardrb!
95
+ pry-byebug
86
96
  rake
87
97
  rspec (~> 3.1)
88
98
 
89
99
  BUNDLED WITH
90
- 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
 
@@ -20,9 +32,30 @@ Or install it yourself as:
20
32
 
21
33
  $ gem install guard-standardrb
22
34
 
35
+ To add this guard plugin to your repo, run:
36
+
37
+ $ bundle exec guard init standardrb
38
+
23
39
  ## Usage
24
40
 
25
- 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
+ ```
26
59
 
27
60
  ## Development
28
61
 
@@ -42,3 +75,11 @@ The gem is available as open source under the terms of the [MIT License](https:/
42
75
  ## Code of Conduct
43
76
 
44
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")
@@ -18,12 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.metadata["source_code_uri"] = "https://github.com/JodyVanden/guard-standardrb"
19
19
  spec.metadata["changelog_uri"] = "https://github.com/JodyVanden/guard-standardrb"
20
20
 
21
- spec.add_runtime_dependency 'guard', '>= 2.0.0'
22
- spec.add_runtime_dependency 'standardrb'
21
+ spec.add_dependency 'guard', '>= 2.0.0'
22
+ spec.add_dependency 'guard-compat', '~> 1.0'
23
+ spec.add_dependency 'standardrb'
23
24
 
24
- spec.add_development_dependency 'bundler', '~> 2.1'
25
- spec.add_development_dependency 'rake', '~> 10.0'
26
- spec.add_development_dependency 'rspec', '~> 3.0'
25
+ spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec', '~> 3.1'
27
+ spec.add_development_dependency 'pry-byebug'
27
28
 
28
29
  # Specify which files should be added to the gem when it is released.
29
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -1,49 +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
- attr_reader :options
10
-
11
- def initialize(options = {})
9
+ def initialize(opts = {})
12
10
  super
13
-
14
- @options = {
15
- all_on_start: false,
16
- fix: false,
17
- }.merge(options)
18
-
11
+ @fix = opts[:fix]
19
12
  end
20
13
 
21
14
  def start
22
- run_all if @options[:all_on_start]
23
- end
24
-
25
- def run_all
26
- UI.info 'Inspecting Ruby code style of all files with standardrb'
27
- system("bundle exec standardrb")
15
+ Guard::Compat::UI.info "Inspecting Ruby code style of all files with standardrb"
16
+ Guard::Compat::UI.info "Standardrb --fix = #{fix}"
28
17
  end
29
18
 
30
19
  def run_on_modifications(res)
31
- UI.info 'StandardRb a file was modified'
32
- options[fix] ? inspect_standardrb_fix(res) : inspect_standardrb(res)
20
+ Guard::Compat::UI.info "StandardRb a file was modified"
21
+ inspect_with_standardrb(res)
33
22
 
34
23
  $stdout.puts res if res
35
24
  end
36
25
 
37
- def inspect_standardrb(paths = [])
38
- paths.each do |path|
39
- system("bundle exec standardrb #{path}")
40
- end
41
- end
26
+ def inspect_with_standardrb(paths = [])
27
+ args = ["bundle", "exec", "standardrb"]
28
+ args << "--fix" if fix
42
29
 
43
- def inspect_standardrb_fix(paths = [])
44
- paths.each do |path|
45
- system("bundle exec standardrb --fix #{path}")
46
- end
30
+ args += paths
31
+ system(*args)
47
32
  end
48
33
  end
49
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.beta2".freeze
3
+ VERSION = "0.2.0b".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.beta2
4
+ version: 0.2.0b
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-15 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
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: guard-compat
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: standardrb
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -39,47 +53,47 @@ dependencies:
39
53
  - !ruby/object:Gem::Version
40
54
  version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: bundler
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '2.1'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '2.1'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
- name: rake
70
+ name: rspec
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - "~>"
60
74
  - !ruby/object:Gem::Version
61
- version: '10.0'
75
+ version: '3.1'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
- version: '10.0'
82
+ version: '3.1'
69
83
  - !ruby/object:Gem::Dependency
70
- name: rspec
84
+ name: pry-byebug
71
85
  requirement: !ruby/object:Gem::Requirement
72
86
  requirements:
73
- - - "~>"
87
+ - - ">="
74
88
  - !ruby/object:Gem::Version
75
- version: '3.0'
89
+ version: '0'
76
90
  type: :development
77
91
  prerelease: false
78
92
  version_requirements: !ruby/object:Gem::Requirement
79
93
  requirements:
80
- - - "~>"
94
+ - - ">="
81
95
  - !ruby/object:Gem::Version
82
- version: '3.0'
96
+ version: '0'
83
97
  description:
84
98
  email:
85
99
  - jody.vanden@gmail.com
@@ -125,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
139
  - !ruby/object:Gem::Version
126
140
  version: 1.3.1
127
141
  requirements: []
128
- rubygems_version: 3.1.2
142
+ rubygems_version: 3.0.3
129
143
  signing_key:
130
144
  specification_version: 4
131
- summary: add a plugin to gard to work with standardrb.
145
+ summary: add a plugin to guard to work with standardrb.
132
146
  test_files: []