asset_cloud 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/LICENSE +1 -1
- data/README.rdoc +3 -1
- data/asset_cloud.gemspec +1 -1
- data/lib/asset_cloud/free_key_locator.rb +1 -2
- data/spec/find_free_key_spec.rb +8 -1
- metadata +14 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf0be61cd6058f4e4ab5cd5c9c5bb19363f819e3
|
4
|
+
data.tar.gz: d8e8070dd5cb0e0bb6cc880f5c88088fe1b30f9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08b3646611ed0077c34764aa11d6a230d376623e5d545521a4ed757a4b906dacc853b30f0f5767f7643be77922d9d2c485d262cad61a5842f5eda51f22f57184
|
7
|
+
data.tar.gz: 9a73762440be2c3560a5cece29e4819aeeb84cbbafe2086b637d7769cd8b538ef471c63bdca55d1944a8dca4c8f67c39afe263c666b1cc0ca18f56ca807e6d0c
|
data/LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
{<img src="https://travis-ci.org/Shopify/asset_cloud.png?branch=master" alt="Build Status" />}[https://travis-ci.org/Shopify/asset_cloud]
|
2
|
+
|
1
3
|
= AssetCloud
|
2
4
|
|
3
5
|
An abstraction layer around arbitrary and diverse asset stores.
|
@@ -10,4 +12,4 @@ An abstraction layer around arbitrary and diverse asset stores.
|
|
10
12
|
|
11
13
|
== Copyright
|
12
14
|
|
13
|
-
Copyright (c) 2008-
|
15
|
+
Copyright (c) 2008-2014 Tobias Lütke & Shopify, Inc. Released under the MIT license (see LICENSE for details).
|
data/asset_cloud.gemspec
CHANGED
@@ -8,10 +8,9 @@ module AssetCloud
|
|
8
8
|
# Check weather the suggested key name is free. If so we
|
9
9
|
# simply return it.
|
10
10
|
|
11
|
-
if
|
11
|
+
if !exist?(key) && !options[:force_uuid]
|
12
12
|
key
|
13
13
|
else
|
14
|
-
|
15
14
|
ext = File.extname(key)
|
16
15
|
dirname = File.dirname(key)
|
17
16
|
base = dirname == '.' ? File.basename(key, ext) : File.join(File.dirname(key), File.basename(key, ext))
|
data/spec/find_free_key_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe "FreeFilenameLocator", 'when asked to return a free key such as the one
|
|
14
14
|
FindFreeKey.find_free_key_like('free.txt').should == 'free.txt'
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should append a UUID to the key before the extension if key is taken
|
17
|
+
it "should append a UUID to the key before the extension if key is taken" do
|
18
18
|
SecureRandom.stub(:uuid).and_return('moo')
|
19
19
|
FindFreeKey.should_receive(:exist?).with('free.txt').and_return(true)
|
20
20
|
FindFreeKey.should_receive(:exist?).with('free_moo.txt').and_return(false)
|
@@ -36,4 +36,11 @@ describe "FreeFilenameLocator", 'when asked to return a free key such as the one
|
|
36
36
|
lambda { FindFreeKey.find_free_key_like('free.txt') }.should raise_error(StandardError)
|
37
37
|
end
|
38
38
|
|
39
|
+
it "should append a UUID to the key before the extensions if the force_uuid option is passed" do
|
40
|
+
FindFreeKey.should_receive(:exist?).with('free.txt').and_return(false)
|
41
|
+
FindFreeKey.should_receive(:exist?).with('free_as-in-beer.txt').and_return(false)
|
42
|
+
SecureRandom.stub(:uuid).and_return('as-in-beer')
|
43
|
+
|
44
|
+
FindFreeKey.find_free_key_like('free.txt', :force_uuid => true).should == 'free_as-in-beer.txt'
|
45
|
+
end
|
39
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asset_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
@@ -14,56 +14,56 @@ dependencies:
|
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: class_inheritable_attributes
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: An abstraction layer around arbitrary and diverse asset stores.
|
@@ -72,7 +72,8 @@ executables: []
|
|
72
72
|
extensions: []
|
73
73
|
extra_rdoc_files: []
|
74
74
|
files:
|
75
|
-
- .gitignore
|
75
|
+
- ".gitignore"
|
76
|
+
- ".travis.yml"
|
76
77
|
- Gemfile
|
77
78
|
- LICENSE
|
78
79
|
- README.rdoc
|
@@ -118,17 +119,17 @@ require_paths:
|
|
118
119
|
- lib
|
119
120
|
required_ruby_version: !ruby/object:Gem::Requirement
|
120
121
|
requirements:
|
121
|
-
- -
|
122
|
+
- - ">="
|
122
123
|
- !ruby/object:Gem::Version
|
123
124
|
version: '0'
|
124
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
126
|
requirements:
|
126
|
-
- -
|
127
|
+
- - ">="
|
127
128
|
- !ruby/object:Gem::Version
|
128
129
|
version: '0'
|
129
130
|
requirements: []
|
130
131
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.0
|
132
|
+
rubygems_version: 2.2.0
|
132
133
|
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: An abstraction layer around arbitrary and diverse asset stores.
|