cameraplus 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -0
- data/README.md +2 -0
- data/cameraplus.gemspec +1 -1
- data/lib/cameraplus/page_metadata.rb +5 -1
- data/lib/cameraplus/version.rb +1 -1
- data/spec/cameraplus/api/page_spec.rb +5 -5
- data/spec/cameraplus/page_metadata_spec.rb +6 -0
- data/spec/vcr_cassettes/page.yml +44 -3
- metadata +17 -16
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Cameraplus (Camera+)
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/kevintuhumury/cameraplus.png)](http://travis-ci.org/kevintuhumury/cameraplus)
|
4
|
+
|
3
5
|
This gem provides a Ruby wrapper around the Camera+ API, using HTTParty. [Camera+](http://camerapl.us) is an iPhone photo app made by [tap tap tap](http://taptaptap.com) with effects made by professional photographer Lisa Bettany. Cameraplus is based on the [Web Sharing API](http://api.campl.us/web-api).
|
4
6
|
|
5
7
|
## Installation
|
data/cameraplus.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.email = ["kevin.tuhumury@gmail.com"]
|
9
9
|
gem.homepage = "http://github.com/kevintuhumury/cameraplus"
|
10
10
|
gem.summary = %q{A Ruby wrapper around the Camera+ (camerapl.us) API.}
|
11
|
-
gem.description = %q{This gem provides a Ruby wrapper around the Camera+ (camerapl.us) API for use in your own project.}
|
11
|
+
gem.description = %q{This gem provides a Ruby wrapper around the Camera+ (http://camerapl.us) iPhone app Web Sharing API for use in your own project.}
|
12
12
|
|
13
13
|
gem.files = `git ls-files`.split("\n")
|
14
14
|
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -42,7 +42,11 @@ module Cameraplus
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def parse_comments
|
45
|
-
|
45
|
+
begin
|
46
|
+
@comments ||= @data.comments.map { |comment| Comment.new comment }
|
47
|
+
rescue NoMethodError => e
|
48
|
+
@comments = []
|
49
|
+
end
|
46
50
|
end
|
47
51
|
|
48
52
|
def parsed_url
|
data/lib/cameraplus/version.rb
CHANGED
@@ -2,16 +2,16 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Cameraplus::API::Page do
|
4
4
|
|
5
|
-
use_vcr_cassette :page
|
5
|
+
use_vcr_cassette :page, :record => :new_episodes
|
6
6
|
|
7
7
|
it "should receive a Hash" do
|
8
8
|
response = Cameraplus::API::Page.find "b72Z"
|
9
9
|
response.should be_a Hash
|
10
10
|
end
|
11
|
-
|
12
|
-
it "should
|
13
|
-
Cameraplus::API::
|
14
|
-
|
11
|
+
|
12
|
+
it "should parse page from 'Create a web link' API" do
|
13
|
+
response = Cameraplus::API::Page.find "gcD72vPLXoq"
|
14
|
+
response.should be_a Hash
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
@@ -111,6 +111,12 @@ describe Cameraplus::PageMetadata do
|
|
111
111
|
it "should know the authors of the comments" do
|
112
112
|
subject.comments.map(&:author).should eq ["Lisa Bettany", "Oleg Lutsenko", "Oliver Penack", "John Goundry \u2714", "Jason Hansen", "Jonathan Feuer"]
|
113
113
|
end
|
114
|
+
|
115
|
+
it "should be optional" do
|
116
|
+
subject = Cameraplus::PageMetadata.find "gcD72vPLXoq"
|
117
|
+
subject.comments.should be_an Array
|
118
|
+
subject.comments.size.should eq 0
|
119
|
+
end
|
114
120
|
|
115
121
|
end
|
116
122
|
|
data/spec/vcr_cassettes/page.yml
CHANGED
@@ -39,7 +39,8 @@ http_interactions:
|
|
39
39
|
encoding: US-ASCII
|
40
40
|
string: ! '{"page":{"timestamp":"2011-07-01 21:50:40","views":925,"comments":6,"tweet":{"id":"86914646237384704","text":"Tiny
|
41
41
|
Town of Kotor, Montenegro #mybestphoto","userid":14199276,"username":"lucyk","realname":"Oleg
|
42
|
-
Lutsenko","avatar":"http:\/\/a0.twimg.com\/profile_images\/1318866321\/avatar1_sqr_normal.jpg"},"location":{"coords":"42.574017
|
42
|
+
Lutsenko","avatar":"http:\/\/a0.twimg.com\/profile_images\/1318866321\/avatar1_sqr_normal.jpg"},"location":{"coords":"42.574017
|
43
|
+
18.641312","name":"Kotor, Montenegro"}},"pictures":[{"800px":"http:\/\/pics.campl.us\/f\/f\/f2cc65ab786741e7ab9fb994d06626a6.jpg","120px":"http:\/\/pics.campl.us\/t\/f\/f2cc65ab786741e7ab9fb994d06626a6.jpg","480px":"http:\/\/pics.campl.us\/iphone\/f\/f2cc65ab786741e7ab9fb994d06626a6.jpg","fullwidth":800,"fullheight":597,"recipe":[{"type":"scenemode","value":"<a
|
43
44
|
href=\"\/clarity\" class=\"claritylink\">Clarity<\/a>"},{"type":"fx","value":"Miniaturize
|
44
45
|
(80%)"}],"exifdata":[{"title":"Camera","value":"Apple iPhone","style":"main"},{"title":"Software","value":"Camera+
|
45
46
|
2.2.1","style":"main"},{"title":"Exposure","value":"1\/580 sec","style":"main"},{"title":"Aperture","value":"f\/2.4","style":"main"},{"title":"Focal
|
@@ -53,6 +54,46 @@ http_interactions:
|
|
53
54
|
love tilt-shift photos & this is one of the best that I have seen. Great
|
54
55
|
shot!"},{"author":"Jonathan Feuer","avatar":"http:\/\/a1.twimg.com\/profile_images\/1375174511\/2D45AE39-9DB5-45C1-9F6E-D214DAEE514E_normal","url":"http:\/\/twitter.com\/SporTech","text":"This
|
55
56
|
looks fantastic! Congrats."}]}'
|
56
|
-
http_version:
|
57
|
+
http_version:
|
57
58
|
recorded_at: Mon, 19 Mar 2012 20:42:07 GMT
|
58
|
-
|
59
|
+
- request:
|
60
|
+
method: get
|
61
|
+
uri: http://camerapl.us/gcD72vPLXoq:info?
|
62
|
+
body:
|
63
|
+
encoding: US-ASCII
|
64
|
+
string: ''
|
65
|
+
headers: {}
|
66
|
+
response:
|
67
|
+
status:
|
68
|
+
code: 200
|
69
|
+
message: OK
|
70
|
+
headers:
|
71
|
+
Cache-Control:
|
72
|
+
- no-store, no-cache, must-revalidate, post-check=0, pre-check=0
|
73
|
+
Content-Type:
|
74
|
+
- application/json
|
75
|
+
Date:
|
76
|
+
- Sun, 29 Apr 2012 05:21:12 GMT
|
77
|
+
Expires:
|
78
|
+
- Thu, 19 Nov 1981 08:52:00 GMT
|
79
|
+
Pragma:
|
80
|
+
- no-cache
|
81
|
+
Server:
|
82
|
+
- Apache/2.2.22 (Amazon)
|
83
|
+
Set-Cookie:
|
84
|
+
- PHPSESSID=r2j3s5afiveiu8bs2n8apu2rf5; expires=Fri, 26-Oct-2012 05:21:12 GMT;
|
85
|
+
path=/; domain=.campl.us
|
86
|
+
- PHPSESSID=r2j3s5afiveiu8bs2n8apu2rf5; expires=Fri, 26-Oct-2012 05:21:12 GMT;
|
87
|
+
path=/; domain=.campl.us
|
88
|
+
X-Powered-By:
|
89
|
+
- PHP/5.3.10
|
90
|
+
Content-Length:
|
91
|
+
- '472'
|
92
|
+
Connection:
|
93
|
+
- keep-alive
|
94
|
+
body:
|
95
|
+
encoding: US-ASCII
|
96
|
+
string: ! '{"page":{"timestamp":"2012-04-24 09:54:45","views":44,"comments":0,"tweet":{"id":null,"text":"link","userid":null,"username":null,"realname":null,"avatar":null}},"pictures":[{"800px":"http:\/\/pics.campl.us\/f\/8\/8da5f70558ea9027e1fe5890af52e113.jpg","120px":"http:\/\/pics.campl.us\/t\/8\/8da5f70558ea9027e1fe5890af52e113.jpg","480px":"http:\/\/pics.campl.us\/iphone\/8\/8da5f70558ea9027e1fe5890af52e113.jpg","fullwidth":533,"fullheight":800,"recipe":[],"exifdata":[]}]}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Sun, 29 Apr 2012 05:21:12 GMT
|
99
|
+
recorded_with: VCR 2.1.1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cameraplus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
16
|
-
requirement: &
|
16
|
+
requirement: &70356308173740 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70356308173740
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: vcr
|
27
|
-
requirement: &
|
27
|
+
requirement: &70356308173320 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70356308173320
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &70356308172900 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70356308172900
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: webmock
|
49
|
-
requirement: &
|
49
|
+
requirement: &70356308188860 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70356308188860
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &70356308188440 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70356308188440
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: spec_coverage
|
71
|
-
requirement: &
|
71
|
+
requirement: &70356308188020 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,9 +76,9 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
description: This gem provides a Ruby wrapper around the Camera+ (camerapl.us)
|
81
|
-
for use in your own project.
|
79
|
+
version_requirements: *70356308188020
|
80
|
+
description: This gem provides a Ruby wrapper around the Camera+ (http://camerapl.us)
|
81
|
+
iPhone app Web Sharing API for use in your own project.
|
82
82
|
email:
|
83
83
|
- kevin.tuhumury@gmail.com
|
84
84
|
executables: []
|
@@ -87,6 +87,7 @@ extra_rdoc_files: []
|
|
87
87
|
files:
|
88
88
|
- .gitignore
|
89
89
|
- .rvmrc
|
90
|
+
- .travis.yml
|
90
91
|
- Gemfile
|
91
92
|
- LICENSE
|
92
93
|
- README.md
|