scholar-rename 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/selector.rb +13 -11
  3. data/lib/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e27d3e44a1bddc2e9ab5793621a7a94efd5a7522
4
- data.tar.gz: 65f9047532d668e9086e47698113f9c9b3687f7a
3
+ metadata.gz: 671790e8a6ff56bc33739664f6f5de8511907fb7
4
+ data.tar.gz: 1d8574b63b6316588c1d0c9c893ac32ac30e005a
5
5
  SHA512:
6
- metadata.gz: e7830b3bdf202a9b6ec4679cff9c0f515f4096c05e16a8ee02143412b9f8012640b4da89fbcb6c4a4edae9af81ddbfcf7b96c760ce455c5f9f22e8145bd76dc1
7
- data.tar.gz: 62ff378fa3577e2d8e3b5b2b05bd1c67a087f7af19d2f0247cada4b6d82d5b865338c48ec7b3bc368e4839a68aca1efa73df2546966af92457c7af579142a515
6
+ metadata.gz: e202dcda47aa6550ac1b3b40afb90f31b70fe9e9f4576712e445ed7d184bb85f5e6fa91158ae377532e03377ee311eecf6e86a95b21ca918cc7b443c841e9ba9
7
+ data.tar.gz: 48d1c58f96ae16502a1141da1c03e70878c1f2e1f268a3c8f21121b5b332fcdff41f5e25fb335988e21726ac0c48ce0cec288f6906b0eb0acf6fe8f27e6d94a8
data/lib/selector.rb CHANGED
@@ -41,8 +41,8 @@ class Selector
41
41
  if @format
42
42
  @title = gen_forms(year, title, author).first
43
43
  else
44
- puts "Select desired title:".bow
45
- @title = choose(gen_forms year, title, author)
44
+ puts "Select desired title:".bow
45
+ @title = choose(gen_forms year, title, author)
46
46
  end
47
47
  end
48
48
 
@@ -52,15 +52,17 @@ class Selector
52
52
  # the users input as a range or integer, but seems to be working for now.
53
53
  # requires you to check for an array and join it on the downside though
54
54
  def choose(options, print: true)
55
- options.each_with_index {|l, i| puts "#{i}\t#{l}" } if print
56
- printf "[0 - #{options.length-1}]: ".bow
57
- line = STDIN.gets.chomp
58
- meta = "options[#{line}]"
59
- mout = eval meta # in theory terrible but this aint a rails app............
60
- if mout.is_a? (Array)
61
- mout.join ' '
62
- else
63
- mout
55
+ if options.length > 0
56
+ options.each_with_index {|l, i| puts "#{i}\t#{l}" } if print
57
+ printf "[0 - #{options.length-1}]: ".bow
58
+ line = STDIN.gets.chomp || 0
59
+ meta = "options[#{line}]"
60
+ mout = eval meta # in theory terrible but this aint a rails app............
61
+ if mout.is_a? (Array)
62
+ mout.join ' '
63
+ else
64
+ mout
65
+ end
64
66
  end
65
67
  end
66
68
 
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SR
2
- Version = "0.2.1"
2
+ Version = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scholar-rename
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Warner