typingpool 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/typingpool/amazon/hit/full.rb +11 -3
- data/lib/typingpool/version.rb +1 -1
- data/test/test_unit_amazon.rb +17 -6
- metadata +17 -35
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 12d9537ae9deb2fdab3078afea4a69132658bf8e
|
4
|
+
data.tar.gz: 7a343081d80b50c26220e5701a3f4a6e758b7006
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6405ecd1a2744e022e45bb0e3dca0c1ca7a396e0633022c6a80aba676f0e6e02f8e9fc922f9683d9165f4cee25d3ed3f8904c1eaf9bfc24d6a1b39aaf8345954
|
7
|
+
data.tar.gz: 6c391f5f719098d40cd987dbe4de7e454f654b3cd2c65cdf99a21c82431d370a992d0a78844fd176ccc028331d289899367930a74f750612528f01522874c964
|
@@ -56,9 +56,17 @@ module Typingpool
|
|
56
56
|
if @external_question.nil?
|
57
57
|
if external_question_url && external_question_url.match(/^http/)
|
58
58
|
#expensive, obviously:
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
begin
|
60
|
+
@external_question = open(external_question_url).read
|
61
|
+
rescue OpenURI::HTTPError => e
|
62
|
+
#we don't worry about missing questions because those
|
63
|
+
#should only be attached to HITs that aren't ours. we
|
64
|
+
#take both 403 and 404 to mean missing because S3
|
65
|
+
#never returns 404, only 403.
|
66
|
+
raise e unless e.message.match(/\b40[34]\b/)
|
67
|
+
end #begin
|
68
|
+
end #if external_question_url && external_question_url.match...
|
69
|
+
end #if @external_question.nil?
|
62
70
|
@external_question
|
63
71
|
end
|
64
72
|
|
data/lib/typingpool/version.rb
CHANGED
data/test/test_unit_amazon.rb
CHANGED
@@ -129,6 +129,17 @@ class TestAmazon < Typingpool::Test
|
|
129
129
|
refute(typingpool_hit.ours?)
|
130
130
|
end
|
131
131
|
|
132
|
+
def test_handles_hits_with_broken_external_question
|
133
|
+
config = self.config
|
134
|
+
dummy_project = Typingpool::Project.new('dummy', config)
|
135
|
+
url = dummy_project.remote.file_to_url(Typingpool::Project::Remote::S3.random_bucket_name(16,'dummy-missing-file-'))
|
136
|
+
refute(working_url? url)
|
137
|
+
with_dummy_typingpool_hit_or_skip('test_handles_hits_with_broken_external_question', url) do |hit, config|
|
138
|
+
assert_equal(hit.full.external_question_url, url)
|
139
|
+
refute(hit.full.external_question)
|
140
|
+
end #with_dummy....
|
141
|
+
end
|
142
|
+
|
132
143
|
#Lacks test for HIT::Assignment - needs VCR fixture (TODO)
|
133
144
|
|
134
145
|
def question_html
|
@@ -139,16 +150,16 @@ class TestAmazon < Typingpool::Test
|
|
139
150
|
File.read(File.join(fixtures_dir, 'amazon-question-url.txt')).strip
|
140
151
|
end
|
141
152
|
|
142
|
-
def dummy_question
|
143
|
-
Typingpool::Amazon::Question.new(
|
153
|
+
def dummy_question(url=question_url)
|
154
|
+
Typingpool::Amazon::Question.new(url, question_html)
|
144
155
|
end
|
145
156
|
|
146
|
-
def dummy_hit(config)
|
147
|
-
Typingpool::Amazon::HIT.create(dummy_question, config.assign)
|
157
|
+
def dummy_hit(config, url=question_url)
|
158
|
+
Typingpool::Amazon::HIT.create(dummy_question(url), config.assign)
|
148
159
|
end
|
149
160
|
|
150
161
|
|
151
|
-
def with_dummy_typingpool_hit_or_skip(skipping_what)
|
162
|
+
def with_dummy_typingpool_hit_or_skip(skipping_what, url=question_url)
|
152
163
|
config = self.config
|
153
164
|
skip_if_no_amazon_credentials(skipping_what, config)
|
154
165
|
config.assign.reward = '0.01'
|
@@ -156,7 +167,7 @@ class TestAmazon < Typingpool::Test
|
|
156
167
|
begin
|
157
168
|
config.cache = cache.path
|
158
169
|
Typingpool::Amazon.setup(:sandbox => true, :config => config)
|
159
|
-
hit = dummy_hit(config)
|
170
|
+
hit = dummy_hit(config, url)
|
160
171
|
begin
|
161
172
|
yield(hit, config)
|
162
173
|
ensure
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: typingpool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ryan Tate
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-30 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rturk
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,39 +27,34 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: highline
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '1.6'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '1.6'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: nokogiri
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '1.5'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '1.5'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: aws-sdk
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ~>
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ~>
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -78,23 +69,20 @@ dependencies:
|
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: net-sftp
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: 2.0.5
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: 2.0.5
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: minitest
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
87
|
- - ~>
|
100
88
|
- !ruby/object:Gem::Version
|
@@ -102,7 +90,6 @@ dependencies:
|
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
94
|
- - ~>
|
108
95
|
- !ruby/object:Gem::Version
|
@@ -110,33 +97,29 @@ dependencies:
|
|
110
97
|
- !ruby/object:Gem::Dependency
|
111
98
|
name: vcr
|
112
99
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
100
|
requirements:
|
115
|
-
- -
|
101
|
+
- - '>='
|
116
102
|
- !ruby/object:Gem::Version
|
117
103
|
version: '0'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
none: false
|
122
107
|
requirements:
|
123
|
-
- -
|
108
|
+
- - '>='
|
124
109
|
- !ruby/object:Gem::Version
|
125
110
|
version: '0'
|
126
111
|
- !ruby/object:Gem::Dependency
|
127
112
|
name: webmock
|
128
113
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
114
|
requirements:
|
131
|
-
- -
|
115
|
+
- - '>='
|
132
116
|
- !ruby/object:Gem::Version
|
133
117
|
version: '0'
|
134
118
|
type: :development
|
135
119
|
prerelease: false
|
136
120
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
-
none: false
|
138
121
|
requirements:
|
139
|
-
- -
|
122
|
+
- - '>='
|
140
123
|
- !ruby/object:Gem::Version
|
141
124
|
version: '0'
|
142
125
|
description: An app for transcribing audio using Mechanical Turk
|
@@ -273,20 +256,19 @@ files:
|
|
273
256
|
- typingpool.gemspec
|
274
257
|
homepage: http://github.com/ryantate/typingpool
|
275
258
|
licenses: []
|
259
|
+
metadata: {}
|
276
260
|
post_install_message:
|
277
261
|
rdoc_options: []
|
278
262
|
require_paths:
|
279
263
|
- lib
|
280
264
|
required_ruby_version: !ruby/object:Gem::Requirement
|
281
|
-
none: false
|
282
265
|
requirements:
|
283
|
-
- -
|
266
|
+
- - '>='
|
284
267
|
- !ruby/object:Gem::Version
|
285
268
|
version: 1.9.2
|
286
269
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
287
|
-
none: false
|
288
270
|
requirements:
|
289
|
-
- -
|
271
|
+
- - '>='
|
290
272
|
- !ruby/object:Gem::Version
|
291
273
|
version: '0'
|
292
274
|
requirements:
|
@@ -294,9 +276,9 @@ requirements:
|
|
294
276
|
- mp3splt
|
295
277
|
- mp3wrap
|
296
278
|
rubyforge_project:
|
297
|
-
rubygems_version:
|
279
|
+
rubygems_version: 2.0.3
|
298
280
|
signing_key:
|
299
|
-
specification_version:
|
281
|
+
specification_version: 4
|
300
282
|
summary: An app for transcribing audio using Mechanical Turk
|
301
283
|
test_files:
|
302
284
|
- test/test_unit_amazon.rb
|