guard-standardrb 0.1.0.beta1 → 0.1.0.beta2

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: 2f8b842a018f3f640006b6cda9e6cd59f10b6aaf53af9633f5cea5dd0ff41e7a
4
- data.tar.gz: e78abdd134e88b8dbbcfcd01ef44b2c887060a25fc03f9680a92cdc097d5ee29
3
+ metadata.gz: 985435e5bdd76921f98e77fb3c8b471bb07f5d55aa8a8133e9244788801eca56
4
+ data.tar.gz: 291007f910d5a6d94c9902597705bbec7de416c28d48fb111785bd5722d0608d
5
5
  SHA512:
6
- metadata.gz: cfa0a137c37fabb7aa83f8851d0a5a301fab40715341094eaa790aeeb4c11e0af3c7daa316d0d002f691c4f74ea64678ca0e0049de742f0256492a6d67d0a500
7
- data.tar.gz: d26ed8bee9e66c2aad26baa6e848b4fc32ed69f5bf94061ec63465ed9e89832dde0c7ad7e444ac0a94395d19c3a2e43abdc413f1be494bdee0cce78191aa28ad
6
+ metadata.gz: d224b8340d8f61775030b53425721f2bb313e49577782ec345af6008c353061cdfaed108d16ce004a7798f27a27933953dcffb456c4bdfbb923d771cd464a7f8
7
+ data.tar.gz: 798b449bc03c34550494b8e8567e7aa4a0198dede9c456b90cfc22a699e88c6520ea6a440b54014c94c115aba59e4bf00a52984242885c395364995d1adc9d7d
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- guard-standardrb (0.1.0)
4
+ guard-standardrb (0.1.0.beta1)
5
5
  guard (>= 2.0.0)
6
- guard-compat (~> 1.0)
7
6
  standardrb
8
7
 
9
8
  GEM
@@ -23,7 +22,6 @@ GEM
23
22
  pry (>= 0.9.12)
24
23
  shellany (~> 0.0)
25
24
  thor (>= 0.18.1)
26
- guard-compat (1.2.1)
27
25
  jaro_winkler (1.5.4)
28
26
  listen (3.2.1)
29
27
  rb-fsevent (~> 0.10, >= 0.10.3)
@@ -83,6 +81,7 @@ PLATFORMS
83
81
  ruby
84
82
 
85
83
  DEPENDENCIES
84
+ bundler (~> 2.1)
86
85
  guard-standardrb!
87
86
  rake
88
87
  rspec (~> 3.1)
@@ -18,9 +18,12 @@ 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_runtime_dependency 'guard', '>= 2.0.0'
22
+ spec.add_runtime_dependency 'standardrb'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 2.1'
25
+ spec.add_development_dependency 'rake', '~> 10.0'
26
+ spec.add_development_dependency 'rspec', '~> 3.0'
24
27
 
25
28
  # Specify which files should be added to the gem when it is released.
26
29
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -2,6 +2,6 @@
2
2
  # watch(%r{file/path}) { `command(s)` }
3
3
  #
4
4
  guard :standardrb do
5
- UI.info 'StandardRb is initilialized'
6
- watch(/(.*).txt/) {|m| `tail #{m[0]}` }
5
+ UI.info 'StandardRb is initialized'
6
+ watch(/.+\.rb$/)
7
7
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module StandardrbVersion
3
- VERSION = "0.1.0.beta1".freeze
3
+ VERSION = "0.1.0.beta2".freeze
4
4
  end
5
5
  end
@@ -6,24 +6,44 @@ require 'guard/plugin'
6
6
  module Guard
7
7
  class Standardrb < Plugin
8
8
 
9
+ attr_reader :options
10
+
11
+ def initialize(options = {})
12
+ super
13
+
14
+ @options = {
15
+ all_on_start: false,
16
+ fix: false,
17
+ }.merge(options)
18
+
19
+ end
20
+
9
21
  def start
10
- UI.info 'Inspecting Ruby code style of all files with standardrb'
22
+ run_all if @options[:all_on_start]
11
23
  end
12
24
 
13
- def stop
25
+ def run_all
26
+ UI.info 'Inspecting Ruby code style of all files with standardrb'
27
+ system("bundle exec standardrb")
14
28
  end
15
29
 
16
30
  def run_on_modifications(res)
17
31
  UI.info 'StandardRb a file was modified'
18
- inspect_with_standardrb(res)
32
+ options[fix] ? inspect_standardrb_fix(res) : inspect_standardrb(res)
19
33
 
20
34
  $stdout.puts res if res
21
35
  end
22
36
 
23
- def inspect_with_standardrb(paths = [])
37
+ def inspect_standardrb(paths = [])
24
38
  paths.each do |path|
25
39
  system("bundle exec standardrb #{path}")
26
40
  end
27
41
  end
42
+
43
+ def inspect_standardrb_fix(paths = [])
44
+ paths.each do |path|
45
+ system("bundle exec standardrb --fix #{path}")
46
+ end
47
+ end
28
48
  end
29
49
  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.beta1
4
+ version: 0.1.0.beta2
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-14 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -25,33 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: guard-compat
28
+ name: standardrb
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.0'
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '2.1'
48
+ type: :development
49
+ prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.0'
54
+ version: '2.1'
41
55
  - !ruby/object:Gem::Dependency
42
- name: standardrb
56
+ name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - ">="
59
+ - - "~>"
46
60
  - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
61
+ version: '10.0'
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: '0'
68
+ version: '10.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.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.0'
55
83
  description:
56
84
  email:
57
85
  - jody.vanden@gmail.com