smile 0.4.3 → 0.4.4
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 +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +50 -0
- data/README.rdoc +0 -4
- data/Rakefile +4 -74
- data/lib/smile.rb +22 -21
- data/lib/smile/base.rb +11 -7
- data/lib/smile/json.rb +1 -1
- data/lib/smile/param_converter.rb +1 -1
- data/lib/smile/photo.rb +1 -1
- data/lib/smile/version.rb +3 -0
- data/smile.gemspec +30 -53
- data/test/smile_test.rb +76 -14
- metadata +106 -12
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
smile (0.4.4)
|
5
|
+
activesupport (>= 3.0)
|
6
|
+
i18n
|
7
|
+
rest-client
|
8
|
+
yajl-ruby (>= 0.7.8)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
activesupport (3.0.0)
|
14
|
+
diff-lcs (1.1.2)
|
15
|
+
formatador (0.0.15)
|
16
|
+
gestalt (0.0.11)
|
17
|
+
formatador (>= 0.0.12)
|
18
|
+
i18n (0.4.1)
|
19
|
+
mime-types (1.16)
|
20
|
+
rest-client (1.6.1)
|
21
|
+
mime-types (>= 1.16)
|
22
|
+
rr (1.0.0)
|
23
|
+
rspec (2.0.1)
|
24
|
+
rspec-core (~> 2.0.1)
|
25
|
+
rspec-expectations (~> 2.0.1)
|
26
|
+
rspec-mocks (~> 2.0.1)
|
27
|
+
rspec-core (2.0.1)
|
28
|
+
rspec-expectations (2.0.1)
|
29
|
+
diff-lcs (>= 1.1.2)
|
30
|
+
rspec-mocks (2.0.1)
|
31
|
+
rspec-core (~> 2.0.1)
|
32
|
+
rspec-expectations (~> 2.0.1)
|
33
|
+
shindo (0.1.6)
|
34
|
+
formatador (>= 0.0.14)
|
35
|
+
gestalt (>= 0.0.11)
|
36
|
+
yajl-ruby (0.7.8)
|
37
|
+
|
38
|
+
PLATFORMS
|
39
|
+
ruby
|
40
|
+
|
41
|
+
DEPENDENCIES
|
42
|
+
activesupport (>= 3.0)
|
43
|
+
bundler (>= 1.0.0)
|
44
|
+
i18n
|
45
|
+
rest-client
|
46
|
+
rr
|
47
|
+
rspec
|
48
|
+
shindo
|
49
|
+
smile!
|
50
|
+
yajl-ruby (>= 0.7.8)
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -1,45 +1,11 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
require 'date'
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
4
3
|
|
5
|
-
|
6
|
-
##
|
7
|
-
## Helper functions
|
8
|
-
##
|
9
|
-
##############################################################################
|
10
|
-
|
11
|
-
def name
|
12
|
-
@name ||= Dir['*.gemspec'].first.split('.').first
|
13
|
-
end
|
14
|
-
|
15
|
-
def version
|
16
|
-
line = File.read("lib/#{name}.rb")[/^\s*VERSION\s*=\s*.*/]
|
17
|
-
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
|
18
|
-
end
|
19
|
-
|
20
|
-
def date
|
21
|
-
Date.today.to_s
|
22
|
-
end
|
23
|
-
|
24
|
-
def rubyforge_project
|
25
|
-
name
|
26
|
-
end
|
27
|
-
|
28
|
-
def gemspec_file
|
29
|
-
"#{name}.gemspec"
|
30
|
-
end
|
31
|
-
|
32
|
-
def gem_file
|
33
|
-
"#{name}-#{version}.gem"
|
34
|
-
end
|
35
|
-
|
36
|
-
def replace_header(head, header_name)
|
37
|
-
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
|
38
|
-
end
|
4
|
+
task :default => :test
|
39
5
|
|
40
6
|
desc "Open an irb session preloaded with this library"
|
41
7
|
task :console do
|
42
|
-
sh "irb -rubygems -r ./lib
|
8
|
+
sh "irb -rubygems -r ./lib/smile.rb"
|
43
9
|
end
|
44
10
|
|
45
11
|
desc "Run Shindo rake tasks"
|
@@ -47,39 +13,3 @@ task :test do
|
|
47
13
|
sh "shindo #{Dir.glob( 'test/**/*_test.rb' ).join(' ')}"
|
48
14
|
end
|
49
15
|
|
50
|
-
begin
|
51
|
-
require 'jeweler'
|
52
|
-
Jeweler::Tasks.new do |gem|
|
53
|
-
gem.name = "smile"
|
54
|
-
gem.summary = %Q{Simple API for talking to SmugMug}
|
55
|
-
gem.email = "zac@kleinpeter.org"
|
56
|
-
gem.homepage = "http://github.com/cajun/smile"
|
57
|
-
gem.authors = ["cajun"]
|
58
|
-
gem.files << "lib/**/*"
|
59
|
-
gem.add_dependency( 'rest-client' )
|
60
|
-
gem.add_dependency( 'activesupport' )
|
61
|
-
gem.rubyforge_project = 'cajun-gems'
|
62
|
-
|
63
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
64
|
-
end
|
65
|
-
rescue LoadError
|
66
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
67
|
-
end
|
68
|
-
|
69
|
-
task :default => :test
|
70
|
-
|
71
|
-
require 'rake/rdoctask'
|
72
|
-
Rake::RDocTask.new do |rdoc|
|
73
|
-
if File.exist?('VERSION.yml')
|
74
|
-
config = YAML.load(File.read('VERSION.yml'))
|
75
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
76
|
-
else
|
77
|
-
version = ""
|
78
|
-
end
|
79
|
-
|
80
|
-
rdoc.rdoc_dir = 'rdoc'
|
81
|
-
rdoc.title = "smile #{version}"
|
82
|
-
rdoc.rdoc_files.include('README*')
|
83
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
84
|
-
end
|
85
|
-
|
data/lib/smile.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
require '
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'active_support/core_ext/string/inflections'
|
2
4
|
require 'restclient'
|
3
5
|
require 'ostruct'
|
6
|
+
require 'singleton'
|
7
|
+
require 'logger'
|
4
8
|
require File.dirname(__FILE__) + '/smile/session'
|
5
9
|
require File.dirname(__FILE__) + '/smile/common'
|
6
10
|
require File.dirname(__FILE__) + '/smile/base'
|
@@ -12,11 +16,11 @@ require File.dirname(__FILE__) + '/smile/exception'
|
|
12
16
|
require File.dirname(__FILE__) + '/smile/json'
|
13
17
|
require 'cgi'
|
14
18
|
require 'rss'
|
15
|
-
require '
|
19
|
+
require 'yajl'
|
16
20
|
|
17
21
|
module Smile
|
18
22
|
module_function
|
19
|
-
|
23
|
+
|
20
24
|
# Login to SmugMug using an anonymously account
|
21
25
|
# This will allow you to execute many functions, but no user specific functions
|
22
26
|
#
|
@@ -26,7 +30,7 @@ module Smile
|
|
26
30
|
smug.auth_anonymously
|
27
31
|
smug
|
28
32
|
end
|
29
|
-
|
33
|
+
|
30
34
|
# Login to SmugMug using a specific user account.
|
31
35
|
#
|
32
36
|
# @param [String] email The username ( e-mail address ) for the SmugMug account
|
@@ -38,24 +42,24 @@ module Smile
|
|
38
42
|
smug.auth( email, password )
|
39
43
|
smug
|
40
44
|
end
|
41
|
-
|
42
|
-
|
45
|
+
|
46
|
+
|
43
47
|
def base_feed( options={} )
|
44
48
|
options.merge!( :format => 'rss' )
|
45
49
|
url = "http://api.smugmug.com/hack/feed.mg?"
|
46
50
|
url_params =[]
|
47
51
|
options.each_pair do |k,value|
|
48
52
|
key, value = Smile::ParamConverter.convert( k, value )
|
49
|
-
|
53
|
+
|
50
54
|
url_params << "#{key.to_s}=#{ CGI.escape( value ) }"
|
51
55
|
end
|
52
|
-
|
56
|
+
|
53
57
|
RestClient.get( url + url_params.join( "&" ) ).body
|
54
58
|
end
|
55
59
|
private( :base_feed )
|
56
|
-
|
60
|
+
|
57
61
|
# Search SmugMug for pics. This search is slower than the others, but returns Smile::Photo objects
|
58
|
-
#
|
62
|
+
#
|
59
63
|
# @param [String] data This is the search term that you want to use
|
60
64
|
# @param [optional, Hash] options Hash of options for the search method
|
61
65
|
# @option options [optional, String] :keyword override the keyword search
|
@@ -73,20 +77,17 @@ module Smile
|
|
73
77
|
# @option options [optional, String] :user_comments Use term nickname
|
74
78
|
# @option options [optional, String] :geo_user Use term nickname
|
75
79
|
# @option options [optional, String] :geo_album Use term nickname
|
76
|
-
#
|
77
|
-
# @return [Array<Smile::Photo>] Smile::Photo objects will be returned. This take longer due to
|
80
|
+
#
|
78
81
|
# pulling more details from every photo.
|
79
82
|
def search( data, options={} )
|
80
|
-
rss
|
81
|
-
|
82
|
-
rss.items.map do |item|
|
83
|
+
rss.items.map do |item|
|
83
84
|
image_id, image_key = item.link.split('/').last.split('#').last.split('_')
|
84
85
|
Smile::Photo.find( :image_id => image_id, :image_key => image_key )
|
85
86
|
end
|
86
87
|
end
|
87
|
-
|
88
|
+
|
88
89
|
# Search SmugMug for pics. This search is slower than the others, but returns Smile::Photo objects
|
89
|
-
#
|
90
|
+
#
|
90
91
|
# @param [String] data This is the search term that you want to use
|
91
92
|
# @param [optional, Hash] options Hash of options for the search method
|
92
93
|
# @option options [optional, String] :keyword override the keyword search
|
@@ -104,15 +105,15 @@ module Smile
|
|
104
105
|
# @option options [optional, String] :user_comments Use term nickname
|
105
106
|
# @option options [optional, String] :geo_user Use term nickname
|
106
107
|
# @option options [optional, String] :geo_album Use term nickname
|
107
|
-
#
|
108
|
+
#
|
108
109
|
# @return [Array<Smile::Photo>] RSS feed from the RSS::Parser.parse method
|
109
110
|
def search_rss( data, options={} )
|
110
111
|
raw = search_raw( data, options )
|
111
112
|
RSS::Parser.parse( raw, false )
|
112
113
|
end
|
113
|
-
|
114
|
+
|
114
115
|
# Raw feed from the SmugMug data feeds
|
115
|
-
#
|
116
|
+
#
|
116
117
|
# @param [String] data This is the search term that you want to use
|
117
118
|
# @param [optional, Hash] options Hash of options for the search method
|
118
119
|
# @option options [optional, String] :keyword override the keyword search
|
@@ -130,7 +131,7 @@ module Smile
|
|
130
131
|
# @option options [optional, String] :user_comments Use term nickname
|
131
132
|
# @option options [optional, String] :geo_user Use term nickname
|
132
133
|
# @option options [optional, String] :geo_album Use term nickname
|
133
|
-
#
|
134
|
+
#
|
134
135
|
# @return [RestClientResponse] The response from a RestClient.get request
|
135
136
|
def search_raw( data, options={} )
|
136
137
|
options.merge!( :type => 'keyword', :data => data )
|
data/lib/smile/base.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
#
|
1
|
+
#
|
2
2
|
# base.rb
|
3
3
|
# smile
|
4
|
-
#
|
4
|
+
#
|
5
5
|
# Created by Zac Kleinpeter on 2009-04-28.
|
6
6
|
# Copyright 2009 Cajun Country. All rights reserved.
|
7
|
-
#
|
7
|
+
#
|
8
8
|
module Smile
|
9
|
-
class Base
|
9
|
+
class Base
|
10
10
|
include Smile::Common
|
11
11
|
attr_accessor :attributes
|
12
|
-
|
12
|
+
|
13
13
|
class << self
|
14
14
|
include Smile::Common
|
15
15
|
|
16
16
|
def configure
|
17
|
-
yield( session )
|
17
|
+
yield( session )
|
18
18
|
end
|
19
19
|
|
20
20
|
def clear_config!
|
@@ -27,7 +27,11 @@ module Smile
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def method_missing( name, *args )
|
30
|
-
|
30
|
+
if args.nil?
|
31
|
+
@attributes.send(name,args)
|
32
|
+
else
|
33
|
+
@attributes.send(name)
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
data/lib/smile/json.rb
CHANGED
data/lib/smile/photo.rb
CHANGED
data/smile.gemspec
CHANGED
@@ -1,66 +1,43 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path("../lib/smile/version", __FILE__)
|
5
3
|
|
6
4
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
5
|
+
s.name = %q{smile}
|
6
|
+
s.version = Smile::VERSION
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["cajun"]
|
9
|
+
s.email = %q{zac@kleinpeter.org}
|
10
|
+
s.date = %q{2010-07-09}
|
11
|
+
s.homepage = %q{http://github.com/cajun/smile}
|
12
|
+
s.summary = %q{Simple API for talking to SmugMug}
|
13
|
+
|
14
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
15
|
+
|
16
|
+
s.required_rubygems_version = ">= 1.3.6"
|
17
|
+
s.rubyforge_project = 'smile'
|
18
|
+
|
19
|
+
s.add_dependency 'rest-client', ">= 0"
|
20
|
+
s.add_dependency 'activesupport', ">= 3.0"
|
21
|
+
s.add_dependency 'i18n'
|
22
|
+
s.add_dependency 'yajl-ruby', '>= 0.7.8'
|
23
|
+
|
24
|
+
s.add_development_dependency "bundler", ">= 1.0.0"
|
25
|
+
s.add_development_dependency "shindo"
|
26
|
+
s.add_development_dependency "rspec"
|
27
|
+
s.add_development_dependency "rr"
|
28
|
+
|
29
|
+
|
30
|
+
s.files = `git ls-files`.split("\n")
|
31
|
+
# s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
32
|
+
s.require_path = 'lib'
|
9
33
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["cajun"]
|
12
|
-
s.date = %q{2010-07-09}
|
13
|
-
s.default_executable = %q{smile}
|
14
|
-
s.email = %q{zac@kleinpeter.org}
|
15
|
-
s.executables = ["smile"]
|
16
34
|
s.extra_rdoc_files = [
|
17
35
|
"LICENSE",
|
18
36
|
"README.rdoc"
|
19
37
|
]
|
20
|
-
|
21
|
-
".gitignore",
|
22
|
-
"LICENSE",
|
23
|
-
"README.rdoc",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION.yml",
|
26
|
-
"lib/smile.rb",
|
27
|
-
"lib/smile/album.rb",
|
28
|
-
"lib/smile/base.rb",
|
29
|
-
"lib/smile/common.rb",
|
30
|
-
"lib/smile/exception.rb",
|
31
|
-
"lib/smile/json.rb",
|
32
|
-
"lib/smile/param_converter.rb",
|
33
|
-
"lib/smile/photo.rb",
|
34
|
-
"lib/smile/session.rb",
|
35
|
-
"lib/smile/smug.rb",
|
36
|
-
"smile.gemspec",
|
37
|
-
"test/smile_test.rb",
|
38
|
-
"test/test_helper.rb"
|
39
|
-
]
|
40
|
-
s.homepage = %q{http://github.com/cajun/smile}
|
41
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
42
|
-
s.require_paths = ["lib"]
|
43
|
-
s.rubyforge_project = %q{cajun-gems}
|
44
|
-
s.rubygems_version = %q{1.3.7}
|
45
|
-
s.summary = %q{Simple API for talking to SmugMug}
|
38
|
+
|
46
39
|
s.test_files = [
|
47
40
|
"test/smile_test.rb",
|
48
41
|
"test/test_helper.rb"
|
49
42
|
]
|
50
|
-
|
51
|
-
if s.respond_to? :specification_version then
|
52
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
53
|
-
s.specification_version = 3
|
54
|
-
|
55
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
|
-
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
57
|
-
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<rest-client>, [">= 0"])
|
60
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
61
|
-
end
|
62
|
-
else
|
63
|
-
s.add_dependency(%q<rest-client>, [">= 0"])
|
64
|
-
s.add_dependency(%q<activesupport>, [">= 0"])
|
65
|
-
end
|
66
43
|
end
|
data/test/smile_test.rb
CHANGED
@@ -7,15 +7,22 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
7
7
|
# this resets the config to the base state before every test
|
8
8
|
Smile::Base.clear_config!
|
9
9
|
Smile::Base.configure do |config|
|
10
|
-
config.logger_on =
|
10
|
+
config.logger_on = false
|
11
11
|
end
|
12
12
|
|
13
13
|
@smug = Smile::Smug.new
|
14
14
|
@smug.auth_anonymously
|
15
15
|
end
|
16
16
|
|
17
|
-
tests 'security checks',
|
18
|
-
test( 'testing basic auth anonymously' )
|
17
|
+
tests 'security checks', 'security' do
|
18
|
+
test( 'testing basic auth anonymously' ) do
|
19
|
+
begin
|
20
|
+
@smug.auth_anonymously
|
21
|
+
true
|
22
|
+
rescue
|
23
|
+
false
|
24
|
+
end
|
25
|
+
end
|
19
26
|
|
20
27
|
test 'InvalidLogin will get raised on foo bar login' do
|
21
28
|
all_good = false
|
@@ -29,12 +36,12 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
29
36
|
end
|
30
37
|
end
|
31
38
|
|
32
|
-
tests 'album and photo checks' do
|
33
|
-
test( 'checking to see if we have some albums'
|
34
|
-
|
39
|
+
tests 'album and photo checks', 'album', 'photos' do
|
40
|
+
test( 'checking to see if we have some albums') do
|
41
|
+
!@smug.albums( :nick_name => 'kleinpeter' ).empty?
|
35
42
|
end
|
36
43
|
|
37
|
-
test( 'we can reload albums from the site'
|
44
|
+
test( 'we can reload albums from the site') do
|
38
45
|
album = @smug.albums( :nick_name => 'kleinpeter' ).first
|
39
46
|
old_title = album.title
|
40
47
|
album.title = 'foo'
|
@@ -42,19 +49,19 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
42
49
|
old_title == album.title
|
43
50
|
end
|
44
51
|
|
45
|
-
test 'checking to see if we have photos in the albums'
|
52
|
+
test 'checking to see if we have photos in the albums' do
|
46
53
|
album = @smug.albums( :nick_name => 'kleinpeter' ).first
|
47
54
|
!album.photos.empty?
|
48
55
|
end
|
49
56
|
|
50
|
-
test 'a photo is connected to its album'
|
57
|
+
test 'a photo is connected to its album' do
|
51
58
|
album = @smug.albums( :nick_name => 'kleinpeter' ).first
|
52
59
|
photo = album.photos.first
|
53
60
|
album.album_id == photo.album.album_id &&
|
54
61
|
album.key == photo.album.key
|
55
62
|
end
|
56
63
|
|
57
|
-
test( 'we can reload photos from the site'
|
64
|
+
test( 'we can reload photos from the site') do
|
58
65
|
album = @smug.albums( :nick_name => 'kleinpeter' ).first
|
59
66
|
photo = album.photos.first
|
60
67
|
old_url = photo.tinyurl
|
@@ -64,9 +71,9 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
64
71
|
end
|
65
72
|
end
|
66
73
|
|
67
|
-
tests 'confirm configuration settings',
|
74
|
+
tests 'confirm configuration settings', 'config' do
|
68
75
|
test 'there is a default api key' do
|
69
|
-
Smile::Base.session.api_key
|
76
|
+
!Smile::Base.session.api_key.nil?
|
70
77
|
end
|
71
78
|
|
72
79
|
test 'we can set the api key in the config' do
|
@@ -74,12 +81,12 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
74
81
|
config.api_key = 'foo'
|
75
82
|
end
|
76
83
|
|
77
|
-
Smile::Base.session.api_key
|
84
|
+
!Smile::Base.session.api_key.nil?
|
78
85
|
end
|
79
86
|
end
|
80
87
|
|
81
88
|
tests 'there is a logger and it does stuff' do
|
82
|
-
test 'the logger is off by default'
|
89
|
+
test 'the logger is off by default' do
|
83
90
|
Smile::Base.clear_config!
|
84
91
|
!Smile::Base.logger_on?
|
85
92
|
end
|
@@ -93,5 +100,60 @@ Shindo.tests 'checking all the cool things smile can do' do
|
|
93
100
|
@@error_got_called
|
94
101
|
end
|
95
102
|
end
|
103
|
+
|
104
|
+
tests 'looking at the params that we have to convert', ['convert'] do
|
105
|
+
|
106
|
+
test 'classify params with first letter lower' do
|
107
|
+
param = [
|
108
|
+
:popular_category, :geo_all, :geo_keyword,
|
109
|
+
:geo_search, :geo_community, :open_search_keyword, :user_keyword,
|
110
|
+
:nickname_recent, :nickname_popular, :user_comments, :geo_user,
|
111
|
+
:geo_albums ]
|
112
|
+
|
113
|
+
correct_param = [
|
114
|
+
:popularCategory, :geoAll, :geoKeyword,
|
115
|
+
:geoSearch, :geoCommunity, :openSearchKeyword, :userKeyword,
|
116
|
+
:NicknameRecent, :NicknamePopular, :userComments, :geoUser,
|
117
|
+
:geoAlbums ]
|
118
|
+
|
119
|
+
failed_params = []
|
120
|
+
correct_param.each_with_index do |correct,index|
|
121
|
+
failed_params << param[index] if( correct != Smile::ParamConverter.convert( param[index] ) )
|
122
|
+
end
|
123
|
+
|
124
|
+
failed_params.empty?
|
125
|
+
end
|
126
|
+
|
127
|
+
=begin
|
128
|
+
when :size
|
129
|
+
value = value.titlecase
|
130
|
+
:Size
|
131
|
+
when :data, :type, :description, :keywords, :geography, :position, :header,
|
132
|
+
:clean, :filenames, :password, :public, :external, :protected, :watermarking,
|
133
|
+
:larges, :originals, :comments, :share, :printable, :backprinting
|
134
|
+
param.to_s.upcase.to_sym
|
135
|
+
when :image_id, :image_key, :image_count, :nick_name, :category_id,
|
136
|
+
:sub_category_id, :album_key, :album_template_id, :highlight_id, :square_thumbs,
|
137
|
+
:template_id, :sort_method, :sort_direction, :password_hint, :word_searchable,
|
138
|
+
:smug_searchable, :watermark_id, :hide_owner, :x_larges, :x2_larges, :x3_larges,
|
139
|
+
:can_rank, :friend_edit, :family_edit, :color_correction, :default_color, :proof_days,
|
140
|
+
:unsharp_amount, :unsharp_radius, :unsharp_sigma, :community_id
|
141
|
+
param.to_s.classify.to_sym
|
142
|
+
when :exif
|
143
|
+
:EXIF
|
144
|
+
when :api_key
|
145
|
+
:APIKey
|
146
|
+
when :session_id
|
147
|
+
:SessionID
|
148
|
+
when :album_id
|
149
|
+
:AlbumID
|
150
|
+
else
|
151
|
+
key = param
|
152
|
+
end
|
153
|
+
|
154
|
+
[ key, value ]
|
155
|
+
end
|
156
|
+
=end
|
157
|
+
end
|
96
158
|
end
|
97
159
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- cajun
|
@@ -16,7 +16,7 @@ bindir: bin
|
|
16
16
|
cert_chain: []
|
17
17
|
|
18
18
|
date: 2010-07-09 00:00:00 -05:00
|
19
|
-
default_executable:
|
19
|
+
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: rest-client
|
@@ -36,6 +36,21 @@ dependencies:
|
|
36
36
|
name: activesupport
|
37
37
|
prerelease: false
|
38
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 7
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 0
|
47
|
+
version: "3.0"
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: i18n
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
39
54
|
none: false
|
40
55
|
requirements:
|
41
56
|
- - ">="
|
@@ -45,11 +60,85 @@ dependencies:
|
|
45
60
|
- 0
|
46
61
|
version: "0"
|
47
62
|
type: :runtime
|
48
|
-
version_requirements: *
|
63
|
+
version_requirements: *id003
|
64
|
+
- !ruby/object:Gem::Dependency
|
65
|
+
name: yajl-ruby
|
66
|
+
prerelease: false
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 19
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
- 7
|
76
|
+
- 8
|
77
|
+
version: 0.7.8
|
78
|
+
type: :runtime
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: bundler
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 23
|
89
|
+
segments:
|
90
|
+
- 1
|
91
|
+
- 0
|
92
|
+
- 0
|
93
|
+
version: 1.0.0
|
94
|
+
type: :development
|
95
|
+
version_requirements: *id005
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: shindo
|
98
|
+
prerelease: false
|
99
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
type: :development
|
109
|
+
version_requirements: *id006
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: rspec
|
112
|
+
prerelease: false
|
113
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
hash: 3
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
version: "0"
|
122
|
+
type: :development
|
123
|
+
version_requirements: *id007
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: rr
|
126
|
+
prerelease: false
|
127
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
hash: 3
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
version: "0"
|
136
|
+
type: :development
|
137
|
+
version_requirements: *id008
|
49
138
|
description:
|
50
139
|
email: zac@kleinpeter.org
|
51
|
-
executables:
|
52
|
-
|
140
|
+
executables: []
|
141
|
+
|
53
142
|
extensions: []
|
54
143
|
|
55
144
|
extra_rdoc_files:
|
@@ -57,10 +146,13 @@ extra_rdoc_files:
|
|
57
146
|
- README.rdoc
|
58
147
|
files:
|
59
148
|
- .gitignore
|
149
|
+
- Gemfile
|
150
|
+
- Gemfile.lock
|
60
151
|
- LICENSE
|
61
152
|
- README.rdoc
|
62
153
|
- Rakefile
|
63
154
|
- VERSION.yml
|
155
|
+
- bin/smile
|
64
156
|
- lib/smile.rb
|
65
157
|
- lib/smile/album.rb
|
66
158
|
- lib/smile/base.rb
|
@@ -71,10 +163,10 @@ files:
|
|
71
163
|
- lib/smile/photo.rb
|
72
164
|
- lib/smile/session.rb
|
73
165
|
- lib/smile/smug.rb
|
166
|
+
- lib/smile/version.rb
|
74
167
|
- smile.gemspec
|
75
168
|
- test/smile_test.rb
|
76
169
|
- test/test_helper.rb
|
77
|
-
- bin/smile
|
78
170
|
has_rdoc: true
|
79
171
|
homepage: http://github.com/cajun/smile
|
80
172
|
licenses: []
|
@@ -98,13 +190,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
190
|
requirements:
|
99
191
|
- - ">="
|
100
192
|
- !ruby/object:Gem::Version
|
101
|
-
hash:
|
193
|
+
hash: 23
|
102
194
|
segments:
|
103
|
-
-
|
104
|
-
|
195
|
+
- 1
|
196
|
+
- 3
|
197
|
+
- 6
|
198
|
+
version: 1.3.6
|
105
199
|
requirements: []
|
106
200
|
|
107
|
-
rubyforge_project:
|
201
|
+
rubyforge_project: smile
|
108
202
|
rubygems_version: 1.3.7
|
109
203
|
signing_key:
|
110
204
|
specification_version: 3
|