Rakefile
author Mahlon E. Smith <mahlon@laika.com>
Fri, 12 May 2017 16:17:41 -0700
changeset 16 e135ccae6783
parent 15 a38e6916504c
child 17 23c7f5c8ee39
permissions -rw-r--r--
Migrate hashing functions to C.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
     1
#!/usr/bin/env rake
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
     2
# vim: set nosta noet ts=4 sw=4:
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     3
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
     4
require 'pathname'
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
     5
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
     6
begin
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
     7
	require 'rake/extensiontask'
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
     8
rescue LoadError
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
     9
	abort "This Rakefile requires rake-compiler (gem install rake-compiler)"
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    10
end
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    11
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    12
PROJECT = 'ezmlm'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    13
BASEDIR = Pathname.new( __FILE__ ).expand_path.dirname.relative_path_from( Pathname.getwd )
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    14
LIBDIR  = BASEDIR + 'lib'
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    15
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    16
if Rake.application.options.trace
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    17
    $trace = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    18
    $stderr.puts '$trace is enabled'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    19
end
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    20
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    21
# parse the current library version
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    22
$version = ( LIBDIR + "#{PROJECT}.rb" ).read.split(/\n/).
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    23
	select{|line| line =~ /VERSION =/}.first.match(/([\d|.]+)/)[1]
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    24
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    25
task :default => [ :spec, :docs, :package ]
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    26
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    27
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    28
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    29
### P A C K A G I N G
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    30
########################################################################
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    31
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    32
require 'rubygems'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    33
require 'rubygems/package_task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    34
spec = Gem::Specification.new do |s|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    35
	s.email        = 'mahlon@martini.nu'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    36
	s.homepage     = 'https://bitbucket.org/mahlon/Ruby-Ezmlm'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    37
	s.authors      = [
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    38
		'Mahlon E. Smith <mahlon@martini.nu>',
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    39
		'Michael Granger <ged@faeriemud.org>',
15
a38e6916504c Everything is workin!
Mahlon E. Smith <mahlon@laika.com>
parents: 14
diff changeset
    40
		'Jeremiah Jordan <jeremiah.m.jordan@gmail.com>'
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    41
	]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    42
	s.platform     = Gem::Platform::RUBY
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    43
	s.summary      = "Interact with Ezmlm-IDX mailing lists."
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    44
	s.name         = PROJECT
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    45
	s.version      = $version
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    46
	s.license      = 'BSD-3-Clause'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    47
	s.has_rdoc     = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    48
	s.require_path = 'lib'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    49
	s.bindir       = 'bin'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    50
	s.files        = File.read( __FILE__ ).split( /^__END__/, 2 ).last.split
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    51
	# s.executables  = %w[]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    52
	s.description  = <<-EOF
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    53
This is a ruby interface for interacting with ezmlm-idx, an email list
14
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
    54
manager for use with the Qmail MTA, and the messages contained therein.
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
    55
(The -idx provides an extended feature set over the original ezmlm
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
    56
environment.)
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    57
	EOF
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    58
	s.extensions = FileList[ "ext/**/extconf.rb" ]
14
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
    59
	s.required_ruby_version = '>= 2.1'
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    60
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    61
	s.add_dependency 'mail', "~> 2.6"
15
a38e6916504c Everything is workin!
Mahlon E. Smith <mahlon@laika.com>
parents: 14
diff changeset
    62
	s.add_dependency 'rake-compiler', "~> 1.0"
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    63
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    64
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    65
Gem::PackageTask.new( spec ) do |pkg|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    66
	pkg.need_zip = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    67
	pkg.need_tar = true
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    68
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    69
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    70
# Build the C extension for hashing addresses.
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    71
Rake::ExtensionTask.new( 'ezmlm/hash', spec )
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    72
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    73
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    74
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    75
### D O C U M E N T A T I O N
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    76
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    77
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    78
begin
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    79
	require 'rdoc/task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    80
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    81
	desc 'Generate rdoc documentation'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    82
	RDoc::Task.new do |rdoc|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    83
		rdoc.name       = :docs
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    84
		rdoc.rdoc_dir   = 'docs'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    85
		rdoc.main       = "README.rdoc"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    86
		# rdoc.options    = [ '-f', 'fivefish' ]
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
    87
		rdoc.rdoc_files = [ 'lib', *FileList['ext/*/*.c'], *FileList['*.rdoc'] ]
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    88
	end
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    89
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    90
	RDoc::Task.new do |rdoc|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    91
		rdoc.name       = :doc_coverage
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    92
		rdoc.options    = [ '-C1' ]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    93
	end
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    94
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    95
rescue LoadError
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    96
	$stderr.puts "Omitting 'docs' tasks, rdoc doesn't seem to be installed."
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    97
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    98
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    99
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   100
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   101
### T E S T I N G
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   102
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   103
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   104
begin
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   105
    require 'rspec/core/rake_task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   106
    task :test => :spec
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   107
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   108
    desc "Run specs"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   109
    RSpec::Core::RakeTask.new do |t|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   110
        t.pattern = "spec/**/*_spec.rb"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   111
    end
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   112
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   113
    desc "Build a coverage report"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   114
    task :coverage do
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   115
        ENV[ 'COVERAGE' ] = "yep"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   116
        Rake::Task[ :spec ].invoke
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   117
    end
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   118
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   119
rescue LoadError
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   120
    $stderr.puts "Omitting testing tasks, rspec doesn't seem to be installed."
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
   121
end
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
   122
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   123
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   124
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   125
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   126
### M A N I F E S T
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   127
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   128
__END__
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   129
ext/ezmlm/hash/hash.c
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   130
ext/ezmlm/hash/hash.h
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   131
ext/ezmlm/hash/extconf.rb
14
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
   132
lib/ezmlm/list.rb
16
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   133
lib/ezmlm/list/message.rb
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   134
lib/ezmlm/list/thread.rb
e135ccae6783 Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents: 15
diff changeset
   135
lib/ezmlm/list/author.rb
14
cba9fb39bcdb Checkpoint commit.
Mahlon E. Smith <mahlon@laika.com>
parents: 13
diff changeset
   136
lib/ezmlm.rb
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   137