2012-02-28 08:08:41 +08:00
|
|
|
namespace :css do
|
2013-03-20 00:58:55 +08:00
|
|
|
desc "Generate styleguide"
|
|
|
|
task :styleguide do
|
|
|
|
puts "--> creating styleguide"
|
2016-02-11 03:03:42 +08:00
|
|
|
system('bin/dress_code config/styleguide.yml')
|
2015-07-02 01:39:42 +08:00
|
|
|
raise "error running dress_code" unless $?.success?
|
2013-03-20 00:58:55 +08:00
|
|
|
end
|
2016-06-28 01:03:19 +08:00
|
|
|
|
|
|
|
task :compile do
|
2017-09-28 07:22:53 +08:00
|
|
|
# try to get a conection to the database so we can do the brand_configs:write below
|
|
|
|
require 'config/environment' rescue nil
|
2017-10-29 00:15:39 +08:00
|
|
|
require 'config/initializers/plugin_symlinks'
|
2017-10-09 23:48:23 +08:00
|
|
|
require 'config/initializers/revved_asset_urls'
|
2016-06-28 01:03:19 +08:00
|
|
|
require 'lib/brandable_css'
|
2017-09-26 07:19:15 +08:00
|
|
|
puts "--> Starting: 'css:compile'"
|
2017-08-10 01:25:10 +08:00
|
|
|
time = Benchmark.realtime do
|
|
|
|
if (BrandConfig.table_exists? rescue false)
|
|
|
|
Rake::Task['brand_configs:write'].invoke
|
|
|
|
else
|
|
|
|
puts "--> no DB connection, skipping generation of brand_config files"
|
|
|
|
end
|
|
|
|
BrandableCSS.save_default_files!
|
2017-09-26 07:19:15 +08:00
|
|
|
raise "error running brandable_css" unless system('yarn run build:css')
|
2017-08-10 01:25:10 +08:00
|
|
|
end
|
2017-09-26 07:19:15 +08:00
|
|
|
puts "--> Finished: 'css:compile' in #{time}"
|
2016-06-28 01:03:19 +08:00
|
|
|
end
|
2012-02-28 08:08:41 +08:00
|
|
|
end
|