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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3f0421040a068165fb6219c055d4d490c0d1b56
4
- data.tar.gz: 539fc589e72c4b3be9eb61e45fb895d75f96f0ae
3
+ metadata.gz: cf0be61cd6058f4e4ab5cd5c9c5bb19363f819e3
4
+ data.tar.gz: d8e8070dd5cb0e0bb6cc880f5c88088fe1b30f9b
5
5
  SHA512:
6
- metadata.gz: 67092177460792fa3892e585bb939b97969b80b96e621d32a619fe24022caccc781db5426c6bc3b8921ed8b950886259ab57a910472cbee922ae27ff9e2f3a28
7
- data.tar.gz: b532387d3a18ceceb4710f8a3bd006693e063171ec1792f040d0ee3d1c2534aa3d95f31edc26ad05a604bbfd916ed387571d08785fdb5829c403ce3a058908c6
6
+ metadata.gz: 08b3646611ed0077c34764aa11d6a230d376623e5d545521a4ed757a4b906dacc853b30f0f5767f7643be77922d9d2c485d262cad61a5842f5eda51f22f57184
7
+ data.tar.gz: 9a73762440be2c3560a5cece29e4819aeeb84cbbafe2086b637d7769cd8b538ef471c63bdca55d1944a8dca4c8f67c39afe263c666b1cc0ca18f56ca807e6d0c
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2008-2013 Tobias Lütke & Shopify, Inc.
1
+ Copyright (c) 2008-2014 Tobias Lütke & Shopify, Inc.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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-2013 Tobias Lütke & Shopify, Inc. Released under the MIT license (see LICENSE for details).
15
+ Copyright (c) 2008-2014 Tobias Lütke & Shopify, Inc. Released under the MIT license (see LICENSE for details).
data/asset_cloud.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{asset_cloud}
5
- s.version = "1.0.2"
5
+ s.version = "1.1.0"
6
6
 
7
7
  s.authors = %w(Shopify)
8
8
  s.date = %q{2009-08-04}
@@ -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 not exist?(key)
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))
@@ -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 " do
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.2
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.14
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.