url_escape 2009.06.24-java
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +9 -0
- data/CHANGELOG +226 -0
- data/MANIFEST +27 -0
- data/README +8 -0
- data/RELEASE +62 -0
- data/Rakefile +100 -0
- data/ext/escape.c +187 -0
- data/ext/extconf.rb +3 -0
- data/lib/url_escape.rb +17 -0
- data/spec/bench.rb +47 -0
- data/spec/big_bench.rb +76 -0
- data/spec/helper.rb +21 -0
- data/spec/url_escape.rb +108 -0
- data/tasks/authors.rake +34 -0
- data/tasks/bacon.rake +77 -0
- data/tasks/build.rake +56 -0
- data/tasks/changelog.rake +18 -0
- data/tasks/clean.rake +8 -0
- data/tasks/copyright.rake +41 -0
- data/tasks/gem.rake +23 -0
- data/tasks/gem_installer.rake +99 -0
- data/tasks/manifest.rake +4 -0
- data/tasks/release.rake +52 -0
- data/tasks/reversion.rake +8 -0
- data/tasks/ride.rake +6 -0
- data/tasks/rspec.rake +21 -0
- data/tasks/setup.rake +18 -0
- metadata +85 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
desc 'update changelog'
|
2
|
+
task :changelog do
|
3
|
+
File.open('CHANGELOG', 'w+') do |changelog|
|
4
|
+
`git log -z --abbrev-commit`.split("\0").each do |commit|
|
5
|
+
next if commit =~ /^Merge: \d*/
|
6
|
+
ref, author, time, _, title, _, message = commit.split("\n", 7)
|
7
|
+
ref = ref[/commit ([0-9a-f]+)/, 1]
|
8
|
+
author = author[/Author: (.*)/, 1].strip
|
9
|
+
time = Time.parse(time[/Date: (.*)/, 1]).utc
|
10
|
+
title.strip!
|
11
|
+
|
12
|
+
changelog.puts "[#{ref} | #{time}] #{author}"
|
13
|
+
changelog.puts '', " * #{title}"
|
14
|
+
changelog.puts '', message.rstrip if message
|
15
|
+
changelog.puts
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/tasks/clean.rake
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
desc "Clean compiled remnants"
|
2
|
+
task :clean do
|
3
|
+
make = RUBY_PLATFORM.match(/mswin/) ? "nmake" : "make"
|
4
|
+
Dir.chdir("ext") do
|
5
|
+
sh "#{make} distclean" rescue nil
|
6
|
+
%w{url_escape.bundle url_escape.so.manifest Makefile escape.o rl_escape.so}.each { |file| File.unlink(file) if File.file?(file) }
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Copyright (c) 2008-2009 The Rubyists, LLC (effortless systems) <rubyists@rubyists.com>
|
2
|
+
# Distributed under the terms of the MIT license.
|
3
|
+
# See the LICENSE file that accompanied this software for the full MIT License text
|
4
|
+
#
|
5
|
+
require "pathname"
|
6
|
+
task :legal do
|
7
|
+
license = Pathname("LICENSE")
|
8
|
+
license.open("w+") do |f|
|
9
|
+
f.puts PROJECT_COPYRIGHT
|
10
|
+
end unless license.file? and license.read == PROJECT_COPYRIGHT
|
11
|
+
doc = Pathname("doc/LEGAL")
|
12
|
+
doc.open("w+") do |f|
|
13
|
+
f.puts "LICENSE"
|
14
|
+
end unless doc.file?
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "add copyright summary to all .rb files in the distribution"
|
18
|
+
task :copyright => [:legal] do
|
19
|
+
doc = Pathname("doc/LEGAL")
|
20
|
+
ignore = doc.readlines.
|
21
|
+
select { |line| line.strip!; Pathname(line).file? }.
|
22
|
+
map { |file| Pathname(file).expand_path }
|
23
|
+
|
24
|
+
puts "adding copyright summary to files that don't have it currently"
|
25
|
+
puts PROJECT_COPYRIGHT_SUMMARY
|
26
|
+
puts
|
27
|
+
|
28
|
+
(Pathname.glob('{controller,model,app,lib,test,spec}/**/*{.rb}') +
|
29
|
+
Pathname.glob("Rakefile")).each do |file|
|
30
|
+
next if ignore.include? file.expand_path
|
31
|
+
lines = file.readlines.map{ |l| l.chomp }
|
32
|
+
if lines.first.match(/^# \* \w.*/)
|
33
|
+
@f = lines.shift
|
34
|
+
end
|
35
|
+
unless lines.first(PROJECT_COPYRIGHT_SUMMARY.size) == PROJECT_COPYRIGHT_SUMMARY
|
36
|
+
oldlines = file.readlines
|
37
|
+
oldlines.shift if @f
|
38
|
+
file.open("w+") { |f| f.puts @f if @f;f.puts PROJECT_COPYRIGHT_SUMMARY + oldlines }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/tasks/gem.rake
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rake/gempackagetask'
|
2
|
+
|
3
|
+
desc "make a gemspec"
|
4
|
+
task :gemspec => [:manifest, :changelog, :authors] do
|
5
|
+
gemspec_file = "#{GEMSPEC.name}.gemspec"
|
6
|
+
File.open(gemspec_file, 'w+'){|gs| gs.puts(GEMSPEC.to_ruby) }
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "package and install from gemspec"
|
10
|
+
task :install => [:gemspec] do
|
11
|
+
sh "gem build #{GEMSPEC.name}.gemspec"
|
12
|
+
sh "gem install #{GEMSPEC.name}-#{GEMSPEC.version}.gem"
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "uninstall the gem"
|
16
|
+
task :uninstall => [:clean] do
|
17
|
+
sh %{gem uninstall -x #{GEMSPEC.name}}
|
18
|
+
end
|
19
|
+
|
20
|
+
Rake::GemPackageTask.new(GEMSPEC) do |p|
|
21
|
+
p.need_tar = true
|
22
|
+
p.need_zip = true
|
23
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# Copyright (c) 2008-2009 The Rubyists, LLC (effortless systems) <rubyists@rubyists.com>
|
2
|
+
# Distributed under the terms of the MIT license.
|
3
|
+
# See the LICENSE file which accompanies this software for the full text
|
4
|
+
#
|
5
|
+
task :gem_installer do
|
6
|
+
class GemInstaller
|
7
|
+
def initialize(options = {}, &block)
|
8
|
+
@gems = []
|
9
|
+
@options = options
|
10
|
+
|
11
|
+
run(&block)
|
12
|
+
end
|
13
|
+
|
14
|
+
def run(&block)
|
15
|
+
instance_eval(&block) if block_given?
|
16
|
+
end
|
17
|
+
|
18
|
+
def gem(name, version = nil, options = {})
|
19
|
+
if version.respond_to?(:merge!)
|
20
|
+
options = version
|
21
|
+
else
|
22
|
+
options[:version] = version
|
23
|
+
end
|
24
|
+
unless rubylib?(options[:lib] || name)
|
25
|
+
@gems << [name, options]
|
26
|
+
end
|
27
|
+
@gems
|
28
|
+
end
|
29
|
+
|
30
|
+
def rubylib?(libname)
|
31
|
+
libdirs = ENV["RUBYLIB"].to_s.split(":")
|
32
|
+
return false if libdirs.size == 0
|
33
|
+
libdirs.each { |dir|
|
34
|
+
libdir = Pathname(dir)
|
35
|
+
if libdir.directory?
|
36
|
+
begin
|
37
|
+
require libdir.join(libname)
|
38
|
+
rescue LoadError
|
39
|
+
return false
|
40
|
+
end
|
41
|
+
end
|
42
|
+
}
|
43
|
+
puts "Loaded #{libname} from RUBYLIB"
|
44
|
+
true
|
45
|
+
end
|
46
|
+
|
47
|
+
def setup_gemspec(gemspec)
|
48
|
+
gemspec.dependencies.each do |dependency|
|
49
|
+
dependency.version_requirements.as_list.each do |version|
|
50
|
+
gem(dependency.name, version)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
setup
|
55
|
+
end
|
56
|
+
|
57
|
+
def setup
|
58
|
+
require 'rubygems'
|
59
|
+
require 'rubygems/dependency_installer'
|
60
|
+
|
61
|
+
@gems.each do |name, options|
|
62
|
+
setup_gem(name, options)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def setup_gem(name, options, try_install = true)
|
67
|
+
print "activating #{name} ... "
|
68
|
+
Gem.activate(name, *[options[:version]].compact)
|
69
|
+
require(options[:lib] || name)
|
70
|
+
puts "success."
|
71
|
+
rescue LoadError => error
|
72
|
+
puts error
|
73
|
+
install_gem(name, options) if try_install
|
74
|
+
setup_gem(name, options, try_install = false)
|
75
|
+
end
|
76
|
+
|
77
|
+
def install_gem(name, options)
|
78
|
+
installer = Gem::DependencyInstaller.new(options)
|
79
|
+
|
80
|
+
temp_argv(options[:extconf]) do
|
81
|
+
print "Installing #{name} ... "
|
82
|
+
installer.install(name, options[:version])
|
83
|
+
puts "done."
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def temp_argv(extconf)
|
88
|
+
if extconf ||= @options[:extconf]
|
89
|
+
old_argv = ARGV.clone
|
90
|
+
ARGV.replace(extconf.split(' '))
|
91
|
+
end
|
92
|
+
|
93
|
+
yield
|
94
|
+
|
95
|
+
ensure
|
96
|
+
ARGV.replace(old_argv) if extconf
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
data/tasks/manifest.rake
ADDED
data/tasks/release.rake
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
namespace :release do
|
2
|
+
task :all => [:release_github, :release_rubyforge]
|
3
|
+
|
4
|
+
desc 'Display instructions to release on github'
|
5
|
+
task :github => [:reversion, :gemspec] do
|
6
|
+
name, version = GEMSPEC.name, GEMSPEC.version
|
7
|
+
|
8
|
+
puts <<INSTRUCTIONS
|
9
|
+
First add the relevant files:
|
10
|
+
|
11
|
+
git add AUTHORS MANIFEST CHANGELOG #{name}.gemspec lib/#{name}/version.rb
|
12
|
+
|
13
|
+
Then commit them, tag the commit, and push:
|
14
|
+
|
15
|
+
git commit -m 'Version #{version}'
|
16
|
+
git tag -a -m '#{version}' '#{version}'
|
17
|
+
git push
|
18
|
+
|
19
|
+
INSTRUCTIONS
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
# TODO: Not tested
|
24
|
+
desc 'Display instructions to release on rubyforge'
|
25
|
+
task :rubyforge => [:reversion, :gemspec, :package] do
|
26
|
+
rf_project, name, version = GEMSPEC.rubyforge_project, GEMSPEC.name, GEMSPEC.version.to_s
|
27
|
+
|
28
|
+
puts <<INSTRUCTIONS
|
29
|
+
To publish to rubyforge do following:
|
30
|
+
|
31
|
+
rubyforge login
|
32
|
+
rubyforge #{/java/i === RUBY_PLATFORM ? "add_file" : "add_release"} #{rf_project} #{name} #{version.dump} pkg/#{name}-#{version}#{/java/i === RUBY_PLATFORM ? "-java" : ""}.gem
|
33
|
+
|
34
|
+
After you have done these steps, see:
|
35
|
+
|
36
|
+
VERSION=#{version.dump} rake release:rubyforge_archives
|
37
|
+
|
38
|
+
INSTRUCTIONS
|
39
|
+
end
|
40
|
+
|
41
|
+
desc 'Display instructions to add archives after release:rubyforge'
|
42
|
+
task :rubyforge_archives do
|
43
|
+
rf_project, name, version = GEMSPEC.rubyforge_project, GEMSPEC.name, GEMSPEC.version.to_s
|
44
|
+
puts "Adding archives for distro packagers is:", ""
|
45
|
+
|
46
|
+
Dir["pkg/#{name}-#{version}.{tgz,zip}"].each do |file|
|
47
|
+
puts "rubyforge add_file %s %s %p %p" % [rf_project, name, version, file]
|
48
|
+
end
|
49
|
+
|
50
|
+
puts
|
51
|
+
end
|
52
|
+
end
|
data/tasks/ride.rake
ADDED
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
data/tasks/setup.rake
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Copyright (c) 2008-2009 The Rubyists, LLC (effortless systems) <rubyists@rubyists.com>
|
2
|
+
# Distributed under the terms of the MIT license.
|
3
|
+
# See the LICENSE file which accompanies this software for the full text
|
4
|
+
#
|
5
|
+
desc 'install all possible dependencies'
|
6
|
+
task :setup => :gem_installer do
|
7
|
+
GemInstaller.new do
|
8
|
+
# core
|
9
|
+
gem "rack"
|
10
|
+
|
11
|
+
# spec
|
12
|
+
gem "bacon"
|
13
|
+
|
14
|
+
# doc
|
15
|
+
|
16
|
+
setup
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
3
|
+
requirements:
|
4
|
+
- - '>='
|
5
|
+
- !ruby/object:Gem::Version
|
6
|
+
version: "0"
|
7
|
+
version:
|
8
|
+
email: manveru@rubyists.com
|
9
|
+
cert_chain: []
|
10
|
+
|
11
|
+
summary: Fast url_escape library written in C
|
12
|
+
post_install_message:
|
13
|
+
extra_rdoc_files: []
|
14
|
+
|
15
|
+
homepage: http://github.com/bougyman/seedling
|
16
|
+
signing_key:
|
17
|
+
name: url_escape
|
18
|
+
rdoc_options: []
|
19
|
+
|
20
|
+
rubyforge_project: url-escape
|
21
|
+
autorequire:
|
22
|
+
licenses: []
|
23
|
+
|
24
|
+
executables: []
|
25
|
+
|
26
|
+
description: Fast replacement for CGI.escape and Rack::Utils.escape
|
27
|
+
specification_version: 3
|
28
|
+
default_executable:
|
29
|
+
files:
|
30
|
+
- RELEASE
|
31
|
+
- AUTHORS
|
32
|
+
- CHANGELOG
|
33
|
+
- MANIFEST
|
34
|
+
- README
|
35
|
+
- Rakefile
|
36
|
+
- ext/escape.c
|
37
|
+
- ext/extconf.rb
|
38
|
+
- spec/big_bench.rb
|
39
|
+
- spec/helper.rb
|
40
|
+
- spec/bench.rb
|
41
|
+
- spec/url_escape.rb
|
42
|
+
- tasks/authors.rake
|
43
|
+
- tasks/gem.rake
|
44
|
+
- tasks/gem_installer.rake
|
45
|
+
- tasks/ride.rake
|
46
|
+
- tasks/manifest.rake
|
47
|
+
- tasks/rspec.rake
|
48
|
+
- tasks/setup.rake
|
49
|
+
- tasks/bacon.rake
|
50
|
+
- tasks/build.rake
|
51
|
+
- tasks/copyright.rake
|
52
|
+
- tasks/changelog.rake
|
53
|
+
- tasks/release.rake
|
54
|
+
- tasks/reversion.rake
|
55
|
+
- tasks/clean.rake
|
56
|
+
- lib/url_escape.rb
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: "0"
|
62
|
+
version:
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
rubygems_version: 1.3.3
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
authors:
|
69
|
+
- Evan Phoenix
|
70
|
+
- TJ Vanderpoel
|
71
|
+
- Michael Fellinger
|
72
|
+
- Trey Dempsey
|
73
|
+
- Jayson Vaughn
|
74
|
+
date: 2009-06-24 05:00:00 +00:00
|
75
|
+
platform: java
|
76
|
+
test_files: []
|
77
|
+
|
78
|
+
version: !ruby/object:Gem::Version
|
79
|
+
version: 2009.06.24
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
dependencies: []
|
83
|
+
|
84
|
+
bindir: bin
|
85
|
+
has_rdoc: true
|