Rakefile
author Mahlon E. Smith <mahlon@martini.nu>
Sun, 01 Sep 2019 15:38:16 -0700
changeset 17 29848143f305
parent 13 686fbfe638bd
permissions -rw-r--r--
Bye, Bitbucket.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     1
#!/usr/bin/env rake
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     2
# vim: set nosta noet ts=4 sw=4:
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     3
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     4
require 'pathname'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
     5
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     6
PROJECT = 'thingfish-metastore-pggraph'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     7
BASEDIR = Pathname.new( __FILE__ ).expand_path.dirname.relative_path_from( Pathname.getwd )
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     8
LIBDIR  = BASEDIR + 'lib'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
     9
LIBFILE = LIBDIR + ( PROJECT.gsub( '-', '/' ) + '.rb' )
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    11
if Rake.application.options.trace
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    12
    $trace = true
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    13
    $stderr.puts '$trace is enabled'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    14
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    15
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    16
# parse the current library version
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    17
$version = LIBFILE.read.split(/\n/).
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    18
	select{|line| line =~ /VERSION =/}.first.match(/([\d|.]+)/)[1]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    19
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    20
task :default => [ :spec, :docs, :package ]
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    21
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    22
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    23
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    24
### P A C K A G I N G
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    25
########################################################################
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    26
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    27
require 'rubygems'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    28
require 'rubygems/package_task'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    29
spec = Gem::Specification.new do |s|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    30
	s.email        = 'mahlon@martini.nu'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    31
	s.homepage     = 'https://bitbucket.org/mahlon/thingfish-metastore-pggraph'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    32
	s.authors      = [ 'Mahlon E. Smith <mahlon@martini.nu>', 'Michael Granger <ged@faeriemud.org>' ]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    33
	s.platform     = Gem::Platform::RUBY
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    34
	s.summary      = "Graph DDL storage for Thingfish metadata."
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    35
	s.name         = PROJECT
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    36
	s.version      = $version
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    37
	s.license      = 'BSD-3-Clause'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    38
	s.has_rdoc     = true
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    39
	s.require_path = 'lib'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    40
	s.bindir       = 'bin'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    41
	s.files        = File.read( __FILE__ ).split( /^__END__/, 2 ).last.split
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    42
	# s.executables  = %w[]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    43
	s.description  = <<-EOF
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    44
This is a metadata storage plugin for the Thingfish digital asset
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    45
manager.  It provides persistent storage for uploaded data to PostgreSQL
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    46
tables.
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    47
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    48
It is heavily based on the regular PG metastore, however it differs by
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    49
storing objects as nodes, and their relations as edges.
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    50
	EOF
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    51
	s.required_ruby_version = '>= 2.3'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    52
13
686fbfe638bd Remove deprecated calls for the Sequel ORM, add compatibility for Sequel 5.
Mahlon E. Smith <mahlon@laika.com>
parents: 11
diff changeset
    53
	s.add_dependency 'thingfish', '~> 0.7'
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    54
	s.add_dependency 'loggability', '~> 0.11'
13
686fbfe638bd Remove deprecated calls for the Sequel ORM, add compatibility for Sequel 5.
Mahlon E. Smith <mahlon@laika.com>
parents: 11
diff changeset
    55
	s.add_dependency 'sequel', '~> 5.4'
686fbfe638bd Remove deprecated calls for the Sequel ORM, add compatibility for Sequel 5.
Mahlon E. Smith <mahlon@laika.com>
parents: 11
diff changeset
    56
	s.add_dependency 'pg', '~> 1.0'
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    57
end
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    58
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    59
Gem::PackageTask.new( spec ) do |pkg|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    60
	pkg.need_zip = true
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    61
	pkg.need_tar = true
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    62
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    63
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    64
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    65
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    66
### D O C U M E N T A T I O N
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    67
########################################################################
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    68
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    69
begin
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    70
	require 'rdoc/task'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    71
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    72
	desc 'Generate rdoc documentation'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    73
	RDoc::Task.new do |rdoc|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    74
		rdoc.name       = :docs
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    75
		rdoc.rdoc_dir   = 'docs'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    76
		rdoc.main       = "README.md"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    77
		rdoc.rdoc_files = [ 'lib', *FileList['*.md'] ]
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    78
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    79
		if File.directory?( '.hg' )
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    80
			rdoc.options    = [ '-f', 'fivefish' ]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    81
		end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    82
	end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    83
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    84
	RDoc::Task.new do |rdoc|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    85
		rdoc.name       = :doc_coverage
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    86
		rdoc.options    = [ '-C1' ]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    87
	end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    88
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    89
rescue LoadError
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    90
	$stderr.puts "Omitting 'docs' tasks, rdoc doesn't seem to be installed."
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    91
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    92
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    93
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    94
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    95
### T E S T I N G
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    96
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    97
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    98
begin
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    99
    require 'rspec/core/rake_task'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   100
    task :test => :spec
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   101
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   102
    desc "Run specs"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   103
    RSpec::Core::RakeTask.new do |t|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   104
        t.pattern = "spec/**/*_spec.rb"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   105
    end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   106
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   107
    desc "Build a coverage report"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   108
    task :coverage do
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   109
        ENV[ 'COVERAGE' ] = "yep"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   110
        Rake::Task[ :spec ].invoke
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   111
    end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   112
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   113
rescue LoadError
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   114
    $stderr.puts "Omitting testing tasks, rspec doesn't seem to be installed."
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
   115
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
   116
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   117
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
   118
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   119
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   120
### M A N I F E S T
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   121
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   122
__END__
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   123
data/thingfish-metastore-pggraph/migrations/20151102_initial.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   124
lib/thingfish/metastore/pggraph/edge.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   125
lib/thingfish/metastore/pggraph/node.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   126
lib/thingfish/metastore/pggraph.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   127