-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
101 lines (84 loc) · 2.59 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
# -*- coding: utf-8 -*-
load File.join(File.dirname(__FILE__), '.local_ruby_env')
def example(*options)
[ 'rackup', '-I', get_project_libdir ] + options + get_command_options +
[ "#{get_project_dir}/run/config.ru" ]
end
desc 'alias for example_develop.'
task :example => [ :example_develop ]
desc 'start example for development (rackup options for o1, o2, ...).'
task :example_develop do
ENV['GLUON_ENV'] = 'development'
sh *example('-E', 'development')
end
desc 'start example for deployment (rackup options for o1, o2, ...).'
task :example_deploy do
ENV['GLUON_ENV'] = 'deployment'
sh *example('-E', 'deployment')
end
desc 'unit-test.'
task :test do
cd "#{get_project_dir}/test", :verbose => true do
run_ruby_tool 'rake'
end
end
rdoc_opts = [ '-SNa', '-m', 'Gluon', '-t', 'gluon - component based web application framework' ]
desc 'make document.'
task :rdoc do
run_ruby_tool 'rdoc', *rdoc_opts, '-o', 'api', 'lib', 'run/lib'
end
desc 'alias for local_example_develop.'
task :local_example => [ :local_example_develop ]
desc 'start example for development (project local RubyGems environemnt).'
task :local_example_develop do
ENV['GLUON_ENV'] = 'development'
run_local_command *example('-E', 'development')
end
desc 'start example for deployment (project local RubyGems environemnt).'
task :local_example_deploy do
ENV['GLUON_ENV'] = 'deployment'
run_local_command *example('-E', 'deployment')
end
desc 'unit-test (project local RubyGems environemnt).'
task :local_test do
cd "#{get_project_dir}/test", :verbose => true do
run_ruby_tool 'rake', 'local_test'
end
end
load File.join(get_project_libdir, 'gluon/version.rb')
require 'rake/gempackagetask'
spec = Gem::Specification.new{|s|
s.name = 'gluon'
s.version = Gluon::VERSION
s.summary = 'component based web application framework'
s.author = 'TOKI Yoshinori'
s.email = '[email protected]'
s.executables << 'gluon_setup' << 'gluon_example'
s.files =
%w[ ChangeLog Rakefile LICENSE EXAMPLE .local_ruby_env ] +
Dir['{lib,run,test}/**/Rakefile'] +
Dir['{lib,run,test}/**/*.{rb,erb,ru,cgi}'] +
Dir['run/bin/cgi_server']
s.test_files = [ 'test/run.rb' ]
s.has_rdoc = true
s.rdoc_options = rdoc_opts
s.add_dependency 'rack'
}
Rake::GemPackageTask.new(spec) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
desc 'clean garbage files'
task :clean => [ :clobber_package ] do
rm_rf 'api'
for f in Dir['**/*.erbc'] + Dir['*~']
rm f
end
cd "#{get_project_dir}/test", :verbose => true do
run_ruby_tool 'rake', 'clean'
end
end
# Local Variables:
# mode: Ruby
# indent-tabs-mode: nil
# End: