rturk 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -3,3 +3,4 @@ mturk.yml
3
3
  examples/last_hit
4
4
  pkg
5
5
  *.sw?
6
+ .rvmrc
data/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
1
  [submodule "doc"]
2
2
  path = doc
3
- url = git@github.com:markpercival/rturk.git
3
+ url = git@github.com:mdp/rturk
data/README.markdown CHANGED
@@ -6,8 +6,7 @@ RTurk is designed to fire off Mechanical Turk tasks for pages that reside on an
6
6
 
7
7
  The pages could be a part of a rails app, or just a simple javascript enabled form.
8
8
 
9
- If you want to build forms that are hosted on Mechanical Turk, this is not the library you need.
10
- You'd be better off with amazon's official library, in all its XML cruftiness.
9
+ If your integrating RTurk with a Rails app, do yourself a favor and check out [Turkee](http://github.com/aantix/turkee) by Jim Jones. It integrates your Rails forms with mechanical turk, and includes rake tasks to pull and process submissions. Definitely a time saver.
11
10
 
12
11
  ## Installation
13
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.3.2
@@ -30,7 +30,8 @@ module RTurk
30
30
 
31
31
  # Find all the details for a HIT
32
32
  # You could do this manually with new(id), and only call for the details
33
- # you need, or simply call this and get them all
33
+ # you need, or simply call this and get them all, and immediately see
34
+ # any errors
34
35
  def find(id)
35
36
  h = new(id)
36
37
  h.details
@@ -1,22 +1,26 @@
1
1
  module RTurk
2
2
  class GetReviewableHITs < Operation
3
+ attr_accessor :page_size, :page_number, :hit_type_id, :status,
4
+ :sort_property, :sort_direction
3
5
 
4
- attr_accessor :page_size, :page_number
5
-
6
6
  def parse(xml)
7
7
  RTurk::GetReviewableHITsResponse.new(xml)
8
8
  end
9
-
9
+
10
10
  def to_params
11
- {
11
+ params = {
12
12
  'PageSize' => (page_size || 100),
13
13
  'PageNumber' => (page_number || 1)
14
- }
14
+ }
15
+ params['HITTypeId'] = hit_type_id unless hit_type_id.nil?
16
+ params['Status'] = status unless status.nil?
17
+ params['SortProperty'] = sort_property unless sort_property.nil?
18
+ params['SortDirection'] = sort_direction unless sort_direction.nil?
19
+ params
15
20
  end
16
-
17
21
  end
22
+
18
23
  def self.GetReviewableHITs(*args, &blk)
19
24
  RTurk::GetReviewableHITs.create(*args, &blk)
20
25
  end
21
-
22
26
  end
@@ -64,7 +64,15 @@ module RTurk
64
64
  :assignments_duration => 'AssignmentDurationInSeconds',
65
65
  :reward_amount => 'Reward/Amount',
66
66
  :max_assignments => 'MaxAssignments',
67
- :auto_approval_delay => 'AutoApprovalDelayInSeconds'
67
+ :auto_approval_delay => 'AutoApprovalDelayInSeconds',
68
+ :description => 'Description',
69
+ :reward => 'Reward',
70
+ :lifetime => 'LifetimeInSeconds',
71
+ :annotation => 'RequesterAnnotation',
72
+ :similar_hits_count => 'NumberOfSimilarHITs',
73
+ :assignments_pending_count => 'NumberofAssignmentsPending',
74
+ :assignments_available_count => 'NumberofAssignmentsAvailable',
75
+ :assignments_completed_count => 'NumberofAssignmentsCompleted'
68
76
  )
69
77
 
70
78
  @keywords = @keywords.split(', ') if @keywords
data/rturk.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rturk}
8
- s.version = "2.3.1"
8
+ s.version = "2.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Percival"]
12
- s.date = %q{2010-09-25}
12
+ s.date = %q{2010-11-03}
13
13
  s.email = %q{mark@mpercival.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
@@ -244,7 +244,7 @@ Gem::Specification.new do |s|
244
244
  s.homepage = %q{http://github.com/markpercival/rturk}
245
245
  s.rdoc_options = ["--charset=UTF-8"]
246
246
  s.require_paths = ["lib"]
247
- s.rubygems_version = %q{1.3.6}
247
+ s.rubygems_version = %q{1.3.7}
248
248
  s.summary = %q{Mechanical Turk API Wrapper}
249
249
  s.test_files = [
250
250
  "spec/adapters/assignment_spec.rb",
@@ -294,7 +294,7 @@ Gem::Specification.new do |s|
294
294
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
295
295
  s.specification_version = 3
296
296
 
297
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
297
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
298
298
  s.add_runtime_dependency(%q<rest-client>, [">= 1.4.0"])
299
299
  s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
300
300
  else
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rturk
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 7
4
5
  prerelease: false
5
6
  segments:
6
7
  - 2
7
8
  - 3
8
- - 1
9
- version: 2.3.1
9
+ - 2
10
+ version: 2.3.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Mark Percival
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-09-25 00:00:00 -07:00
18
+ date: 2010-11-03 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rest-client
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 7
27
30
  segments:
28
31
  - 1
29
32
  - 4
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: nokogiri
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 5
41
46
  segments:
42
47
  - 1
43
48
  - 4
@@ -289,23 +294,27 @@ rdoc_options:
289
294
  require_paths:
290
295
  - lib
291
296
  required_ruby_version: !ruby/object:Gem::Requirement
297
+ none: false
292
298
  requirements:
293
299
  - - ">="
294
300
  - !ruby/object:Gem::Version
301
+ hash: 3
295
302
  segments:
296
303
  - 0
297
304
  version: "0"
298
305
  required_rubygems_version: !ruby/object:Gem::Requirement
306
+ none: false
299
307
  requirements:
300
308
  - - ">="
301
309
  - !ruby/object:Gem::Version
310
+ hash: 3
302
311
  segments:
303
312
  - 0
304
313
  version: "0"
305
314
  requirements: []
306
315
 
307
316
  rubyforge_project:
308
- rubygems_version: 1.3.6
317
+ rubygems_version: 1.3.7
309
318
  signing_key:
310
319
  specification_version: 3
311
320
  summary: Mechanical Turk API Wrapper