rubocop-extension-generator 0.2.2 → 0.2.3

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: 02d60bc8930a959e217cd3cd4e52b9ed878604ada711a9dbf446b7808a9eda64
4
- data.tar.gz: 20954cca8f4b43194d7f4b2d792db63487fcfb7c918803383e36c059bd64d416
3
+ metadata.gz: 493a33fb15b6f6a243d2341c7e2a481c13a5c0e2d52e9b565a5b395747cc8906
4
+ data.tar.gz: 941e29fef38cd1ef2dd9a088e1decadeb80517afbb0b48007bb96c254c976bc1
5
5
  SHA512:
6
- metadata.gz: 5c5f3866dd59d11f94aa389a914cc7093cbbf0b0052e1f917685596c98de5677d7b0207a4d34007b399391348c14b3bcdeebf85538fda8bb5dcf256cdcf8752f
7
- data.tar.gz: 7cbfff705bb6d5e33727e4e1330049adf6028fe5951ec5e269e0d72a28491d4f88fcf1a1c917adeae8abdf18ff8790c1414258d1523acf7f638fb20db0143129
6
+ metadata.gz: c58446442375acabe73542045e9a85340802261cfd4cfce0326c628c195b9be7df7b5c940e9ad129f1f888f3e94911dccf64ca2dfb7364245305158f70153860
7
+ data.tar.gz: ebbcdab4a7048d35d17072c39f2d2ed05046c1cf36e17f5d48271074585a4447177e8097c3cc4a84df64430fd24e077c0e4ab2d79aa43c6a38178ef3e0fb1aec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # master (unreleased)
2
2
 
3
+ # v0.2.3
4
+
5
+ * [#7](https://github.com/rubocop-hq/rubocop-extension-generator/pull/7): Improve CLI
6
+
3
7
  # v0.2.2
4
8
 
5
9
  * [#5](https://github.com/rubocop-hq/rubocop-extension-generator/pull/5): Add `require: false` to sample code in README
@@ -4,6 +4,8 @@ module RuboCop
4
4
  class CLI
5
5
  BANNER = <<~TEXT
6
6
  Usage: rubocop-extension-generator NAME
7
+
8
+ The NAME must start with rubocop-, like rubocop-rspec.
7
9
  TEXT
8
10
 
9
11
  def self.run(argv)
@@ -17,13 +19,20 @@ module RuboCop
17
19
  def run
18
20
  # For --help
19
21
  opt = OptionParser.new(BANNER)
22
+ opt.version = VERSION
20
23
  args = opt.parse(@argv)
21
24
 
22
25
  name = args.first
23
- raise "It must be named `rubocop-*`. For example: rubocop-rspec" unless name.match?(/\Arubocop-\w+\z/)
26
+ fail!(opt) unless name
27
+ fail!(opt) unless name.match?(/\Arubocop-\w+\z/)
24
28
 
25
29
  Generator.new(name).generate
26
30
  end
31
+
32
+ private def fail!(opt)
33
+ puts opt.help
34
+ exit 1
35
+ end
27
36
  end
28
37
  end
29
38
  end
@@ -1,7 +1,7 @@
1
1
  module RuboCop
2
2
  module Extension
3
3
  module Generator
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-extension-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masataka Pocke Kuwabara
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler