This repository has been archived by the owner on Jan 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Rakefile
68 lines (57 loc) · 1.61 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
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'push_type/version'
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'PushType'
rdoc.options << '--line-numbers'
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('{core,admin,auth}/{app,lib}/**/*.rb')
end
Bundler::GemHelper.install_tasks
task default: :test
PUSH_TYPE_LIBS = %w(core api admin auth)
desc "Runs all tests in all PushType engines"
task :test do
ENV['RAILS_ENV'] = ENV['PUSH_TYPE_ENV'] = 'test'
PUSH_TYPE_LIBS.each do |dir|
Dir.chdir dir do
system 'bundle exec rake test_app'
system 'bundle exec rake test' or exit(1)
end
end
end
namespace :gems do
desc "Build all PushType engine gems"
task :build do
Rake::Task['build'].invoke
PUSH_TYPE_LIBS.each do |dir|
Dir.chdir dir do
system 'bundle exec rake build'
system 'mv pkg/* ../pkg && rm -r pkg'
end
end
end
desc "Remove all PushType engines from pkg/"
task :clean do
puts 'Deleting gems from pkg/'
system 'rm pkg/*'
end
desc "Install all PushType engines into system gems"
task :install do
Rake::Task['gems:build'].invoke
gem_paths = Dir["pkg/push_type*-#{ PushType::VERSION }.gem"]
system "gem install #{ gem_paths.join(' ') }"
end
desc "Install all PushType engines into system gems"
task :release do
Rake::Task['gems:build'].invoke
Dir["pkg/push_type*-#{ PushType::VERSION }.gem"].each do |gem_path|
system "gem push #{ gem_path }"
end
end
end