guard-standardrb 0.2.1 → 0.2.3

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: 8f82e9fc56faf953f423f18d189996b83cadb6167fe8a2c4db3e74dbbe12dc07
4
- data.tar.gz: afc7c6d9f7597dc5f7e25abeacd71d22a4cbd85850a55aea17121cd7cc41eba0
3
+ metadata.gz: 1ed1c687e781beb4bd754c2cbd80d31e06adf8afb3ea4f5471db95c445c2b039
4
+ data.tar.gz: d06799a46ce0d2380b26a042803f257e8d938dc895d245e4155e160642449b20
5
5
  SHA512:
6
- metadata.gz: 54e8bc0ccc086fc1200842379cc7a260cb656d7a7797dc79d39da237be2f26c058d808402dc0e66d8a42c86718d0dd2239bd34dad826882e23a562f59beb2e10
7
- data.tar.gz: 6344b4daa4416e184e77d88d3d4f94caa97a8155536521183284b6977e41917a7d2de7872d148220748b0a644b2bc5febc758c9a0e3d74ed14ab872513de9f9b
6
+ metadata.gz: bc1debad4c52930323f939356d79b931751f74a3043bd4680e20584ddfdb5e23c2f45fbbb5b3ddd9b661473fd1059c9123e08ab461620865012f0d093e7fc2b9
7
+ data.tar.gz: 997225235fbacf735b814f9491ceafbcbc99a97f91b011b5ba0ea5fa1048bc88b8986aaa171829aec3c9cd6867a1d9edc5076a8042e274508d6e5e409de841da
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.2.1)
4
+ guard-standardrb (0.2.3)
5
5
  guard (>= 2.0.0)
6
6
  guard-compat (~> 1.0)
7
- standardrb
7
+ standard
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -12,80 +12,94 @@ GEM
12
12
  ast (2.4.2)
13
13
  byebug (11.1.3)
14
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)
15
+ diff-lcs (1.5.1)
16
+ ffi (1.16.3)
17
+ formatador (1.1.0)
18
+ guard (2.18.1)
19
19
  formatador (>= 0.2.4)
20
20
  listen (>= 2.7, < 4.0)
21
21
  lumberjack (>= 1.0.12, < 2.0)
22
22
  nenv (~> 0.1)
23
23
  notiffany (~> 0.0)
24
- pry (>= 0.9.12)
24
+ pry (>= 0.13.0)
25
25
  shellany (~> 0.0)
26
26
  thor (>= 0.18.1)
27
27
  guard-compat (1.2.1)
28
- listen (3.5.1)
28
+ json (2.7.1)
29
+ language_server-protocol (3.17.0.3)
30
+ lint_roller (1.1.0)
31
+ listen (3.9.0)
29
32
  rb-fsevent (~> 0.10, >= 0.10.3)
30
33
  rb-inotify (~> 0.9, >= 0.9.10)
31
- lumberjack (1.2.8)
34
+ lumberjack (1.2.10)
32
35
  method_source (1.0.0)
33
36
  nenv (0.3.0)
34
37
  notiffany (0.1.3)
35
38
  nenv (~> 0.1)
36
39
  shellany (~> 0.0)
37
- parallel (1.20.1)
38
- parser (3.0.1.1)
40
+ parallel (1.24.0)
41
+ parser (3.3.0.5)
39
42
  ast (~> 2.4.1)
40
- pry (0.13.1)
43
+ racc
44
+ pry (0.14.2)
41
45
  coderay (~> 1.1)
42
46
  method_source (~> 1.0)
43
- pry-byebug (3.9.0)
47
+ pry-byebug (3.10.1)
44
48
  byebug (~> 11.0)
45
- pry (~> 0.13.0)
46
- rainbow (3.0.0)
47
- rake (13.0.3)
48
- rb-fsevent (0.11.0)
49
+ pry (>= 0.13, < 0.15)
50
+ racc (1.7.3)
51
+ rainbow (3.1.1)
52
+ rake (13.1.0)
53
+ rb-fsevent (0.11.2)
49
54
  rb-inotify (0.10.1)
50
55
  ffi (~> 1.0)
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
+ regexp_parser (2.9.0)
57
+ rexml (3.2.6)
58
+ rspec (3.13.0)
59
+ rspec-core (~> 3.13.0)
60
+ rspec-expectations (~> 3.13.0)
61
+ rspec-mocks (~> 3.13.0)
62
+ rspec-core (3.13.0)
63
+ rspec-support (~> 3.13.0)
64
+ rspec-expectations (3.13.0)
60
65
  diff-lcs (>= 1.2.0, < 2.0)
61
- rspec-support (~> 3.10.0)
62
- rspec-mocks (3.10.2)
66
+ rspec-support (~> 3.13.0)
67
+ rspec-mocks (3.13.0)
63
68
  diff-lcs (>= 1.2.0, < 2.0)
64
- rspec-support (~> 3.10.0)
65
- rspec-support (3.10.2)
66
- rubocop (1.18.1)
69
+ rspec-support (~> 3.13.0)
70
+ rspec-support (3.13.1)
71
+ rubocop (1.62.1)
72
+ json (~> 2.3)
73
+ language_server-protocol (>= 3.17.0)
67
74
  parallel (~> 1.10)
68
- parser (>= 3.0.0.0)
75
+ parser (>= 3.3.0.2)
69
76
  rainbow (>= 2.2.2, < 4.0)
70
77
  regexp_parser (>= 1.8, < 3.0)
71
- rexml
72
- rubocop-ast (>= 1.7.0, < 2.0)
78
+ rexml (>= 3.2.5, < 4.0)
79
+ rubocop-ast (>= 1.31.1, < 2.0)
73
80
  ruby-progressbar (~> 1.7)
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)
81
+ unicode-display_width (>= 2.4.0, < 3.0)
82
+ rubocop-ast (1.31.2)
83
+ parser (>= 3.3.0.4)
84
+ rubocop-performance (1.20.2)
85
+ rubocop (>= 1.48.1, < 2.0)
86
+ rubocop-ast (>= 1.30.0, < 2.0)
87
+ ruby-progressbar (1.13.0)
81
88
  shellany (0.0.1)
82
- standard (1.1.3)
83
- rubocop (= 1.18.1)
84
- rubocop-performance (= 1.11.2)
85
- standardrb (1.0.0)
86
- standard
87
- thor (1.1.0)
88
- unicode-display_width (2.0.0)
89
+ standard (1.35.1)
90
+ language_server-protocol (~> 3.17.0.2)
91
+ lint_roller (~> 1.0)
92
+ rubocop (~> 1.62.0)
93
+ standard-custom (~> 1.0.0)
94
+ standard-performance (~> 1.3)
95
+ standard-custom (1.0.2)
96
+ lint_roller (~> 1.0)
97
+ rubocop (~> 1.50)
98
+ standard-performance (1.3.1)
99
+ lint_roller (~> 1.1)
100
+ rubocop-performance (~> 1.20.2)
101
+ thor (1.3.1)
102
+ unicode-display_width (2.5.0)
89
103
 
90
104
  PLATFORMS
91
105
  ruby
@@ -97,4 +111,4 @@ DEPENDENCIES
97
111
  rspec (~> 3.1)
98
112
 
99
113
  BUNDLED WITH
100
- 2.1.4
114
+ 2.4.10
data/README.md CHANGED
@@ -52,11 +52,21 @@ you can choose to activate or disable it.
52
52
  After the initilisation of the guard, jump into the GuardFile and you can modify the argument fix to be `true` or `false`
53
53
 
54
54
  ```
55
- guard :standardrb fix: false do
55
+ guard :standardrb, fix: false do
56
56
  ...
57
57
  end
58
58
  ```
59
59
 
60
+ ## Other options
61
+
62
+ Pass standardrb's ```--format progress``` option using ```progress: true``` and trigger inspection on startup using ```all_on_start: true```
63
+
64
+ ```
65
+ guard :standardrb, fix: false, all_on_start: true, progress: true do
66
+ ...
67
+ end
68
+ ```
69
+
60
70
  ## Development
61
71
 
62
72
  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.
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -1,15 +1,15 @@
1
- $LOAD_PATH.unshift('./lib', __FILE__)
2
- require 'guard/standardrb/version'
1
+ $LOAD_PATH.unshift("./lib", __FILE__)
2
+ require "guard/standardrb/version"
3
3
 
4
4
  Gem::Specification.new do |spec|
5
- spec.name = "guard-standardrb"
6
- spec.version = Guard::StandardrbVersion::VERSION
7
- spec.authors = ["Jody Vandenschrick"]
8
- spec.email = ["jody.vanden@gmail.com"]
5
+ spec.name = "guard-standardrb"
6
+ spec.version = Guard::StandardrbVersion::VERSION
7
+ spec.authors = ["Jody Vandenschrick"]
8
+ spec.email = ["jody.vanden@gmail.com"]
9
9
 
10
- spec.summary = %q{add a plugin to guard to work with standardrb.}
11
- spec.homepage = "https://github.com/JodyVanden/guard-standardrb"
12
- spec.license = "MIT"
10
+ spec.summary = "add a plugin to guard to work with standardrb."
11
+ spec.homepage = "https://github.com/JodyVanden/guard-standardrb"
12
+ spec.license = "MIT"
13
13
  # spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
14
14
 
15
15
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
@@ -18,20 +18,20 @@ 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_dependency 'guard', '>= 2.0.0'
22
- spec.add_dependency 'guard-compat', '~> 1.0'
23
- spec.add_dependency 'standardrb'
21
+ spec.add_dependency "guard", ">= 2.0.0"
22
+ spec.add_dependency "guard-compat", "~> 1.0"
23
+ spec.add_dependency "standard"
24
24
 
25
- spec.add_development_dependency 'rake'
26
- spec.add_development_dependency 'rspec', '~> 3.1'
27
- spec.add_development_dependency 'pry-byebug'
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec", "~> 3.1"
27
+ spec.add_development_dependency "pry-byebug"
28
28
 
29
29
  # Specify which files should be added to the gem when it is released.
30
30
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
31
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
32
32
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
33
  end
34
- spec.bindir = "exe"
35
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
+ spec.bindir = "exe"
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
36
  spec.require_paths = ["lib"]
37
37
  end
@@ -1,12 +1,8 @@
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
1
+ # guard :standardrb, fix: true, all_on_start: true do
5
2
  # UI.info 'StandardRb is initialized'
6
3
  # watch(/.+\.rb$/)
7
4
  # end
8
5
 
9
- guard :standardrb, fix: false do
10
- UI.info 'StandardRb is initialized'
6
+ guard :standardrb, fix: false, all_on_start: false, progress: false do
11
7
  watch(/.+\.rb$/)
12
8
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module StandardrbVersion
3
- VERSION = "0.2.1".freeze
3
+ VERSION = "0.2.3".freeze
4
4
  end
5
5
  end
@@ -1,33 +1,50 @@
1
- require "guard"
2
1
  require "guard/plugin"
3
2
  require "guard/standardrb/version"
4
3
 
5
4
  module Guard
6
5
  class Standardrb < Plugin
7
- attr_reader :fix
8
-
9
6
  def initialize(opts = {})
10
7
  super
11
- @fix = opts[:fix]
8
+
9
+ @options = {
10
+ fix: false,
11
+ all_on_start: false,
12
+ progress: false
13
+ }.merge(opts)
12
14
  end
13
15
 
14
16
  def start
15
- Guard::Compat::UI.info "Inspecting Ruby code style of all files with standardrb"
16
- Guard::Compat::UI.info "Standardrb --fix = #{fix}"
17
+ Guard::UI.info "Inspecting Ruby code style with standardrb"
18
+ Guard::UI.info "fix = #{@options[:fix]}," +
19
+ " all_on_start = #{@options[:all_on_start]}," +
20
+ " progress = #{@options[:progress]}"
21
+ run_all if @options[:all_on_start]
17
22
  end
18
23
 
19
- def run_on_modifications(res)
20
- Guard::Compat::UI.info "StandardRb a file was modified"
21
- inspect_with_standardrb(res)
24
+ def run_all
25
+ inspect_with_standardrb
26
+ end
22
27
 
23
- $stdout.puts res if res
28
+ def run_on_additions(paths)
29
+ Guard::UI.info "StandardRb a file was added"
30
+ inspect_with_standardrb(paths)
31
+ end
32
+
33
+ def run_on_modifications(paths)
34
+ Guard::UI.info "StandardRb a file was modified"
35
+ inspect_with_standardrb(paths)
36
+
37
+ $stdout.puts paths if paths
24
38
  end
25
39
 
26
40
  def inspect_with_standardrb(paths = [])
27
41
  args = ["bundle", "exec", "standardrb"]
28
- args << "--fix" if fix
42
+ args << "--fix" if @options[:fix]
43
+ args << ["--format", "progress"] if @options[:progress]
29
44
 
45
+ args.flatten!
30
46
  args += paths
47
+
31
48
  system(*args)
32
49
  end
33
50
  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.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jody Vandenschrick
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-01 00:00:00.000000000 Z
11
+ date: 2024-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: standardrb
42
+ name: standard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -94,7 +94,7 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
- description:
97
+ description:
98
98
  email:
99
99
  - jody.vanden@gmail.com
100
100
  executables: []
@@ -124,7 +124,7 @@ metadata:
124
124
  homepage_uri: https://github.com/JodyVanden/guard-standardrb
125
125
  source_code_uri: https://github.com/JodyVanden/guard-standardrb
126
126
  changelog_uri: https://github.com/JodyVanden/guard-standardrb
127
- post_install_message:
127
+ post_install_message:
128
128
  rdoc_options: []
129
129
  require_paths:
130
130
  - lib
@@ -139,8 +139,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.0.3
143
- signing_key:
142
+ rubygems_version: 3.5.6
143
+ signing_key:
144
144
  specification_version: 4
145
145
  summary: add a plugin to guard to work with standardrb.
146
146
  test_files: []