Rakefile
author Mahlon E. Smith <mahlon@laika.com>
Mon, 14 Nov 2016 15:17:46 -0800
changeset 10 8388c2d1d7af
parent 9 47425483883e
child 11 b1f97f6063a3
permissions -rw-r--r--
Additional cleanups for release.
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
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    53
	s.add_dependency 'thingfish', '~> 0.5'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    54
	s.add_dependency 'loggability', '~> 0.11'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    55
	s.add_dependency 'configurability', '~> 2.2'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    56
	s.add_dependency 'sequel', '~> 4.35'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    57
	s.add_dependency 'pg', '~> 0.19'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    58
end
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    59
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    60
Gem::PackageTask.new( spec ) do |pkg|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    61
	pkg.need_zip = true
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    62
	pkg.need_tar = true
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    63
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    64
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    65
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    66
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    67
### 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
    68
########################################################################
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    69
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    70
begin
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    71
	require 'rdoc/task'
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    72
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    73
	desc 'Generate rdoc documentation'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    74
	RDoc::Task.new do |rdoc|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    75
		rdoc.name       = :docs
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    76
		rdoc.rdoc_dir   = 'docs'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    77
		rdoc.main       = "README.md"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    78
		rdoc.rdoc_files = [ 'lib', *FileList['*.md'] ]
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    79
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    80
		if File.directory?( '.hg' )
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    81
			rdoc.options    = [ '-f', 'fivefish' ]
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
	end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    84
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    85
	RDoc::Task.new do |rdoc|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    86
		rdoc.name       = :doc_coverage
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    87
		rdoc.options    = [ '-C1' ]
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    88
	end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    89
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    90
rescue LoadError
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    91
	$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
    92
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    93
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
    94
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    95
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    96
### T E S T I N G
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
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
    99
begin
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   100
    require 'rspec/core/rake_task'
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   101
    task :test => :spec
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   102
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   103
    desc "Run specs"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   104
    RSpec::Core::RakeTask.new do |t|
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   105
        t.pattern = "spec/**/*_spec.rb"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   106
    end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   107
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   108
    desc "Build a coverage report"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   109
    task :coverage do
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   110
        ENV[ 'COVERAGE' ] = "yep"
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   111
        Rake::Task[ :spec ].invoke
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   112
    end
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   113
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   114
rescue LoadError
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   115
    $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
   116
end
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
   117
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   118
0
3cc90e88c6ab Initial commit.
Mahlon E. Smith <mahlon@martini.nu>
parents:
diff changeset
   119
10
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   120
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   121
### M A N I F E S T
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   122
########################################################################
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   123
__END__
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   124
data/thingfish-metastore-pggraph/migrations/20151102_initial.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   125
lib/thingfish/metastore/pggraph/edge.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   126
lib/thingfish/metastore/pggraph/node.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   127
lib/thingfish/metastore/pggraph.rb
8388c2d1d7af Additional cleanups for release.
Mahlon E. Smith <mahlon@laika.com>
parents: 9
diff changeset
   128