chimps 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -9
- data/Gemfile.lock +14 -10
- data/README.rdoc +146 -240
- data/Rakefile +4 -33
- data/VERSION +1 -1
- data/lib/chimps/config.rb +35 -21
- data/lib/chimps/{utils/error.rb → error.rb} +1 -12
- data/lib/chimps/query_request.rb +67 -0
- data/lib/chimps/request.rb +82 -108
- data/lib/chimps/response.rb +62 -22
- data/lib/chimps/utils/typewriter.rb +90 -0
- data/lib/chimps/utils/uses_curl.rb +22 -12
- data/lib/chimps/utils.rb +50 -6
- data/lib/chimps/workflows/download.rb +72 -0
- data/lib/chimps/workflows/upload.rb +113 -0
- data/lib/chimps.rb +12 -12
- data/spec/chimps/query_request_spec.rb +44 -0
- data/spec/chimps/request_spec.rb +92 -0
- data/spec/chimps/response_spec.rb +0 -1
- data/spec/chimps/workflows/download_spec.rb +48 -0
- data/spec/spec_helper.rb +2 -19
- metadata +46 -91
- data/.document +0 -5
- data/.gitignore +0 -32
- data/CHANGELOG.textile +0 -4
- data/bin/chimps +0 -5
- data/lib/chimps/cli.rb +0 -28
- data/lib/chimps/commands/base.rb +0 -65
- data/lib/chimps/commands/batch.rb +0 -40
- data/lib/chimps/commands/create.rb +0 -31
- data/lib/chimps/commands/destroy.rb +0 -26
- data/lib/chimps/commands/download.rb +0 -46
- data/lib/chimps/commands/help.rb +0 -100
- data/lib/chimps/commands/list.rb +0 -41
- data/lib/chimps/commands/query.rb +0 -82
- data/lib/chimps/commands/search.rb +0 -48
- data/lib/chimps/commands/show.rb +0 -30
- data/lib/chimps/commands/test.rb +0 -39
- data/lib/chimps/commands/update.rb +0 -34
- data/lib/chimps/commands/upload.rb +0 -50
- data/lib/chimps/commands.rb +0 -125
- data/lib/chimps/typewriter.rb +0 -349
- data/lib/chimps/utils/log.rb +0 -48
- data/lib/chimps/utils/uses_model.rb +0 -34
- data/lib/chimps/utils/uses_yaml_data.rb +0 -93
- data/lib/chimps/workflows/batch.rb +0 -127
- data/lib/chimps/workflows/downloader.rb +0 -102
- data/lib/chimps/workflows/up.rb +0 -149
- data/lib/chimps/workflows/upload/bundler.rb +0 -249
- data/lib/chimps/workflows/upload/notifier.rb +0 -59
- data/lib/chimps/workflows/upload/token.rb +0 -77
- data/lib/chimps/workflows/upload/uploader.rb +0 -51
- data/lib/chimps/workflows.rb +0 -12
- data/spec/chimps/typewriter_spec.rb +0 -114
- data/spec/chimps/workflows/upload/bundler_spec.rb +0 -75
- data/spec/chimps/workflows/upload/token_spec.rb +0 -6
data/Gemfile
CHANGED
@@ -1,16 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
source :gemcutter
|
3
3
|
gem "json"
|
4
|
-
gem "configliere"
|
4
|
+
gem "configliere", ">= 0.3.2"
|
5
5
|
gem 'rest-client', '>= 1.6.1', :require => 'restclient'
|
6
|
+
gem 'addressable', :require => 'addressable/uri'
|
6
7
|
|
7
8
|
group :test do
|
8
|
-
gem "rspec"
|
9
|
+
gem "rspec"
|
9
10
|
end
|
10
|
-
|
11
|
-
group :upload do
|
12
|
-
gem 'imw', '>= 0.2.11'
|
13
|
-
gem 'activesupport', '2.3.5', :require => 'active_support'
|
14
|
-
gem 'addressable', :require => 'addressable/uri'
|
15
|
-
end
|
16
|
-
|
data/Gemfile.lock
CHANGED
@@ -1,24 +1,28 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
json (1.4.6)
|
4
|
+
addressable (2.2.4)
|
5
|
+
configliere (0.3.2)
|
6
|
+
diff-lcs (1.1.2)
|
7
|
+
json (1.5.1)
|
9
8
|
mime-types (1.16)
|
10
9
|
rest-client (1.6.1)
|
11
10
|
mime-types (>= 1.16)
|
12
|
-
rspec (
|
11
|
+
rspec (2.5.0)
|
12
|
+
rspec-core (~> 2.5.0)
|
13
|
+
rspec-expectations (~> 2.5.0)
|
14
|
+
rspec-mocks (~> 2.5.0)
|
15
|
+
rspec-core (2.5.1)
|
16
|
+
rspec-expectations (2.5.0)
|
17
|
+
diff-lcs (~> 1.1.2)
|
18
|
+
rspec-mocks (2.5.0)
|
13
19
|
|
14
20
|
PLATFORMS
|
15
21
|
ruby
|
16
22
|
|
17
23
|
DEPENDENCIES
|
18
|
-
activesupport (= 2.3.5)
|
19
24
|
addressable
|
20
|
-
configliere
|
21
|
-
imw (>= 0.2.11)
|
25
|
+
configliere (>= 0.3.2)
|
22
26
|
json
|
23
27
|
rest-client (>= 1.6.1)
|
24
|
-
rspec
|
28
|
+
rspec
|
data/README.rdoc
CHANGED
@@ -1,278 +1,182 @@
|
|
1
|
-
|
2
|
-
and modify data:
|
1
|
+
= Who /are/ these Chimps?
|
3
2
|
|
4
|
-
|
5
|
-
|
3
|
+
Infochimps[http://www.infochimps.com] is an online data marketplace
|
4
|
+
and repository where anyone can find, share, and sell data.
|
6
5
|
|
7
|
-
|
8
|
-
RestClient) as well as a command-line tool.
|
6
|
+
Infochimps offers two APIs for users to access and modify data
|
9
7
|
|
10
|
-
|
11
|
-
|
8
|
+
- a {Dataset API}[http://www.infochimps.com/api] to list, show, create, update, and destroy datasets and associated resources on Infochimps[http://www.infochimps.com]
|
9
|
+
- a {Query API}[http://www.infochimps.com/api] to query data from particular rows of these datasets
|
12
10
|
|
13
|
-
|
11
|
+
*Chimps* is a Ruby library that makes interacting with Infochimps'
|
12
|
+
APIs as easy as
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
gem sources -a http://gemcutter.org
|
23
|
-
|
24
|
-
Then you can install Chimps with
|
25
|
-
|
26
|
-
gem install chimps
|
27
|
-
|
28
|
-
== API keys
|
29
|
-
|
30
|
-
You'll need an API key and secret from Infochimps before you can start
|
31
|
-
adding or modifying datasets via the Dataset API. {Sign up for an
|
32
|
-
Infochimps account}[http://infochimps.org/signup] and register for an
|
33
|
-
API key.
|
34
|
-
|
35
|
-
You'll need a separate API key to use the Query API, {register for one
|
36
|
-
now}[http://api.infochimps.com/features-and-pricing].
|
37
|
-
|
38
|
-
Once you've registered for the API(s) you'll need to put them in your
|
39
|
-
<tt>~/.chimps</tt> file which should look like
|
40
|
-
|
41
|
-
# -*-yaml-*-
|
42
|
-
:site:
|
43
|
-
:username: monkeyboy
|
44
|
-
:key: xxxxxxxxxxxxxxxx
|
45
|
-
:secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
46
|
-
:query:
|
47
|
-
:username: monkeyboy
|
48
|
-
:key: xxxxxxxxxxxxxxxxx
|
49
|
-
|
50
|
-
= Usage
|
51
|
-
|
52
|
-
Chimps can be used as a library in your own code or as a command-line
|
53
|
-
tool.
|
54
|
-
|
55
|
-
== Chimps on the Command Line
|
14
|
+
require 'rubygems'
|
15
|
+
require 'chimps'
|
16
|
+
|
17
|
+
# Sign up for an Infochimps account and get your keys from
|
18
|
+
# http://www.infochimps.com/me
|
19
|
+
Chimps.config[:dataset][:key] = "Your Dataset API key"
|
20
|
+
Chimps.config[:dataset][:secret] = "Your Dataset API secret"
|
56
21
|
|
57
|
-
|
58
|
-
|
22
|
+
# list datasets in JSON
|
23
|
+
Chimps::Request.new("/datasets").get.print
|
59
24
|
|
60
|
-
|
25
|
+
You can use Chimps into your web application or into any other
|
26
|
+
Ruby software that talks to Infochimps.
|
61
27
|
|
62
|
-
|
28
|
+
If you're interested in a command line client built on top of Chimps,
|
29
|
+
try {Chimps CLI}[http://github.com/infochimps/chimps-cli].
|
63
30
|
|
64
|
-
|
31
|
+
= First Steps
|
65
32
|
|
66
|
-
|
33
|
+
== Installing Chimps
|
67
34
|
|
68
|
-
|
69
|
-
|
70
|
-
performing.
|
35
|
+
Chimps is hosted as a gem on RubyGems[http://rubygems.org]. You can
|
36
|
+
see your current gem sources with
|
71
37
|
|
72
|
-
|
38
|
+
$ gem sources
|
73
39
|
|
74
|
-
|
40
|
+
If you don't see <tt>http://rubygems.org</tt> you'll have to add it
|
75
41
|
with
|
76
42
|
|
77
|
-
|
78
|
-
|
79
|
-
Chimps will try and print informative error messages if it finds it
|
80
|
-
can't authenticate you.
|
81
|
-
|
82
|
-
=== Searching
|
83
|
-
|
84
|
-
Search datasets
|
85
|
-
|
86
|
-
chimps search 'statisical abstract'
|
87
|
-
|
88
|
-
or other kinds of models
|
89
|
-
|
90
|
-
chimps search -m source 'Department of Justice'
|
91
|
-
|
92
|
-
This _does_ _not_ require credentials for the RESTful API.
|
93
|
-
|
94
|
-
=== Listing
|
95
|
-
|
96
|
-
You can list your datasets
|
97
|
-
|
98
|
-
chimps list
|
99
|
-
|
100
|
-
or all datasets
|
101
|
-
|
102
|
-
chimps list -a
|
103
|
-
|
104
|
-
=== Showing
|
105
|
-
|
106
|
-
You can get more information about a particular dataset (as a YAML
|
107
|
-
document)
|
43
|
+
$ gem sources -a http://rubygems.org
|
108
44
|
|
109
|
-
|
110
|
-
|
111
|
-
This _does_ _not_ require credentials for the RESTful API.
|
112
|
-
|
113
|
-
=== Creating
|
114
|
-
|
115
|
-
You can create a dataset, passing properties directly on the command
|
116
|
-
line
|
117
|
-
|
118
|
-
chimps create title="My Awesome Dataset" description="Curt, but informative."
|
119
|
-
16011 my-awesome-dataset 2010-05-25T22:52:16Z My Awesome Dataset
|
120
|
-
|
121
|
-
or from a YAML input file
|
122
|
-
|
123
|
-
chimps create my_awesome_dataset.yaml
|
124
|
-
16011 my-awesome-dataset 2010-05-25T22:52:16Z My Awesome Dataset
|
125
|
-
|
126
|
-
Examples of input files are in the <tt>examples</tt> directory of the
|
127
|
-
Chimps distribution.
|
128
|
-
|
129
|
-
=== Updating
|
130
|
-
|
131
|
-
You can also update an existing dataset
|
132
|
-
|
133
|
-
chimps update my-awesome-dataset title="My TOTALLY Awesome Dataset"
|
134
|
-
|
135
|
-
Passing in data works just like the <tt>create</tt> command.
|
136
|
-
|
137
|
-
=== Destroying
|
138
|
-
|
139
|
-
You can destroy datasets as well
|
140
|
-
|
141
|
-
chimps destroy my-awesome-dataset
|
142
|
-
|
143
|
-
=== Downloading
|
144
|
-
|
145
|
-
You can download a dataset from Infochimps
|
146
|
-
|
147
|
-
chimps download my-awesome-dataset
|
148
|
-
|
149
|
-
which will put it in the current directory.
|
150
|
-
|
151
|
-
You can also specify a format or package.
|
152
|
-
|
153
|
-
chimps download -f csv -p tar.bz2 my-awesome-dataset
|
45
|
+
Then you can install Chimps with
|
154
46
|
|
155
|
-
|
47
|
+
$ sudo gem install chimps
|
156
48
|
|
157
|
-
|
158
|
-
Infochimps
|
49
|
+
== Configuring Chimps
|
159
50
|
|
160
|
-
|
161
|
-
|
51
|
+
You'll need a Dataset API key and secret from Infochimps before you
|
52
|
+
can start adding or modifying datasets via the Dataset API. {Sign up
|
53
|
+
for an Infochimps account}[http://www.infochimps.com/signup] and get
|
54
|
+
your {Dataset API key}[http://www.infochimps.com/me].
|
162
55
|
|
163
|
-
|
164
|
-
|
165
|
-
(though Chimps will try and guess). Chimps will NOT make an archive
|
166
|
-
if you only attempt to upload a single file and it is already an
|
167
|
-
archive.
|
56
|
+
To query particular rows from a dataset, you'll also need to get a
|
57
|
+
{Query API key}[http://www.infochimps.com/api].
|
168
58
|
|
169
|
-
|
170
|
-
|
171
|
-
|
59
|
+
You can always explicitly set values in <tt>Chimps.config</tt> like
|
60
|
+
in the first example at the top of this +README+ but you may find it
|
61
|
+
more convenient to keep your keys in a configuration file.
|
172
62
|
|
173
|
-
|
63
|
+
Chimps will look for configuration in two places:
|
64
|
+
<tt>/etc/chimps/chimps.yaml</tt> and <tt>~/.chimps</tt>. Once you've
|
65
|
+
registered for the API(s) you can create one of these files. The
|
66
|
+
configuration file looks like
|
174
67
|
|
175
|
-
Chimps allows you to peform batch requests against the Infochimps REST
|
176
|
-
API in which many changes are affected through a single API call.
|
177
68
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
to update or create. Each resource's data can be attached to local
|
186
|
-
paths to upload. These paths will be packaged and uploaded (just as
|
187
|
-
in the +upload+ command) after the batch update finishes.
|
188
|
-
|
189
|
-
Errors in a particular resource will not cause the whole batch job to
|
190
|
-
fail (as above).
|
69
|
+
# -*-yaml-*-
|
70
|
+
# ~/.chimps
|
71
|
+
:site:
|
72
|
+
:key: xxxxxxxxxxxxxxxx
|
73
|
+
:secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
74
|
+
:query:
|
75
|
+
:key: xxxxxxxxxxxxxxxxx
|
191
76
|
|
192
|
-
|
193
|
-
|
194
|
-
distribution or by visiting the {Infochimps REST
|
195
|
-
API}[http://infochimps.org/api].
|
77
|
+
Your personal configuration file (<tt>~/.chimps</tt>) will override
|
78
|
+
the site-configuration file (<tt>/etc/chimps/chimps.yaml</tt>).
|
196
79
|
|
197
|
-
|
80
|
+
You have to explicitly tell Chimps to read your configuration file
|
81
|
+
when you require it:
|
198
82
|
|
199
|
-
|
200
|
-
|
83
|
+
require 'rubygems'
|
84
|
+
require 'chimps'
|
201
85
|
|
202
|
-
|
203
|
-
|
86
|
+
# reads configuration files
|
87
|
+
Chimps.boot!
|
204
88
|
|
205
|
-
|
206
|
-
the command line.
|
89
|
+
# ..do stuff
|
207
90
|
|
208
|
-
|
209
|
-
array of such parameter hashes and will result in multiple queries
|
210
|
-
being made (to the same dataset)
|
91
|
+
= Making Requests
|
211
92
|
|
212
|
-
|
213
|
-
{"replies_out":13,"account_age":602,"statuses":166,"id":15748351,"replies_in":22,"screen_name":"infochimps"}
|
214
|
-
{"replies_out":940,"account_age":440,"statuses":5015,"id":19058681,"replies_in":88909,"screen_name":"aplusk"}
|
215
|
-
{"replies_out":0,"account_age":1123,"statuses":634,"id":813286,"replies_in":14541,"screen_name":"BarackObama"}
|
93
|
+
== Dataset API
|
216
94
|
|
217
|
-
|
95
|
+
You can use the {Dataset API}[http://www.infochimps.com/api] to
|
96
|
+
search, list, show, create, update, or destroy datasets and other
|
97
|
+
resources at Infochimps.
|
218
98
|
|
219
|
-
|
220
|
-
|
99
|
+
If instead of /creating/ a dataset with 100,000 baby names you want to
|
100
|
+
/query/ a dataset of 100,000 baby names then you should skip down to
|
101
|
+
the Query API section below.
|
221
102
|
|
222
|
-
|
223
|
-
|
103
|
+
You can find a complete list of Dataset API endpoints, expected
|
104
|
+
parameters, return codes, documentation, and authentication
|
105
|
+
requirements at http://www.infochimps.com/api.
|
224
106
|
|
225
|
-
===
|
107
|
+
=== A Simple +GET+ Request
|
226
108
|
|
227
|
-
|
228
|
-
|
229
|
-
|
109
|
+
The <tt>Chimps::Request</tt> class makes requests against the Dataset
|
110
|
+
API. Create a request by specifying a path on the Infochimps server.
|
111
|
+
The extension of the path determines the MIME type that Infochimps
|
112
|
+
will respond with:
|
230
113
|
|
231
|
-
|
232
|
-
|
114
|
+
# list datasets
|
115
|
+
request = Chimps::Request.new('/datasets.json')
|
116
|
+
response = request.get
|
117
|
+
response.print
|
118
|
+
# lotsa JSON...
|
233
119
|
|
234
|
-
|
235
|
-
to do so by calling
|
120
|
+
=== Understanding the Response
|
236
121
|
|
237
|
-
|
122
|
+
The +response+ above is an instance of <tt>Chimps::Response</tt>. You
|
123
|
+
can examine <tt>response.body<tt>, <tt>response.code</tt>,
|
124
|
+
<tt>response.headers</tt>, &c.
|
238
125
|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
match the structure of a <tt>~/.chimps</tt> file).
|
126
|
+
response.code #=> 200
|
127
|
+
response.headers #=> Hash of headers
|
128
|
+
response.body #=> JSON text
|
243
129
|
|
244
|
-
|
130
|
+
Since the response is a structured data format, you can parse it and
|
131
|
+
look inside:
|
245
132
|
|
246
|
-
|
247
|
-
|
248
|
-
|
133
|
+
response.parse!
|
134
|
+
response.size #=> 20
|
135
|
+
response.each do |dataset|
|
136
|
+
# do something ...
|
137
|
+
end
|
249
138
|
|
250
|
-
|
251
|
-
Create a request by specifying a path on the Infochimps server (it
|
252
|
-
_must_ end with <tt>.json</tt> for now).
|
139
|
+
=== A Signed +GET+ Request
|
253
140
|
|
254
|
-
|
255
|
-
|
141
|
+
Many Dataset API calls at Infochimps (like listing datasets, above) do
|
142
|
+
not require the request to be signed in any way. Other requests,
|
143
|
+
which reveal your private information or create new datasets, &c. on
|
144
|
+
Infochimps will require your Dataset API secret to sign. You can see
|
145
|
+
a full list of the Dataset API endpoints available and whether or not
|
146
|
+
requests to each need to be signed at http://www.infochimps.com/api.
|
256
147
|
|
257
148
|
Assuming you've properly configured Chimps (see above) you ask the
|
258
149
|
request to sign itself.
|
259
150
|
|
260
|
-
|
151
|
+
# list only your datasets -- required to be signed
|
152
|
+
request = Chimps::Request.new('/my/datasets.json', :sign => true)
|
153
|
+
response = request.get
|
154
|
+
response.print
|
155
|
+
# lotsa JSON...but only about *your* datasets
|
156
|
+
|
157
|
+
The authentication mechanism uses the Dataset API secret (which is
|
158
|
+
shared between you and Infochimps) to sign either the query string
|
159
|
+
(for the case of +GET+ and +DELETE+ requests) or the request body (for
|
160
|
+
+POST+ and +PUT+ requests).
|
261
161
|
|
262
|
-
|
263
|
-
You can also pass in query params
|
162
|
+
=== +PUT+, +POST+, and +DELETE+ Requests
|
264
163
|
|
265
|
-
|
164
|
+
All +POST+, +PUT+, and +DELETE+ requests to Infochimps are required to
|
165
|
+
be signed.
|
266
166
|
|
267
|
-
|
268
|
-
be signed if you ask.
|
167
|
+
Here's how to you might create a new dataset via a +POST+ request:
|
269
168
|
|
270
|
-
|
271
|
-
|
169
|
+
request = Chimps::Request('/datasets.json', :body => { :dataset => { :title => "My Awesome Dataset", :description => "An amazing description." }}, :sign => true)
|
170
|
+
response = request.post
|
171
|
+
response.code #=> 201
|
172
|
+
response.print
|
173
|
+
# your new dataset in JSON...
|
174
|
+
response.parse!
|
175
|
+
response['dataset']['id'] #=> 20876
|
272
176
|
|
273
|
-
|
274
|
-
|
275
|
-
|
177
|
+
You can find a complete list of what Dataset API endpoints are
|
178
|
+
available and what parameters they take at
|
179
|
+
http://www.infochimps.com/api.
|
276
180
|
|
277
181
|
=== Using the Query API
|
278
182
|
|
@@ -283,34 +187,36 @@ API}[http://api.infochimps.com].
|
|
283
187
|
|
284
188
|
All QueryRequests will automatically be signed.
|
285
189
|
|
286
|
-
|
287
|
-
|
190
|
+
request = Chimps::QueryRequest.new('soc/net/tw/trstrank.json', :query_params => { :screen_name => 'infochimps' } )
|
191
|
+
response = request.get
|
192
|
+
response.print
|
193
|
+
#=> {"trstrank":1.75,"user_id":15748351,"tq":96,"screen_name":"infochimps"}
|
288
194
|
|
289
|
-
|
195
|
+
= Downloading Data
|
290
196
|
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
authorization tokens).
|
197
|
+
You can download the data for a dataset on Infochimps by making a
|
198
|
+
signed +POST+ request to obtain a download token and then making a
|
199
|
+
+GET+ request to the signed and expired URL contained in the token.
|
295
200
|
|
296
|
-
|
201
|
+
Chimps provides a +Download+ class to simplify this for you. Here's
|
202
|
+
an example.
|
297
203
|
|
298
|
-
|
299
|
-
|
300
|
-
|
204
|
+
download = Chimps::Download.new('my-awesome-dataset')
|
205
|
+
# save your data directory
|
206
|
+
download.download('/data')
|
301
207
|
|
302
|
-
|
303
|
-
brief example of how to use the Downloader:
|
208
|
+
= Uploading Data
|
304
209
|
|
305
|
-
|
306
|
-
|
210
|
+
Coming soon! For now you will have to upload your data manually
|
211
|
+
through the Infochimps website.
|
307
212
|
|
308
213
|
= Contributing
|
309
214
|
|
310
215
|
Chimps is an open source project created by the Infochimps team to
|
311
|
-
encourage adoption of
|
312
|
-
hosted on GitHub
|
216
|
+
encourage adoption of Infochimps' Dataset & Query APIs. The official
|
217
|
+
repository is hosted on GitHub
|
313
218
|
|
314
219
|
http://github.com/infochimps/chimps
|
315
220
|
|
316
|
-
|
221
|
+
Infochimps encourages you to contribute by cloning Chimps, adding your
|
222
|
+
feature or bugfix, writing a spec, and sending us a pull request.
|
data/Rakefile
CHANGED
@@ -6,16 +6,11 @@ begin
|
|
6
6
|
require 'jeweler'
|
7
7
|
Jeweler::Tasks.new do |gem|
|
8
8
|
gem.name = "chimps"
|
9
|
-
gem.summary = "Chimps
|
10
|
-
gem.description = "Chimps
|
11
|
-
gem.email = "coders@infochimps.
|
9
|
+
gem.summary = "Chimps is a Ruby interface for the Infochimps Dataset & Query APIs (http://www.infochimps.com/api)"
|
10
|
+
gem.description = "Chimps allows you to easily make API calls against Infochimps web services. Chimps!'s Request and Response classes take care of all the details so you can remain calm and RESTful."
|
11
|
+
gem.email = "coders@infochimps.com"
|
12
12
|
gem.homepage = "http://github.com/infochimps/chimps"
|
13
13
|
gem.authors = ["Dhruv Bansal"]
|
14
|
-
gem.add_dependency 'rest-client', ['>= 1.5.1']
|
15
|
-
gem.add_dependency 'json', ['>= 1.4.3']
|
16
|
-
gem.add_dependency 'imw', ['>= 0.2.3']
|
17
|
-
gem.add_development_dependency "rspec", [">= 1.2.9"]
|
18
|
-
gem.add_development_dependency "yard", [">= 0"]
|
19
14
|
gem.files.exclude "old/**/*"
|
20
15
|
end
|
21
16
|
Jeweler::GemcutterTasks.new
|
@@ -25,30 +20,6 @@ end
|
|
25
20
|
|
26
21
|
desc "Build tags"
|
27
22
|
task :tags do
|
28
|
-
system "etags -R README.rdoc
|
23
|
+
system "etags -R README.rdoc examples lib spec"
|
29
24
|
end
|
30
25
|
|
31
|
-
require 'spec/rake/spectask'
|
32
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
33
|
-
spec.libs << 'lib' << 'spec'
|
34
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
35
|
-
end
|
36
|
-
|
37
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
38
|
-
spec.libs << 'lib' << 'spec'
|
39
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
40
|
-
spec.rcov = true
|
41
|
-
end
|
42
|
-
|
43
|
-
task :spec => :check_dependencies
|
44
|
-
task :default => :spec
|
45
|
-
|
46
|
-
begin
|
47
|
-
require 'yard'
|
48
|
-
YARD::Rake::YardocTask.new
|
49
|
-
rescue LoadError
|
50
|
-
desc "Build YARD documentation"
|
51
|
-
task :yardoc do
|
52
|
-
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
53
|
-
end
|
54
|
-
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|