treequel 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.md +2977 -0
- data/README.md +31 -1
- data/Rakefile +41 -359
- data/lib/treequel.rb +3 -3
- data/lib/treequel/branch.rb +7 -0
- data/lib/treequel/model.rb +15 -5
- data/lib/treequel/model/objectclass.rb +3 -3
- data/spec/data/objectClasses.yml +149 -0
- data/spec/data/schema.yml +781 -0
- data/spec/treequel/branch_spec.rb +21 -0
- data/spec/treequel/model/objectclass_spec.rb +10 -1
- metadata +151 -122
- data.tar.gz.sig +0 -0
- data/ChangeLog +0 -963
- data/LICENSE +0 -27
- data/Rakefile.local +0 -65
- data/rake/191_compat.rb +0 -26
- data/rake/dependencies.rb +0 -76
- data/rake/documentation.rb +0 -123
- data/rake/helpers.rb +0 -502
- data/rake/hg.rb +0 -318
- data/rake/manual.rb +0 -787
- data/rake/packaging.rb +0 -129
- data/rake/publishing.rb +0 -341
- data/rake/style.rb +0 -62
- data/rake/svn.rb +0 -668
- data/rake/testing.rb +0 -152
- data/rake/verifytask.rb +0 -64
- metadata.gz.sig +0 -3
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Treequel - an honest LDAP library
|
2
2
|
|
3
|
+
* http://deveiate.org/projects/Treequel
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
3
7
|
Treequel is an LDAP toolkit for Ruby. It is intended to allow quick, easy
|
4
8
|
access to LDAP directories in a manner consistent with LDAP's hierarchical,
|
5
9
|
free-form nature.
|
@@ -43,7 +47,33 @@ You can submit bug reports, suggestions, and read more about future plans at
|
|
43
47
|
|
44
48
|
## License
|
45
49
|
|
46
|
-
|
50
|
+
Copyright (c) 2008-2010, Michael Granger and Mahlon E. Smith
|
51
|
+
All rights reserved.
|
52
|
+
|
53
|
+
Redistribution and use in source and binary forms, with or without
|
54
|
+
modification, are permitted provided that the following conditions are met:
|
55
|
+
|
56
|
+
* Redistributions of source code must retain the above copyright notice,
|
57
|
+
this list of conditions and the following disclaimer.
|
58
|
+
|
59
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
60
|
+
this list of conditions and the following disclaimer in the documentation
|
61
|
+
and/or other materials provided with the distribution.
|
62
|
+
|
63
|
+
* Neither the name of the author/s, nor the names of the project's
|
64
|
+
contributors may be used to endorse or promote products derived from this
|
65
|
+
software without specific prior written permission.
|
66
|
+
|
67
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
68
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
69
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
70
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
71
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
72
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
73
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
74
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
75
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
76
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
47
77
|
|
48
78
|
|
49
79
|
## Authors
|
data/Rakefile
CHANGED
@@ -1,376 +1,58 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# Treequel rakefile
|
4
|
-
#
|
5
|
-
# Based on various other Rakefiles, especially one by Ben Bleything
|
6
|
-
#
|
7
|
-
# Copyright (c) 2007-2010 The FaerieMUD Consortium
|
8
|
-
#
|
9
|
-
# Authors:
|
10
|
-
# * Michael Granger <ged@FaerieMUD.org>
|
11
|
-
#
|
1
|
+
#!/usr/bin/env rake
|
12
2
|
|
13
|
-
|
14
|
-
require 'rbconfig'
|
15
|
-
require 'pathname'
|
16
|
-
basedir = Pathname.new( __FILE__ ).dirname
|
3
|
+
require 'hoe'
|
17
4
|
|
18
|
-
|
19
|
-
|
5
|
+
Hoe.plugin :hg
|
6
|
+
Hoe.plugin :yard
|
7
|
+
Hoe.plugin :signing
|
20
8
|
|
21
|
-
|
22
|
-
$LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
|
23
|
-
$LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
|
24
|
-
}
|
9
|
+
Hoe.plugins.delete :rubyforge
|
25
10
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
rescue LoadError
|
30
|
-
# Fall back to a plain prompt
|
31
|
-
def readline( text )
|
32
|
-
$stderr.print( text.chomp )
|
33
|
-
return $stdin.gets
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
begin
|
38
|
-
require 'rubygems'
|
39
|
-
rescue LoadError
|
40
|
-
module Gem
|
41
|
-
class Specification; end
|
42
|
-
end
|
43
|
-
end
|
11
|
+
hoespec = Hoe.spec 'treequel' do
|
12
|
+
self.name = 'treequel'
|
13
|
+
self.readme_file = 'README.md'
|
44
14
|
|
45
|
-
|
46
|
-
|
47
|
-
require 'rake'
|
48
|
-
require 'rake/testtask'
|
49
|
-
require 'rake/packagetask'
|
50
|
-
require 'rake/clean'
|
51
|
-
# require 'rake/191_compat.rb'
|
15
|
+
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
16
|
+
self.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
|
52
17
|
|
53
|
-
|
18
|
+
self.extra_deps <<
|
19
|
+
['ruby-ldap', '~> 0.9.11']
|
20
|
+
self.extra_dev_deps <<
|
21
|
+
['rspec', '~> 2.1.0'] <<
|
22
|
+
['ruby-termios', '~> 0.9.6'] <<
|
23
|
+
['ruby-terminfo', '~> 0.1.1'] <<
|
24
|
+
['yard', '~> 0.6.1']
|
54
25
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
26
|
+
self.spec_extras[:licenses] = ["BSD"]
|
27
|
+
self.spec_extras[:post_install_message] = [
|
28
|
+
"If you want to use the included 'treequel' LDAP shell, you'll need to install",
|
29
|
+
"the following libraries as well:",
|
30
|
+
" - termios",
|
31
|
+
" - ruby-terminfo",
|
32
|
+
" - columnize",
|
33
|
+
].join( "\n" )
|
63
34
|
|
64
|
-
|
35
|
+
self.require_ruby_version( '>=1.8.7' )
|
65
36
|
|
66
|
-
|
67
|
-
|
68
|
-
PKG_SUMMARY = 'An honest LDAP library'
|
69
|
-
|
70
|
-
# Cruisecontrol stuff
|
71
|
-
CC_BUILD_LABEL = ENV['CC_BUILD_LABEL']
|
72
|
-
CC_BUILD_ARTIFACTS = ENV['CC_BUILD_ARTIFACTS'] || 'artifacts'
|
73
|
-
|
74
|
-
VERSION_FILE = LIBDIR + 'treequel.rb'
|
75
|
-
if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
|
76
|
-
PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
|
77
|
-
elsif VERSION_FILE.exist?
|
78
|
-
PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
|
37
|
+
self.yard_title = 'Treequel'
|
38
|
+
self.yard_opts = [ '--use-cache', '--protected', '--verbose' ]
|
79
39
|
end
|
80
40
|
|
81
|
-
|
82
|
-
|
83
|
-
PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
|
84
|
-
GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
|
85
|
-
|
86
|
-
# Universal VCS constants
|
87
|
-
DEFAULT_EDITOR = 'vi'
|
88
|
-
COMMIT_MSG_FILE = 'commit-msg.txt'
|
89
|
-
FILE_INDENT = " " * 12
|
90
|
-
LOG_INDENT = " " * 3
|
91
|
-
|
92
|
-
EXTCONF = EXTDIR + 'extconf.rb'
|
93
|
-
|
94
|
-
ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
|
95
|
-
|
96
|
-
TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README* LICENSE] )
|
97
|
-
BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
|
98
|
-
LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
|
99
|
-
EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
|
100
|
-
DATA_FILES = Rake::FileList.new( "#{DATADIR}/**/*" )
|
101
|
-
|
102
|
-
SPECDIR = BASEDIR + 'spec'
|
103
|
-
SPECLIBDIR = SPECDIR + 'lib'
|
104
|
-
SPEC_FILES = Rake::FileList.new( "#{SPECDIR}/**/*_spec.rb", "#{SPECLIBDIR}/**/*.rb" )
|
105
|
-
|
106
|
-
TESTDIR = BASEDIR + 'tests'
|
107
|
-
TEST_FILES = Rake::FileList.new( "#{TESTDIR}/**/*.tests.rb" )
|
108
|
-
|
109
|
-
RAKE_TASKDIR = BASEDIR + 'rake'
|
110
|
-
RAKE_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/*.rb" )
|
111
|
-
PKG_TASKLIBS = Rake::FileList.new( "#{RAKE_TASKDIR}/{191_compat,helpers,packaging,rdoc,testing}.rb" )
|
112
|
-
PKG_TASKLIBS.include( "#{RAKE_TASKDIR}/manual.rb" ) if MANUALDIR.exist?
|
113
|
-
|
114
|
-
RAKE_TASKLIBS_URL = 'http://repo.deveiate.org/rake-tasklibs'
|
115
|
-
|
116
|
-
LOCAL_RAKEFILE = BASEDIR + 'Rakefile.local'
|
117
|
-
|
118
|
-
EXTRA_PKGFILES = Rake::FileList.new
|
119
|
-
EXTRA_PKGFILES.include( "#{BASEDIR}/examples/**/*.{rb,erb,css,png}" )
|
120
|
-
|
121
|
-
RELEASE_FILES = TEXT_FILES +
|
122
|
-
SPEC_FILES +
|
123
|
-
TEST_FILES +
|
124
|
-
BIN_FILES +
|
125
|
-
LIB_FILES +
|
126
|
-
EXT_FILES +
|
127
|
-
DATA_FILES +
|
128
|
-
RAKE_TASKLIBS +
|
129
|
-
EXTRA_PKGFILES
|
41
|
+
ENV['VERSION'] ||= hoespec.spec.version.to_s
|
130
42
|
|
43
|
+
include Hoe::MercurialHelpers
|
131
44
|
|
132
|
-
|
45
|
+
### Task: prerelease
|
46
|
+
desc "Append the package build number to package versions"
|
47
|
+
task :pre do
|
48
|
+
rev = get_numeric_rev()
|
49
|
+
trace "Current rev is: %p" % [ rev ]
|
50
|
+
hoespec.spec.version.version << "pre#{rev}"
|
51
|
+
Rake::Task[:gem].clear
|
133
52
|
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
COVERAGE_MINIMUM = ENV['COVERAGE_MINIMUM'] ? Float( ENV['COVERAGE_MINIMUM'] ) : 85.0
|
139
|
-
RCOV_EXCLUDES = 'spec,tests,/Library/Ruby,/var/lib,/usr/local/lib'
|
140
|
-
RCOV_OPTS = [
|
141
|
-
'--exclude', RCOV_EXCLUDES,
|
142
|
-
'--xrefs',
|
143
|
-
'--save',
|
144
|
-
'--callsites',
|
145
|
-
#'--aggregate', 'coverage.data' # <- doesn't work as of 0.8.1.2.0
|
146
|
-
]
|
147
|
-
|
148
|
-
|
149
|
-
### Load some task libraries that need to be loaded early
|
150
|
-
if !RAKE_TASKDIR.exist?
|
151
|
-
$stderr.puts "It seems you don't have the build task directory. Shall I fetch it "
|
152
|
-
ans = readline( "for you? [y]" )
|
153
|
-
ans = 'y' if !ans.nil? && ans.empty?
|
154
|
-
|
155
|
-
if ans =~ /^y/i
|
156
|
-
$stderr.puts "Okay, fetching #{RAKE_TASKLIBS_URL} into #{RAKE_TASKDIR}..."
|
157
|
-
system 'hg', 'clone', RAKE_TASKLIBS_URL, "./#{RAKE_TASKDIR}"
|
158
|
-
if ! $?.success?
|
159
|
-
fail "Damn. That didn't work. Giving up; maybe try manually fetching?"
|
160
|
-
end
|
161
|
-
else
|
162
|
-
$stderr.puts "Then I'm afraid I can't continue. Best of luck."
|
163
|
-
fail "Rake tasklibs not present."
|
53
|
+
Gem::PackageTask.new( hoespec.spec ) do |pkg|
|
54
|
+
pkg.need_zip = true
|
55
|
+
pkg.need_tar = true
|
164
56
|
end
|
165
|
-
|
166
|
-
RAKE_TASKLIBS.include( "#{RAKE_TASKDIR}/*.rb" )
|
167
|
-
end
|
168
|
-
|
169
|
-
require RAKE_TASKDIR + 'helpers.rb'
|
170
|
-
include RakefileHelpers
|
171
|
-
|
172
|
-
# Set the build ID if the mercurial executable is available
|
173
|
-
if hg = which( 'hg' )
|
174
|
-
id = `#{hg} id -n`.chomp
|
175
|
-
PKG_BUILD = (id.chomp[ /^[[:xdigit:]]+/ ] || '1')
|
176
|
-
else
|
177
|
-
PKG_BUILD = '0'
|
178
|
-
end
|
179
|
-
SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
|
180
|
-
SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
|
181
|
-
|
182
|
-
# Documentation constants
|
183
|
-
API_DOCSDIR = DOCSDIR + 'api'
|
184
|
-
README_FILE = TEXT_FILES.find {|path| path =~ /^README/ } || 'README'
|
185
|
-
RDOC_OPTIONS = [
|
186
|
-
'--tab-width=4',
|
187
|
-
'--show-hash',
|
188
|
-
'--include', BASEDIR.to_s,
|
189
|
-
"--main=#{README_FILE}",
|
190
|
-
"--title=#{PKG_NAME}",
|
191
|
-
]
|
192
|
-
YARD_OPTIONS = [
|
193
|
-
'--use-cache',
|
194
|
-
'--protected',
|
195
|
-
'-r', README_FILE,
|
196
|
-
'--exclude', 'extconf\\.rb',
|
197
|
-
'--files', 'ChangeLog,LICENSE',
|
198
|
-
'--output-dir', API_DOCSDIR.to_s,
|
199
|
-
'--title', "#{PKG_NAME} #{PKG_VERSION}",
|
200
|
-
]
|
201
|
-
|
202
|
-
# Release constants
|
203
|
-
SMTP_HOST = "mail.faeriemud.org"
|
204
|
-
SMTP_PORT = 465 # SMTP + SSL
|
205
|
-
|
206
|
-
# Project constants
|
207
|
-
PROJECT_HOST = 'deveiate'
|
208
|
-
PROJECT_PUBDIR = '/usr/local/www/public/code'
|
209
|
-
PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
|
210
|
-
PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
|
211
|
-
PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
|
212
|
-
|
213
|
-
GEM_PUBHOST = 'rubygems.org'
|
214
|
-
|
215
|
-
# Gem dependencies: gemname => version
|
216
|
-
DEPENDENCIES = {
|
217
|
-
'ruby-ldap' => '~> 0.9.9',
|
218
|
-
}
|
219
|
-
|
220
|
-
# Developer Gem dependencies: gemname => version
|
221
|
-
DEVELOPMENT_DEPENDENCIES = {
|
222
|
-
'rake' => '~> 0.8.7',
|
223
|
-
'rcodetools' => '~> 0.7.0.0',
|
224
|
-
'rcov' => '~> 0.8.1.2.0',
|
225
|
-
'yard' => '~> 0.6.1',
|
226
|
-
'RedCloth' => '~> 4.2.3',
|
227
|
-
'rspec' => '~> 2.0.1',
|
228
|
-
'ruby-termios' => '~> 0.9.6',
|
229
|
-
'text-format' => '~> 1.0.0',
|
230
|
-
'tmail' => '~> 1.2.3.1',
|
231
|
-
'columnize' => '~> 0.3.1',
|
232
|
-
'diff-lcs' => '~> 1.1.2',
|
233
|
-
'ruby-termios' => '~> 0.9.6',
|
234
|
-
'rspec' => '~> 2.0.1',
|
235
|
-
'ruby-terminfo' => '~> 0.1.1',
|
236
|
-
}
|
237
|
-
|
238
|
-
# Non-gem requirements: packagename => version
|
239
|
-
REQUIREMENTS = {
|
240
|
-
'ldap' => '>=0',
|
241
|
-
}
|
242
|
-
|
243
|
-
# RubyGem specification
|
244
|
-
GEMSPEC = Gem::Specification.new do |gem|
|
245
|
-
gem.name = PKG_NAME.downcase
|
246
|
-
gem.version = PKG_VERSION
|
247
|
-
|
248
|
-
gem.summary = PKG_SUMMARY
|
249
|
-
gem.description = [
|
250
|
-
"A library for interacting with LDAP (modeled after Sequel). It is an attempt to remove",
|
251
|
-
"the impedence mismatch of trying to treat LDAP as if it's a relational database, and",
|
252
|
-
"instead embrace its hierarchical, free-form nature.",
|
253
|
-
].join( "\n" )
|
254
|
-
gem.post_install_message = [
|
255
|
-
"If you want to use the included 'treequel' LDAP shell, you'll need to install",
|
256
|
-
"the following libraries as well:",
|
257
|
-
" - termios",
|
258
|
-
" - ruby-terminfo",
|
259
|
-
" - columnize",
|
260
|
-
" - diff-lcs",
|
261
|
-
].join( "\n" )
|
262
|
-
|
263
|
-
gem.authors = ["Michael Granger", "Mahlon E. Smith"]
|
264
|
-
gem.email = ["mahlon@martini.nu", "ged@FaerieMUD.org"]
|
265
|
-
gem.homepage = 'http://deveiate.org/projects/Treequel'
|
266
|
-
gem.licenses = ["BSD"]
|
267
|
-
|
268
|
-
gem.has_rdoc = true
|
269
|
-
gem.rdoc_options = RDOC_OPTIONS
|
270
|
-
gem.extra_rdoc_files = TEXT_FILES - [ 'Rakefile' ]
|
271
|
-
|
272
|
-
gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
|
273
|
-
gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
|
274
|
-
collect {|pn| File.basename(pn) }
|
275
|
-
gem.require_paths << EXTDIR.relative_path_from( BASEDIR ).to_s if EXTDIR.exist?
|
276
|
-
|
277
|
-
if EXTCONF.exist?
|
278
|
-
gem.extensions << EXTCONF.relative_path_from( BASEDIR ).to_s
|
279
|
-
end
|
280
|
-
|
281
|
-
gem.files = RELEASE_FILES
|
282
|
-
gem.test_files = SPEC_FILES
|
283
|
-
|
284
|
-
# signing key and certificate chain
|
285
|
-
gem.signing_key = '/Volumes/Keys/ged-private_gem_key.pem'
|
286
|
-
gem.cert_chain = [File.expand_path('~/.gem/ged-public_gem_cert.pem')]
|
287
|
-
|
288
|
-
|
289
|
-
gem.required_ruby_version = '>=1.8.7'
|
290
|
-
|
291
|
-
DEPENDENCIES.each do |name, version|
|
292
|
-
version = '>= 0' if version.length.zero?
|
293
|
-
gem.add_runtime_dependency( name, version )
|
294
|
-
end
|
295
|
-
|
296
|
-
REQUIREMENTS.each do |name, version|
|
297
|
-
gem.requirements << [ name, version ].compact.join(' ')
|
298
|
-
end
|
299
|
-
end
|
300
|
-
|
301
|
-
$trace = Rake.application.options.trace ? true : false
|
302
|
-
$dryrun = Rake.application.options.dryrun ? true : false
|
303
|
-
$include_dev_dependencies = false
|
304
|
-
|
305
|
-
# Load any remaining task libraries
|
306
|
-
RAKE_TASKLIBS.each do |tasklib|
|
307
|
-
next if tasklib.to_s =~ %r{/helpers\.rb$}
|
308
|
-
begin
|
309
|
-
trace " loading tasklib %s" % [ tasklib ]
|
310
|
-
import tasklib
|
311
|
-
rescue ScriptError => err
|
312
|
-
fail "Task library '%s' failed to load: %s: %s" %
|
313
|
-
[ tasklib, err.class.name, err.message ]
|
314
|
-
trace "Backtrace: \n " + err.backtrace.join( "\n " )
|
315
|
-
rescue => err
|
316
|
-
log "Task library '%s' failed to load: %s: %s. Some tasks may not be available." %
|
317
|
-
[ tasklib, err.class.name, err.message ]
|
318
|
-
trace "Backtrace: \n " + err.backtrace.join( "\n " )
|
319
|
-
end
|
320
|
-
end
|
321
|
-
|
322
|
-
# Load any project-specific rules defined in 'Rakefile.local' if it exists
|
323
|
-
import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
|
324
|
-
|
325
|
-
|
326
|
-
#####################################################################
|
327
|
-
### T A S K S
|
328
|
-
#####################################################################
|
329
|
-
|
330
|
-
### Default task
|
331
|
-
task :default => [:clean, :local, :spec, :apidocs, :package]
|
332
|
-
|
333
|
-
### Task the local Rakefile can append to -- no-op by default
|
334
|
-
task :local
|
335
|
-
|
336
|
-
### Task: clean
|
337
|
-
CLEAN.include 'coverage', '**/*.orig', '**/*.rej'
|
338
|
-
CLOBBER.include 'artifacts', 'coverage.info', 'ChangeLog', PKGDIR
|
339
|
-
|
340
|
-
### Task: changelog
|
341
|
-
file 'ChangeLog' do |task|
|
342
|
-
log "Updating #{task.name}"
|
343
|
-
|
344
|
-
changelog = make_changelog()
|
345
|
-
File.open( task.name, 'w' ) do |fh|
|
346
|
-
fh.print( changelog )
|
347
|
-
end
|
348
|
-
end
|
349
|
-
|
350
|
-
|
351
|
-
### Task: cruise (Cruisecontrol task)
|
352
|
-
desc "Cruisecontrol build"
|
353
|
-
task :cruise => [:clean, 'spec:quiet', :package] do |task|
|
354
|
-
raise "Artifacts dir not set." if ARTIFACTS_DIR.to_s.empty?
|
355
|
-
artifact_dir = ARTIFACTS_DIR.cleanpath + (CC_BUILD_LABEL || Time.now.strftime('%Y%m%d-%T'))
|
356
|
-
artifact_dir.mkpath
|
357
|
-
|
358
|
-
coverage = BASEDIR + 'coverage'
|
359
|
-
if coverage.exist? && coverage.directory?
|
360
|
-
$stderr.puts "Copying coverage stats..."
|
361
|
-
FileUtils.cp_r( 'coverage', artifact_dir )
|
362
|
-
end
|
363
|
-
|
364
|
-
$stderr.puts "Copying packages..."
|
365
|
-
FileUtils.cp_r( FileList['pkg/*'].to_a, artifact_dir )
|
366
|
-
end
|
367
|
-
|
368
|
-
|
369
|
-
desc "Update the build system to the latest version"
|
370
|
-
task :update_build do
|
371
|
-
log "Updating the build system"
|
372
|
-
run 'hg', '-R', RAKE_TASKDIR, 'pull', '-u'
|
373
|
-
log "Updating the Rakefile"
|
374
|
-
sh 'rake', '-f', RAKE_TASKDIR + 'Metarakefile'
|
375
57
|
end
|
376
58
|
|