npo_assets 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/npo_assets/asset.rb +13 -1
- data/npo_assets.gemspec +2 -7
- data/spec/npo_assets/asset_spec.rb +1 -1
- metadata +6 -8
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/lib/npo_assets/asset.rb
CHANGED
@@ -35,7 +35,19 @@ module NPO
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def url(size='')
|
38
|
-
|
38
|
+
u = attributes['url']
|
39
|
+
|
40
|
+
if size == ''
|
41
|
+
# /000/001/002.jpg
|
42
|
+
parts = u
|
43
|
+
else
|
44
|
+
# /000/001/002/320x240.jpg
|
45
|
+
ext = File.extname(u)
|
46
|
+
dir = File.basename(u, ext)
|
47
|
+
parts = [dir, "#{size}#{ext}"]
|
48
|
+
end
|
49
|
+
|
50
|
+
File.join(NPO::Assets.base_url, 'assets', parts)
|
39
51
|
end
|
40
52
|
|
41
53
|
private
|
data/npo_assets.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{npo_assets}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bart Zonneveld"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-07-13}
|
13
13
|
s.description = %q{Wrapper for media db}
|
14
14
|
s.email = %q{loop@superinfinite.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -37,11 +37,6 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.require_paths = ["lib"]
|
38
38
|
s.rubygems_version = %q{1.6.2}
|
39
39
|
s.summary = %q{Wrapper for media db}
|
40
|
-
s.test_files = [
|
41
|
-
"spec/npo_assets/asset_spec.rb",
|
42
|
-
"spec/npo_assets_spec.rb",
|
43
|
-
"spec/spec_helper.rb"
|
44
|
-
]
|
45
40
|
|
46
41
|
if s.respond_to? :specification_version then
|
47
42
|
s.specification_version = 3
|
@@ -183,7 +183,7 @@ describe NPO::Assets::Asset do
|
|
183
183
|
end
|
184
184
|
|
185
185
|
it "should return the correct url with a size" do
|
186
|
-
@asset.url('100x200').should == "http://test.com/assets/100x200
|
186
|
+
@asset.url('100x200').should == "http://test.com/assets/1/100x200.jpg"
|
187
187
|
end
|
188
188
|
end
|
189
189
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: npo_assets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bart Zonneveld
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-07-13 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -107,7 +107,5 @@ rubygems_version: 1.6.2
|
|
107
107
|
signing_key:
|
108
108
|
specification_version: 3
|
109
109
|
summary: Wrapper for media db
|
110
|
-
test_files:
|
111
|
-
|
112
|
-
- spec/npo_assets_spec.rb
|
113
|
-
- spec/spec_helper.rb
|
110
|
+
test_files: []
|
111
|
+
|