Pickaxe 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pickaxe.rb +1 -1
- data/lib/pickaxe/test.rb +5 -5
- metadata +3 -3
data/lib/pickaxe.rb
CHANGED
data/lib/pickaxe/test.rb
CHANGED
@@ -15,7 +15,7 @@ module Pickaxe
|
|
15
15
|
include Enumerable
|
16
16
|
|
17
17
|
# Ruby-comments and C-comments
|
18
|
-
COMMENTS_RE = /^\s
|
18
|
+
COMMENTS_RE = /^\s*#.*|^\/\/.*|^;.*/
|
19
19
|
|
20
20
|
def initialize(*files)
|
21
21
|
@files = files.collect do |file_or_directory|
|
@@ -108,7 +108,7 @@ module Pickaxe
|
|
108
108
|
content << answers.shift
|
109
109
|
end
|
110
110
|
|
111
|
-
raise
|
111
|
+
raise MissingContent.new(answers.first.index) if content.blank?
|
112
112
|
raise BadQuestion.new(content.first) unless m = RE.match(content.first)
|
113
113
|
raise MissingAnswers.new(content.first) if answers.blank?
|
114
114
|
|
@@ -180,9 +180,9 @@ module Pickaxe
|
|
180
180
|
if correct?(given)
|
181
181
|
"Correct!".color(:green)
|
182
182
|
else
|
183
|
-
hit = "
|
184
|
-
missed = "
|
185
|
-
incorrect = "
|
183
|
+
hit = "#{(given & correct_answers).join}".color(:green)
|
184
|
+
missed = "#{(correct_answers - given).join}".color(:yellow)
|
185
|
+
incorrect = "#{(given - correct_answers).join}".color(:red)
|
186
186
|
"Incorrect, should be: #{correct_answers.join}! #{hit} #{missed} #{incorrect}"
|
187
187
|
end
|
188
188
|
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 5
|
10
|
+
version: 0.5.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dawid Fatyga
|