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.
- checksums.yaml +4 -4
- data/lib/selector.rb +13 -11
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 671790e8a6ff56bc33739664f6f5de8511907fb7
|
4
|
+
data.tar.gz: 1d8574b63b6316588c1d0c9c893ac32ac30e005a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
45
|
-
|
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.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
mout.
|
62
|
-
|
63
|
-
|
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