jarrett-quarto 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
1
+ 1.2.1
@@ -1,5 +1,4 @@
1
1
  require 'cgi'
2
- require 'uri'
3
2
 
4
3
  module Quarto
5
4
 
@@ -70,12 +69,7 @@ module Quarto
70
69
  # Somewhat compatible with the Rails url_for helper.
71
70
  def url_for(options = {})
72
71
  if options.is_a?(String)
73
- uri = URI.parse(options)
74
- if uri.absolute?
75
- uri.to_s
76
- else
77
- abs_url(uri.to_s)
78
- end
72
+ options
79
73
  else
80
74
  url_for_with_element_wrapper(options)
81
75
  end
data/quarto.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{quarto}
5
- s.version = "1.2.0"
5
+ s.version = "1.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jarrett Colby"]
@@ -1,4 +1,5 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'uri'
2
3
 
3
4
  describe Quarto::UrlHelper do
4
5
  include Quarto::UrlHelper
@@ -144,16 +145,17 @@ describe Quarto::UrlHelper do
144
145
  end
145
146
  end
146
147
 
147
- it 'should call abs_url if the parameter is a relative URL' do
148
- ['foo', '/foo'].each do |rel_url|
148
+ it 'should not call abs_url' do
149
+ ['foo', '../foo', '/foo'].each do |rel_url|
149
150
  template = TemplateOutsideRails.new
150
- template.should_receive(:abs_url).with(rel_url)
151
+ template.should_not_receive(:abs_url)
151
152
  template.url_for(rel_url)
152
153
  end
153
154
  end
154
155
 
155
- it 'should not modify an absolute url' do
156
- ['http://example.com', 'http://example.com/foo', 'https://example.com', 'ftp://example.com'].each do |url|
156
+ it 'should not modify a url, be it absolute or relative' do
157
+ ['http://example.com', 'http://example.com/foo', 'https://example.com', 'ftp://example.com',
158
+ 'foo', '../foo', '/foo'].each do |url|
157
159
  TemplateOutsideRails.new.url_for(url).should == url
158
160
  end
159
161
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarrett-quarto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrett Colby