guard-standardrb 0.1.1 → 0.2.2

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: 03ab395c9a951dbb9ef428667cdc0464bd46565688422d6d4068acd8664da705
4
- data.tar.gz: 91fc5b06daabf12f370687611fafe5b5918173c9637a417d3749ea762a07f8b7
3
+ metadata.gz: c897dc6d6aa3c984e75b17e7a987aaae0990fec0bb9cfbfc4a9f4606a835c2f1
4
+ data.tar.gz: 6ef8f151a6327681ed24ffcc340a7476baa8a0c4a069e171684dc08d1e14c64f
5
5
  SHA512:
6
- metadata.gz: d24e1f6e15fc5d6e8472e90e14862ad4b164dcf0d36b2eb9c3512c87255489aa1a2c6c788aad763e58635b80c261244ddeb834fd7b1606442a720fc5e71948ce
7
- data.tar.gz: 8a9d9b13968634f7894afa9bda2f65daae632b6bea4aa350d1e1d1a2b6c066c85466ce3ebc43becb62b669ee78b90e04d12804a8332451627c248a7b2e929843
6
+ metadata.gz: 92426f8a40c227b7996e0157b47edab405dd54832c7eb653e90526d968917ce2f240a83f7ec78c844aaddccf6b9113d97abf9742d839d76ac7d2b8db69febd5a
7
+ data.tar.gz: 5ae20664553ebce9ae1c43aad01ea284c4e234c8675cf3bd645d40020afce4f27e429870377fb5e538500bc346c1062ad60c84ad1aff694c9a100a780291735e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.1.0)
4
+ guard-standardrb (0.2.2)
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.1)
12
+ ast (2.4.2)
13
+ byebug (11.1.3)
13
14
  coderay (1.1.3)
14
- diff-lcs (1.3)
15
- ffi (1.13.1)
16
- formatador (0.2.5)
17
- guard (2.16.2)
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,71 +25,76 @@ GEM
24
25
  shellany (~> 0.0)
25
26
  thor (>= 0.18.1)
26
27
  guard-compat (1.2.1)
27
- listen (3.2.1)
28
+ listen (3.5.1)
28
29
  rb-fsevent (~> 0.10, >= 0.10.3)
29
30
  rb-inotify (~> 0.9, >= 0.9.10)
30
- lumberjack (1.2.5)
31
+ lumberjack (1.2.8)
31
32
  method_source (1.0.0)
32
33
  nenv (0.3.0)
33
34
  notiffany (0.1.3)
34
35
  nenv (~> 0.1)
35
36
  shellany (~> 0.0)
36
- parallel (1.19.2)
37
- parser (2.7.1.3)
38
- ast (~> 2.4.0)
37
+ parallel (1.20.1)
38
+ parser (3.0.1.1)
39
+ ast (~> 2.4.1)
39
40
  pry (0.13.1)
40
41
  coderay (~> 1.1)
41
42
  method_source (~> 1.0)
43
+ pry-byebug (3.9.0)
44
+ byebug (~> 11.0)
45
+ pry (~> 0.13.0)
42
46
  rainbow (3.0.0)
43
- rake (13.0.1)
44
- rb-fsevent (0.10.4)
47
+ rake (13.0.3)
48
+ rb-fsevent (0.11.0)
45
49
  rb-inotify (0.10.1)
46
50
  ffi (~> 1.0)
47
- regexp_parser (1.7.1)
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.85.1)
64
+ rspec-support (~> 3.10.0)
65
+ rspec-support (3.10.2)
66
+ rubocop (1.18.1)
63
67
  parallel (~> 1.10)
64
- parser (>= 2.7.0.1)
68
+ parser (>= 3.0.0.0)
65
69
  rainbow (>= 2.2.2, < 4.0)
66
- regexp_parser (>= 1.7)
70
+ regexp_parser (>= 1.8, < 3.0)
67
71
  rexml
68
- rubocop-ast (>= 0.0.3)
72
+ rubocop-ast (>= 1.7.0, < 2.0)
69
73
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (>= 1.4.0, < 2.0)
71
- rubocop-ast (0.0.3)
72
- parser (>= 2.7.0.1)
73
- rubocop-performance (1.6.1)
74
- rubocop (>= 0.71.0)
75
- 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)
76
81
  shellany (0.0.1)
77
- standard (0.4.7)
78
- rubocop (~> 0.85.0)
79
- rubocop-performance (~> 1.6.0)
82
+ standard (1.1.3)
83
+ rubocop (= 1.18.1)
84
+ rubocop-performance (= 1.11.2)
80
85
  standardrb (1.0.0)
81
86
  standard
82
- thor (1.0.1)
83
- unicode-display_width (1.7.0)
87
+ thor (1.1.0)
88
+ unicode-display_width (2.0.0)
84
89
 
85
90
  PLATFORMS
86
91
  ruby
87
92
 
88
93
  DEPENDENCIES
89
94
  guard-standardrb!
95
+ pry-byebug
90
96
  rake
91
97
  rspec (~> 3.1)
92
98
 
93
99
  BUNDLED WITH
94
- 2.1.4
100
+ 2.2.14
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,31 @@ 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
+
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
+
45
70
  ## Development
46
71
 
47
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.
@@ -60,3 +85,11 @@ The gem is available as open source under the terms of the [MIT License](https:/
60
85
  ## Code of Conduct
61
86
 
62
87
  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).
88
+
89
+ ### Author
90
+
91
+ [Jody Vandenschrick](https://github.com/JodyVanden) ([@jodyvanden](https://twitter.com/jodyvanden))
92
+
93
+ ### Contributors
94
+
95
+ [https://github.com/JodyVanden/guard-standardrb/graphs/contributors](https://github.com/JodyVanden/guard-standardrb/graphs/contributors)
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'
24
-
25
- spec.add_development_dependency 'rake'
26
- spec.add_development_dependency 'rspec', '~> 3.1'
21
+ spec.add_dependency "guard", ">= 2.0.0"
22
+ spec.add_dependency "guard-compat", "~> 1.0"
23
+ spec.add_dependency "standardrb"
27
24
 
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,29 +1,51 @@
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
- def initialize(options = {})
6
+ def initialize(opts = {})
8
7
  super
9
- @options = options
8
+
9
+ @options = {
10
+ fix: false,
11
+ all_on_start: false,
12
+ progress: false
13
+ }.merge(opts)
10
14
  end
11
15
 
12
16
  def start
13
- Guard::Compat::UI.info "Inspecting Ruby code style of all files with standardrb"
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]
14
22
  end
15
23
 
16
- def run_on_modifications(res)
17
- Guard::Compat::UI.info "StandardRb a file was modified"
18
- inspect_with_standardrb(res)
24
+ def run_all
25
+ inspect_with_standardrb
26
+ end
19
27
 
20
- $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
21
38
  end
22
39
 
23
40
  def inspect_with_standardrb(paths = [])
24
- paths.each do |path|
25
- system("bundle exec standardrb #{path}")
26
- end
41
+ args = ["bundle", "exec", "standardrb"]
42
+ args << "--fix" if @options[:fix]
43
+ args << ["--format", "progress"] if @options[:progress]
44
+
45
+ args.flatten!
46
+ args += paths
47
+
48
+ system(*args)
27
49
  end
28
50
  end
29
51
  end
@@ -1,7 +1,8 @@
1
- # Add files and commands to this file, like the example:
2
- # watch(%r{file/path}) { `command(s)` }
3
- #
4
- guard :standardrb do
5
- UI.info 'StandardRb is initialized'
1
+ # guard :standardrb, fix: true, all_on_start: true do
2
+ # UI.info 'StandardRb is initialized'
3
+ # watch(/.+\.rb$/)
4
+ # end
5
+
6
+ guard :standardrb, fix: false, all_on_start: false, progress: false do
6
7
  watch(/.+\.rb$/)
7
8
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module StandardrbVersion
3
- VERSION = "0.1.1".freeze
3
+ VERSION = "0.2.2".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.1
4
+ version: 0.2.2
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-07-05 00:00:00.000000000 Z
11
+ date: 2021-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
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'
83
97
  description:
84
98
  email:
85
99
  - jody.vanden@gmail.com