-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
66 lines (54 loc) · 1.7 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
# frozen_string_literal: true
require 'rubygems'
require 'bundler/setup'
require 'rspec/core/rake_task'
require 'yard'
require_relative './codeclimate/export-coverage'
require 'bundler/gem_tasks'
require 'rubocop/rake_task'
task default: [:spec, :yard, 'coverage:format']
# task default: :rubocop
desc 'Export to single file'
task :buildfile do
result = ''
main = File.read('lib/felecs.rb')
tmp = main.lines(chomp: true).select do |line|
line.include? 'require_relative '
end
tmp.each do |file|
file.delete_prefix!('require_relative ')
result += "#{File.read("lib/#{file[1, file.length - 2]}.rb")}\n"
end
result += main.lines.reject do |line|
line.include? 'require_relative '
end.join
`mkdir pkg`
File.write('pkg/felecs.rb', result)
File.write('mrbgem/mrblib/felecs.rb', result)
end
RuboCop::RakeTask.new
namespace :coverage do
desc 'format coverage so it can be exported to codeclimate'
task :format do
ReportCoverage.format
end
desc 'upload coverage using your key'
task :upload do
ReportCoverage.upload
end
end
YARD::Rake::YardocTask.new do |t|
t.files = ['lib/felecs.rb', 'lib/felecs/*'] # ['system_manager.rb', 'component_manager.rb', 'entity_manager.rb', 'scene_manager.rb', 'stage_manager.rb', 'felecs.rb']
t.options = ['--output-dir', './docs', 'yardoc --markup=markdown|textile|rdoc(default)']
t.stats_options = ['--list-undoc']
end
# Rake::TestTask.new do |t|
# t.pattern = "tests/**/*_test.rb"
# end
RSpec::Core::RakeTask.new :spec
# For installing FelPacks
# Gem::Specification.find_all.each do |a_gem|
# next unless a_gem.name.include? 'felpack-'
#
# Dir.glob("#{a_gem.gem_dir}/lib/#{a_gem.name.gsub('-', '/')}/tasks/*.rake").each { |r| load r }
# end