cloudkey 0.0.1 → 0.0.2
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/Gemfile.lock +26 -0
- data/MIT-LICENSE +23 -0
- data/README.md +26 -0
- data/Rakefile +4 -8
- data/Readme.md +3 -8
- data/cloudkey.gemspec +7 -6
- data/lib/cloudkey/api.rb +1 -1
- data/lib/cloudkey/security_policy.rb +2 -2
- data/lib/cloudkey/version.rb +1 -1
- data/spec/cloudkey/api_spec.rb +1 -0
- metadata +18 -34
data/Gemfile.lock
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
cloudkey (0.0.1)
|
5
|
+
curb (~> 0.7.15)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: http://rubygems.org/
|
9
|
+
specs:
|
10
|
+
curb (0.7.15)
|
11
|
+
diff-lcs (1.1.2)
|
12
|
+
rspec (2.6.0)
|
13
|
+
rspec-core (~> 2.6.0)
|
14
|
+
rspec-expectations (~> 2.6.0)
|
15
|
+
rspec-mocks (~> 2.6.0)
|
16
|
+
rspec-core (2.6.4)
|
17
|
+
rspec-expectations (2.6.0)
|
18
|
+
diff-lcs (~> 1.1.2)
|
19
|
+
rspec-mocks (2.6.0)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
cloudkey!
|
26
|
+
rspec (~> 2.6.0)
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2011, Kareea SARL.
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
data/README.md
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Cloudkey
|
2
|
+
========
|
3
|
+
|
4
|
+
Introduction
|
5
|
+
------------
|
6
|
+
|
7
|
+
This gem, still under development, aims to provide an abstract interface to DailyMotion's Cloud service.
|
8
|
+
Currently, it's mostly a rewrite of the Python version.
|
9
|
+
|
10
|
+
Usage
|
11
|
+
-----
|
12
|
+
|
13
|
+
# Fill in your credentials
|
14
|
+
@cloudkey = Cloudkey.authenticate USER_ID, KEY
|
15
|
+
|
16
|
+
# Grab a list of your medias
|
17
|
+
p @cloudkey.media.list(:fields => [:id])
|
18
|
+
|
19
|
+
# Get an embedded player for your video, with its usage restricted to a specific IP address
|
20
|
+
p @cloudkey.media.embedded_url VIDEO_ID, Cloudkey::SecurityPolicy.new(:ip => "88.0.0.1")
|
21
|
+
|
22
|
+
|
23
|
+
License
|
24
|
+
-------
|
25
|
+
|
26
|
+
CloudkeyRb is Copyright © 2010-2011 Kareea SARL. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/Rakefile
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
require 'bundler'
|
2
|
-
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rspec/core/rake_task'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
desc "Run all examples"
|
7
|
-
Spec::Rake::SpecTask.new('spec') do |t|
|
8
|
-
t.spec_files = FileList['spec/**/*.rb']
|
9
|
-
end
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
task :default => :spec
|
data/Readme.md
CHANGED
@@ -5,13 +5,7 @@ Introduction
|
|
5
5
|
------------
|
6
6
|
|
7
7
|
This gem, still under development, aims to provide an abstract interface to DailyMotion's Cloud service.
|
8
|
-
Currently, it's mostly a rewrite of the Python
|
9
|
-
|
10
|
-
Warning
|
11
|
-
-------
|
12
|
-
|
13
|
-
We were not able to use security features from the web service to craft restricted urls while testing the Python
|
14
|
-
or PHP versions, so we supposed they had not been activated yet.
|
8
|
+
Currently, it's mostly a rewrite of the Python version.
|
15
9
|
|
16
10
|
Usage
|
17
11
|
-----
|
@@ -25,7 +19,8 @@ Usage
|
|
25
19
|
# Get an embedded player for your video, with its usage restricted to a specific IP address
|
26
20
|
p @cloudkey.media.embedded_url VIDEO_ID, Cloudkey::SecurityPolicy.new(:ip => "88.0.0.1")
|
27
21
|
|
22
|
+
|
28
23
|
License
|
29
24
|
-------
|
30
25
|
|
31
|
-
|
26
|
+
CloudkeyRb is Copyright © 2010-2011 Kareea SARL. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/cloudkey.gemspec
CHANGED
@@ -8,17 +8,18 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Jean-Hadrien Chabran", "Boubacar Diallo"]
|
10
10
|
s.email = ["jh@kareea.com"]
|
11
|
-
s.homepage = "http://
|
12
|
-
s.summary = %q{
|
13
|
-
s.description = %q{
|
11
|
+
s.homepage = "http://github.com/kareea/cloudkey"
|
12
|
+
s.summary = %q{Client library to access DailymotionCloud services}
|
13
|
+
s.description = %q{Client library to access DailymotionCloud services}
|
14
14
|
|
15
15
|
s.rubyforge_project = "cloudkey"
|
16
|
-
|
16
|
+
s.rdoc_options = ["--line-numbers", "--main", "README.md"]
|
17
|
+
s.extra_rdoc_files = ["README.md"]
|
17
18
|
s.files = `git ls-files`.split("\n")
|
18
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
21
|
s.require_paths = ["lib"]
|
21
22
|
|
22
|
-
s.add_development_dependency "rspec", "~> 2.0
|
23
|
-
s.add_dependency 'curb', "~> 0.7.
|
23
|
+
s.add_development_dependency "rspec", "~> 2.6.0"
|
24
|
+
s.add_dependency 'curb', "~> 0.7.15"
|
24
25
|
end
|
data/lib/cloudkey/api.rb
CHANGED
@@ -77,7 +77,7 @@ module Cloudkey
|
|
77
77
|
when Array
|
78
78
|
payload.collect { |element| normalize element }.join('')
|
79
79
|
when Hash
|
80
|
-
payload.to_a.
|
80
|
+
payload.to_a.sort_by {|a,b| a.to_s }.collect {|array| array.first.to_s + normalize(array.last)}.join('')
|
81
81
|
else
|
82
82
|
payload.to_s
|
83
83
|
end
|
@@ -61,7 +61,7 @@ module Cloudkey
|
|
61
61
|
|
62
62
|
def referers?
|
63
63
|
if @options[:referers] && !@options[:referers].empty?
|
64
|
-
raise REFERERS_FORMAT_ERROR unless @options[:referers].
|
64
|
+
raise REFERERS_FORMAT_ERROR unless @options[:referers].all? { |url| url.match(/https?:\/\/(.*)/) }
|
65
65
|
true
|
66
66
|
end
|
67
67
|
end
|
@@ -97,4 +97,4 @@ module Cloudkey
|
|
97
97
|
result
|
98
98
|
end
|
99
99
|
end
|
100
|
-
end
|
100
|
+
end
|
data/lib/cloudkey/version.rb
CHANGED
data/spec/cloudkey/api_spec.rb
CHANGED
@@ -30,6 +30,7 @@ describe Cloudkey::API do
|
|
30
30
|
'foo42bar' => ['foo', 42, 'bar'],
|
31
31
|
'pink3red2yellow1' => {'yellow' => 1, 'red' => 2, 'pink' => 3},
|
32
32
|
'foo42pink3red2yellow1bar' => ['foo', 42, {'yellow' => 1, 'red' => 2, 'pink' => 3}, 'bar'],
|
33
|
+
'foo42pink3red2yellow1bar' => [:foo, 42, {:yellow => 1, :red => 2, :pink => 3}, :bar],
|
33
34
|
'12' => [nil, 1,2],
|
34
35
|
'' => nil,
|
35
36
|
'212345' => {2 => [nil, 1,2], 3 => nil, 4 => 5}
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 1
|
10
|
-
version: 0.0.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.2
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Jean-Hadrien Chabran
|
@@ -16,7 +11,7 @@ autorequire:
|
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date:
|
14
|
+
date: 2011-07-07 00:00:00 +02:00
|
20
15
|
default_executable:
|
21
16
|
dependencies:
|
22
17
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +22,7 @@ dependencies:
|
|
27
22
|
requirements:
|
28
23
|
- - ~>
|
29
24
|
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
segments:
|
32
|
-
- 2
|
33
|
-
- 0
|
34
|
-
- 1
|
35
|
-
version: 2.0.1
|
25
|
+
version: 2.6.0
|
36
26
|
type: :development
|
37
27
|
version_requirements: *id001
|
38
28
|
- !ruby/object:Gem::Dependency
|
@@ -43,26 +33,23 @@ dependencies:
|
|
43
33
|
requirements:
|
44
34
|
- - ~>
|
45
35
|
- !ruby/object:Gem::Version
|
46
|
-
|
47
|
-
segments:
|
48
|
-
- 0
|
49
|
-
- 7
|
50
|
-
- 8
|
51
|
-
version: 0.7.8
|
36
|
+
version: 0.7.15
|
52
37
|
type: :runtime
|
53
38
|
version_requirements: *id002
|
54
|
-
description:
|
39
|
+
description: Client library to access DailymotionCloud services
|
55
40
|
email:
|
56
41
|
- jh@kareea.com
|
57
42
|
executables: []
|
58
43
|
|
59
44
|
extensions: []
|
60
45
|
|
61
|
-
extra_rdoc_files:
|
62
|
-
|
46
|
+
extra_rdoc_files:
|
47
|
+
- README.md
|
63
48
|
files:
|
64
49
|
- .gitignore
|
65
50
|
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- MIT-LICENSE
|
66
53
|
- Rakefile
|
67
54
|
- Readme.md
|
68
55
|
- cloudkey.gemspec
|
@@ -78,13 +65,16 @@ files:
|
|
78
65
|
- spec/cloudkey/security_policy_spec.rb
|
79
66
|
- spec/cloudkey_spec.rb
|
80
67
|
- spec/spec_helper.rb
|
68
|
+
- README.md
|
81
69
|
has_rdoc: true
|
82
|
-
homepage: http://
|
70
|
+
homepage: http://github.com/kareea/cloudkey
|
83
71
|
licenses: []
|
84
72
|
|
85
73
|
post_install_message:
|
86
|
-
rdoc_options:
|
87
|
-
|
74
|
+
rdoc_options:
|
75
|
+
- --line-numbers
|
76
|
+
- --main
|
77
|
+
- README.md
|
88
78
|
require_paths:
|
89
79
|
- lib
|
90
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -92,26 +82,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
92
82
|
requirements:
|
93
83
|
- - ">="
|
94
84
|
- !ruby/object:Gem::Version
|
95
|
-
hash: 3
|
96
|
-
segments:
|
97
|
-
- 0
|
98
85
|
version: "0"
|
99
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
87
|
none: false
|
101
88
|
requirements:
|
102
89
|
- - ">="
|
103
90
|
- !ruby/object:Gem::Version
|
104
|
-
hash: 3
|
105
|
-
segments:
|
106
|
-
- 0
|
107
91
|
version: "0"
|
108
92
|
requirements: []
|
109
93
|
|
110
94
|
rubyforge_project: cloudkey
|
111
|
-
rubygems_version: 1.
|
95
|
+
rubygems_version: 1.6.2
|
112
96
|
signing_key:
|
113
97
|
specification_version: 3
|
114
|
-
summary:
|
98
|
+
summary: Client library to access DailymotionCloud services
|
115
99
|
test_files:
|
116
100
|
- spec/cloudkey/api_spec.rb
|
117
101
|
- spec/cloudkey/security_policy_spec.rb
|