thewalters 0.2.1 → 0.3.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.
- checksums.yaml +4 -4
- data/README.rdoc +0 -1
- data/VERSION +1 -1
- data/lib/thewalters.rb +1 -0
- data/lib/thewalters/art_object.rb +1 -1
- data/lib/thewalters/base.rb +7 -0
- data/lib/thewalters/image.rb +18 -0
- data/thewalters.gemspec +3 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e7786ebfa1f5e96a250839a0e74ed0a59f8c8a1
|
4
|
+
data.tar.gz: 51a616cbaa2df49b5a1ea7e98bd604e650d4fcd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f0fd3c7372720de592528a0f63d59b51aa7daa01f4161e785084c3a2bdc17837cf59ef6fc619a3f49913d9ab7addae3566b207744c58203d90e4a6e5f3e165
|
7
|
+
data.tar.gz: 83f3272151918b2c7e1d463b5d3dc44a3191a954216d4af181503dc4dc1f1152e667e7213182f4e16c93eaecd6fa7232e38a7a399253b1773b0135c87ff51112
|
data/README.rdoc
CHANGED
@@ -34,7 +34,6 @@ API client available for attendees of {ArtBytes 2014}[http://www.eventbrite.com/
|
|
34
34
|
|
35
35
|
=== Things that need to be done
|
36
36
|
* Add more tests
|
37
|
-
* implement objects/:id/images with a first-class image object
|
38
37
|
|
39
38
|
=== Do's and Don'ts
|
40
39
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/thewalters.rb
CHANGED
data/lib/thewalters/base.rb
CHANGED
@@ -42,6 +42,13 @@ module TheWalters
|
|
42
42
|
result
|
43
43
|
end
|
44
44
|
|
45
|
+
def self.get_images(id)
|
46
|
+
path = [version, api_path, id, 'images'].join("/")
|
47
|
+
result = fetch(path)
|
48
|
+
result["Items"] = result["Items"].map {|o| Image.new(o) }
|
49
|
+
result
|
50
|
+
end
|
51
|
+
|
45
52
|
def self.version; "v1" end
|
46
53
|
def self.base_url; "http://api.thewalters.org" end
|
47
54
|
def self.path
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'uri'
|
2
|
+
module TheWalters
|
3
|
+
# The URLs for images are able to accept a number of parameters.
|
4
|
+
# See https://github.com/WaltersArtMuseum/walters-api/blob/master/images.md
|
5
|
+
# and https://github.com/JimBobSquarePants/ImageProcessor
|
6
|
+
class Image < Hashie::Mash
|
7
|
+
|
8
|
+
def url(params={})
|
9
|
+
escaped_params_as_string = params.to_a.map {|n,v| "#{URI.escape(n.to_s)}=#{URI.escape(v.to_s)}" }.join("&") if params.any?
|
10
|
+
[self.ImageURL, escaped_params_as_string].compact.join('?')
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
self.url
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/thewalters.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: thewalters 0.
|
5
|
+
# stub: thewalters 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "thewalters"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.authors = ["Jonathan Julian"]
|
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|
33
33
|
"lib/thewalters/collection.rb",
|
34
34
|
"lib/thewalters/exhibition.rb",
|
35
35
|
"lib/thewalters/geography.rb",
|
36
|
+
"lib/thewalters/image.rb",
|
36
37
|
"lib/thewalters/location.rb",
|
37
38
|
"test/helper.rb",
|
38
39
|
"test/test_base.rb",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thewalters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Julian
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- lib/thewalters/collection.rb
|
132
132
|
- lib/thewalters/exhibition.rb
|
133
133
|
- lib/thewalters/geography.rb
|
134
|
+
- lib/thewalters/image.rb
|
134
135
|
- lib/thewalters/location.rb
|
135
136
|
- test/helper.rb
|
136
137
|
- test/test_base.rb
|