crowdflower 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/crowdflower.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{crowdflower}
8
- s.version = "0.5.4"
8
+ s.version = "0.5.5"
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"]
12
- s.date = %q{2011-02-13}
12
+ s.date = %q{2011-02-18}
13
13
  s.description = %q{A toolkit for interacting with CrowdFlower via the REST API.
14
14
 
15
15
  This is alpha software. Have fun!
@@ -28,7 +28,7 @@ module CrowdFlower
28
28
  #
29
29
  # @param [String,Integer] id The CrowdFlower id for the judgment to reject.
30
30
  def reject( id )
31
- put( "#{resource_uri}/#{id}/reject", :headers => { "Content-Length" => 0 } )
31
+ put( "#{resource_uri}/#{id}/reject", :headers => { "Content-Length" => "0" } )
32
32
  end
33
33
 
34
34
  protected
@@ -13,8 +13,10 @@ module CrowdFlower
13
13
  end
14
14
 
15
15
  def bonus( worker_id, amount, reason=nil )
16
- params = { :amount => amount }
17
- params.merge!( :reason => reason ) if reason
16
+ params = {
17
+ :amount => amount,
18
+ :reason => reason
19
+ }
18
20
  connection.post( "#{resource_uri}/#{worker_id}/bonus", :query => params )
19
21
  end
20
22
 
@@ -39,16 +41,15 @@ module CrowdFlower
39
41
  :subject => subject,
40
42
  :message => message
41
43
  }
42
- connection.post( "#{resource_uri}/#{worker_id}/notify", :query => params, :headers => { "Content-Length" => "0" } )
44
+ connection.post( "#{resource_uri}/#{worker_id}/notify", :query => params )
43
45
  end
44
46
 
45
- def flag( worker_id, reason )
46
- params = reason ? { :reason => reason } : nil
47
- connection.put( "#{resource_uri}/#{worker_id}/flag", :query => params, :headers => { "Content-Length" => "0" } )
47
+ def flag( worker_id, reason = nil )
48
+ connection.put( "#{resource_uri}/#{worker_id}/flag", :body => { :reason => reason }, :headers => { "Content-Length" => "0" } )
48
49
  end
49
50
 
50
51
  def deflag( worker_id )
51
- connection.put( "#{resource_uri}/#{worker_id}/deflag", :headers => { "Content-Length" => "0" } )
52
+ connection.put( "#{resource_uri}/#{worker_id}/deflag", :headers => { "Content-Length" => "0" } )
52
53
  end
53
54
  end
54
55
  end
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 4
10
- version: 0.5.4
9
+ - 5
10
+ version: 0.5.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian P O'Rourke
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-02-13 00:00:00 -08:00
19
+ date: 2011-02-18 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency