spadeio 0.0.1
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/.gitignore +17 -0
- data/Gemfile +4 -0
- data/Guardfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/lib/spadeio/api.rb +4 -0
- data/lib/spadeio/client.rb +50 -0
- data/lib/spadeio/version.rb +3 -0
- data/lib/spadeio.rb +12 -0
- data/spadeio.gemspec +30 -0
- data/spec/fixtures/bigres.json +186 -0
- data/spec/fixtures/empty.json +1 -0
- data/spec/fixtures/no_objects.json +0 -0
- data/spec/spade_io/client_spec.rb +75 -0
- data/spec/spec_helper.rb +15 -0
- metadata +195 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 jondot
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Spadeio
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'spadeio'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install spadeio
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/spadeio/api.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'faraday_middleware'
|
3
|
+
|
4
|
+
|
5
|
+
class SpadeIO::Client
|
6
|
+
attr_accessor :conn
|
7
|
+
|
8
|
+
def initialize(opts)
|
9
|
+
if !opts[:key]
|
10
|
+
raise "Please supply an authentication key in ':key'. Get yours at http://spade.io."
|
11
|
+
end
|
12
|
+
|
13
|
+
@opts = opts
|
14
|
+
@conn = Faraday.new(:url => SpadeIO::API::STABLE) do |faraday|
|
15
|
+
faraday.response :json
|
16
|
+
faraday.adapter Faraday.default_adapter
|
17
|
+
faraday.basic_auth(opts[:key],'')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def scrape(uri, bucket=nil)
|
22
|
+
res = scrape_all(uri, bucket)
|
23
|
+
body = res.body
|
24
|
+
if body && body.count > 0 && body.first['objects']
|
25
|
+
return body.first['objects']
|
26
|
+
else
|
27
|
+
return nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def scrape_all(uri, bucket)
|
32
|
+
res = @conn.get("scrape", { :url => uri })
|
33
|
+
|
34
|
+
|
35
|
+
# XXX seriously work on this error handling area.
|
36
|
+
# dev should get a clear explanation of:
|
37
|
+
#
|
38
|
+
# * what was wrong
|
39
|
+
# * what we think may be wrong, and how to fix it
|
40
|
+
# * where to get more information
|
41
|
+
#
|
42
|
+
if res.status != 200
|
43
|
+
raise "error"
|
44
|
+
end
|
45
|
+
|
46
|
+
res
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
data/lib/spadeio.rb
ADDED
data/spadeio.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'spadeio/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "spadeio"
|
8
|
+
spec.version = SpadeIO::VERSION
|
9
|
+
spec.authors = ["jondot"]
|
10
|
+
spec.email = ["jondotan@gmail.com"]
|
11
|
+
spec.description = %q{Intelligent content scraping - Ruby driver, see http://spade.io for more.}
|
12
|
+
spec.summary = %q{Intelligent content scraping - Ruby driver}
|
13
|
+
spec.homepage = "http://spade.io"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_runtime_dependency "faraday"
|
22
|
+
spec.add_runtime_dependency "faraday_middleware"
|
23
|
+
spec.add_runtime_dependency "webmock"
|
24
|
+
spec.add_runtime_dependency "multi_json"
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
27
|
+
spec.add_development_dependency "rake"
|
28
|
+
spec.add_development_dependency "guard-minitest"
|
29
|
+
spec.add_development_dependency "rr"
|
30
|
+
end
|
@@ -0,0 +1,186 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"objects": [
|
4
|
+
{
|
5
|
+
"format": "jpg",
|
6
|
+
"height": 360,
|
7
|
+
"kind": "image",
|
8
|
+
"orientation": "landscape",
|
9
|
+
"ratio": 0.5625,
|
10
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
11
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419173956-earth-day-nature-hikes-gaylor-lake-yosemite-story-top.jpg",
|
12
|
+
"width": 640,
|
13
|
+
"x-algo": "ogilansky"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"format": "jpg",
|
17
|
+
"height": 360,
|
18
|
+
"kind": "image",
|
19
|
+
"orientation": "landscape",
|
20
|
+
"ratio": 0.5625,
|
21
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
22
|
+
"title": "If you hike the 3/4 mile up the Gaylor Lakes trail in Yosemite National Park, your reward is an incredible view of middle Gaylor Lake.",
|
23
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419173956-earth-day-nature-hikes-gaylor-lake-yosemite-horizontal-gallery.jpg",
|
24
|
+
"width": 640,
|
25
|
+
"x-algo": "reutmann"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"format": "jpg",
|
29
|
+
"height": 360,
|
30
|
+
"kind": "image",
|
31
|
+
"orientation": "landscape",
|
32
|
+
"ratio": 0.5625,
|
33
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
34
|
+
"title": "Naturalist Beth Pratt always hopes to see the pika (in the same family as the rabbit) on her annual spring hike of Gaylor Lakes trail in Yosemite.",
|
35
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421152624-earth-day-pika-gaylor-lake-yosemite-horizontal-gallery.jpg",
|
36
|
+
"width": 640,
|
37
|
+
"x-algo": "reutmann"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"format": "jpg",
|
41
|
+
"height": 360,
|
42
|
+
"kind": "image",
|
43
|
+
"orientation": "landscape",
|
44
|
+
"ratio": 0.5625,
|
45
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
46
|
+
"title": "For a day in Yellowstone National Park, the Mount Washburn hike gives you the best bang for your wildlife, wildflower and scenery \"buck.\"",
|
47
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419174148-earth-day-mount-washburn-yellowstone-horizontal-gallery.jpg",
|
48
|
+
"width": 640,
|
49
|
+
"x-algo": "reutmann"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"format": "jpg",
|
53
|
+
"height": 360,
|
54
|
+
"kind": "image",
|
55
|
+
"orientation": "landscape",
|
56
|
+
"ratio": 0.5625,
|
57
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
58
|
+
"title": "Bighorn sheep give birth to their lambs in May and June, and hikers on the Mount Washburn trail in Yellowstone can sometimes spot lambs along the way. ",
|
59
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421153259-earth-day-mt-washburn-big-horn-lambs-horizontal-gallery.jpg",
|
60
|
+
"width": 640,
|
61
|
+
"x-algo": "reutmann"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"format": "jpg",
|
65
|
+
"height": 360,
|
66
|
+
"kind": "image",
|
67
|
+
"orientation": "landscape",
|
68
|
+
"ratio": 0.5625,
|
69
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
70
|
+
"title": "The Great Smoky Mountains are known as the salamander capital of the world, home to 30 species.",
|
71
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419175921-earth-day-great-smoky-mtns-horizontal-gallery.jpg",
|
72
|
+
"width": 640,
|
73
|
+
"x-algo": "reutmann"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"format": "jpg",
|
77
|
+
"height": 360,
|
78
|
+
"kind": "image",
|
79
|
+
"orientation": "landscape",
|
80
|
+
"ratio": 0.5625,
|
81
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
82
|
+
"title": "The views in Great Smoky Mountains National Park, located in North Carolina and Tennessee, are spectacular. ",
|
83
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421145519-earth-day-great-smoky-mountains-horizontal-gallery.jpg",
|
84
|
+
"width": 640,
|
85
|
+
"x-algo": "reutmann"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"format": "jpg",
|
89
|
+
"height": 360,
|
90
|
+
"kind": "image",
|
91
|
+
"orientation": "landscape",
|
92
|
+
"ratio": 0.5625,
|
93
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
94
|
+
"title": "Hiking the Lands End Coastal Trail, about 15 minutes from downtown San Francisco, you'll have incredible views -- and you might spot bottlenose dolphins and their calves. ",
|
95
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419175601-earth-day-lands-end-dolphins-and-calves-horizontal-gallery.jpg",
|
96
|
+
"width": 640,
|
97
|
+
"x-algo": "reutmann"
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"format": "jpg",
|
101
|
+
"height": 360,
|
102
|
+
"kind": "image",
|
103
|
+
"orientation": "landscape",
|
104
|
+
"ratio": 0.5625,
|
105
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
106
|
+
"title": "For wildlife, more than 200 species of resident and migratory birds have been sighted at Lands End, where a lovely trail will take you to Sutro Bath.\n",
|
107
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421150907-earth-day-sutro-baths-lands-end2-horizontal-gallery.jpg",
|
108
|
+
"width": 640,
|
109
|
+
"x-algo": "reutmann"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"format": "jpg",
|
113
|
+
"height": 360,
|
114
|
+
"kind": "image",
|
115
|
+
"orientation": "landscape",
|
116
|
+
"ratio": 0.5625,
|
117
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
118
|
+
"title": "The late CBS news travel correspondent Charles Kuralt called the Beartooth Highway, which runs through Montana and Wyoming, the \"most beautiful road in America.\"",
|
119
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419174417-earth-day-beartooth-hwy-horizontal-gallery.jpg",
|
120
|
+
"width": 640,
|
121
|
+
"x-algo": "reutmann"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"format": "jpg",
|
125
|
+
"height": 360,
|
126
|
+
"kind": "image",
|
127
|
+
"orientation": "landscape",
|
128
|
+
"ratio": 0.5625,
|
129
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
130
|
+
"title": "Drive the 67-mile Beartooth Highway to see the beautiful scenery, but don't forget to get out of the car to find many magnificent views a short walk from the road.",
|
131
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421151955-earth-day-beartooth-hwy-horizontal-gallery.jpg",
|
132
|
+
"width": 640,
|
133
|
+
"x-algo": "reutmann"
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"format": "jpg",
|
137
|
+
"height": 360,
|
138
|
+
"kind": "image",
|
139
|
+
"orientation": "landscape",
|
140
|
+
"ratio": 0.5625,
|
141
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
142
|
+
"title": "Head to Kearney, Nebraska, to see the great Sandhill Crane migration. About 500,000 of these spectacular birds make a spring pit stop here before heading north. ",
|
143
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130419175333-earth-day-platte-river-sandhill-cranes-horizontal-gallery.jpg",
|
144
|
+
"width": 640,
|
145
|
+
"x-algo": "reutmann"
|
146
|
+
},
|
147
|
+
{
|
148
|
+
"format": "jpg",
|
149
|
+
"height": 360,
|
150
|
+
"kind": "image",
|
151
|
+
"orientation": "landscape",
|
152
|
+
"ratio": 0.5625,
|
153
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
154
|
+
"title": "The sandhill crane spring migration, shown here in Nebraska, runs from February to April.",
|
155
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421145920-earth-day-platte-river-cranes2-horizontal-gallery.jpg",
|
156
|
+
"width": 640,
|
157
|
+
"x-algo": "reutmann"
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"format": "jpg",
|
161
|
+
"height": 360,
|
162
|
+
"kind": "image",
|
163
|
+
"orientation": "landscape",
|
164
|
+
"ratio": 0.5625,
|
165
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
166
|
+
"title": "Beth Pratt explored nature as a child in Cape Cod National Seashore in Massachusetts. The Great Island Trail in Wellfleet is shown here. ",
|
167
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421144053-earth-day-cape-cod-nat-seashore-nps-horizontal-gallery.jpg",
|
168
|
+
"width": 640,
|
169
|
+
"x-algo": "reutmann"
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"format": "jpg",
|
173
|
+
"height": 360,
|
174
|
+
"kind": "image",
|
175
|
+
"orientation": "landscape",
|
176
|
+
"ratio": 0.5625,
|
177
|
+
"source": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5",
|
178
|
+
"title": "Enjoy the Province Lands dunes in Provincetown, part of Cape Cod National Seashore.",
|
179
|
+
"uri": "http://i2.cdn.turner.com/cnn/dam/assets/130421154524-earth-day-cape-cod-natl-seashore-province-lands-dunes-horizontal-gallery.jpg",
|
180
|
+
"width": 640,
|
181
|
+
"x-algo": "reutmann"
|
182
|
+
}
|
183
|
+
],
|
184
|
+
"uri": "http://edition.cnn.com/2013/04/21/travel/earth-day-best-wildlife-sites/index.html?hpt=hp_bn5"
|
185
|
+
}
|
186
|
+
]
|
@@ -0,0 +1 @@
|
|
1
|
+
[]
|
File without changes
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
OPTS = { :key => 'foobar' }
|
5
|
+
API_ENDPOINT = "http://foobar:@api.spade.io/v1/"
|
6
|
+
|
7
|
+
|
8
|
+
describe SpadeIO::Client do
|
9
|
+
describe "#scrape" do
|
10
|
+
it "should fail given bad authentication info" do
|
11
|
+
Proc.new do
|
12
|
+
SpadeIO::Client.new({})
|
13
|
+
end.must_raise RuntimeError
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should send an authenticated scrape to a page" do
|
17
|
+
uri = "http://foo.example.com/article.html"
|
18
|
+
stub_request(:get,"#{API_ENDPOINT}scrape?url=#{CGI.escape uri}")
|
19
|
+
.to_return( :status => 200, :body => file_fixture('bigres.json'))
|
20
|
+
|
21
|
+
c = SpadeIO::Client.new(OPTS)
|
22
|
+
res = c.scrape(uri)
|
23
|
+
|
24
|
+
expected = JSON.parse(file_fixture('bigres.json')).first['objects']
|
25
|
+
assert_equal res, expected
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
#XXX DRY the shit out of this fixture code
|
30
|
+
it "should populate the result object given a successful response" do
|
31
|
+
uri = "http://foo.example.com/article.html"
|
32
|
+
stub_request(:get,"#{API_ENDPOINT}scrape?url=#{CGI.escape uri}")
|
33
|
+
.to_return( :status => 200, :body => file_fixture('bigres.json'))
|
34
|
+
|
35
|
+
c = SpadeIO::Client.new(OPTS)
|
36
|
+
res = c.scrape(uri)
|
37
|
+
|
38
|
+
expected = JSON.parse(file_fixture('bigres.json')).first['objects']
|
39
|
+
assert_equal res, expected
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should return nil with an empty response" do
|
43
|
+
uri = "http://foo.example.com/article.html"
|
44
|
+
stub_request(:get,"#{API_ENDPOINT}scrape?url=#{CGI.escape uri}")
|
45
|
+
.to_return( :status => 200, :body => file_fixture('empty.json'))
|
46
|
+
|
47
|
+
c = SpadeIO::Client.new(OPTS)
|
48
|
+
res = c.scrape(uri)
|
49
|
+
|
50
|
+
assert_equal res, nil
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should return nil when no objects" do
|
54
|
+
uri = "http://foo.example.com/article.html"
|
55
|
+
stub_request(:get,"#{API_ENDPOINT}scrape?url=#{CGI.escape uri}")
|
56
|
+
.to_return( :status => 200, :body => file_fixture('no_objects.json'))
|
57
|
+
|
58
|
+
c = SpadeIO::Client.new(OPTS)
|
59
|
+
res = c.scrape(uri)
|
60
|
+
|
61
|
+
assert_equal res, nil
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should return an error given a failed response" do
|
65
|
+
uri = "http://foo.example.com/article.html"
|
66
|
+
stub_request(:get,"#{API_ENDPOINT}scrape?url=#{CGI.escape uri}")
|
67
|
+
.to_return( :status => 500, :body => "")
|
68
|
+
|
69
|
+
c = SpadeIO::Client.new(OPTS)
|
70
|
+
Proc.new do
|
71
|
+
res = c.scrape(uri)
|
72
|
+
end.must_raise RuntimeError
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
$: << File.expand_path('../lib', File.dirname(__FILE__))
|
2
|
+
require 'rr'
|
3
|
+
require 'spadeio'
|
4
|
+
require 'minitest/autorun'
|
5
|
+
require 'webmock/minitest'
|
6
|
+
|
7
|
+
class MiniTest::Unit::TestCase
|
8
|
+
include RR::Adapters::MiniTest
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def file_fixture(fname)
|
13
|
+
open(File.expand_path("fixtures/#{fname}", File.dirname(__FILE__))).read
|
14
|
+
end
|
15
|
+
|
metadata
ADDED
@@ -0,0 +1,195 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spadeio
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- jondot
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: faraday
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: faraday_middleware
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: webmock
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: multi_json
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '1.3'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '1.3'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rake
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: guard-minitest
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rr
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
description: Intelligent content scraping - Ruby driver, see http://spade.io for more.
|
143
|
+
email:
|
144
|
+
- jondotan@gmail.com
|
145
|
+
executables: []
|
146
|
+
extensions: []
|
147
|
+
extra_rdoc_files: []
|
148
|
+
files:
|
149
|
+
- .gitignore
|
150
|
+
- Gemfile
|
151
|
+
- Guardfile
|
152
|
+
- LICENSE.txt
|
153
|
+
- README.md
|
154
|
+
- Rakefile
|
155
|
+
- lib/spadeio.rb
|
156
|
+
- lib/spadeio/api.rb
|
157
|
+
- lib/spadeio/client.rb
|
158
|
+
- lib/spadeio/version.rb
|
159
|
+
- spadeio.gemspec
|
160
|
+
- spec/fixtures/bigres.json
|
161
|
+
- spec/fixtures/empty.json
|
162
|
+
- spec/fixtures/no_objects.json
|
163
|
+
- spec/spade_io/client_spec.rb
|
164
|
+
- spec/spec_helper.rb
|
165
|
+
homepage: http://spade.io
|
166
|
+
licenses:
|
167
|
+
- MIT
|
168
|
+
post_install_message:
|
169
|
+
rdoc_options: []
|
170
|
+
require_paths:
|
171
|
+
- lib
|
172
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
174
|
+
requirements:
|
175
|
+
- - ! '>='
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
none: false
|
180
|
+
requirements:
|
181
|
+
- - ! '>='
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
requirements: []
|
185
|
+
rubyforge_project:
|
186
|
+
rubygems_version: 1.8.23
|
187
|
+
signing_key:
|
188
|
+
specification_version: 3
|
189
|
+
summary: Intelligent content scraping - Ruby driver
|
190
|
+
test_files:
|
191
|
+
- spec/fixtures/bigres.json
|
192
|
+
- spec/fixtures/empty.json
|
193
|
+
- spec/fixtures/no_objects.json
|
194
|
+
- spec/spade_io/client_spec.rb
|
195
|
+
- spec/spec_helper.rb
|