shared_workforce 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -3,18 +3,21 @@ Shared Workforce Client
3
3
 
4
4
  [![Build Status](https://secure.travis-ci.org/sharedworkforce/sharedworkforce.png)](http://travis-ci.org/#!/sharedworkforce/sharedworkforce)
5
5
 
6
- Shared Workforce is a platform for managing and completing repetitive tasks that require human intelligence. For example, tagging photos, approving text and answering simple questions.
6
+ Shared Workforce is a platform for managing and completing repetitive tasks that require human intelligence. For example, tagging and cropping photos, approving text and answering simple questions.
7
7
 
8
- It differs from other similar services in the following ways:
8
+ The Shared Workforce client lets you add behaviour to your models so that when an action occurs (for example, a photo is added), details of that action and model are sent to human workers, who can asses the data and return a response, which can be used to trigger further actions in the model (for example, marking it as spam).
9
9
 
10
- * All tasks should be very simple and typically take no more than 10-15 seconds. (larger tasks can be broken down in to smaller ones).
11
- * Tasks are displayed from a selection of pre-defined formats.
12
- * Very simple integration via this ruby gem or the straight forward REST API.
10
+ You can view a live demo sandbox app at [http://catsify.herokuapp.com](http://catsify.herokuapp.com)
13
11
 
14
- The service is currently in private beta. You can apply for an invitation at [sharedworkforce.com](http://www.sharedworkforce.com).
12
+ The service is currently in private beta and is available as a [Heroku add-on](https://addons.heroku.com/sharedworkforce). You can apply for an invitation at [sharedworkforce.com](http://www.sharedworkforce.com).
15
13
 
16
- Getting started
17
- ===============
14
+ Getting started with Heroku
15
+ ===========================
16
+
17
+ Getting started with [Heroku][http://www.heroku.com] takes less than 5 minutes. The best way to get started is to follow the README on the [demo app source code](https://github.com/sharedworkforce/sharedworkforce-demo-rails).
18
+
19
+ Getting started without Heroku
20
+ ==============================
18
21
 
19
22
  ### Step 1 - get an API key
20
23
 
@@ -28,10 +31,6 @@ Add shared_workforce to your Gemfile:
28
31
 
29
32
  gem "shared_workforce"
30
33
 
31
- Or, for Rails 2.x add the gem to your environment.rb
32
-
33
- config.gem "shared_workforce"
34
-
35
34
  Create config/initializers/shared_workforce.rb
36
35
 
37
36
  SharedWorkforce.configure do |config|
@@ -43,9 +42,7 @@ If you're not using Rails, simply require the gem or include it in your Gemfile,
43
42
 
44
43
  ### Step 3 - define tasks
45
44
 
46
- Create a directory called 'tasks' in the root of your app. This is where you define your tasks - all files in this directory will be loaded.
47
-
48
- If, for example, you would like to approve a photo on upload, create your first task in a file called tasks/approve_photo.rb
45
+ If, for example, you would like to approve a photo on upload, create your first task in a file called app/tasks/approve_photo.rb
49
46
 
50
47
  class ApprovePhotoTask
51
48
  include SharedWorkforce::Task
@@ -6,7 +6,7 @@ module SharedWorkforce
6
6
  end
7
7
 
8
8
  def call(env)
9
- if env["PATH_INFO"] =~ %r{^/#{callback_path}} || env["PATH_INFO"] =~ %r{^/hci_task_result} #legacy compatibility, can be removed in next release
9
+ if env["PATH_INFO"] =~ %r{^/#{callback_path}}
10
10
  process_response(Rack::Request.new(env).body.read)
11
11
  else
12
12
  @app.call(env) if @app.respond_to? :call
@@ -126,6 +126,7 @@ module SharedWorkforce
126
126
  :instruction => instruction,
127
127
  :guidelines => guidelines,
128
128
  :image_url => image_url,
129
+ :image_crop_ratio => image_crop_ratio,
129
130
  :answer_options => answer_options,
130
131
  :responses_required => responses_required,
131
132
  :answer_type => answer_type.to_s,
@@ -1,4 +1,4 @@
1
1
  module SharedWorkforce
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
 
4
4
  end
data/spec/task_spec.rb CHANGED
@@ -335,6 +335,12 @@ describe "Task" do
335
335
  task.guidelines = "* be careful"
336
336
  task.to_hash[:guidelines].should == '* be careful'
337
337
  end
338
+
339
+ it "should include the image crop ratio" do
340
+ task = ApprovePhotoTask.new(@resource_class.new)
341
+ task.image_crop_ratio = 0.5
342
+ task.to_hash[:image_crop_ratio].should == 0.5
343
+ end
338
344
  end
339
345
  end
340
346
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shared_workforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
12
+ date: 2012-06-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
16
- requirement: &70267692749100 !ruby/object:Gem::Requirement
16
+ requirement: &70337624682520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70267692749100
24
+ version_requirements: *70337624682520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &70267692638140 !ruby/object:Gem::Requirement
27
+ requirement: &70337624682100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70267692638140
35
+ version_requirements: *70337624682100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: activesupport
38
- requirement: &70267692453420 !ruby/object:Gem::Requirement
38
+ requirement: &70337624681680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70267692453420
46
+ version_requirements: *70337624681680
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
- requirement: &70267692377100 !ruby/object:Gem::Requirement
49
+ requirement: &70337624681180 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.2.9
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70267692377100
57
+ version_requirements: *70337624681180
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: webmock
60
- requirement: &70267692331160 !ruby/object:Gem::Requirement
60
+ requirement: &70337624680760 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70267692331160
68
+ version_requirements: *70337624680760
69
69
  description: Shared Workforce is a service and simple API for human intelligence tasks
70
70
  email:
71
71
  - sam@samoliver.com