Pickaxe 0.6.1 → 0.6.2

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.
@@ -18,7 +18,7 @@ end
18
18
  $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
19
19
 
20
20
  module Pickaxe
21
- VERSION = "0.6.1"
21
+ VERSION = "0.6.2"
22
22
 
23
23
  class PickaxeError < StandardError; end
24
24
 
@@ -43,8 +43,8 @@ END_OF_BANNER
43
43
  options[:syntax_check] = true
44
44
  end
45
45
 
46
- opts.on("--no-clear", "Turn off shell clearing") do |v|
47
- options[:no_clear] = true
46
+ opts.on("--clear", "Turn on shell clearing before question") do |v|
47
+ options[:clear] = true
48
48
  end
49
49
 
50
50
  opts.on("--no-color", "Turn off colors") do |v|
@@ -68,7 +68,8 @@ END_OF_TEST
68
68
  end
69
69
  rescue Interrupt
70
70
  # empty
71
- ensure
71
+ ensure
72
+ puts "#{@last_answer}\n\n"
72
73
  statistics!
73
74
  end
74
75
  end
@@ -133,11 +134,6 @@ END_OF_HELP
133
134
  @answers[@question] = convert_answers(line)
134
135
  unless Main.options[:full_test]
135
136
  @last_answer = @question.check?(@answers[@question])
136
-
137
- if @current_index == (@questions.length-1)
138
- puts @last_answer
139
- end
140
-
141
137
  if Main.options[:repeat_incorrect] and not @question.correct?(@answers[@question])
142
138
  @answers.delete(@question)
143
139
  @questions.insert(@current_index + 1 + rand(@questions.length - @current_index), @question)
@@ -13,7 +13,7 @@ module Pickaxe
13
13
  end
14
14
 
15
15
  def self.clear
16
- unless Pickaxe::WINDOWS_IT_IS or Main.options[:no_clear]
16
+ if not Pickaxe::WINDOWS_IT_IS and Main.options[:clear]
17
17
  print "\e[H\e[2J"
18
18
  end
19
19
  end
@@ -200,7 +200,7 @@ module Pickaxe
200
200
  else
201
201
  ""
202
202
  end
203
- "Incorrect, should be:".color(:red) + " #{correct_answers.join}! #{[missed, incorrect].join(" ")}"
203
+ "Incorrect, should be:".color(:red) + " #{correct_answers.join.color(:green)}! #{[missed, incorrect].join(" ")}"
204
204
  end
205
205
  end
206
206
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Pickaxe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 2
10
+ version: 0.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dawid Fatyga