gfobh_scorer 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gfobh_scorer/scorer.rb +5 -1
- data/lib/gfobh_scorer/version.rb +1 -1
- data/spec/lib/scorer_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c6bf7fdc737608006d6b5c277a38d9efce5114
|
4
|
+
data.tar.gz: 78e0e5402de54a20cd539fe619ef4d32f0665070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d26a599093a24c9e0f669cbf6c3d92568446bea65a4ac7f1b9c8ead83fb235fd12d453df57235835ed6903af3989e68fe04b5778e0aaa9a47ceaab0761a9292e
|
7
|
+
data.tar.gz: d38085ae6e3db361ebf83f6a5099473070129556167c649993ecc407582c67afccc4f6b9fbbf23dde1421f647be12ca508f07762a84893246010e3df1c04f4bb
|
data/lib/gfobh_scorer/scorer.rb
CHANGED
@@ -47,7 +47,11 @@ module GfobhScorer
|
|
47
47
|
start = Time.now
|
48
48
|
log("running #{current_example_script} #{seed}")
|
49
49
|
ret = begin
|
50
|
-
|
50
|
+
val = case seed
|
51
|
+
when Hash, Array then JSON.unparse(seed)
|
52
|
+
else seed.to_s
|
53
|
+
end
|
54
|
+
`#{current_example_script} '#{val.gsub("'","\'")}'`
|
51
55
|
rescue Errno::ENOENT
|
52
56
|
log("#{current_example_script} does not exist")
|
53
57
|
"" # blank output is considered a failure
|
data/lib/gfobh_scorer/version.rb
CHANGED
data/spec/lib/scorer_spec.rb
CHANGED
@@ -82,7 +82,7 @@ describe GfobhScorer::Scorer do
|
|
82
82
|
.with(make_url(nil, 'http://foo.bar/baz'), headers)
|
83
83
|
.and_yield(response1)
|
84
84
|
expect(subject).to receive(:`)
|
85
|
-
.with('/path/to/example seed-for-problem-1')
|
85
|
+
.with('/path/to/example \'seed-for-problem-1\'')
|
86
86
|
.and_return('answer-for-problem-1')
|
87
87
|
expect(RestClient).to receive(:get)
|
88
88
|
.with(
|
@@ -107,7 +107,7 @@ describe GfobhScorer::Scorer do
|
|
107
107
|
allow(stderr).to receive(:puts)
|
108
108
|
|
109
109
|
allow(subject).to receive(:`)
|
110
|
-
.with('./bin/example_1 seed-for-problem-1')
|
110
|
+
.with('./bin/example_1 \'seed-for-problem-1\'')
|
111
111
|
.and_return('answer-for-problem-1')
|
112
112
|
end
|
113
113
|
|
@@ -141,7 +141,7 @@ describe GfobhScorer::Scorer do
|
|
141
141
|
describe 'with a correct second answer' do
|
142
142
|
before do
|
143
143
|
allow(subject).to receive(:`)
|
144
|
-
.with('./bin/example_2 seed-for-problem-2')
|
144
|
+
.with('./bin/example_2 \'seed-for-problem-2\'')
|
145
145
|
.and_return('answer-for-problem-2')
|
146
146
|
end
|
147
147
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gfobh_scorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Langevin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|