addressable 2.2.7 → 2.2.8
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/{CHANGELOG → CHANGELOG.md} +5 -0
- data/Gemfile +17 -0
- data/Gemfile.lock +35 -0
- data/{LICENSE → LICENSE.txt} +0 -0
- data/README.md +10 -3
- data/Rakefile +0 -5
- data/lib/addressable/uri.rb +52 -37
- data/lib/addressable/version.rb +1 -1
- data/spec/addressable/uri_spec.rb +53 -2
- data/tasks/gem.rake +3 -4
- data/tasks/git.rake +1 -1
- data/tasks/{spec.rake → rspec.rake} +15 -17
- data/tasks/rubyforge.rake +1 -1
- data/tasks/yard.rake +2 -1
- metadata +17 -25
- data/tasks/rdoc.rake +0 -26
data/{CHANGELOG → CHANGELOG.md}
RENAMED
@@ -1,3 +1,8 @@
|
|
1
|
+
# Addressable 2.2.8
|
2
|
+
- fixed issues with dot segment removal code
|
3
|
+
- form encoding can now handle multiple values per key
|
4
|
+
- updated development environment
|
5
|
+
|
1
6
|
# Addressable 2.2.7
|
2
7
|
- fixed issues related to Addressable::URI#query_values=
|
3
8
|
- the Addressable::URI.parse method is now polymorphic
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development do
|
4
|
+
gem 'launchy'
|
5
|
+
gem 'yard'
|
6
|
+
gem 'redcarpet'
|
7
|
+
gem 'rubyforge'
|
8
|
+
end
|
9
|
+
|
10
|
+
group :test, :development do
|
11
|
+
gem 'rake', '>= 0.7.3'
|
12
|
+
gem 'rspec', '>= 2.9.0'
|
13
|
+
end
|
14
|
+
|
15
|
+
gem 'idn', :platform => :mri_18
|
16
|
+
|
17
|
+
gemspec
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
addressable (2.2.8)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
diff-lcs (1.1.3)
|
10
|
+
idn (0.0.2)
|
11
|
+
launchy (2.1.0)
|
12
|
+
addressable (~> 2.2.6)
|
13
|
+
rake (0.9.2.2)
|
14
|
+
redcarpet (2.1.1)
|
15
|
+
rspec (2.9.0)
|
16
|
+
rspec-core (~> 2.9.0)
|
17
|
+
rspec-expectations (~> 2.9.0)
|
18
|
+
rspec-mocks (~> 2.9.0)
|
19
|
+
rspec-core (2.9.0)
|
20
|
+
rspec-expectations (2.9.1)
|
21
|
+
diff-lcs (~> 1.1.3)
|
22
|
+
rspec-mocks (2.9.0)
|
23
|
+
yard (0.8.0)
|
24
|
+
|
25
|
+
PLATFORMS
|
26
|
+
ruby
|
27
|
+
|
28
|
+
DEPENDENCIES
|
29
|
+
addressable!
|
30
|
+
idn
|
31
|
+
launchy
|
32
|
+
rake (>= 0.7.3)
|
33
|
+
redcarpet
|
34
|
+
rspec (>= 2.9.0)
|
35
|
+
yard
|
data/{LICENSE → LICENSE.txt}
RENAMED
File without changes
|
data/README.md
CHANGED
@@ -7,6 +7,9 @@
|
|
7
7
|
<dt>License</dt><dd>Apache 2.0</dd>
|
8
8
|
</dl>
|
9
9
|
|
10
|
+
[](http://travis-ci.org/sporkmonger/addressable)
|
11
|
+
[](https://gemnasium.com/sporkmonger/addressable)
|
12
|
+
|
10
13
|
# Description
|
11
14
|
|
12
15
|
Addressable is a replacement for the URI implementation that is part of
|
@@ -67,10 +70,14 @@ support for URI templates.
|
|
67
70
|
|
68
71
|
# Install
|
69
72
|
|
70
|
-
|
73
|
+
$ sudo gem install addressable
|
71
74
|
|
72
75
|
You may optionally turn on native IDN support by installing libidn and the
|
73
76
|
idn gem:
|
74
77
|
|
75
|
-
|
76
|
-
|
78
|
+
$ sudo apt-get install idn # Debian/Ubuntu
|
79
|
+
$ sudo brew install libidn # OS X
|
80
|
+
$ sudo gem install idn
|
81
|
+
|
82
|
+
**NOTE:** Native IDN support appears to be broken in Ruby 1.9.x. The IDN gem
|
83
|
+
hasn't been updated in years.
|
data/Rakefile
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
-
require 'rake/testtask'
|
4
|
-
require 'rake/rdoctask'
|
5
|
-
require 'rake/packagetask'
|
6
|
-
require 'rake/gempackagetask'
|
7
|
-
require 'spec/rake/spectask'
|
8
3
|
|
9
4
|
require File.join(File.dirname(__FILE__), 'lib', 'addressable', 'version')
|
10
5
|
|
data/lib/addressable/uri.rb
CHANGED
@@ -51,7 +51,7 @@ module Addressable
|
|
51
51
|
end
|
52
52
|
|
53
53
|
SLASH = '/'
|
54
|
-
|
54
|
+
EMPTY_STR = ''
|
55
55
|
|
56
56
|
URIREGEX = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/
|
57
57
|
|
@@ -120,10 +120,10 @@ module Addressable
|
|
120
120
|
user = userinfo.strip[/^([^:]*):?/, 1]
|
121
121
|
password = userinfo.strip[/:(.*)$/, 1]
|
122
122
|
end
|
123
|
-
host = authority.gsub(/^([^\[\]]*)@/,
|
123
|
+
host = authority.gsub(/^([^\[\]]*)@/, EMPTY_STR).gsub(/:([^:@\[\]]*?)$/, EMPTY_STR)
|
124
124
|
port = authority[/:([^:@\[\]]*?)$/, 1]
|
125
125
|
end
|
126
|
-
if port ==
|
126
|
+
if port == EMPTY_STR
|
127
127
|
port = nil
|
128
128
|
end
|
129
129
|
|
@@ -187,7 +187,7 @@ module Addressable
|
|
187
187
|
if new_host
|
188
188
|
parsed.defer_validation do
|
189
189
|
new_path = parsed.path.gsub(
|
190
|
-
Regexp.new("^" + Regexp.escape(new_host)),
|
190
|
+
Regexp.new("^" + Regexp.escape(new_host)), EMPTY_STR)
|
191
191
|
parsed.host = new_host
|
192
192
|
parsed.path = new_path
|
193
193
|
parsed.scheme = hints[:scheme] unless parsed.scheme
|
@@ -237,7 +237,7 @@ module Addressable
|
|
237
237
|
# Otherwise, convert to a String
|
238
238
|
path = path.to_str.strip
|
239
239
|
|
240
|
-
path.gsub!(/^file:\/?\/?/,
|
240
|
+
path.gsub!(/^file:\/?\/?/, EMPTY_STR) if path =~ /^file:\/?\/?/
|
241
241
|
path = SLASH + path if path =~ /^([a-zA-Z])[\|:]/
|
242
242
|
uri = self.parse(path)
|
243
243
|
|
@@ -249,14 +249,14 @@ module Addressable
|
|
249
249
|
uri.path.gsub!(/\\/, SLASH)
|
250
250
|
if File.exists?(uri.path) &&
|
251
251
|
File.stat(uri.path).directory?
|
252
|
-
uri.path.gsub!(/\/$/,
|
252
|
+
uri.path.gsub!(/\/$/, EMPTY_STR)
|
253
253
|
uri.path = uri.path + '/'
|
254
254
|
end
|
255
255
|
|
256
256
|
# If the path is absolute, set the scheme and host.
|
257
257
|
if uri.path =~ /^\//
|
258
258
|
uri.scheme = "file"
|
259
|
-
uri.host =
|
259
|
+
uri.host = EMPTY_STR
|
260
260
|
end
|
261
261
|
uri.normalize!
|
262
262
|
end
|
@@ -619,9 +619,18 @@ module Addressable
|
|
619
619
|
else
|
620
620
|
raise TypeError, "Can't convert #{form_values.class} into Array."
|
621
621
|
end
|
622
|
-
|
623
|
-
|
622
|
+
|
623
|
+
form_values = form_values.inject([]) do |accu, (key, value)|
|
624
|
+
if value.kind_of?(Array)
|
625
|
+
value.each do |v|
|
626
|
+
accu << [key.to_s, v.to_s]
|
627
|
+
end
|
628
|
+
else
|
629
|
+
accu << [key.to_s, value.to_s]
|
630
|
+
end
|
631
|
+
accu
|
624
632
|
end
|
633
|
+
|
625
634
|
if sort
|
626
635
|
# Useful for OAuth and optimizing caching systems
|
627
636
|
form_values = form_values.sort
|
@@ -832,7 +841,7 @@ module Addressable
|
|
832
841
|
|
833
842
|
# You can't have a nil user with a non-nil password
|
834
843
|
if password != nil
|
835
|
-
@user =
|
844
|
+
@user = EMPTY_STR if @user.nil?
|
836
845
|
end
|
837
846
|
|
838
847
|
# Reset dependant values
|
@@ -887,7 +896,7 @@ module Addressable
|
|
887
896
|
@password ||= nil
|
888
897
|
@user ||= nil
|
889
898
|
if @password != nil
|
890
|
-
@user =
|
899
|
+
@user = EMPTY_STR if @user.nil?
|
891
900
|
end
|
892
901
|
|
893
902
|
# Reset dependant values
|
@@ -992,7 +1001,7 @@ module Addressable
|
|
992
1001
|
end
|
993
1002
|
result
|
994
1003
|
else
|
995
|
-
|
1004
|
+
EMPTY_STR
|
996
1005
|
end
|
997
1006
|
else
|
998
1007
|
nil
|
@@ -1081,7 +1090,7 @@ module Addressable
|
|
1081
1090
|
new_password = new_userinfo.strip[/:(.*)$/, 1]
|
1082
1091
|
end
|
1083
1092
|
new_host =
|
1084
|
-
new_authority.gsub(/^([^\[\]]*)@/,
|
1093
|
+
new_authority.gsub(/^([^\[\]]*)@/, EMPTY_STR).gsub(/:([^:@\[\]]*?)$/, EMPTY_STR)
|
1085
1094
|
new_port =
|
1086
1095
|
new_authority[/:([^:@\[\]]*?)$/, 1]
|
1087
1096
|
end
|
@@ -1269,7 +1278,7 @@ module Addressable
|
|
1269
1278
|
#
|
1270
1279
|
# @return [String] The path component.
|
1271
1280
|
def path
|
1272
|
-
return instance_variable_defined?(:@path) ? @path :
|
1281
|
+
return instance_variable_defined?(:@path) ? @path : EMPTY_STR
|
1273
1282
|
end
|
1274
1283
|
|
1275
1284
|
NORMPATH = /^(?!\/)[^\/:]*:.*$/
|
@@ -1310,7 +1319,7 @@ module Addressable
|
|
1310
1319
|
if new_path && !new_path.respond_to?(:to_str)
|
1311
1320
|
raise TypeError, "Can't convert #{new_path.class} into String."
|
1312
1321
|
end
|
1313
|
-
@path = (new_path ||
|
1322
|
+
@path = (new_path || EMPTY_STR).to_str
|
1314
1323
|
if !@path.empty? && @path[0..0] != SLASH && host != nil
|
1315
1324
|
@path = "/#{@path}"
|
1316
1325
|
end
|
@@ -1327,7 +1336,7 @@ module Addressable
|
|
1327
1336
|
# @return [String] The path's basename.
|
1328
1337
|
def basename
|
1329
1338
|
# Path cannot be nil
|
1330
|
-
return File.basename(self.path).gsub(/;[^\/]*$/,
|
1339
|
+
return File.basename(self.path).gsub(/;[^\/]*$/, EMPTY_STR)
|
1331
1340
|
end
|
1332
1341
|
|
1333
1342
|
##
|
@@ -1572,7 +1581,7 @@ module Addressable
|
|
1572
1581
|
return nil if self.absolute? && self.scheme !~ /^https?$/
|
1573
1582
|
return (
|
1574
1583
|
(!self.path.empty? ? self.path : SLASH) +
|
1575
|
-
(self.query ? "?#{self.query}" :
|
1584
|
+
(self.query ? "?#{self.query}" : EMPTY_STR)
|
1576
1585
|
)
|
1577
1586
|
end
|
1578
1587
|
|
@@ -1732,7 +1741,7 @@ module Addressable
|
|
1732
1741
|
joined_path = URI.normalize_path(uri.path)
|
1733
1742
|
else
|
1734
1743
|
base_path = self.path.dup
|
1735
|
-
base_path =
|
1744
|
+
base_path = EMPTY_STR if base_path == nil
|
1736
1745
|
base_path = URI.normalize_path(base_path)
|
1737
1746
|
|
1738
1747
|
# Section 5.2.3 of RFC 3986
|
@@ -1741,7 +1750,7 @@ module Addressable
|
|
1741
1750
|
if base_path =~ /\//
|
1742
1751
|
base_path.gsub!(/\/[^\/]+$/, SLASH)
|
1743
1752
|
else
|
1744
|
-
base_path =
|
1753
|
+
base_path = EMPTY_STR
|
1745
1754
|
end
|
1746
1755
|
|
1747
1756
|
# If the base path is empty and an authority segment has been
|
@@ -1905,7 +1914,7 @@ module Addressable
|
|
1905
1914
|
else
|
1906
1915
|
if uri.path != SLASH
|
1907
1916
|
components[:path].gsub!(
|
1908
|
-
Regexp.new("^" + Regexp.escape(uri.path)),
|
1917
|
+
Regexp.new("^" + Regexp.escape(uri.path)), EMPTY_STR)
|
1909
1918
|
end
|
1910
1919
|
end
|
1911
1920
|
end
|
@@ -2184,21 +2193,20 @@ module Addressable
|
|
2184
2193
|
end
|
2185
2194
|
|
2186
2195
|
private
|
2196
|
+
SELF_REF = '.'
|
2197
|
+
PARENT = '..'
|
2198
|
+
|
2199
|
+
RULE_2A = /\/\.\/|\/\.$/
|
2200
|
+
RULE_2B_2C = /\/([^\/]*)\/\.\.\/|\/([^\/]*)\/\.\.$/
|
2201
|
+
RULE_2D = /^\.\.?\/?/
|
2202
|
+
RULE_PREFIXED_PARENT = /^\/\.\.?\/|^(\/\.\.?)+\/?$/
|
2203
|
+
|
2187
2204
|
##
|
2188
2205
|
# Resolves paths to their simplest form.
|
2189
2206
|
#
|
2190
2207
|
# @param [String] path The path to normalize.
|
2191
2208
|
#
|
2192
2209
|
# @return [String] The normalized path.
|
2193
|
-
|
2194
|
-
PARENT1 = '.'
|
2195
|
-
PARENT2 = '..'
|
2196
|
-
|
2197
|
-
NPATH1 = /\/\.\/|\/\.$/
|
2198
|
-
NPATH2 = /\/([^\/]+)\/\.\.\/|\/([^\/]+)\/\.\.$/
|
2199
|
-
NPATH3 = /^\.\.?\/?/
|
2200
|
-
NPATH4 = /^\/\.\.?\/|^(\/\.\.?)+\/?$/
|
2201
|
-
|
2202
2210
|
def self.normalize_path(path)
|
2203
2211
|
# Section 5.2.4 of RFC 3986
|
2204
2212
|
|
@@ -2206,16 +2214,23 @@ module Addressable
|
|
2206
2214
|
normalized_path = path.dup
|
2207
2215
|
begin
|
2208
2216
|
mod = nil
|
2209
|
-
mod ||= normalized_path.gsub!(
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2217
|
+
mod ||= normalized_path.gsub!(RULE_2A, SLASH)
|
2218
|
+
|
2219
|
+
pair = normalized_path.match(RULE_2B_2C)
|
2220
|
+
parent, current = pair[1], pair[2] if pair
|
2221
|
+
if pair && ((parent != SELF_REF && parent != PARENT) ||
|
2222
|
+
(current != SELF_REF && current != PARENT))
|
2223
|
+
mod ||= normalized_path.gsub!(
|
2224
|
+
Regexp.new(
|
2225
|
+
"/#{Regexp.escape(parent.to_s)}/\\.\\./|" +
|
2226
|
+
"(/#{Regexp.escape(current.to_s)}/\\.\\.$)"
|
2227
|
+
), SLASH
|
2228
|
+
)
|
2215
2229
|
end
|
2216
2230
|
|
2217
|
-
mod ||= normalized_path.gsub!(
|
2218
|
-
|
2231
|
+
mod ||= normalized_path.gsub!(RULE_2D, EMPTY_STR)
|
2232
|
+
# Non-standard, removes prefixed dotted segments from path.
|
2233
|
+
mod ||= normalized_path.gsub!(RULE_PREFIXED_PARENT, SLASH)
|
2219
2234
|
end until mod.nil?
|
2220
2235
|
|
2221
2236
|
return normalized_path
|
data/lib/addressable/version.rb
CHANGED
@@ -1920,6 +1920,51 @@ describe Addressable::URI, "when parsed from " +
|
|
1920
1920
|
end
|
1921
1921
|
end
|
1922
1922
|
|
1923
|
+
describe Addressable::URI, "when parsed from '/a/b/c/./../../g'" do
|
1924
|
+
before do
|
1925
|
+
@uri = Addressable::URI.parse("/a/b/c/./../../g")
|
1926
|
+
end
|
1927
|
+
|
1928
|
+
it "should not be considered to be in normal form" do
|
1929
|
+
@uri.normalize.should_not be_eql(@uri)
|
1930
|
+
end
|
1931
|
+
|
1932
|
+
# Section 5.2.4 of RFC 3986
|
1933
|
+
it "should normalize to '/a/g'" do
|
1934
|
+
@uri.normalize.should === "/a/g"
|
1935
|
+
end
|
1936
|
+
end
|
1937
|
+
|
1938
|
+
describe Addressable::URI, "when parsed from 'mid/content=5/../6'" do
|
1939
|
+
before do
|
1940
|
+
@uri = Addressable::URI.parse("mid/content=5/../6")
|
1941
|
+
end
|
1942
|
+
|
1943
|
+
it "should not be considered to be in normal form" do
|
1944
|
+
@uri.normalize.should_not be_eql(@uri)
|
1945
|
+
end
|
1946
|
+
|
1947
|
+
# Section 5.2.4 of RFC 3986
|
1948
|
+
it "should normalize to 'mid/6'" do
|
1949
|
+
@uri.normalize.should === "mid/6"
|
1950
|
+
end
|
1951
|
+
end
|
1952
|
+
|
1953
|
+
describe Addressable::URI, "when parsed from " +
|
1954
|
+
"'http://www.example.com///../'" do
|
1955
|
+
before do
|
1956
|
+
@uri = Addressable::URI.parse('http://www.example.com///../')
|
1957
|
+
end
|
1958
|
+
|
1959
|
+
it "should not be considered to be in normal form" do
|
1960
|
+
@uri.normalize.should_not be_eql(@uri)
|
1961
|
+
end
|
1962
|
+
|
1963
|
+
it "should normalize to 'http://www.example.com//'" do
|
1964
|
+
@uri.normalize.should === "http://www.example.com//"
|
1965
|
+
end
|
1966
|
+
end
|
1967
|
+
|
1923
1968
|
describe Addressable::URI, "when parsed from " +
|
1924
1969
|
"'http://example.com/path/to/resource/'" do
|
1925
1970
|
before do
|
@@ -4286,7 +4331,7 @@ end
|
|
4286
4331
|
describe Addressable::URI, "when form encoding a hash" do
|
4287
4332
|
it "should result in correct percent encoded sequence" do
|
4288
4333
|
Addressable::URI.form_encode(
|
4289
|
-
|
4334
|
+
[["&one", "/1"], ["=two", "?2"], [":three", "#3"]]
|
4290
4335
|
).should == "%26one=%2F1&%3Dtwo=%3F2&%3Athree=%233"
|
4291
4336
|
end
|
4292
4337
|
|
@@ -4302,6 +4347,12 @@ describe Addressable::URI, "when form encoding a hash" do
|
|
4302
4347
|
).should == "key="
|
4303
4348
|
end
|
4304
4349
|
|
4350
|
+
it "should result in correct percent encoded sequence" do
|
4351
|
+
Addressable::URI.form_encode(
|
4352
|
+
{"q" => ["one", "two", "three"]}
|
4353
|
+
).should == "q=one&q=two&q=three"
|
4354
|
+
end
|
4355
|
+
|
4305
4356
|
it "should result in correctly encoded newlines" do
|
4306
4357
|
Addressable::URI.form_encode(
|
4307
4358
|
{"text" => "one\ntwo\rthree\r\nfour\n\r"}
|
@@ -4818,7 +4869,7 @@ describe Addressable::URI, "when assigning query values" do
|
|
4818
4869
|
end
|
4819
4870
|
|
4820
4871
|
it "should preserve query string order" do
|
4821
|
-
query_string = (('a'..'z').to_a.
|
4872
|
+
query_string = (('a'..'z').to_a.reverse.map { |e| "#{e}=#{e}" }).join("&")
|
4822
4873
|
@uri.query = query_string
|
4823
4874
|
original_uri = @uri.to_s
|
4824
4875
|
@uri.query_values = @uri.query_values(:notation => :flat_array)
|
data/tasks/gem.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "
|
1
|
+
require "rubygems/package_task"
|
2
2
|
|
3
3
|
namespace :gem do
|
4
4
|
GEM_SPEC = Gem::Specification.new do |s|
|
@@ -19,9 +19,8 @@ namespace :gem do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
s.add_development_dependency("rake", ">= 0.7.3")
|
22
|
-
s.add_development_dependency("rspec", ">=
|
22
|
+
s.add_development_dependency("rspec", ">= 2.9.0")
|
23
23
|
s.add_development_dependency("launchy", ">= 0.3.2")
|
24
|
-
s.add_development_dependency("diff-lcs", ">= 1.1.2")
|
25
24
|
|
26
25
|
s.require_path = "lib"
|
27
26
|
|
@@ -31,7 +30,7 @@ namespace :gem do
|
|
31
30
|
s.rubyforge_project = RUBY_FORGE_PROJECT
|
32
31
|
end
|
33
32
|
|
34
|
-
|
33
|
+
Gem::PackageTask.new(GEM_SPEC) do |p|
|
35
34
|
p.gem_spec = GEM_SPEC
|
36
35
|
p.need_tar = true
|
37
36
|
p.need_zip = true
|
data/tasks/git.rake
CHANGED
@@ -10,7 +10,7 @@ namespace :git do
|
|
10
10
|
|
11
11
|
desc "Create a new tag in the Git repository"
|
12
12
|
task :create do
|
13
|
-
changelog = File.open("CHANGELOG", "r") { |file| file.read }
|
13
|
+
changelog = File.open("CHANGELOG.md", "r") { |file| file.read }
|
14
14
|
puts "-" * 80
|
15
15
|
puts changelog
|
16
16
|
puts "-" * 80
|
@@ -1,8 +1,9 @@
|
|
1
|
+
require "rspec/core/rake_task"
|
2
|
+
|
1
3
|
namespace :spec do
|
2
|
-
|
3
|
-
t.
|
4
|
-
t.
|
5
|
-
t.spec_opts = ['--color', '--format', 'specdoc']
|
4
|
+
RSpec::Core::RakeTask.new(:rcov) do |t|
|
5
|
+
t.pattern = FileList['spec/**/*_spec.rb']
|
6
|
+
t.rspec_opts = ['--color', '--format', 'documentation']
|
6
7
|
|
7
8
|
t.rcov = RCOV_ENABLED
|
8
9
|
t.rcov_opts = [
|
@@ -17,31 +18,28 @@ namespace :spec do
|
|
17
18
|
]
|
18
19
|
end
|
19
20
|
|
20
|
-
|
21
|
-
t.
|
22
|
-
t.
|
23
|
-
t.spec_opts = ['--color', '--format', 'specdoc']
|
21
|
+
RSpec::Core::RakeTask.new(:normal) do |t|
|
22
|
+
t.pattern = FileList['spec/**/*_spec.rb'].exclude(/compat/)
|
23
|
+
t.rspec_opts = ['--color', '--format', 'documentation']
|
24
24
|
t.rcov = false
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
t.
|
29
|
-
t.
|
30
|
-
t.spec_opts = ['--color', '--format', 'specdoc']
|
27
|
+
RSpec::Core::RakeTask.new(:all) do |t|
|
28
|
+
t.pattern = FileList['spec/**/*_spec.rb']
|
29
|
+
t.rspec_opts = ['--color', '--format', 'documentation']
|
31
30
|
t.rcov = false
|
32
31
|
end
|
33
32
|
|
34
33
|
desc "Generate HTML Specdocs for all specs"
|
35
|
-
|
34
|
+
RSpec::Core::RakeTask.new(:specdoc) do |t|
|
36
35
|
specdoc_path = File.expand_path(
|
37
|
-
File.join(File.dirname(__FILE__), '..', '
|
36
|
+
File.join(File.dirname(__FILE__), '..', 'documentation')
|
38
37
|
)
|
39
38
|
Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
|
40
39
|
|
41
40
|
output_file = File.join(specdoc_path, 'index.html')
|
42
|
-
t.
|
43
|
-
t.
|
44
|
-
t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
|
41
|
+
t.pattern = FileList['spec/**/*_spec.rb']
|
42
|
+
t.rspec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
|
45
43
|
t.fail_on_error = false
|
46
44
|
end
|
47
45
|
|
data/tasks/rubyforge.rake
CHANGED
data/tasks/yard.rake
CHANGED
@@ -10,7 +10,8 @@ begin
|
|
10
10
|
yardoc.name = "yard"
|
11
11
|
yardoc.options = ["--verbose", "--markup", "markdown"]
|
12
12
|
yardoc.files = FileList[
|
13
|
-
"lib/**/*.rb", "ext/**/*.c",
|
13
|
+
"lib/**/*.rb", "ext/**/*.c",
|
14
|
+
"README.md", "CHANGELOG.md", "LICENSE.txt"
|
14
15
|
].exclude(/idna/)
|
15
16
|
end
|
16
17
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 2.2.
|
8
|
+
- 8
|
9
|
+
version: 2.2.8
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Bob Aman
|
@@ -14,13 +14,14 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-02
|
17
|
+
date: 2012-05-02 00:00:00 +03:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
24
25
|
requirements:
|
25
26
|
- - ">="
|
26
27
|
- !ruby/object:Gem::Version
|
@@ -35,20 +36,22 @@ dependencies:
|
|
35
36
|
name: rspec
|
36
37
|
prerelease: false
|
37
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
38
40
|
requirements:
|
39
41
|
- - ">="
|
40
42
|
- !ruby/object:Gem::Version
|
41
43
|
segments:
|
42
|
-
-
|
44
|
+
- 2
|
45
|
+
- 9
|
43
46
|
- 0
|
44
|
-
|
45
|
-
version: 1.0.8
|
47
|
+
version: 2.9.0
|
46
48
|
type: :development
|
47
49
|
version_requirements: *id002
|
48
50
|
- !ruby/object:Gem::Dependency
|
49
51
|
name: launchy
|
50
52
|
prerelease: false
|
51
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
52
55
|
requirements:
|
53
56
|
- - ">="
|
54
57
|
- !ruby/object:Gem::Version
|
@@ -59,20 +62,6 @@ dependencies:
|
|
59
62
|
version: 0.3.2
|
60
63
|
type: :development
|
61
64
|
version_requirements: *id003
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: diff-lcs
|
64
|
-
prerelease: false
|
65
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
segments:
|
70
|
-
- 1
|
71
|
-
- 1
|
72
|
-
- 2
|
73
|
-
version: 1.1.2
|
74
|
-
type: :development
|
75
|
-
version_requirements: *id004
|
76
65
|
description: |
|
77
66
|
Addressable is a replacement for the URI implementation that is part of
|
78
67
|
Ruby's standard library. It more closely conforms to the relevant RFCs and
|
@@ -100,13 +89,14 @@ files:
|
|
100
89
|
- tasks/gem.rake
|
101
90
|
- tasks/git.rake
|
102
91
|
- tasks/metrics.rake
|
103
|
-
- tasks/
|
92
|
+
- tasks/rspec.rake
|
104
93
|
- tasks/rubyforge.rake
|
105
|
-
- tasks/spec.rake
|
106
94
|
- tasks/yard.rake
|
107
95
|
- website/index.html
|
108
|
-
- CHANGELOG
|
109
|
-
-
|
96
|
+
- CHANGELOG.md
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.lock
|
99
|
+
- LICENSE.txt
|
110
100
|
- Rakefile
|
111
101
|
- README.md
|
112
102
|
has_rdoc: true
|
@@ -120,6 +110,7 @@ rdoc_options:
|
|
120
110
|
require_paths:
|
121
111
|
- lib
|
122
112
|
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
123
114
|
requirements:
|
124
115
|
- - ">="
|
125
116
|
- !ruby/object:Gem::Version
|
@@ -127,6 +118,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
118
|
- 0
|
128
119
|
version: "0"
|
129
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
130
122
|
requirements:
|
131
123
|
- - ">="
|
132
124
|
- !ruby/object:Gem::Version
|
@@ -136,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
128
|
requirements: []
|
137
129
|
|
138
130
|
rubyforge_project: addressable
|
139
|
-
rubygems_version: 1.3.
|
131
|
+
rubygems_version: 1.3.7
|
140
132
|
signing_key:
|
141
133
|
specification_version: 3
|
142
134
|
summary: URI Implementation
|
data/tasks/rdoc.rake
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require "rake/rdoctask"
|
2
|
-
|
3
|
-
namespace :doc do
|
4
|
-
desc "Generate RDoc documentation"
|
5
|
-
Rake::RDocTask.new do |rdoc|
|
6
|
-
rdoc.rdoc_dir = "doc"
|
7
|
-
rdoc.title = "#{PKG_NAME}-#{PKG_VERSION} Documentation"
|
8
|
-
rdoc.options << "--line-numbers" << "--inline-source" <<
|
9
|
-
"--accessor" << "cattr_accessor=object" << "--charset" << "utf-8"
|
10
|
-
rdoc.template = "#{ENV["template"]}.rb" if ENV["template"]
|
11
|
-
rdoc.rdoc_files.include("README.md", "CHANGELOG", "LICENSE")
|
12
|
-
rdoc.rdoc_files.include("lib/**/*.rb")
|
13
|
-
end
|
14
|
-
|
15
|
-
desc "Generate ri locally for testing"
|
16
|
-
task :ri do
|
17
|
-
sh "rdoc --ri -o ri ."
|
18
|
-
end
|
19
|
-
|
20
|
-
desc "Remove ri products"
|
21
|
-
task :clobber_ri do
|
22
|
-
rm_r "ri" rescue nil
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
task "clobber" => ["doc:clobber_rdoc", "doc:clobber_ri"]
|