smugmugr 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.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.textile +60 -0
- data/Rakefile +43 -0
- data/VERSION +1 -0
- data/lib/smugmugr/album.rb +134 -0
- data/lib/smugmugr/base.rb +25 -0
- data/lib/smugmugr/category.rb +5 -0
- data/lib/smugmugr/community.rb +5 -0
- data/lib/smugmugr/family.rb +5 -0
- data/lib/smugmugr/friend.rb +5 -0
- data/lib/smugmugr/image.rb +89 -0
- data/lib/smugmugr/session.rb +126 -0
- data/lib/smugmugr/share_group.rb +5 -0
- data/lib/smugmugr/sub_category.rb +5 -0
- data/lib/smugmugr/theme.rb +5 -0
- data/lib/smugmugr/user.rb +34 -0
- data/lib/smugmugr/watermark.rb +5 -0
- data/lib/smugmugr.rb +32 -0
- data/smugmugr.gemspec +88 -0
- data/spec/album_spec.rb +51 -0
- data/spec/category_spec.rb +2 -0
- data/spec/community_spec.rb +2 -0
- data/spec/family_spec.rb +2 -0
- data/spec/friend_spec.rb +0 -0
- data/spec/image_spec.rb +26 -0
- data/spec/response_stubs.rb +567 -0
- data/spec/session_spec.rb +17 -0
- data/spec/sub_category_spec.rb +2 -0
- data/spec/test_helper.rb +10 -0
- data/spec/theme_spec.rb +2 -0
- data/spec/user_spec.rb +5 -0
- data/spec/watermark_spec.rb +2 -0
- metadata +118 -0
data/smugmugr.gemspec
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{smugmugr}
|
5
|
+
s.version = "0.3.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Rob Sterner"]
|
9
|
+
s.date = %q{2009-05-30}
|
10
|
+
s.email = %q{rob.sterner@gmail.com}
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE",
|
13
|
+
"README.textile"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
".document",
|
17
|
+
".gitignore",
|
18
|
+
"LICENSE",
|
19
|
+
"README.textile",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"lib/smugmugr.rb",
|
23
|
+
"lib/smugmugr/base.rb",
|
24
|
+
"lib/smugmugr/album.rb",
|
25
|
+
"lib/smugmugr/category.rb",
|
26
|
+
"lib/smugmugr/community.rb",
|
27
|
+
"lib/smugmugr/family.rb",
|
28
|
+
"lib/smugmugr/friend.rb",
|
29
|
+
"lib/smugmugr/image.rb",
|
30
|
+
"lib/smugmugr/session.rb",
|
31
|
+
"lib/smugmugr/share_group.rb",
|
32
|
+
"lib/smugmugr/sub_category.rb",
|
33
|
+
"lib/smugmugr/theme.rb",
|
34
|
+
"lib/smugmugr/user.rb",
|
35
|
+
"lib/smugmugr/watermark.rb",
|
36
|
+
"smugmugr.gemspec",
|
37
|
+
"spec/album_spec.rb",
|
38
|
+
"spec/category_spec.rb",
|
39
|
+
"spec/community_spec.rb",
|
40
|
+
"spec/family_spec.rb",
|
41
|
+
"spec/friend_spec.rb",
|
42
|
+
"spec/image_spec.rb",
|
43
|
+
"spec/response_stubs.rb",
|
44
|
+
"spec/session_spec.rb",
|
45
|
+
"spec/sub_category_spec.rb",
|
46
|
+
"spec/test_helper.rb",
|
47
|
+
"spec/theme_spec.rb",
|
48
|
+
"spec/user_spec.rb",
|
49
|
+
"spec/watermark_spec.rb",
|
50
|
+
]
|
51
|
+
s.has_rdoc = false
|
52
|
+
s.homepage = %q{http://github.com/fermion/smugmugr}
|
53
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
54
|
+
s.require_paths = ["lib"]
|
55
|
+
s.rubygems_version = %q{1.3.1}
|
56
|
+
s.summary = %q{smugmugr, the smugmug API wrapper}
|
57
|
+
s.test_files = [
|
58
|
+
"spec/album_spec.rb",
|
59
|
+
"spec/category_spec.rb",
|
60
|
+
"spec/community_spec.rb",
|
61
|
+
"spec/family_spec.rb",
|
62
|
+
"spec/friend_spec.rb",
|
63
|
+
"spec/image_spec.rb",
|
64
|
+
"spec/response_stubs.rb",
|
65
|
+
"spec/session_spec.rb",
|
66
|
+
"spec/sub_category_spec.rb",
|
67
|
+
"spec/test_helper.rb",
|
68
|
+
"spec/theme_spec.rb",
|
69
|
+
"spec/user_spec.rb",
|
70
|
+
"spec/watermark_spec.rb",
|
71
|
+
]
|
72
|
+
|
73
|
+
if s.respond_to? :specification_version then
|
74
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
75
|
+
s.specification_version = 2
|
76
|
+
|
77
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
78
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
79
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
80
|
+
else
|
81
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
82
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
83
|
+
end
|
84
|
+
else
|
85
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
86
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
87
|
+
end
|
88
|
+
end
|
data/spec/album_spec.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require File.dirname(__FILE__) + '/response_stubs'
|
3
|
+
|
4
|
+
describe("Smugmugr::Album") do
|
5
|
+
before(:all) do
|
6
|
+
@user = Smugmugr::User.new('anapikey')
|
7
|
+
end
|
8
|
+
|
9
|
+
describe("album_get") do
|
10
|
+
before(:all) do
|
11
|
+
@user.stubs(:call).returns(JSON.parse(albums_get))
|
12
|
+
@album = Smugmugr::Album.get(@user).first
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have a title" do
|
16
|
+
@album.title.should == "My Birthday 2008"
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should be in Category 'Other'" do
|
20
|
+
@album.category.name.should == "Other"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe("albums_get_info") do
|
25
|
+
before(:all) do
|
26
|
+
@album = Smugmugr::Album.new(@user)
|
27
|
+
@user.stubs(:call).returns(JSON.parse(albums_get_info))
|
28
|
+
@album.get_info
|
29
|
+
end
|
30
|
+
|
31
|
+
# spot checks that method_missing is working
|
32
|
+
it "should have 20 images" do
|
33
|
+
@album.image_count.should == 20
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should handle try to handle sumgumg's exceptions to camel case naming" do
|
37
|
+
# EXIF, for example
|
38
|
+
@album.exif.should be_true
|
39
|
+
end
|
40
|
+
|
41
|
+
# spot checks that complex attributes function as expected
|
42
|
+
it "should be watermarked with name: Smugmug" do
|
43
|
+
@album.watermark.name.should == "SmugMug"
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should be in a category named 'Other' with id 0" do
|
47
|
+
@album.category.name.should == "Other"
|
48
|
+
@album.category.id.should == 0
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/spec/family_spec.rb
ADDED
data/spec/friend_spec.rb
ADDED
File without changes
|
data/spec/image_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper'
|
2
|
+
require File.dirname(__FILE__) + '/response_stubs'
|
3
|
+
|
4
|
+
describe("Image") do
|
5
|
+
before(:all) do
|
6
|
+
@user = Smugmugr::User.new('anapikey')
|
7
|
+
@user.stubs(:call).returns(JSON.parse(images_get))
|
8
|
+
@album = Smugmugr::Album.new(@user)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe("images_get") do
|
12
|
+
before(:all) do
|
13
|
+
@images = Smugmugr::Image.get(@album)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should have one image" do
|
17
|
+
@images.size.should == 1
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
describe("image_get_info") do
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|