whatisquiz 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/whatisquiz +22 -3
- data/lib/whatisquiz/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: d042842dc0104f31c67b2843c4adcb50ba165160
|
|
4
|
+
data.tar.gz: 8d0810239a9b2b67e81eaab1524b04cb877d1c90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 25479796b0b12d9b6e92f74b44e4620c757731ed6de65b18a100b85b7924825ec81201dd2a2602bf73ba5ff3bfda5b6444be6857ee43c95ff886e70a77759684
|
|
7
|
+
data.tar.gz: 0675a220444296bd14c02bf784df28b55d1850d461959b1f4dffc7fbaa87f2817bba520388a741d71b132a0c60d47834affe061b5058db5e057aea6c598f7bd2
|
data/bin/whatisquiz
CHANGED
|
@@ -35,6 +35,27 @@ $helpstr=<<EOF
|
|
|
35
35
|
| help: show commands |
|
|
36
36
|
*-----------------------------------*
|
|
37
37
|
EOF
|
|
38
|
+
$default_config=<<EOF
|
|
39
|
+
## this is config file.
|
|
40
|
+
# you can change your bin path, prompt, prompt color.
|
|
41
|
+
|
|
42
|
+
## PATH is used for creating quiz database
|
|
43
|
+
## it can create your own quiz.
|
|
44
|
+
## shell like syntax
|
|
45
|
+
## ex) setpath '/bin:/usr/bin'
|
|
46
|
+
setpath '/bin'
|
|
47
|
+
|
|
48
|
+
## you can change the prompt
|
|
49
|
+
## ex) setprompt 'you> '
|
|
50
|
+
setprompt '$ '
|
|
51
|
+
|
|
52
|
+
## you can change the color(red, blue, green, yellow, magenta, cyan, white)
|
|
53
|
+
## ex) setcolor 'prompt', 'red'
|
|
54
|
+
## ex) setcolor 'great', 'blue'
|
|
55
|
+
setcolor 'prompt', 'white'
|
|
56
|
+
setcolor 'great', 'red'
|
|
57
|
+
setcolor 'miss', 'blue'
|
|
58
|
+
EOF
|
|
38
59
|
$config = Reader.new
|
|
39
60
|
def create_dict
|
|
40
61
|
commands = Array.new
|
|
@@ -60,7 +81,6 @@ def repl
|
|
|
60
81
|
CSV.foreach($DB_PATH) do |row|
|
|
61
82
|
db << row
|
|
62
83
|
end
|
|
63
|
-
puts db.size
|
|
64
84
|
while true
|
|
65
85
|
randarr = (0..File.read($DB_PATH).count("\n")-1).to_a.shuffle!
|
|
66
86
|
puts $design
|
|
@@ -108,8 +128,7 @@ def conf_init
|
|
|
108
128
|
if Dir.glob($CONFIG_PATH).empty?
|
|
109
129
|
FileUtils.mkdir_p($HOME + '/.whatisquiz')
|
|
110
130
|
puts 'generating config file...'
|
|
111
|
-
|
|
112
|
-
FileUtils.cp "lib/default_config", $HOME + "/.whatisquiz/config"
|
|
131
|
+
File.write($CONFIG_PATH, $default_config)
|
|
113
132
|
else
|
|
114
133
|
$config.instance_eval File.read($CONFIG_PATH), $CONFIG_PATH
|
|
115
134
|
end
|
data/lib/whatisquiz/version.rb
CHANGED