addressable 2.3.3 → 2.8.9
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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +199 -29
- data/README.md +103 -69
- data/lib/addressable/idna/native.rb +31 -8
- data/lib/addressable/idna/pure.rb +4269 -217
- data/lib/addressable/idna.rb +3 -2
- data/lib/addressable/template.rb +243 -58
- data/lib/addressable/uri.rb +614 -294
- data/lib/addressable/version.rb +5 -4
- data/lib/addressable.rb +4 -0
- metadata +30 -81
- data/Gemfile +0 -18
- data/Rakefile +0 -37
- data/data/unicode.data +0 -0
- data/spec/addressable/idna_spec.rb +0 -231
- data/spec/addressable/net_http_compat_spec.rb +0 -26
- data/spec/addressable/template_spec.rb +0 -1022
- data/spec/addressable/uri_spec.rb +0 -5161
- data/tasks/clobber.rake +0 -2
- data/tasks/gem.rake +0 -86
- data/tasks/git.rake +0 -45
- data/tasks/metrics.rake +0 -22
- data/tasks/rspec.rake +0 -58
- data/tasks/rubyforge.rake +0 -89
- data/tasks/yard.rake +0 -27
- data/website/index.html +0 -110
data/tasks/clobber.rake
DELETED
data/tasks/gem.rake
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
require "rubygems/package_task"
|
|
2
|
-
|
|
3
|
-
namespace :gem do
|
|
4
|
-
GEM_SPEC = Gem::Specification.new do |s|
|
|
5
|
-
s.name = PKG_NAME
|
|
6
|
-
s.version = PKG_VERSION
|
|
7
|
-
s.summary = PKG_SUMMARY
|
|
8
|
-
s.description = PKG_DESCRIPTION
|
|
9
|
-
|
|
10
|
-
s.files = PKG_FILES.to_a
|
|
11
|
-
|
|
12
|
-
s.has_rdoc = true
|
|
13
|
-
s.extra_rdoc_files = %w( README.md )
|
|
14
|
-
s.rdoc_options.concat ["--main", "README.md"]
|
|
15
|
-
|
|
16
|
-
if !s.respond_to?(:add_development_dependency)
|
|
17
|
-
puts "Cannot build Gem with this version of RubyGems."
|
|
18
|
-
exit(1)
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
s.add_development_dependency("rake", ">= 0.7.3")
|
|
22
|
-
s.add_development_dependency("rspec", ">= 2.9.0")
|
|
23
|
-
s.add_development_dependency("launchy", ">= 0.3.2")
|
|
24
|
-
|
|
25
|
-
s.require_path = "lib"
|
|
26
|
-
|
|
27
|
-
s.author = "Bob Aman"
|
|
28
|
-
s.email = "bob@sporkmonger.com"
|
|
29
|
-
s.homepage = RUBY_FORGE_URL
|
|
30
|
-
s.rubyforge_project = RUBY_FORGE_PROJECT
|
|
31
|
-
s.license = "Apache License 2.0"
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
Gem::PackageTask.new(GEM_SPEC) do |p|
|
|
35
|
-
p.gem_spec = GEM_SPEC
|
|
36
|
-
p.need_tar = true
|
|
37
|
-
p.need_zip = true
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
desc "Generates .gemspec file"
|
|
41
|
-
task :gemspec do
|
|
42
|
-
spec_string = GEM_SPEC.to_ruby
|
|
43
|
-
|
|
44
|
-
begin
|
|
45
|
-
Thread.new { eval("$SAFE = 3\n#{spec_string}", binding) }.join
|
|
46
|
-
rescue
|
|
47
|
-
abort "unsafe gemspec: #{$!}"
|
|
48
|
-
else
|
|
49
|
-
File.open("#{GEM_SPEC.name}.gemspec", 'w') do |file|
|
|
50
|
-
file.write spec_string
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
desc "Show information about the gem"
|
|
56
|
-
task :debug do
|
|
57
|
-
puts GEM_SPEC.to_ruby
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
desc "Install the gem"
|
|
61
|
-
task :install => ["clobber", "gem:package"] do
|
|
62
|
-
sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
desc "Uninstall the gem"
|
|
66
|
-
task :uninstall do
|
|
67
|
-
installed_list = Gem.source_index.find_name(PKG_NAME)
|
|
68
|
-
if installed_list &&
|
|
69
|
-
(installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
|
|
70
|
-
sh(
|
|
71
|
-
"#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
|
|
72
|
-
"--ignore-dependencies --executables #{PKG_NAME}"
|
|
73
|
-
)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
desc "Reinstall the gem"
|
|
78
|
-
task :reinstall => [:uninstall, :install]
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
desc "Alias to gem:package"
|
|
82
|
-
task "gem" => "gem:package"
|
|
83
|
-
|
|
84
|
-
task "gem:release" => "gem:gemspec"
|
|
85
|
-
|
|
86
|
-
task "clobber" => ["gem:clobber_package"]
|
data/tasks/git.rake
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
namespace :git do
|
|
2
|
-
namespace :tag do
|
|
3
|
-
desc "List tags from the Git repository"
|
|
4
|
-
task :list do
|
|
5
|
-
tags = `git tag -l`
|
|
6
|
-
tags.gsub!("\r", "")
|
|
7
|
-
tags = tags.split("\n").sort {|a, b| b <=> a }
|
|
8
|
-
puts tags.join("\n")
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
desc "Create a new tag in the Git repository"
|
|
12
|
-
task :create do
|
|
13
|
-
changelog = File.open("CHANGELOG.md", "r") { |file| file.read }
|
|
14
|
-
puts "-" * 80
|
|
15
|
-
puts changelog
|
|
16
|
-
puts "-" * 80
|
|
17
|
-
puts
|
|
18
|
-
|
|
19
|
-
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
|
20
|
-
abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION
|
|
21
|
-
|
|
22
|
-
git_status = `git status`
|
|
23
|
-
if git_status !~ /nothing to commit \(working directory clean\)/
|
|
24
|
-
abort "Working directory isn't clean."
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
tag = "#{PKG_NAME}-#{PKG_VERSION}"
|
|
28
|
-
msg = "Release #{PKG_NAME}-#{PKG_VERSION}"
|
|
29
|
-
|
|
30
|
-
existing_tags = `git tag -l #{PKG_NAME}-*`.split('\n')
|
|
31
|
-
if existing_tags.include?(tag)
|
|
32
|
-
warn("Tag already exists, deleting...")
|
|
33
|
-
unless system "git tag -d #{tag}"
|
|
34
|
-
abort "Tag deletion failed."
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
puts "Creating git tag '#{tag}'..."
|
|
38
|
-
unless system "git tag -a -m \"#{msg}\" #{tag}"
|
|
39
|
-
abort "Tag creation failed."
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
task "gem:release" => "git:tag:create"
|
data/tasks/metrics.rake
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
namespace :metrics do
|
|
2
|
-
task :lines do
|
|
3
|
-
lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
|
|
4
|
-
for file_name in FileList["lib/**/*.rb"]
|
|
5
|
-
f = File.open(file_name)
|
|
6
|
-
while line = f.gets
|
|
7
|
-
lines += 1
|
|
8
|
-
next if line =~ /^\s*$/
|
|
9
|
-
next if line =~ /^\s*#/
|
|
10
|
-
codelines += 1
|
|
11
|
-
end
|
|
12
|
-
puts "L: #{sprintf("%4d", lines)}, " +
|
|
13
|
-
"LOC #{sprintf("%4d", codelines)} | #{file_name}"
|
|
14
|
-
total_lines += lines
|
|
15
|
-
total_codelines += codelines
|
|
16
|
-
|
|
17
|
-
lines, codelines = 0, 0
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
|
|
21
|
-
end
|
|
22
|
-
end
|
data/tasks/rspec.rake
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
require "rspec/core/rake_task"
|
|
2
|
-
|
|
3
|
-
namespace :spec do
|
|
4
|
-
RSpec::Core::RakeTask.new(:rcov) do |t|
|
|
5
|
-
t.pattern = FileList['spec/**/*_spec.rb']
|
|
6
|
-
t.rspec_opts = ['--color', '--format', 'documentation']
|
|
7
|
-
|
|
8
|
-
t.rcov = RCOV_ENABLED
|
|
9
|
-
t.rcov_opts = [
|
|
10
|
-
'--exclude', 'lib\\/compat',
|
|
11
|
-
'--exclude', 'spec',
|
|
12
|
-
'--exclude', '\\.rvm\\/gems',
|
|
13
|
-
'--exclude', '1\\.8\\/gems',
|
|
14
|
-
'--exclude', '1\\.9\\/gems',
|
|
15
|
-
'--exclude', '\\.rvm',
|
|
16
|
-
'--exclude', '\\/Library\\/Ruby',
|
|
17
|
-
'--exclude', 'addressable\\/idna' # environment dependant
|
|
18
|
-
]
|
|
19
|
-
end
|
|
20
|
-
|
|
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
|
-
t.rcov = false
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
RSpec::Core::RakeTask.new(:all) do |t|
|
|
28
|
-
t.pattern = FileList['spec/**/*_spec.rb']
|
|
29
|
-
t.rspec_opts = ['--color', '--format', 'documentation']
|
|
30
|
-
t.rcov = false
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
desc "Generate HTML Specdocs for all specs"
|
|
34
|
-
RSpec::Core::RakeTask.new(:specdoc) do |t|
|
|
35
|
-
specdoc_path = File.expand_path(
|
|
36
|
-
File.join(File.dirname(__FILE__), '..', 'documentation')
|
|
37
|
-
)
|
|
38
|
-
Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
|
|
39
|
-
|
|
40
|
-
output_file = File.join(specdoc_path, 'index.html')
|
|
41
|
-
t.pattern = FileList['spec/**/*_spec.rb']
|
|
42
|
-
t.rspec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
|
|
43
|
-
t.fail_on_error = false
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
namespace :rcov do
|
|
47
|
-
desc "Browse the code coverage report."
|
|
48
|
-
task :browse => "spec:rcov" do
|
|
49
|
-
require "launchy"
|
|
50
|
-
Launchy::Browser.run("coverage/index.html")
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
desc "Alias to spec:normal"
|
|
56
|
-
task "spec" => "spec:normal"
|
|
57
|
-
|
|
58
|
-
task "clobber" => ["spec:clobber_rcov"]
|
data/tasks/rubyforge.rake
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
namespace :gem do
|
|
2
|
-
desc 'Package and upload to RubyForge'
|
|
3
|
-
task :release => ["gem:package", "gem:gemspec"] do |t|
|
|
4
|
-
require 'rubyforge'
|
|
5
|
-
|
|
6
|
-
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
|
7
|
-
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PKG_VERSION
|
|
8
|
-
pkg = "pkg/#{GEM_SPEC.full_name}"
|
|
9
|
-
|
|
10
|
-
rf = RubyForge.new
|
|
11
|
-
rf.configure
|
|
12
|
-
puts 'Logging in...'
|
|
13
|
-
rf.login
|
|
14
|
-
|
|
15
|
-
c = rf.userconfig
|
|
16
|
-
changelog = File.open("CHANGELOG.md") { |file| file.read }
|
|
17
|
-
c['release_changes'] = changelog
|
|
18
|
-
c['preformatted'] = true
|
|
19
|
-
|
|
20
|
-
files = ["#{pkg}.tgz", "#{pkg}.zip", "#{pkg}.gem"]
|
|
21
|
-
|
|
22
|
-
puts "Releasing #{PKG_NAME} v. #{PKG_VERSION}"
|
|
23
|
-
rf.add_release RUBY_FORGE_PROJECT, PKG_NAME, PKG_VERSION, *files
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
namespace :doc do
|
|
28
|
-
desc "Publish RDoc to RubyForge"
|
|
29
|
-
task :release => ["doc"] do
|
|
30
|
-
require "rake/contrib/sshpublisher"
|
|
31
|
-
require "yaml"
|
|
32
|
-
|
|
33
|
-
config = YAML.load(
|
|
34
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
35
|
-
)
|
|
36
|
-
host = "#{config['username']}@rubyforge.org"
|
|
37
|
-
remote_dir = RUBY_FORGE_PATH + "/api"
|
|
38
|
-
local_dir = "doc"
|
|
39
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
40
|
-
end
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
namespace :spec do
|
|
44
|
-
desc "Publish specdoc to RubyForge"
|
|
45
|
-
task :release => ["spec:specdoc"] do
|
|
46
|
-
require "rake/contrib/sshpublisher"
|
|
47
|
-
require "yaml"
|
|
48
|
-
|
|
49
|
-
config = YAML.load(
|
|
50
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
51
|
-
)
|
|
52
|
-
host = "#{config['username']}@rubyforge.org"
|
|
53
|
-
remote_dir = RUBY_FORGE_PATH + "/specdoc"
|
|
54
|
-
local_dir = "specdoc"
|
|
55
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
namespace :rcov do
|
|
59
|
-
desc "Publish coverage report to RubyForge"
|
|
60
|
-
task :release => ["spec:rcov"] do
|
|
61
|
-
require "rake/contrib/sshpublisher"
|
|
62
|
-
require "yaml"
|
|
63
|
-
|
|
64
|
-
config = YAML.load(
|
|
65
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
66
|
-
)
|
|
67
|
-
host = "#{config['username']}@rubyforge.org"
|
|
68
|
-
remote_dir = RUBY_FORGE_PATH + "/coverage"
|
|
69
|
-
local_dir = "coverage"
|
|
70
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
namespace :website do
|
|
76
|
-
desc "Publish website to RubyForge"
|
|
77
|
-
task :release => ["doc:release", "spec:release", "spec:rcov:release"] do
|
|
78
|
-
require "rake/contrib/sshpublisher"
|
|
79
|
-
require "yaml"
|
|
80
|
-
|
|
81
|
-
config = YAML.load(
|
|
82
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
83
|
-
)
|
|
84
|
-
host = "#{config['username']}@rubyforge.org"
|
|
85
|
-
remote_dir = RUBY_FORGE_PATH
|
|
86
|
-
local_dir = "website"
|
|
87
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
88
|
-
end
|
|
89
|
-
end
|
data/tasks/yard.rake
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require "rake"
|
|
2
|
-
|
|
3
|
-
begin
|
|
4
|
-
require "yard"
|
|
5
|
-
require "yard/rake/yardoc_task"
|
|
6
|
-
|
|
7
|
-
namespace :doc do
|
|
8
|
-
desc "Generate Yardoc documentation"
|
|
9
|
-
YARD::Rake::YardocTask.new do |yardoc|
|
|
10
|
-
yardoc.name = "yard"
|
|
11
|
-
yardoc.options = ["--verbose", "--markup", "markdown"]
|
|
12
|
-
yardoc.files = FileList[
|
|
13
|
-
"lib/**/*.rb", "ext/**/*.c",
|
|
14
|
-
"README.md", "CHANGELOG.md", "LICENSE.txt"
|
|
15
|
-
].exclude(/idna/)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
task "clobber" => ["doc:clobber_yard"]
|
|
20
|
-
|
|
21
|
-
desc "Alias to doc:yard"
|
|
22
|
-
task "doc" => "doc:yard"
|
|
23
|
-
rescue LoadError
|
|
24
|
-
# If yard isn't available, it's not the end of the world
|
|
25
|
-
desc "Alias to doc:rdoc"
|
|
26
|
-
task "doc" => "doc:rdoc"
|
|
27
|
-
end
|
data/website/index.html
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8"/>
|
|
5
|
-
<title>Addressable</title>
|
|
6
|
-
<style type="text/css">
|
|
7
|
-
* {
|
|
8
|
-
font-size: 100%;
|
|
9
|
-
margin: 0;
|
|
10
|
-
padding: 0;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
body {
|
|
14
|
-
font-family: lucida grande, verdana, sans-serif;
|
|
15
|
-
margin: 1em;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
a {
|
|
19
|
-
color: #880000;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
a:visited {
|
|
23
|
-
color: #333333;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
h1 {
|
|
27
|
-
font-size: 2em;
|
|
28
|
-
margin: 0 0 0.8em 0;
|
|
29
|
-
text-align: center;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
h2 {
|
|
33
|
-
font-size: 1em;
|
|
34
|
-
margin: 0.8em 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
p {
|
|
38
|
-
margin: 0.8em 0;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
ul {
|
|
42
|
-
font-size: 0.9em;
|
|
43
|
-
margin: 0 0 0 1.5em;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
div {
|
|
47
|
-
width: 50%;
|
|
48
|
-
margin: 0 auto;
|
|
49
|
-
padding: 0.8em;
|
|
50
|
-
background-color: #AA5852;
|
|
51
|
-
border: 2px solid #C2645D;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@media print {
|
|
55
|
-
body {
|
|
56
|
-
font-size: 0.9em;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
a {
|
|
60
|
-
text-decoration: none;
|
|
61
|
-
color: #000;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
</style>
|
|
65
|
-
</head>
|
|
66
|
-
<body>
|
|
67
|
-
<h1>Addressable</h1>
|
|
68
|
-
<div>
|
|
69
|
-
<p>
|
|
70
|
-
Addressable is a replacement for the URI implementation that is part
|
|
71
|
-
of Ruby's standard library. It more closely conforms to the relevant
|
|
72
|
-
RFCs and adds support for IRIs and URI templates.
|
|
73
|
-
</p>
|
|
74
|
-
<ul>
|
|
75
|
-
<li>
|
|
76
|
-
<a href="http://rubyforge.org/projects/addressable/">
|
|
77
|
-
Project Page
|
|
78
|
-
</a>
|
|
79
|
-
</li>
|
|
80
|
-
<li>
|
|
81
|
-
<a href="http://github.com/sporkmonger/addressable/tree/">
|
|
82
|
-
GitHub Page
|
|
83
|
-
</a>
|
|
84
|
-
</li>
|
|
85
|
-
<li><a href="/api/">API</a></li>
|
|
86
|
-
<li><a href="/specdoc/">Specifications</a></li>
|
|
87
|
-
<li><a href="/coverage/">Code Coverage</a></li>
|
|
88
|
-
</ul>
|
|
89
|
-
<p>
|
|
90
|
-
You know what to do:
|
|
91
|
-
</p>
|
|
92
|
-
<p>
|
|
93
|
-
<code>sudo gem install addressable</code>
|
|
94
|
-
</p>
|
|
95
|
-
<p>
|
|
96
|
-
Alternatively, you can:
|
|
97
|
-
</p>
|
|
98
|
-
<p>
|
|
99
|
-
<code>
|
|
100
|
-
git submodule add
|
|
101
|
-
git://github.com/sporkmonger/addressable.git
|
|
102
|
-
vendor/gems/addressable
|
|
103
|
-
</code>
|
|
104
|
-
</p>
|
|
105
|
-
<p>
|
|
106
|
-
Addressable works in Ruby 1.8.x, 1.9.x, and JRuby.
|
|
107
|
-
</p>
|
|
108
|
-
</div>
|
|
109
|
-
</body>
|
|
110
|
-
</html>
|