crowdflower 0.6.7 → 0.6.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/crowdflower.gemspec +1 -1
- data/lib/crowdflower/base.rb +3 -1
- data/lib/crowdflower/job.rb +6 -6
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.8
|
data/crowdflower.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{crowdflower}
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Brian P O'Rourke", "Chris Van Pelt"]
|
data/lib/crowdflower/base.rb
CHANGED
@@ -112,9 +112,11 @@ module CrowdFlower
|
|
112
112
|
# job1 = Job.create('created with default api key')
|
113
113
|
# job2 = JobSubclass.create('created with custom api key')
|
114
114
|
class Base
|
115
|
+
attr_accessor :last_response
|
115
116
|
|
116
|
-
def initialize(new_connection = nil)
|
117
|
+
def initialize(new_connection = nil, last_res = nil)
|
117
118
|
@connection = new_connection
|
119
|
+
@last_response = last_res
|
118
120
|
end
|
119
121
|
|
120
122
|
def connection
|
data/lib/crowdflower/job.rb
CHANGED
@@ -2,9 +2,9 @@ module CrowdFlower
|
|
2
2
|
class Job < Base
|
3
3
|
attr_accessor :res
|
4
4
|
attr_reader :id
|
5
|
-
|
6
|
-
def initialize(job_id, connection = nil)
|
7
|
-
super connection
|
5
|
+
|
6
|
+
def initialize(job_id, connection = nil, last_response = nil)
|
7
|
+
super connection, last_response
|
8
8
|
@id = job_id
|
9
9
|
connect
|
10
10
|
end
|
@@ -34,7 +34,7 @@ module CrowdFlower
|
|
34
34
|
:query => opts)
|
35
35
|
|
36
36
|
verify_response res
|
37
|
-
job.kind_of?(Job) ? job : self.new(res["id"], conn)
|
37
|
+
job.kind_of?(Job) ? job : self.new(res["id"], conn, res)
|
38
38
|
end
|
39
39
|
|
40
40
|
# Creates a new empty Job in CrowdFlower.
|
@@ -42,7 +42,7 @@ module CrowdFlower
|
|
42
42
|
connect
|
43
43
|
res = self.post("#{resource_uri}.json", :query => {:job => {:title => title } }, :headers => { "Content-Length" => "0" } )
|
44
44
|
verify_response res
|
45
|
-
self.new(res["id"])
|
45
|
+
self.new(res["id"], nil, res)
|
46
46
|
end
|
47
47
|
|
48
48
|
def get(id = nil)
|
@@ -67,7 +67,7 @@ module CrowdFlower
|
|
67
67
|
def copy(opts = {})
|
68
68
|
res = connection.get("#{resource_uri}/#{@id}/copy", {:query => opts})
|
69
69
|
self.class.verify_response res
|
70
|
-
self.class.new(res["id"])
|
70
|
+
self.class.new(res["id"], nil, res)
|
71
71
|
end
|
72
72
|
|
73
73
|
def status
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowdflower
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 8
|
10
|
+
version: 0.6.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian P O'Rourke
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements: []
|
100
100
|
|
101
101
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.
|
102
|
+
rubygems_version: 1.3.7
|
103
103
|
signing_key:
|
104
104
|
specification_version: 3
|
105
105
|
summary: a toolkit for the CrowdFlower API
|