crowdkit 0.1.0

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.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/.document +5 -0
  3. data/.rspec +1 -0
  4. data/Gemfile +16 -0
  5. data/Gemfile.lock +97 -0
  6. data/LICENSE.txt +20 -0
  7. data/README.md +178 -0
  8. data/Rakefile +54 -0
  9. data/VERSION +1 -0
  10. data/crowdkit.gemspec +122 -0
  11. data/lib/crowdkit.rb +77 -0
  12. data/lib/crowdkit/api.rb +171 -0
  13. data/lib/crowdkit/api/arguments.rb +187 -0
  14. data/lib/crowdkit/api/factory.rb +29 -0
  15. data/lib/crowdkit/api/request_methods.rb +70 -0
  16. data/lib/crowdkit/api/response_wrapper.rb +122 -0
  17. data/lib/crowdkit/client.rb +36 -0
  18. data/lib/crowdkit/client/account.rb +7 -0
  19. data/lib/crowdkit/client/jobs.rb +56 -0
  20. data/lib/crowdkit/client/judgments.rb +9 -0
  21. data/lib/crowdkit/client/poll.rb +48 -0
  22. data/lib/crowdkit/client/statuses.rb +14 -0
  23. data/lib/crowdkit/client/units.rb +54 -0
  24. data/lib/crowdkit/client/workers.rb +13 -0
  25. data/lib/crowdkit/client/worksets.rb +27 -0
  26. data/lib/crowdkit/config.rb +62 -0
  27. data/lib/crowdkit/core_ext/array.rb +7 -0
  28. data/lib/crowdkit/core_ext/hash.rb +30 -0
  29. data/lib/crowdkit/core_ext/sawyer.rb +7 -0
  30. data/lib/crowdkit/error.rb +198 -0
  31. data/lib/crowdkit/middleware/raise_error.rb +14 -0
  32. data/lib/crowdkit/ssl_certs/cacerts.pem +3868 -0
  33. data/lib/crowdkit/version.rb +3 -0
  34. data/spec/crowdkit/client/account_spec.rb +19 -0
  35. data/spec/crowdkit/client/jobs_spec.rb +275 -0
  36. data/spec/crowdkit/client/judgments_spec.rb +30 -0
  37. data/spec/crowdkit/client/statuses_spec.rb +30 -0
  38. data/spec/crowdkit/client/units_spec.rb +266 -0
  39. data/spec/crowdkit/client/workers_spec.rb +33 -0
  40. data/spec/crowdkit/client/worksets_spec.rb +113 -0
  41. data/spec/crowdkit/client_spec.rb +55 -0
  42. data/spec/crowdkit_spec.rb +139 -0
  43. data/spec/fixtures/account.json +7 -0
  44. data/spec/fixtures/jobs/copy.json +79 -0
  45. data/spec/fixtures/jobs/job.json +1 -0
  46. data/spec/fixtures/jobs/order.json +53 -0
  47. data/spec/fixtures/jobs/search.json +1 -0
  48. data/spec/fixtures/judgments/index.json +46 -0
  49. data/spec/fixtures/judgments/show.json +16 -0
  50. data/spec/fixtures/root.json +1 -0
  51. data/spec/fixtures/statuses/index.json +25 -0
  52. data/spec/fixtures/statuses/status.json +12 -0
  53. data/spec/fixtures/units/copy.json +34 -0
  54. data/spec/fixtures/units/index.json +1502 -0
  55. data/spec/fixtures/units/poll/normal.json +902 -0
  56. data/spec/fixtures/units/poll/small.json +602 -0
  57. data/spec/fixtures/units/show.json +34 -0
  58. data/spec/fixtures/upload.csv +25 -0
  59. data/spec/fixtures/worksets/index.json +20 -0
  60. data/spec/fixtures/worksets/show.json +9 -0
  61. data/spec/spec_helper.rb +53 -0
  62. data/spec/support/base.rb +11 -0
  63. metadata +218 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 465723a6ac2f11feea2f347b1574cc49bc46a295
4
+ data.tar.gz: 527a5d9e1482d98e57f767015eee4792e6276b08
5
+ SHA512:
6
+ metadata.gz: 575299ba50009f42385dac46185aec5e909c456a62b4b38a2cdecd5ece3e3432147d9c79d4f641833dfa8b06be7dd41442ee2b180900e68dd04864b2e44ce69f
7
+ data.tar.gz: 386d5c148f30af3b8ca843bddf20d92c7087b81369f4b1bfefea79da269ff19c285466746e6c92b323a92fa73f4fe0e017d5bdcf8d61a99ab2807db5e2e4520d
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ gem "sawyer", "0.5.5"
5
+ gem "ruby-progressbar"
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "rspec"
11
+ gem "webmock"
12
+ gem "pry"
13
+ gem "bundler", "~> 1.0"
14
+ gem "jeweler", "~> 2.0.1"
15
+ gem "simplecov", ">= 0"
16
+ end
@@ -0,0 +1,97 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ addressable (2.3.6)
5
+ builder (3.2.2)
6
+ coderay (1.1.0)
7
+ crack (0.4.2)
8
+ safe_yaml (~> 1.0.0)
9
+ descendants_tracker (0.0.4)
10
+ thread_safe (~> 0.3, >= 0.3.1)
11
+ diff-lcs (1.2.5)
12
+ docile (1.1.5)
13
+ faraday (0.9.1)
14
+ multipart-post (>= 1.2, < 3)
15
+ git (1.2.8)
16
+ github_api (0.12.2)
17
+ addressable (~> 2.3)
18
+ descendants_tracker (~> 0.0.4)
19
+ faraday (~> 0.8, < 0.10)
20
+ hashie (>= 3.3)
21
+ multi_json (>= 1.7.5, < 2.0)
22
+ nokogiri (~> 1.6.3)
23
+ oauth2
24
+ hashie (3.3.2)
25
+ highline (1.6.21)
26
+ jeweler (2.0.1)
27
+ builder
28
+ bundler (>= 1.0)
29
+ git (>= 1.2.5)
30
+ github_api
31
+ highline (>= 1.6.15)
32
+ nokogiri (>= 1.5.10)
33
+ rake
34
+ rdoc
35
+ json (1.8.1)
36
+ jwt (1.2.0)
37
+ method_source (0.8.2)
38
+ mini_portile (0.6.2)
39
+ multi_json (1.10.1)
40
+ multi_xml (0.5.5)
41
+ multipart-post (2.0.0)
42
+ nokogiri (1.6.5)
43
+ mini_portile (~> 0.6.0)
44
+ oauth2 (1.0.0)
45
+ faraday (>= 0.8, < 0.10)
46
+ jwt (~> 1.0)
47
+ multi_json (~> 1.3)
48
+ multi_xml (~> 0.5)
49
+ rack (~> 1.2)
50
+ pry (0.10.1)
51
+ coderay (~> 1.1.0)
52
+ method_source (~> 0.8.1)
53
+ slop (~> 3.4)
54
+ rack (1.6.0)
55
+ rake (10.4.2)
56
+ rdoc (4.2.0)
57
+ json (~> 1.4)
58
+ rspec (3.1.0)
59
+ rspec-core (~> 3.1.0)
60
+ rspec-expectations (~> 3.1.0)
61
+ rspec-mocks (~> 3.1.0)
62
+ rspec-core (3.1.7)
63
+ rspec-support (~> 3.1.0)
64
+ rspec-expectations (3.1.2)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.1.0)
67
+ rspec-mocks (3.1.3)
68
+ rspec-support (~> 3.1.0)
69
+ rspec-support (3.1.2)
70
+ ruby-progressbar (1.7.1)
71
+ safe_yaml (1.0.4)
72
+ sawyer (0.5.5)
73
+ addressable (~> 2.3.5)
74
+ faraday (~> 0.8, < 0.10)
75
+ simplecov (0.9.1)
76
+ docile (~> 1.1.0)
77
+ multi_json (~> 1.0)
78
+ simplecov-html (~> 0.8.0)
79
+ simplecov-html (0.8.0)
80
+ slop (3.6.0)
81
+ thread_safe (0.3.4)
82
+ webmock (1.20.4)
83
+ addressable (>= 2.3.6)
84
+ crack (>= 0.3.2)
85
+
86
+ PLATFORMS
87
+ ruby
88
+
89
+ DEPENDENCIES
90
+ bundler (~> 1.0)
91
+ jeweler (~> 2.0.1)
92
+ pry
93
+ rspec
94
+ ruby-progressbar
95
+ sawyer (= 0.5.5)
96
+ simplecov
97
+ webmock
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Chris Van Pelt
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,178 @@
1
+ # CrowdKit
2
+
3
+ CrowdKit is the official Ruby wrapper for the [CrowdFlower API v2](http://docs.crowdflower.apiary.io).
4
+
5
+ CrowdKit is heavily inspired by Peter Murach's fantastic Github API gem: https://github.com/peter-murach/github.
6
+
7
+ ## Sample Usage
8
+
9
+ ```ruby
10
+ require "crowdkit"
11
+
12
+ #A reusable client instance
13
+ @client = Crowdkit.new(access_token: "123abc")
14
+ @client.jobs(12345).units.list do |unit|
15
+ puts unit.state
16
+ end
17
+
18
+ #Global configuration and a new client instance on every call to `Crowdkit`
19
+ Crowdkit.configure do |c|
20
+ c.access_token = "123abc"
21
+ end
22
+ puts Crowdkit.units.get(unit_id: 54321)
23
+ ```
24
+
25
+ ## Contents
26
+
27
+ 1. [Configuration](#configuration)
28
+ 2. [Scopes & Parameters](#scopes--parameters)
29
+ 3. [Errors](#errors)
30
+ 4. [Example Usage](#example-usage)
31
+ 10. [Development](#development)
32
+
33
+ ## Configuration
34
+
35
+ As demonstrated above, CrowdKit can be instantiated in one of two ways. The `Crowdkit` namespace will proxy to a newly created client instance every time a defined method is called. Alternatively calling `Crowdkit.new` will return a reusable client instance. Configuration overrides can be passed into `Crowdkit.new` as a hash, or both `Crowdkit.new` and `Crowdkit.configure` accept a block that receives a configuration object as demonstrated below.
36
+
37
+ ```ruby
38
+ Crowdkit.new(debug: true)
39
+ Crowdkit.new do |config|
40
+ config.debug = true
41
+ end
42
+ Crowdkit.configure do |config|
43
+ config.debug = true
44
+ end
45
+ ```
46
+
47
+ ### Configuration Variables
48
+
49
+ Variable | Definition
50
+ ---------|------------
51
+ *access_token* | Your CrowdFlower Access Token found on your account page, required for API access.
52
+ *per_page* | The number of results to request per page. By default 10.
53
+ *debug* | Enabling this will log all API activity for debugging purposes.
54
+ *adapter* | The HTTP adapter to use, by default :net_http, other options are: :net_http_persistent, :typhoeus, :patron, :em_synchrony, :excon, :test
55
+ *user_agent* | The user agent, by default "CrowdKit Ruby Gem {version}".
56
+ *auto_paginate* | Whether or not to automatically paginate through collections, default: false.
57
+ *api_endpoint* | A custom API endpoint, default: https://api.crowdflower.com/v2
58
+ *ssl* | By default the client is configured to use OpenSSL::SSL::VERIFY_PEER, to disable peer verification set this to `{ verify: false }`
59
+
60
+ ### Environment Variables
61
+
62
+ Lastly, Crowdkit looks for all configuration variables in the environment with the following format: `CROWDKIT_{upcased_variable_name}` i.e. `CROWDKIT_ACCESS_TOKEN=abc123`
63
+
64
+ ### Advanced Configuration
65
+
66
+ Crowdkit uses Faraday and exposes a `stack` configuration parameter. `stack` can be freely modified with methods such as `insert`, `insert_after`, `delete` and `swap`. Additionally, if you're feeling adventurous you can override the default stack completely:
67
+
68
+ ```ruby
69
+ Crowdkit.configure do |config|
70
+ config.stack.insert CustomMiddleware
71
+ end
72
+
73
+ Crowdkit.configure do |config|
74
+ config.stack do |builder|
75
+ builder.use CustomMiddleware
76
+ builder.use Crowdkit::Middleware::RaiseError
77
+ builder.adapter :excon
78
+ end
79
+ end
80
+ ```
81
+
82
+ ### Scopes & Parameters
83
+
84
+ Crowdkit operates within scopes appropriate to the CrowdFlower API. The most common scope is `jobs`. Parameters can be passed into any scope and will be used by the API method. i.e.
85
+
86
+ ```ruby
87
+ client.jobs(state: "finished").list
88
+ ```
89
+
90
+ Ofcourse the API methods themselves also accept parameters
91
+
92
+ ```ruby
93
+ client.jobs.list(state: "finished")
94
+ ```
95
+
96
+ Most scopes accept an optional first parameter that will be translated to the primary key of the scope for convenience. i.e.
97
+
98
+ ```ruby
99
+ client.units(54321).get
100
+ client.jobs.search("whatever")
101
+ ```
102
+
103
+ The above is equivalent to the following:
104
+
105
+ ```ruby
106
+ client.units.get(unit_id: 54321)
107
+ client.jobs.search(query: "whatever")
108
+ ```
109
+
110
+ Lastly Crowdkit also provides a `with` method to clearly denote your scopes.
111
+
112
+ ```ruby
113
+ client.with(unit_id: 54321).units.get
114
+ ```
115
+
116
+ ### Errors
117
+
118
+ All errors thrown by the client inherit from `Crowdkit::Error`. There are two primary types of errors: `Crowdkit::UserError` and `Crowdkit::ServiceError`. User errors are thrown when local validations fail while service errors are thrown when we receive invalid response codes from the CrowdFlower servers.
119
+
120
+ ### Example Usage
121
+
122
+ #### Get statistics for jobs with a given tag
123
+
124
+ ```ruby
125
+ jobs = client.jobs.search("url", fields: ["tags"])
126
+ jobs.each do |job|
127
+ pp job.stats
128
+ end
129
+ ```
130
+
131
+ #### Copying a job and ordering all units
132
+
133
+ ```ruby
134
+ new_job = client.jobs(101010).copy(all_units: true)
135
+ CrowdKit.wait_on_status(new_job)
136
+ order = client.jobs(new_job.id).order
137
+ CrowdKit.wait_on_status(order)
138
+ ```
139
+
140
+ #### Sum unit states for all units in a job
141
+
142
+ ```ruby
143
+ client.jobs(101010).units.list(auto_pagination: true).inject(Hash.new(0)) do |memo, unit|
144
+ memo[unit.state] += 1
145
+ memo
146
+ end
147
+ ```
148
+
149
+ #### Poll a job for completed units
150
+
151
+ ```ruby
152
+ while true
153
+ units = client.jobs(101010).units.poll
154
+ if units.any?
155
+ units.each do |unit|
156
+ # Do something with the resulting data
157
+ result = unit.aggregate_result
158
+ # We also support acknowledging individual units if you want more granularity i.e.
159
+ # result.delete
160
+ end
161
+ # This acknowledges all units in one request but assumes the above code will
162
+ # complete in less than 30 seconds if you have multiple pollers.
163
+ units.delete
164
+ else
165
+ sleep 10
166
+ end
167
+ end
168
+ ```
169
+
170
+ ### Development
171
+
172
+ All scopes are defined in the `client` directory and inherit from API. The API class provides the following convenience methods for defining API's:
173
+
174
+ *arguments:* parses arguments and let's you specify which if any are required: `arguments(args, required: [:job_id])`
175
+
176
+ *do_{http_verb}:* performs the specified http_verb.
177
+
178
+ *namespace:* attaches a scope and uses the class defined with `class_name` to instantiate it: `namespace :units, class_name: "Client::Units"`
@@ -0,0 +1,54 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "crowdkit"
18
+ gem.homepage = "http://github.com/crowdflower/crowdkit.rb"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{CrowdFlower ruby API client}
21
+ gem.description = %Q{A flat API client that sits atop the CrowdFlower API}
22
+ gem.email = "vanpelt@crowdflower.com"
23
+ gem.authors = ["Chris Van Pelt"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rspec/core'
29
+ require 'rspec/core/rake_task'
30
+ RSpec::Core::RakeTask.new(:spec) do |spec|
31
+ spec.pattern = FileList['spec/**/*_spec.rb']
32
+ end
33
+
34
+ task :pry do
35
+ `pry --gem -r crowdkit`
36
+ end
37
+
38
+ desc "Code coverage detail"
39
+ task :simplecov do
40
+ ENV['COVERAGE'] = "true"
41
+ Rake::Task['spec'].execute
42
+ end
43
+
44
+ task :default => :spec
45
+
46
+ require 'rdoc/task'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "crowdkit #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,122 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: crowdkit 0.1.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "crowdkit"
9
+ s.version = "0.1.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Chris Van Pelt"]
14
+ s.date = "2015-01-09"
15
+ s.description = "A flat API client that sits atop the CrowdFlower API"
16
+ s.email = "vanpelt@crowdflower.com"
17
+ s.extra_rdoc_files = [
18
+ "LICENSE.txt",
19
+ "README.md"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".rspec",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE.txt",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "crowdkit.gemspec",
31
+ "lib/crowdkit.rb",
32
+ "lib/crowdkit/api.rb",
33
+ "lib/crowdkit/api/arguments.rb",
34
+ "lib/crowdkit/api/factory.rb",
35
+ "lib/crowdkit/api/request_methods.rb",
36
+ "lib/crowdkit/api/response_wrapper.rb",
37
+ "lib/crowdkit/client.rb",
38
+ "lib/crowdkit/client/account.rb",
39
+ "lib/crowdkit/client/jobs.rb",
40
+ "lib/crowdkit/client/judgments.rb",
41
+ "lib/crowdkit/client/poll.rb",
42
+ "lib/crowdkit/client/statuses.rb",
43
+ "lib/crowdkit/client/units.rb",
44
+ "lib/crowdkit/client/workers.rb",
45
+ "lib/crowdkit/client/worksets.rb",
46
+ "lib/crowdkit/config.rb",
47
+ "lib/crowdkit/core_ext/array.rb",
48
+ "lib/crowdkit/core_ext/hash.rb",
49
+ "lib/crowdkit/core_ext/sawyer.rb",
50
+ "lib/crowdkit/error.rb",
51
+ "lib/crowdkit/middleware/raise_error.rb",
52
+ "lib/crowdkit/ssl_certs/cacerts.pem",
53
+ "lib/crowdkit/version.rb",
54
+ "spec/crowdkit/client/account_spec.rb",
55
+ "spec/crowdkit/client/jobs_spec.rb",
56
+ "spec/crowdkit/client/judgments_spec.rb",
57
+ "spec/crowdkit/client/statuses_spec.rb",
58
+ "spec/crowdkit/client/units_spec.rb",
59
+ "spec/crowdkit/client/workers_spec.rb",
60
+ "spec/crowdkit/client/worksets_spec.rb",
61
+ "spec/crowdkit/client_spec.rb",
62
+ "spec/crowdkit_spec.rb",
63
+ "spec/fixtures/account.json",
64
+ "spec/fixtures/jobs/copy.json",
65
+ "spec/fixtures/jobs/job.json",
66
+ "spec/fixtures/jobs/order.json",
67
+ "spec/fixtures/jobs/search.json",
68
+ "spec/fixtures/judgments/index.json",
69
+ "spec/fixtures/judgments/show.json",
70
+ "spec/fixtures/root.json",
71
+ "spec/fixtures/statuses/index.json",
72
+ "spec/fixtures/statuses/status.json",
73
+ "spec/fixtures/units/copy.json",
74
+ "spec/fixtures/units/index.json",
75
+ "spec/fixtures/units/poll/normal.json",
76
+ "spec/fixtures/units/poll/small.json",
77
+ "spec/fixtures/units/show.json",
78
+ "spec/fixtures/upload.csv",
79
+ "spec/fixtures/worksets/index.json",
80
+ "spec/fixtures/worksets/show.json",
81
+ "spec/spec_helper.rb",
82
+ "spec/support/base.rb"
83
+ ]
84
+ s.homepage = "http://github.com/crowdflower/crowdkit.rb"
85
+ s.licenses = ["MIT"]
86
+ s.rubygems_version = "2.2.0"
87
+ s.summary = "CrowdFlower ruby API client"
88
+
89
+ if s.respond_to? :specification_version then
90
+ s.specification_version = 4
91
+
92
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
93
+ s.add_runtime_dependency(%q<sawyer>, ["= 0.5.5"])
94
+ s.add_runtime_dependency(%q<ruby-progressbar>, [">= 0"])
95
+ s.add_development_dependency(%q<rspec>, [">= 0"])
96
+ s.add_development_dependency(%q<webmock>, [">= 0"])
97
+ s.add_development_dependency(%q<pry>, [">= 0"])
98
+ s.add_development_dependency(%q<bundler>, ["~> 1.0"])
99
+ s.add_development_dependency(%q<jeweler>, ["~> 2.0.1"])
100
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
101
+ else
102
+ s.add_dependency(%q<sawyer>, ["= 0.5.5"])
103
+ s.add_dependency(%q<ruby-progressbar>, [">= 0"])
104
+ s.add_dependency(%q<rspec>, [">= 0"])
105
+ s.add_dependency(%q<webmock>, [">= 0"])
106
+ s.add_dependency(%q<pry>, [">= 0"])
107
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
108
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
109
+ s.add_dependency(%q<simplecov>, [">= 0"])
110
+ end
111
+ else
112
+ s.add_dependency(%q<sawyer>, ["= 0.5.5"])
113
+ s.add_dependency(%q<ruby-progressbar>, [">= 0"])
114
+ s.add_dependency(%q<rspec>, [">= 0"])
115
+ s.add_dependency(%q<webmock>, [">= 0"])
116
+ s.add_dependency(%q<pry>, [">= 0"])
117
+ s.add_dependency(%q<bundler>, ["~> 1.0"])
118
+ s.add_dependency(%q<jeweler>, ["~> 2.0.1"])
119
+ s.add_dependency(%q<simplecov>, [">= 0"])
120
+ end
121
+ end
122
+