-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
138 lines (104 loc) · 3.63 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/env rake
require 'pathname'
require 'rake/clean'
begin
require 'hoe'
rescue LoadError
abort "This Rakefile requires hoe (gem install hoe)"
end
GEMSPEC = 'arborist.gemspec'
BASEDIR = Pathname( __FILE__ ).dirname
LIBDIR = BASEDIR + 'lib'
NODE_STATE_GRAPH = BASEDIR + 'node-state-machine.dot'
Hoe.plugin :mercurial
Hoe.plugin :signing
Hoe.plugin :deveiate
Hoe.plugins.delete :rubyforge
hoespec = Hoe.spec 'arborist' do |spec|
spec.readme_file = 'README.md'
spec.history_file = 'History.md'
spec.extra_rdoc_files = FileList[ '*.rdoc', '*.md' ]
spec.license 'BSD-3-Clause'
spec.urls = {
home: 'http://deveiate.org/projects/arborist',
code: 'http://bitbucket.org/ged/arborist',
docs: 'http://deveiate.org/code/arborist',
github: 'http://github.com/ged/arborist',
}
spec.developer 'Michael Granger', 'ged@FaerieMUD.org'
spec.developer 'Mahlon E. Smith', 'mahlon@martini.nu'
spec.dependency 'schedulability', '~> 0.1'
spec.dependency 'loggability', '~> 0.12'
spec.dependency 'configurability', '~> 3.0'
spec.dependency 'pluggability', '~> 0.4'
spec.dependency 'state_machines', '~> 0.5'
spec.dependency 'msgpack', '~> 1.0'
spec.dependency 'cztop', '~> 0.11'
spec.dependency 'cztop-reactor', '~> 0.3'
spec.dependency 'gli', '~> 2.3'
spec.dependency 'tty', '~> 0.7'
spec.dependency 'tty-tree', '~> 0.1'
spec.dependency 'pry', '~> 0.11'
spec.dependency 'rspec', '~> 3.2', :developer
spec.dependency 'rspec-wait', '~> 0.0', :developer
spec.dependency 'simplecov', '~> 0.9', :developer
spec.dependency 'timecop', '~> 0.7', :developer
spec.dependency 'rdoc', '~> 5.1', :developer
spec.dependency 'state_machines-graphviz', '~> 0.0', :developer
spec.require_ruby_version( '>=2.3.1' )
spec.hg_sign_tags = true if spec.respond_to?( :hg_sign_tags= )
spec.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
end
ENV['VERSION'] ||= hoespec.spec.version.to_s
# Run the tests before checking in
task 'hg:precheckin' => [ :check_history, :check_manifest, :gemspec, :spec ]
# Rebuild the ChangeLog immediately before release
task :prerelease => 'ChangeLog'
CLOBBER.include( 'ChangeLog' )
desc "Build a coverage report"
task :coverage do
ENV["COVERAGE"] = 'yes'
Rake::Task[:spec].invoke
end
# Use the fivefish formatter for docs generated from development checkout
if File.directory?( '.hg' )
require 'rdoc/task'
Rake::Task[ 'docs' ].clear
RDoc::Task.new( 'docs' ) do |rdoc|
rdoc.main = "README.md"
rdoc.rdoc_files.include( "*.rdoc", "*.md", "ChangeLog", "lib/**/*.rb" )
rdoc.generator = :fivefish
rdoc.title = 'Arborist'
rdoc.rdoc_dir = 'doc'
end
end
file 'Manifest.txt'
task :gemspec => [ 'ChangeLog', __FILE__, 'Manifest.txt', GEMSPEC ]
file GEMSPEC => __FILE__ do |task|
spec = $hoespec.spec
spec.files.delete( '.gemtest' )
spec.files.delete( 'LICENSE' )
spec.signing_key = nil
spec.version = "#{spec.version.bump}.0.pre#{Time.now.strftime("%Y%m%d%H%M%S")}"
#spec.cert_chain = [ 'certs/ged.pem' ]
File.open( task.name, 'w' ) do |fh|
fh.write( spec.to_ruby )
end
end
CLOBBER.include( GEMSPEC )
task :default => :gemspec
file NODE_STATE_GRAPH
desc "Generate a graph of the node status state machine."
task NODE_STATE_GRAPH do |task|
$LOAD_PATH.unshift( LIBDIR.to_s )
require 'state_machines'
require 'state_machines/graphviz'
require 'arborist/node'
state_machine = Arborist::Node.state_machine
name = File.basename( NODE_STATE_GRAPH, '.dot' )
puts "Writing status state machine diagram to #{NODE_STATE_GRAPH}"
graph = state_machine.draw( path: BASEDIR.to_s, name: name, format: 'dot' )
# graph.output
end
CLEAN.include( NODE_STATE_GRAPH.to_s )
task :diagrams => [ NODE_STATE_GRAPH ]