rails_imager 0.0.14 → 0.0.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faf8ac77f14d52b15633279599d4019ba361d6a8
|
4
|
+
data.tar.gz: 4610c1a6e2e33aa0d22b98ffcb15fc5f8260f0f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea67285e3137d64be22d25de1a54bdf23bece4f78eaae447ccf7f8a01e8f385123889ec966dd0722137bbf4c4b98c963426cdc6b7ac9d3dd8373bad7128c29d7
|
7
|
+
data.tar.gz: d84e9da88ec02a30060f64cb993b12c491644e59bba52d6ee947a8f26734fbe3ed27b3b936a9292dc2a147ec2cb60c3cfe19f2566277622b9dc6ed4fdf4dd9b4
|
@@ -10,7 +10,9 @@ class RailsImager::ImagesController < ApplicationController
|
|
10
10
|
raise ArgumentError, "Invalid parameter: '#{key}'." unless RailsImager::ImageHandler::PARAMS_ARGS.map{ |param| param.to_s }.include?(key)
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
image_id = params[:id].to_s.gsub("%C3%B8", "ø")
|
14
|
+
|
15
|
+
image_path = "#{Rails.public_path}/#{image_id}"
|
14
16
|
image_path = File.realpath(image_path)
|
15
17
|
validate_path(image_path)
|
16
18
|
|
@@ -9,12 +9,35 @@ module RailsImager::ImagesHelper
|
|
9
9
|
path = path_without_public
|
10
10
|
end
|
11
11
|
|
12
|
+
newpath = ""
|
13
|
+
|
14
|
+
if args[:url]
|
15
|
+
args.delete(:url)
|
16
|
+
newpath << "#{request.protocol}#{request.host_with_port}"
|
17
|
+
elsif args[:mailer]
|
18
|
+
args.delete(:mailer)
|
19
|
+
|
20
|
+
if ActionMailer::Base.default_url_options[:protocol]
|
21
|
+
newpath << ActionMailer::Base.default_url_options[:protocol]
|
22
|
+
else
|
23
|
+
newpath << "http://"
|
24
|
+
end
|
25
|
+
|
26
|
+
newpath << ActionMailer::Base.default_url_options[:host]
|
27
|
+
|
28
|
+
if ActionMailer::Base.default_url_options[:port]
|
29
|
+
newpath << ":#{ActionMailer::Base.default_url_options[:port]}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
12
33
|
# Check for invalid parameters.
|
13
34
|
args.each do |key, val|
|
14
35
|
raise ArgumentError, "Invalid parameter: '#{key}'." unless RailsImager::ImageHandler::PARAMS_ARGS.include?(key)
|
15
36
|
end
|
16
37
|
|
17
|
-
|
38
|
+
|
39
|
+
|
40
|
+
newpath << "/rails_imager/images/"
|
18
41
|
newpath << URI.encode(path)
|
19
42
|
newpath << "/?"
|
20
43
|
|
data/lib/rails_imager/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_imager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaspernj
|
@@ -109,7 +109,6 @@ files:
|
|
109
109
|
- app/assets/stylesheets/rails_imager/images.css
|
110
110
|
- app/controllers/rails_imager/images_controller.rb
|
111
111
|
- app/controllers/rails_imager/application_controller.rb
|
112
|
-
- app/views/rails_imager/images/show.html.erb
|
113
112
|
- app/views/layouts/rails_imager/application.html.erb
|
114
113
|
- config/routes.rb
|
115
114
|
- lib/rails_imager/engine.rb
|