git-semver-cop 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/git-semver-cop/semver.rb +4 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2b9d994d7c3dc9f0605d651dec3f345295b6cc9
4
- data.tar.gz: cc2900d13274be1c014a4139b341fe930664d8fe
3
+ metadata.gz: 736f1724f7bf5e8cbda82eb020ce86958ee02c5c
4
+ data.tar.gz: 750a3ba967c8ef320bd62f791306abdd961844f2
5
5
  SHA512:
6
- metadata.gz: dcd09cdd5b75770dd1d027d4c7ef64cc51a8be2feca5eaf5c0479501b596be0eb98fd32cae3c83dba56cb63f88bf7c78ee2c1c79291d041069ccbcc8a9fed162
7
- data.tar.gz: 1be54368ad4d4814106d5ab62d9d9fa2e2a3645b57fb4dea58aa104d3c9279acfd95267986841450c013ac58b98ee935066de7b3b02f9ded98cd139366c92e27
6
+ metadata.gz: c5085e21a6cfec811774fc168b32c5db9cce87cef2f89aacd90318102cab3ea854ee326390a1924d8f692fa972e481b6e225338521f130f48165b7801c070a79
7
+ data.tar.gz: 06bebc4b285683f02629b9a0e56b9d340606ff959f04b2e928f7f757fda9bdeb25081b29335bb7c3e9a1482fb72a40ea047c32eece5bdcb92ba5ef8a3240a0db
@@ -22,9 +22,11 @@ module GitSemverCop
22
22
  end
23
23
 
24
24
  def ask_increment
25
- puts "How big of an increment is this?\n[#{inc_opts.join('|')}]"
25
+ puts "How big of an increment is this? (semver: M.m.p)\n"\
26
+ "[n] none (default)\n[p] patch\n[m] minor\n[M] Major"
26
27
  inc = gets.chomp
27
- inc_opts.include?(inc) ? semver_inc(inc) : exit(0)
28
+ val = %w(none patch minor Major).find { |v| v =~ /^#{inc[0]}/ }
29
+ val == "none" ? exit(0) : semver_inc(val)
28
30
  end
29
31
 
30
32
  # #
@@ -43,12 +45,6 @@ module GitSemverCop
43
45
 
44
46
  private
45
47
 
46
- # #
47
- # Valid increment options
48
- def inc_opts
49
- %w(patch minor major none)
50
- end
51
-
52
48
  # #
53
49
  # Command line operations
54
50
  def add_to_git
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-semver-cop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Farah
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: semver2