-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
101 lines (80 loc) · 2.53 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
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
ZIP_URL = "https://github.com/projecthydra/hydra-jetty/archive/v8.3.1.zip"
require 'active_support/benchmarkable'
require 'jettywrapper'
require 'engine_cart/rake_task'
desc 'run the triannon specs'
task :ci => 'engine_cart:generate' do
RAILS_ENV = 'test'
Rake::Task['spec'].invoke
end
load 'rails/tasks/statistics.rake'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :ci
Dir.glob('lib/tasks/*.rake').each { |r| load r}
namespace :triannon do
desc 'run test rails app w triannon and jetty'
task :server_jetty do
jetty_params = Jettywrapper.load_config.merge({:jetty_home => File.expand_path(File.dirname(__FILE__) + '/jetty')})
Jettywrapper.wrap(jetty_params) do
within_test_app do
system "rails s"
end
end
end
desc 'run test rails app w triannon but no jetty'
task :server_no_jetty do
within_test_app do
system "rails s"
end
end
desc 'run test rails app w triannon but no jetty'
task :server => :server_no_jetty
desc 'run test rails console w triannon'
task :console_jetty do
jetty_params = Jettywrapper.load_config.merge({:jetty_home => File.expand_path(File.dirname(__FILE__) + '/jetty')})
Jettywrapper.wrap(jetty_params) do
within_test_app do
system "rails c"
end
end
end
desc 'run test rails console w triannon but no jetty'
task :console_no_jetty do
within_test_app do
system "rails c"
end
end
desc 'run test rails console w triannon but no jetty'
task :console => :console_no_jetty
end # namespace triannon
desc "Generate RDoc with YARD"
task :doc => ['doc:generate']
namespace :doc do
begin
require 'yard'
require 'yard/rake/yardoc_task'
YARD::Rake::YardocTask.new(:generate) do |yt|
yt.files = Dir.glob(File.join('app', '**', '*.rb')) +
Dir.glob(File.join('lib', '*.rb')) +
Dir.glob(File.join('lib', '**', '*.rb'))
yt.options = ['--output-dir', 'rdoc', '--readme', 'README.md', '--files', 'LICENSE',
'--protected', '--private', '--title', 'Triannon', '--exclude', 'triannon_vocab']
end
rescue LoadError
desc "Generate RDoc with YARD"
task :generate do
abort "Please install the YARD gem to generate rdoc."
end
end
desc "Remove generated documenation"
task :clean do
rm_r 'rdoc' if File.exist?('rdoc')
end
end
Bundler::GemHelper.install_tasks