-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
38 lines (29 loc) · 958 Bytes
/
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
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
require 'rubocop/rake_task'
RuboCop::RakeTask.new
task default: :spec
desc 'Update Library Files'
task :update_library_files do
puts 'Updating Library Files'
require 'fileutils'
lib_files = []
$:.each do |load_path|
if /topolys/.match(load_path)
lib_files = Dir.glob(File.join(load_path, 'topolys/*.rb'))
end
end
schema_files = Dir.glob(File.join(File.dirname(__FILE__), './lib/topolys_measures/schema/*.json'))
measure_resources = Dir.glob(File.join(File.dirname(__FILE__), './lib/measures/*/resources'))
schema_files.each do |schema_file|
measure_resources.each do |measure_resource|
FileUtils.cp(schema_file, "#{measure_resource}/.")
end
end
lib_files.each do |lib_file|
measure_resources.each do |measure_resource|
FileUtils.cp(lib_file, "#{measure_resource}/.")
end
end
end
task :spec => [:update_library_files]