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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26ecfa4416543821e77400392111b8b48ca53c71
4
- data.tar.gz: 1d8655923580c184ad5c41e8d85b79de239f0cdb
3
+ metadata.gz: d042842dc0104f31c67b2843c4adcb50ba165160
4
+ data.tar.gz: 8d0810239a9b2b67e81eaab1524b04cb877d1c90
5
5
  SHA512:
6
- metadata.gz: b6352e7b2c82965635b820fa38ae8f27b725657fca749a97861eeaac8e46ac9d8c4bc3b69351f08f6ad5576578e87d3fb4b3625893c1691185ec2632734558de
7
- data.tar.gz: 46e942e94dab065cdfe1dbf288406c8c96b29bb0efc3e8de8bfb8e80c02e99e728679c495621b24228f75af3d0784ae5ba23a53873ecf8984cf201d38b23dbd1
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
- #`cp lib/default_config $HOME/.whatisquiz/config`
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
@@ -1,3 +1,3 @@
1
1
  module Whatisquiz
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whatisquiz
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - chakirin