Rakefile
author Mahlon E. Smith <mahlon@martini.nu>
Wed, 01 Feb 2017 15:35:35 -0800
changeset 12 3cc813140c80
parent 11 7fc2d1713795
child 13 a03c08c289e9
permissions -rw-r--r--
First round of modernizing after a long absence. Much work to be done.
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
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
     6
PROJECT = 'ezmlm'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
     7
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
     8
LIBDIR  = BASEDIR + 'lib'
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
     9
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    10
if Rake.application.options.trace
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    11
    $trace = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    12
    $stderr.puts '$trace is enabled'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    13
end
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    14
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    15
# parse the current library version
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    16
$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
    17
	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
    18
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    19
task :default => [ :spec, :docs, :package ]
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    20
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    21
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    22
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    23
### 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
    24
########################################################################
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    25
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    26
require 'rubygems'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    27
require 'rubygems/package_task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    28
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
    29
	s.email        = 'mahlon@martini.nu'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    30
	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
    31
	s.authors      = [
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    32
		'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
    33
		'Michael Granger <ged@faeriemud.org>',
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    34
		'Jeremiah Jordan <jjordan@laika.com>'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    35
	]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    36
	s.platform     = Gem::Platform::RUBY
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    37
	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
    38
	s.name         = PROJECT
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    39
	s.version      = $version
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    40
	s.license      = 'BSD-3-Clause'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    41
	s.has_rdoc     = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    42
	s.require_path = 'lib'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    43
	s.bindir       = 'bin'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    44
	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
    45
	# s.executables  = %w[]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    46
	s.description  = <<-EOF
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    47
This is a ruby interface for interacting with ezmlm-idx, an email list
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    48
manager for use with the Qmail MTA.  (The -idx provides an extended
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    49
feature set over the initial ezmlm environment.)
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    50
	EOF
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    51
	s.required_ruby_version = '>= 2'
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    52
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    53
	s.add_dependency 'loggability', "~> 0.13"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    54
	s.add_dependency 'mail', "~> 2.6"
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    55
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    56
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    57
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
    58
	pkg.need_zip = true
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    59
	pkg.need_tar = true
1
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    60
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    61
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    62
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    63
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    64
### 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
    65
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    66
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    67
begin
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    68
	require 'rdoc/task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    69
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    70
	desc 'Generate rdoc documentation'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    71
	RDoc::Task.new do |rdoc|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    72
		rdoc.name       = :docs
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    73
		rdoc.rdoc_dir   = 'docs'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    74
		rdoc.main       = "README.rdoc"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    75
		# rdoc.options    = [ '-f', 'fivefish' ]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    76
		rdoc.rdoc_files = [ 'lib', *FileList['*.rdoc'] ]
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    77
	end
12
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    78
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    79
	RDoc::Task.new do |rdoc|
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    80
		rdoc.name       = :doc_coverage
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    81
		rdoc.options    = [ '-C1' ]
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    82
	end
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    83
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    84
rescue LoadError
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    85
	$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
    86
end
1d3cfd4837a8 Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff changeset
    87
11
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
    88
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
### 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
    91
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    92
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    93
begin
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    94
    require 'rspec/core/rake_task'
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    95
    task :test => :spec
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    96
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    97
    desc "Run specs"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
    98
    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
    99
        t.pattern = "spec/**/*_spec.rb"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   100
    end
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   101
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   102
    desc "Build a coverage report"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   103
    task :coverage do
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   104
        ENV[ 'COVERAGE' ] = "yep"
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   105
        Rake::Task[ :spec ].invoke
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   106
    end
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
rescue LoadError
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   109
    $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
   110
end
7fc2d1713795 Updated to new build system.
Michael Granger <mgranger@laika.com>
parents: 5
diff changeset
   111
12
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
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   114
########################################################################
3cc813140c80 First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents: 11
diff changeset
   115
### 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
   116
########################################################################
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