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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 080e26edf9074f022c3bd6612767c60f5bab2afd
4
- data.tar.gz: cc72592bb673faf93e3b0fc7dc989e238b4afbf8
3
+ metadata.gz: b4c6bf7fdc737608006d6b5c277a38d9efce5114
4
+ data.tar.gz: 78e0e5402de54a20cd539fe619ef4d32f0665070
5
5
  SHA512:
6
- metadata.gz: 5a2dde201e4cb2ca82a1736e7b0b5d5cc1147c74661320571b458b340ae0bf96c6d112431fb9852f413ab5736172e60b73ee06fd38ce84166607446ef157021f
7
- data.tar.gz: 3ad564bfccebc15bf0e88b324935b12529733eb4a5cd838830567c4602130b92c36d6549631e24ec017e9f4e77c3aad9821c00346d8dc56afd85fb1b957804e2
6
+ metadata.gz: d26a599093a24c9e0f669cbf6c3d92568446bea65a4ac7f1b9c8ead83fb235fd12d453df57235835ed6903af3989e68fe04b5778e0aaa9a47ceaab0761a9292e
7
+ data.tar.gz: d38085ae6e3db361ebf83f6a5099473070129556167c649993ecc407582c67afccc4f6b9fbbf23dde1421f647be12ca508f07762a84893246010e3df1c04f4bb
@@ -47,7 +47,11 @@ module GfobhScorer
47
47
  start = Time.now
48
48
  log("running #{current_example_script} #{seed}")
49
49
  ret = begin
50
- `#{current_example_script} #{seed}`
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
@@ -1,3 +1,3 @@
1
1
  module GfobhScorer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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.1
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-04-05 00:00:00.000000000 Z
11
+ date: 2015-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client