paperclip-remote 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/paperclip/remote.rb +5 -3
- metadata +7 -9
data/lib/paperclip/remote.rb
CHANGED
@@ -26,9 +26,11 @@ module Paperclip::Remote
|
|
26
26
|
|
27
27
|
before_validation do |record|
|
28
28
|
url = record.send(:"#{name}_remote_url")
|
29
|
-
if url.present? && (
|
30
|
-
|
31
|
-
|
29
|
+
if url.present? && (io = open(URI.parse(url)) rescue nil)
|
30
|
+
def io.original_filename
|
31
|
+
File.basename(base_uri.path)
|
32
|
+
end
|
33
|
+
send :"#{name}=", io
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dimitrij Denissenko
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-08-18 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: paperclip
|
@@ -45,11 +44,10 @@ extra_rdoc_files: []
|
|
45
44
|
files:
|
46
45
|
- LICENSE
|
47
46
|
- README.rdoc
|
48
|
-
- lib/paperclip_remote.rb
|
49
|
-
- lib/paperclip/remote.rb
|
50
47
|
- lib/paperclip-remote.rb
|
48
|
+
- lib/paperclip/remote.rb
|
49
|
+
- lib/paperclip_remote.rb
|
51
50
|
- rails/init.rb
|
52
|
-
has_rdoc: true
|
53
51
|
homepage: https://github.com/bsm/paperclip-remote
|
54
52
|
licenses: []
|
55
53
|
|
@@ -83,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
81
|
requirements: []
|
84
82
|
|
85
83
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
84
|
+
rubygems_version: 1.8.5
|
87
85
|
signing_key:
|
88
86
|
specification_version: 3
|
89
87
|
summary: Plugin for Paperclip
|