has_image 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/lib/has_image/storage.rb +1 -1
- data/test/storage_test.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
2008-08-18 Norman Clarke <norman@randomba.org>
|
2
|
+
* Fixed ability to set the path for storing image files.
|
3
|
+
|
1
4
|
2008-08-1 Adrian Mugnolo <adrian@randomba.org>
|
2
5
|
* Improved partitioned path handling to avoid collisions when the id is
|
3
6
|
very high, which can happen if you use db:fixtures:load.
|
data/lib/has_image/storage.rb
CHANGED
@@ -90,7 +90,7 @@ module HasImage
|
|
90
90
|
#
|
91
91
|
# /photos/0000/0001/3er0zs.jpg
|
92
92
|
def public_path_for(object, thumbnail = nil)
|
93
|
-
filesystem_path_for(object, thumbnail).gsub(
|
93
|
+
filesystem_path_for(object, thumbnail).gsub(/\A.*public/, '')
|
94
94
|
end
|
95
95
|
|
96
96
|
# Deletes the images and directory that contains them.
|
data/test/storage_test.rb
CHANGED
@@ -35,7 +35,7 @@ class StorageTest < Test::Unit::TestCase
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def test_public_path_for
|
38
|
-
@storage = HasImage::Storage.new(default_options)
|
38
|
+
@storage = HasImage::Storage.new(default_options.merge(:base_path => '/public'))
|
39
39
|
pic = stub(:has_image_file => "mypic", :id => 1)
|
40
40
|
assert_equal "/tests/0000/0001/mypic_square.jpg", @storage.public_path_for(pic, :square)
|
41
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_image
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Norman Clarke
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-08-
|
12
|
+
date: 2008-08-18 00:00:00 -03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|