guard-standardrb 0.2.1 → 0.2.2
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 +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +11 -1
- data/Rakefile +1 -1
- data/guard-standardrb.gemspec +18 -18
- data/lib/guard/standardrb.rb +28 -11
- data/lib/guard/standardrb/templates/GuardFile +2 -6
- data/lib/guard/standardrb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c897dc6d6aa3c984e75b17e7a987aaae0990fec0bb9cfbfc4a9f4606a835c2f1
|
4
|
+
data.tar.gz: 6ef8f151a6327681ed24ffcc340a7476baa8a0c4a069e171684dc08d1e14c64f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92426f8a40c227b7996e0157b47edab405dd54832c7eb653e90526d968917ce2f240a83f7ec78c844aaddccf6b9113d97abf9742d839d76ac7d2b8db69febd5a
|
7
|
+
data.tar.gz: 5ae20664553ebce9ae1c43aad01ea284c4e234c8675cf3bd645d40020afce4f27e429870377fb5e538500bc346c1062ad60c84ad1aff694c9a100a780291735e
|
data/Gemfile.lock
CHANGED
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
data/guard-standardrb.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
$LOAD_PATH.unshift(
|
2
|
-
require
|
1
|
+
$LOAD_PATH.unshift("./lib", __FILE__)
|
2
|
+
require "guard/standardrb/version"
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
|
-
spec.name
|
6
|
-
spec.version
|
7
|
-
spec.authors
|
8
|
-
spec.email
|
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
|
11
|
-
spec.homepage
|
12
|
-
spec.license
|
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
|
22
|
-
spec.add_dependency
|
23
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency "guard", ">= 2.0.0"
|
22
|
+
spec.add_dependency "guard-compat", "~> 1.0"
|
23
|
+
spec.add_dependency "standardrb"
|
24
24
|
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency
|
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
|
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
|
35
|
-
spec.executables
|
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
|
data/lib/guard/standardrb.rb
CHANGED
@@ -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
|
-
|
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::
|
16
|
-
Guard::
|
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
|
20
|
-
|
21
|
-
|
24
|
+
def run_all
|
25
|
+
inspect_with_standardrb
|
26
|
+
end
|
22
27
|
|
23
|
-
|
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
|
@@ -1,12 +1,8 @@
|
|
1
|
-
#
|
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
|
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.
|
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: 2021-07-
|
11
|
+
date: 2021-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|