panda 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -2
- data/VERSION +1 -1
- data/lib/panda/api_authentication.rb +23 -4
- data/lib/panda/base.rb +1 -1
- data/lib/panda/modules/builders.rb +1 -1
- data/lib/panda/modules/finders.rb +1 -1
- data/lib/panda/modules/router.rb +1 -1
- data/lib/panda/proxies/proxy.rb +2 -2
- data/lib/panda/proxies/scope.rb +1 -1
- data/lib/panda/resources/resource.rb +1 -1
- data/panda.gemspec +68 -49
- data/spec/spec_helper.rb +1 -1
- metadata +118 -15
- data/.gitignore +0 -21
data/Gemfile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
@@ -26,11 +26,9 @@ module Panda
|
|
26
26
|
|
27
27
|
# param keys should be strings, not symbols please. return a string joined
|
28
28
|
# by & in canonical order.
|
29
|
-
def self.canonical_querystring(
|
30
|
-
|
31
|
-
params.keys.sort.collect {|key| [url_encode(key), url_encode(params[key])].join("=") }.join("&")
|
29
|
+
def self.canonical_querystring(h)
|
30
|
+
_recursion(h).join('&')
|
32
31
|
end
|
33
|
-
|
34
32
|
# Turns a hash into a query string, returns the query string.
|
35
33
|
# url-encodes everything to Amazon's specifications.
|
36
34
|
def self.hash_to_query(hash)
|
@@ -42,5 +40,26 @@ module Panda
|
|
42
40
|
def self.url_encode(string)
|
43
41
|
CGI.escape(string.to_s).gsub("%7E", "~").gsub("+", "%20")
|
44
42
|
end
|
43
|
+
|
44
|
+
def self._recursion(h, base = nil)
|
45
|
+
pairs = []
|
46
|
+
h.keys.sort.each do |key|
|
47
|
+
value = h[key]
|
48
|
+
if value.kind_of? Hash
|
49
|
+
pairs += _recursion(value, key)
|
50
|
+
else
|
51
|
+
new_pair = nil
|
52
|
+
if base
|
53
|
+
new_pair = "#{base}[#{url_encode(key)}]=#{url_encode(value)}"
|
54
|
+
else
|
55
|
+
new_pair = "#{url_encode(key)}=#{url_encode(value)}"
|
56
|
+
end
|
57
|
+
pairs << new_pair
|
58
|
+
end
|
59
|
+
end
|
60
|
+
pairs
|
61
|
+
end
|
62
|
+
|
63
|
+
|
45
64
|
end
|
46
65
|
end
|
data/lib/panda/base.rb
CHANGED
data/lib/panda/modules/router.rb
CHANGED
data/lib/panda/proxies/proxy.rb
CHANGED
data/lib/panda/proxies/scope.rb
CHANGED
@@ -19,7 +19,7 @@ module Panda
|
|
19
19
|
|
20
20
|
# delegate to the scope if the method exists
|
21
21
|
def method_missing(method_symbol, *args, &block)
|
22
|
-
scope = Panda::const_get("#{
|
22
|
+
scope = Panda::const_get("#{sti_name}Scope").new(self)
|
23
23
|
if scope.respond_to?(method_symbol)
|
24
24
|
scope.send(method_symbol, *args, &block)
|
25
25
|
else
|
data/panda.gemspec
CHANGED
@@ -1,74 +1,72 @@
|
|
1
1
|
# Generated by jeweler
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{panda}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["New Bamboo"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-25}
|
13
13
|
s.description = %q{Panda Client}
|
14
14
|
s.email = %q{info@pandastream.com}
|
15
15
|
s.extra_rdoc_files = [
|
16
16
|
"LICENSE",
|
17
|
-
|
17
|
+
"README.md"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
"spec/video_spec.rb"
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE",
|
22
|
+
"README.md",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION",
|
25
|
+
"lib/panda.rb",
|
26
|
+
"lib/panda/api_authentication.rb",
|
27
|
+
"lib/panda/base.rb",
|
28
|
+
"lib/panda/connection.rb",
|
29
|
+
"lib/panda/error.rb",
|
30
|
+
"lib/panda/modules/associations.rb",
|
31
|
+
"lib/panda/modules/builders.rb",
|
32
|
+
"lib/panda/modules/cloud_connection.rb",
|
33
|
+
"lib/panda/modules/finders.rb",
|
34
|
+
"lib/panda/modules/router.rb",
|
35
|
+
"lib/panda/modules/short_status.rb",
|
36
|
+
"lib/panda/modules/updatable.rb",
|
37
|
+
"lib/panda/panda.rb",
|
38
|
+
"lib/panda/proxies/encoding_scope.rb",
|
39
|
+
"lib/panda/proxies/profile_scope.rb",
|
40
|
+
"lib/panda/proxies/proxy.rb",
|
41
|
+
"lib/panda/proxies/scope.rb",
|
42
|
+
"lib/panda/proxies/video_scope.rb",
|
43
|
+
"lib/panda/resources/cloud.rb",
|
44
|
+
"lib/panda/resources/encoding.rb",
|
45
|
+
"lib/panda/resources/profile.rb",
|
46
|
+
"lib/panda/resources/resource.rb",
|
47
|
+
"lib/panda/resources/video.rb",
|
48
|
+
"panda.gemspec",
|
49
|
+
"spec/cloud_spec.rb",
|
50
|
+
"spec/encoding_spec.rb",
|
51
|
+
"spec/heroku_spec.rb",
|
52
|
+
"spec/panda_spec.rb",
|
53
|
+
"spec/profile_spec.rb",
|
54
|
+
"spec/spec.opts",
|
55
|
+
"spec/spec_helper.rb",
|
56
|
+
"spec/video_spec.rb"
|
58
57
|
]
|
59
58
|
s.homepage = %q{http://github.com/newbamboo/panda_gem}
|
60
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
61
59
|
s.require_paths = ["lib"]
|
62
60
|
s.rubygems_version = %q{1.3.7}
|
63
61
|
s.summary = %q{Panda Client}
|
64
62
|
s.test_files = [
|
65
63
|
"spec/cloud_spec.rb",
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
64
|
+
"spec/encoding_spec.rb",
|
65
|
+
"spec/heroku_spec.rb",
|
66
|
+
"spec/panda_spec.rb",
|
67
|
+
"spec/profile_spec.rb",
|
68
|
+
"spec/spec_helper.rb",
|
69
|
+
"spec/video_spec.rb"
|
72
70
|
]
|
73
71
|
|
74
72
|
if s.respond_to? :specification_version then
|
@@ -76,15 +74,36 @@ Gem::Specification.new do |s|
|
|
76
74
|
s.specification_version = 3
|
77
75
|
|
78
76
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
77
|
+
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
78
|
+
s.add_runtime_dependency(%q<rest-client>, [">= 0"])
|
79
|
+
s.add_runtime_dependency(%q<json>, [">= 0"])
|
80
|
+
s.add_runtime_dependency(%q<jeweler>, [">= 0"])
|
81
|
+
s.add_runtime_dependency(%q<rake>, [">= 0"])
|
82
|
+
s.add_runtime_dependency(%q<rspec>, ["= 1.3.1"])
|
83
|
+
s.add_runtime_dependency(%q<webmock>, ["= 1.6.1"])
|
79
84
|
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
80
85
|
s.add_runtime_dependency(%q<rest-client>, [">= 1.4"])
|
81
86
|
s.add_runtime_dependency(%q<json>, [">= 1.2"])
|
82
87
|
else
|
88
|
+
s.add_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
89
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
90
|
+
s.add_dependency(%q<json>, [">= 0"])
|
91
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
92
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
93
|
+
s.add_dependency(%q<rspec>, ["= 1.3.1"])
|
94
|
+
s.add_dependency(%q<webmock>, ["= 1.6.1"])
|
83
95
|
s.add_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
84
96
|
s.add_dependency(%q<rest-client>, [">= 1.4"])
|
85
97
|
s.add_dependency(%q<json>, [">= 1.2"])
|
86
98
|
end
|
87
99
|
else
|
100
|
+
s.add_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
101
|
+
s.add_dependency(%q<rest-client>, [">= 0"])
|
102
|
+
s.add_dependency(%q<json>, [">= 0"])
|
103
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
104
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
105
|
+
s.add_dependency(%q<rspec>, ["= 1.3.1"])
|
106
|
+
s.add_dependency(%q<webmock>, ["= 1.6.1"])
|
88
107
|
s.add_dependency(%q<ruby-hmac>, [">= 0.3.2"])
|
89
108
|
s.add_dependency(%q<rest-client>, [">= 1.4"])
|
90
109
|
s.add_dependency(%q<json>, [">= 1.2"])
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 1.
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- New Bamboo
|
@@ -15,12 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-25 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name: ruby-hmac
|
23
|
-
prerelease: false
|
24
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
23
|
none: false
|
26
24
|
requirements:
|
@@ -33,11 +31,115 @@ dependencies:
|
|
33
31
|
- 2
|
34
32
|
version: 0.3.2
|
35
33
|
type: :runtime
|
34
|
+
name: ruby-hmac
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: *id001
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
38
48
|
name: rest-client
|
39
49
|
prerelease: false
|
40
|
-
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :runtime
|
62
|
+
name: json
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
type: :runtime
|
76
|
+
name: jeweler
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
hash: 3
|
86
|
+
segments:
|
87
|
+
- 0
|
88
|
+
version: "0"
|
89
|
+
type: :runtime
|
90
|
+
name: rake
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: *id005
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - "="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
hash: 25
|
100
|
+
segments:
|
101
|
+
- 1
|
102
|
+
- 3
|
103
|
+
- 1
|
104
|
+
version: 1.3.1
|
105
|
+
type: :runtime
|
106
|
+
name: rspec
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: *id006
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - "="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
hash: 13
|
116
|
+
segments:
|
117
|
+
- 1
|
118
|
+
- 6
|
119
|
+
- 1
|
120
|
+
version: 1.6.1
|
121
|
+
type: :runtime
|
122
|
+
name: webmock
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
hash: 23
|
132
|
+
segments:
|
133
|
+
- 0
|
134
|
+
- 3
|
135
|
+
- 2
|
136
|
+
version: 0.3.2
|
137
|
+
type: :runtime
|
138
|
+
name: ruby-hmac
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: *id008
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
41
143
|
none: false
|
42
144
|
requirements:
|
43
145
|
- - ">="
|
@@ -48,11 +150,11 @@ dependencies:
|
|
48
150
|
- 4
|
49
151
|
version: "1.4"
|
50
152
|
type: :runtime
|
51
|
-
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: json
|
153
|
+
name: rest-client
|
54
154
|
prerelease: false
|
55
|
-
|
155
|
+
version_requirements: *id009
|
156
|
+
- !ruby/object:Gem::Dependency
|
157
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
56
158
|
none: false
|
57
159
|
requirements:
|
58
160
|
- - ">="
|
@@ -63,7 +165,9 @@ dependencies:
|
|
63
165
|
- 2
|
64
166
|
version: "1.2"
|
65
167
|
type: :runtime
|
66
|
-
|
168
|
+
name: json
|
169
|
+
prerelease: false
|
170
|
+
version_requirements: *id010
|
67
171
|
description: Panda Client
|
68
172
|
email: info@pandastream.com
|
69
173
|
executables: []
|
@@ -74,7 +178,6 @@ extra_rdoc_files:
|
|
74
178
|
- LICENSE
|
75
179
|
- README.md
|
76
180
|
files:
|
77
|
-
- .gitignore
|
78
181
|
- Gemfile
|
79
182
|
- LICENSE
|
80
183
|
- README.md
|
@@ -117,8 +220,8 @@ homepage: http://github.com/newbamboo/panda_gem
|
|
117
220
|
licenses: []
|
118
221
|
|
119
222
|
post_install_message:
|
120
|
-
rdoc_options:
|
121
|
-
|
223
|
+
rdoc_options: []
|
224
|
+
|
122
225
|
require_paths:
|
123
226
|
- lib
|
124
227
|
required_ruby_version: !ruby/object:Gem::Requirement
|