uploadcare-ruby 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uploadcare/resources/group.rb +4 -0
- data/lib/uploadcare/version.rb +1 -1
- data/spec/group_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13befd5dd6e5faed651bdb5735db6273577ce2da
|
4
|
+
data.tar.gz: f93c39068ff590a2b0fcd5bb1388b225c477e00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4138493da1575faba21ed1136845693c540ef97a04f22bde1f1ea27b2f0cbb02d613cdd207afaa09bec01866984451c14aed15e5b3838b6dcd45a49547102588
|
7
|
+
data.tar.gz: c00dca425022a489b824add52361f82454e79aa8aa51e7afe8e8750ec9ead0145558187b22cb894ddaca46ce93c406a345ab37a9d2c1c9d8fd93babd2c95e7d1
|
@@ -18,6 +18,10 @@ module Uploadcare
|
|
18
18
|
@api.options[:static_url_base] + "/#{uuid}/"
|
19
19
|
end
|
20
20
|
|
21
|
+
def file_cdn_url index=0
|
22
|
+
raise ArgumentError.new "The index was given is greater than files count in group." if index + 1 > files_count
|
23
|
+
cdn_url + "nth/#{index}/"
|
24
|
+
end
|
21
25
|
|
22
26
|
# Loading logic
|
23
27
|
def is_loaded?
|
data/lib/uploadcare/version.rb
CHANGED
data/spec/group_spec.rb
CHANGED
@@ -87,4 +87,18 @@ describe Uploadcare::Api::Group do
|
|
87
87
|
group.store
|
88
88
|
group.datetime_stored.should be_kind_of(DateTime)
|
89
89
|
end
|
90
|
+
|
91
|
+
it "should return cdn string for file in group by it index" do
|
92
|
+
group = @api.create_group @files
|
93
|
+
|
94
|
+
file_cdn_url = group.file_cdn_url(0)
|
95
|
+
|
96
|
+
file_cdn_url.should be_kind_of(String)
|
97
|
+
file_cdn_url.should == group.cdn_url + "nth/0/"
|
98
|
+
end
|
99
|
+
|
100
|
+
it 'should raise an error if index is greater than files count in group' do
|
101
|
+
group = @api.create_group @files
|
102
|
+
expect {group.file_cdn_url(5)}.to raise_error
|
103
|
+
end
|
90
104
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uploadcare-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- '@rastyagaev (Vadim Rastyagaev)'
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-04-
|
13
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|