No uri adapters #2435
No uri adapters #2435
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ group :development, :test do | |
gem 'mime-types' | ||
gem 'builder' | ||
gem 'rubocop', require: false | ||
gem 'rspec' | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
gem "rubysl", :platform => :rbx | ||
""" | ||
And I remove turbolinks | ||
And I comment out lines that contain "action_mailer" in "config/environments/*.rb" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [86/80] |
||
And I empty the application.js file | ||
And I configure the application to use "paperclip" from this project | ||
} | ||
|
@@ -49,6 +50,16 @@ | |
end | ||
end | ||
|
||
Given /^I comment out lines that contain "([^"]+)" in "([^"]+)"$/ do |contains, glob| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ambiguous regexp literal. Parenthesize the method arguments if it's surely a regexp literal, or add a whitespace to the right of the / if it should be a division. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [85/80] |
||
cd(".") do | ||
Dir.glob(glob).each do |file| | ||
transform_file(file) do |content| | ||
content.gsub(/^(.*?#{contains}.*?)$/) { |line| "# #{line}" } | ||
end | ||
end | ||
end | ||
end | ||
|
||
Given /^I attach :attachment$/ do | ||
attach_attachment("attachment") | ||
end | ||
|
@@ -138,8 +149,10 @@ def attach_attachment(name, definition = nil) | |
|
||
Given /^I start the rails application$/ do | ||
cd(".") do | ||
require "rails" | ||
require "./config/environment" | ||
require "capybara/rails" | ||
require "capybara" | ||
Capybara.app = Rails.application | ||
end | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
World(RSpec::Matchers) | ||
|
||
Before do | ||
aruba.config.command_launcher = ENV.fetch("DEBUG", nil) ? :debug : :spawn | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. |
||
@aruba_timeout_seconds = 120 | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module Paperclip | ||
class HttpUrlProxyAdapter < UriAdapter | ||
def self.register | ||
Paperclip.io_adapters.register self do |target| | ||
String === target && target =~ REGEXP | ||
end | ||
end | ||
|
||
REGEXP = /\Ahttps?:\/\// | ||
|
||
def initialize(target, options = {}) | ||
super(URI(URI.escape(target)), options) | ||
end | ||
|
||
end | ||
end | ||
|
||
Paperclip.io_adapters.register Paperclip::HttpUrlProxyAdapter do |target| | ||
String === target && target =~ Paperclip::HttpUrlProxyAdapter::REGEXP | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the risk with
DataUriAdapter
? How can we use it safely?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See - #2530 (comment)