mislav-addressable 2.1.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.
@@ -0,0 +1,2 @@
1
+ desc "Remove all build products"
2
+ task "clobber"
@@ -0,0 +1,68 @@
1
+ require "rake/gempackagetask"
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 )
14
+ s.rdoc_options.concat ["--main", "README"]
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", ">= 1.0.8")
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
+ end
32
+
33
+ Rake::GemPackageTask.new(GEM_SPEC) do |p|
34
+ p.gem_spec = GEM_SPEC
35
+ p.need_tar = true
36
+ p.need_zip = true
37
+ end
38
+
39
+ desc "Show information about the gem"
40
+ task :debug do
41
+ puts GEM_SPEC.to_ruby
42
+ end
43
+
44
+ desc "Install the gem"
45
+ task :install => ["clobber", "gem:package"] do
46
+ sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
47
+ end
48
+
49
+ desc "Uninstall the gem"
50
+ task :uninstall do
51
+ installed_list = Gem.source_index.find_name(PKG_NAME)
52
+ if installed_list &&
53
+ (installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
54
+ sh(
55
+ "#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
56
+ "--ignore-dependencies --executables #{PKG_NAME}"
57
+ )
58
+ end
59
+ end
60
+
61
+ desc "Reinstall the gem"
62
+ task :reinstall => [:uninstall, :install]
63
+ end
64
+
65
+ desc "Alias to gem:package"
66
+ task "gem" => "gem:package"
67
+
68
+ task "clobber" => ["gem:clobber_package"]
@@ -0,0 +1,40 @@
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", "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
+ tag = "#{PKG_NAME}-#{PKG_VERSION}"
23
+ msg = "Release #{PKG_NAME}-#{PKG_VERSION}"
24
+
25
+ existing_tags = `git tag -l instrument-*`.split("\n")
26
+ if existing_tags.include?(tag)
27
+ warn("Tag already exists, deleting...")
28
+ unless system "git tag -d #{tag}"
29
+ abort "Tag deletion failed."
30
+ end
31
+ end
32
+ puts "Creating git tag '#{tag}'..."
33
+ unless system "git tag -a -m \"#{msg}\" #{tag}"
34
+ abort "Tag creation failed."
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ task "gem:release" => "git:tag:create"
@@ -0,0 +1,22 @@
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
@@ -0,0 +1,29 @@
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", "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
+ desc "Alias to doc:rdoc"
27
+ task "doc" => "doc:rdoc"
28
+
29
+ task "clobber" => ["doc:clobber_rdoc", "doc:clobber_ri"]
@@ -0,0 +1,89 @@
1
+ namespace :gem do
2
+ desc 'Package and upload to RubyForge'
3
+ task :release => ["gem:package"] 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") { |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:rdoc"] 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
@@ -0,0 +1,48 @@
1
+ namespace :spec do
2
+ Spec::Rake::SpecTask.new(:rcov) do |t|
3
+ t.spec_files = FileList['spec/**/*_spec.rb']
4
+ t.spec_opts = ['--color', '--format', 'specdoc']
5
+ if RCOV_ENABLED
6
+ t.rcov = true
7
+ else
8
+ t.rcov = false
9
+ end
10
+ t.rcov_opts = [
11
+ '--exclude', 'spec',
12
+ '--exclude', '1\\.8\\/gems',
13
+ '--exclude', '1\\.9\\/gems',
14
+ '--exclude', 'addressable\\/idna\\.rb', # unicode tables too big
15
+ ]
16
+ end
17
+
18
+ Spec::Rake::SpecTask.new(:normal) do |t|
19
+ t.spec_files = FileList['spec/**/*_spec.rb']
20
+ t.spec_opts = ['--color', '--format', 'specdoc']
21
+ t.rcov = false
22
+ end
23
+
24
+ desc "Generate HTML Specdocs for all specs"
25
+ Spec::Rake::SpecTask.new(:specdoc) do |t|
26
+ specdoc_path = File.expand_path(
27
+ File.join(File.dirname(__FILE__), '../specdoc/'))
28
+ Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
29
+
30
+ output_file = File.join(specdoc_path, 'index.html')
31
+ t.spec_files = FileList['spec/**/*_spec.rb']
32
+ t.spec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
33
+ t.fail_on_error = false
34
+ end
35
+
36
+ namespace :rcov do
37
+ desc "Browse the code coverage report."
38
+ task :browse => "spec:rcov" do
39
+ require "launchy"
40
+ Launchy::Browser.run("coverage/index.html")
41
+ end
42
+ end
43
+ end
44
+
45
+ desc "Alias to spec:normal"
46
+ task "spec" => "spec:normal"
47
+
48
+ task "clobber" => ["spec:clobber_rcov"]
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mislav-addressable
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Bob Aman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-09-27 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Addressable is a replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to the relevant RFCs and adds support for IRIs and URI templates.
17
+ email: bob@sporkmonger.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files: []
23
+
24
+ files:
25
+ - Rakefile
26
+ - lib/addressable/idna.rb
27
+ - lib/addressable/template.rb
28
+ - lib/addressable/uri.rb
29
+ - lib/addressable/version.rb
30
+ - tasks/clobber.rake
31
+ - tasks/gem.rake
32
+ - tasks/git.rake
33
+ - tasks/metrics.rake
34
+ - tasks/rdoc.rake
35
+ - tasks/rubyforge.rake
36
+ - tasks/spec.rake
37
+ - spec/addressable/idna_spec.rb
38
+ - spec/addressable/template_spec.rb
39
+ - spec/addressable/uri_spec.rb
40
+ - spec/data/rfc3986.txt
41
+ - README
42
+ - LICENSE
43
+ - CHANGELOG
44
+ has_rdoc: false
45
+ homepage: http://github.com/mislav/addressable
46
+ licenses:
47
+ post_install_message:
48
+ rdoc_options: []
49
+
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ version:
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ requirements: []
65
+
66
+ rubyforge_project:
67
+ rubygems_version: 1.3.5
68
+ signing_key:
69
+ specification_version: 3
70
+ summary: URI Implementation
71
+ test_files: []
72
+