Skip to content

Commit 2faf22a

Browse files
author
austin
committed
Added the framework for release. I haven't actually verified this yet for Net::LDAP, but I used the same framework for the recent release of MIME::Types. Some pieces of the code may need to be moved around to better handle the testing framework in the Rakefile and the pre-setup.rb file. To make this work, you will need the meta_project, gmailer, and archive-tar-minitar gems.
1 parent 65102e4 commit 2faf22a

File tree

11 files changed

+2064
-317
lines changed

11 files changed

+2064
-317
lines changed

COPYING

Lines changed: 272 additions & 281 deletions
Large diffs are not rendered by default.

ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
= Net::LDAP Changelong
2+
3+
== Net::LDAP 0.0.1: April 30, 2006
4+
5+
#--
6+
# Net::LDAP for Ruby.
7+
# http://rubyforge.org/projects/net-ldap/
8+
# Copyright 2006 Francis Cianfrocca
9+
#
10+
# Available under the same terms as Ruby. See LICENCE in the main
11+
# distribution for full licensing information.
12+
#
13+
# $Id: ChangeLog,v 1.17.2.4 2005/09/09 12:36:42 austin Exp $
14+
#++
15+
# vim: sts=2 sw=2 ts=4 et ai tw=77

Install

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Net::LDAP is a pure Ruby LDAP client. It does not as yet require any external
2+
libraries. It can be installed with:
3+
4+
% ruby setup.rb
5+
6+
Alternatively, you can use the RubyGems version of Net::LDAP availalble as
7+
ruby-net-ldap-0.0.1.gem from the usual sources.
8+
9+
Net::LDAP:: http://rubyforge.org/projects/net-ldap/
10+
11+
#--
12+
# Net::LDAP for Ruby.
13+
# http://rubyforge.org/projects/net-ldap/
14+
# Copyright 2006 Francis Cianfrocca
15+
#
16+
# Available under the same terms as Ruby. See LICENCE in the main
17+
# distribution for full licensing information.
18+
#
19+
# $Id: ChangeLog,v 1.17.2.4 2005/09/09 12:36:42 austin Exp $
20+
#++
21+
# vim: sts=2 sw=2 ts=4 et ai tw=77

LICENCE

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
Net::LDAP is copyrighted free software by Francis Gianfrocca
2+
<garbagecat@gmail.com>. You can redistribute it and/or modify it under either
3+
the terms of the GPL (see the file COPYING), or the conditions below:
4+
5+
1. You may make and give away verbatim copies of the source form of the
6+
software without restriction, provided that you duplicate all of the
7+
original copyright notices and associated disclaimers.
8+
9+
2. You may modify your copy of the software in any way, provided that you do
10+
at least ONE of the following:
11+
12+
a) place your modifications in the Public Domain or otherwise make them
13+
Freely Available, such as by posting said modifications to Usenet or
14+
an equivalent medium, or by allowing the author to include your
15+
modifications in the software.
16+
17+
b) use the modified software only within your corporation or
18+
organization.
19+
20+
c) rename any non-standard executables so the names do not conflict with
21+
standard executables, which must also be provided.
22+
23+
d) make other distribution arrangements with the author.
24+
25+
3. You may distribute the software in object code or executable form,
26+
provided that you do at least ONE of the following:
27+
28+
a) distribute the executables and library files of the software, together
29+
with instructions (in the manual page or equivalent) on where to get
30+
the original distribution.
31+
32+
b) accompany the distribution with the machine-readable source of the
33+
software.
34+
35+
c) give non-standard executables non-standard names, with instructions on
36+
where to get the original software distribution.
37+
38+
d) make other distribution arrangements with the author.
39+
40+
4. You may modify and include the part of the software into any other
41+
software (possibly commercial). But some files in the distribution are
42+
not written by the author, so that they are not under this terms.
43+
44+
They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
45+
files under the ./missing directory. See each file for the copying
46+
condition.
47+
48+
5. The scripts and library files supplied as input to or produced as output
49+
from the software do not automatically fall under the copyright of the
50+
software, but belong to whomever generated them, and may be sold
51+
commercially, and may be aggregated with this software.
52+
53+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
54+
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
55+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

README

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
# $Id$
2-
#
3-
#
1+
= Net::LDAP for Ruby
2+
Net::LDAP is an LDAP support library written in pure Ruby. It supports all
3+
LDAP client features, and a subset of server features as well.
44

5-
Net::LDAP is an LDAP support library written in pure Ruby.
6-
It supports all LDAP client features, and a subset of server features as well.
5+
Homepage:: http://rubyforge.org/projects/net-ldap/
6+
Copyright:: 2006, Francis Cianfrocca
77

8-
NOTE: Net::LDAP is currently released under GPL but we expect that it will
9-
be changed to the Ruby license before being released in a "stable" version.
8+
== LICENCE NOTES
9+
Please read the file LICENCE for licensing restrictions on this library. In
10+
it simplest terms, this library is available under the same terms as Ruby
11+
itself.
1012

13+
== Requirements
14+
PDF::Writer requires Ruby 1.8.2 or better.
1115

16+
#--
17+
# Net::LDAP for Ruby.
18+
# http://rubyforge.org/projects/net-ldap/
19+
# Copyright 2006 Francis Cianfrocca
20+
#
21+
# Available under the same terms as Ruby. See LICENCE in the main
22+
# distribution for full licensing information.
23+
#
24+
# $Id$
25+
#++
26+
# vim: sts=2 sw=2 ts=4 et ai tw=77

RELEASE_NOTES

Lines changed: 0 additions & 6 deletions
This file was deleted.

Rakefile

Lines changed: 221 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,230 @@
1-
# $Id$
2-
# Rakefile for the netldap ruby gem.
1+
#! /usr/bin/env rake
2+
#--
3+
# Net::LDAP for Ruby.
4+
# http://rubyforge.org/projects/net-ldap/
5+
# Copyright 2006 Francis Cianfrocca
36
#
7+
# Available under the same terms as Ruby. See LICENCE in the main
8+
# distribution for full licensing information.
9+
#
10+
# $Id$
11+
#++
412

5-
6-
require 'rubygems'
7-
Gem::manage_gems
13+
require 'meta_project'
814
require 'rake/gempackagetask'
15+
require 'rake/contrib/xforge'
16+
require 'rake/clean'
17+
18+
$can_gmail = false
19+
begin
20+
require 'gmailer'
21+
$can_gmail = true
22+
rescue LoadError
23+
end
24+
25+
$can_minitar = false
26+
begin
27+
require 'archive/tar/minitar'
28+
require 'zlib'
29+
$can_minitar = true
30+
rescue LoadError
31+
end
32+
33+
$LOAD_PATH.unshift "lib"
34+
require 'net/ldap'
35+
36+
$version = Net::LDAP::VERSION
37+
$name = Net::LDAP.to_s
38+
$project = MetaProject::Project::XForge::RubyForge.new('net-ldap')
39+
$distdir = "ruby-net-ldap-#$version"
40+
$tardist = "../#$distdir.tar.gz"
41+
42+
$release_date = nil
43+
$release_date = Time.parse(ENV['RELEASE_DATE']) if ENV['RELEASE_DATE']
44+
45+
desc "Run the tests for #$name."
46+
task :test do |t|
47+
require 'test/unit/testsuite'
48+
require 'test/unit/ui/console/testrunner'
49+
50+
runner = Test::Unit::UI::Console::TestRunner
51+
52+
$LOAD_PATH.unshift('tests')
53+
$stderr.puts "Checking for test cases:" if t.verbose
54+
Dir['tests/tc_*.rb'].each do |testcase|
55+
$stderr.puts "\t#{testcase}" if t.verbose
56+
load testcase
57+
end
58+
59+
suite = Test::Unit::TestSuite.new($name)
60+
61+
ObjectSpace.each_object(Class) do |testcase|
62+
suite << testcase.suite if testcase < Test::Unit::TestCase
63+
end
64+
65+
runner.run(suite)
66+
end
67+
68+
spec = eval(File.read("net-ldap.gemspec"))
69+
spec.version = $version
70+
desc "Build the RubyGem for #$name."
71+
task :gem => [ :test ]
72+
Rake::GemPackageTask.new(spec) do |g|
73+
if $can_minitar
74+
g.need_tar = false
75+
g.need_zip = false
76+
end
77+
g.package_dir = ".."
78+
end
79+
80+
if $can_minitar
81+
desc "Build a #$name .tar.gz distribution."
82+
task :tar => [ $tardist ]
83+
file $tardist => [ :test ] do |t|
84+
current = File.basename(Dir.pwd)
85+
Dir.chdir("..") do
86+
begin
87+
files = %W(bin/**/* lib/**/* tests/**/* ChangeLog README LICENCE
88+
COPYING Rakefile net-ldap.gemspec setup.rb pre-setup.rb)
89+
files = FileList[files.map { |file| File.join(current, file) }].to_a
90+
files.map! do |dd|
91+
ddnew = dd.gsub(/^#{current}/, $distdir)
92+
mtime = $release_date || File.stat(dd).mtime
93+
if File.directory?(dd)
94+
{ :name => ddnew, :mode => 0755, :dir => true, :mtime => mtime }
95+
else
96+
if dd =~ %r{bin/}
97+
mode = 0755
98+
else
99+
mode = 0644
100+
end
101+
data = File.open(dd, "rb") { |ff| ff.read }
102+
{ :name => ddnew, :mode => mode, :data => data, :size =>
103+
data.size, :mtime => mtime }
104+
end
105+
end
106+
107+
ff = File.open(t.name.gsub(%r{^\.\./}o, ''), "wb")
108+
gz = Zlib::GzipWriter.new(ff)
109+
tw = Archive::Tar::Minitar::Writer.new(gz)
110+
111+
files.each do |entry|
112+
if entry[:dir]
113+
tw.mkdir(entry[:name], entry)
114+
else
115+
tw.add_file_simple(entry[:name], entry) { |os| os.write(entry[:data]) }
116+
end
117+
end
118+
ensure
119+
tw.close if tw
120+
gz.finish if gz
121+
ff.close
122+
end
123+
end
124+
end
125+
task $tardist => [ :test ]
126+
end
127+
128+
desc "Build the RDoc documentation for #$name."
129+
task :docs do
130+
require 'rdoc/rdoc'
131+
rdoc_options = %W(--title #$name --main README --line-numbers)
132+
files = FileList[*%w(README LICENCE ChangeLog COPYING LICENCE bin/**/*.rb lib/**/*.rb)]
133+
rdoc_options += files.to_a
134+
RDoc::RDoc.new.document(rdoc_options)
135+
end
136+
137+
task :verify_rubyforge do
138+
raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
139+
raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
140+
end
141+
142+
if $can_gmail
143+
task :verify_gmail do
144+
raise "GMAIL_USER environment variable not set!" unless ENV['GMAIL_USER']
145+
raise "GMAIL_PASSWORD environment variable not set!" unless ENV['GMAIL_PASSWORD']
146+
end
147+
148+
desc "Post a release announcement via GMail."
149+
task :email_announcement => [ :verify_gmail ] do
150+
GMailer.connect(ENV["GMAIL_USER"], ENV["GMAIL_PASSWORD"]) do |gmail|
151+
msg = {
152+
:to => "ruby-talk@ruby-lang.org, #{ENV['GMAIL_USER']}@gmail.com",
153+
:subject => "[ANN] #$name #$version",
154+
:body => File.read("Release-Announcement"),
155+
}
156+
gmail.send msg
157+
end
158+
end
159+
end
160+
161+
desc "Release files on RubyForge."
162+
task :release_files => [ :verify_rubyforge, :gem ] do
163+
release_files = FileList[$tardist, "../#$distdir.gem"]
164+
Rake::XForge::Release.new($project) do |release|
165+
release.user_name = ENV['RUBYFORGE_USER']
166+
release.password = ENV['RUBYFORGE_PASSWORD']
167+
release.files = release_files.to_a
168+
release.release_name = "#$name #$version"
169+
release.package_name = "mime-types"
170+
171+
notes = []
172+
File.open("README") do |file|
173+
file.each do |line|
174+
line.chomp!
175+
line.gsub!(/^#.*$/, '') and next
176+
notes << line
177+
end
178+
end
179+
release.release_notes = notes.join("\n")
180+
181+
changes = []
182+
File.open("ChangeLog") do |file|
183+
current = true
184+
185+
file.each do |line|
186+
line.chomp!
187+
current = false if current and line =~ /^==/
188+
break if line.empty? and not current
189+
changes << line
190+
end
191+
end
192+
release.release_changes = changes.join("\n")
193+
end
194+
end
9195

10-
em_version = "0.0.1"
196+
desc "Publish news on RubyForge"
197+
task :publish_news => [ :verify_rubyforge, :gem ] do
198+
Rake::XForge::NewsPublisher.new($project) do |news|
199+
news.user_name = ENV['RUBYFORGE_USER']
200+
news.password = ENV['RUBYFORGE_PASSWORD']
201+
news.subject = "#$name #$version Released"
202+
news.changes_file = nil
11203

12-
spec = Gem::Specification.new {|s|
13-
s.name = "netldap"
14-
s.version = em_version
15-
s.author = "Francis Cianfrocca"
16-
s.email = "garbagecat10@gmail.com"
17-
s.homepage = "netldap@rubyforge.org"
18-
s.summary = "Net::LDAP library"
19-
s.files = FileList["{bin,tests,lib}/**/*"].exclude("rdoc").to_a
20-
s.require_paths = ["lib"]
21-
s.test_file = "tests/testem.rb"
22-
s.has_rdoc = true
23-
s.extra_rdoc_files = ["README", "RELEASE_NOTES", "COPYING"]
24-
}
204+
details = []
205+
File.open("Release-Announcement") do |file|
206+
file.each do |line|
207+
line.chomp!
208+
break if line =~ /^=/
209+
details << line
210+
end
211+
end
212+
news.details = details.join("\n")
213+
end
214+
end
25215

26-
Rake::GemPackageTask.new( spec ) {|pkg|
27-
pkg.need_tar = true
28-
}
216+
desc "Release the latest version."
217+
task :release => [ :verify_rubyforge, :release_files, :publish_news, :docs ]
218+
if $can_gmail
219+
task :release => [ :verify_gmail, :email_announcment ]
220+
end
29221

222+
desc "Build everything."
223+
task :default => [ :gem ]
30224

31-
task :default => ["pkg/netldap-#{em_version}.gem"]
225+
if $can_minitar
226+
task :release_files => :tar
227+
task :publish_news => :tar
228+
task :default => :tar
229+
end
32230

0 commit comments

Comments
 (0)