./bin/cli/assets in lux-fw-0.1.17 vs ./bin/cli/assets in lux-fw-0.1.35
- old
+ new
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
+ENV['RACK_ENV'] = 'production'
+
if ARGV[0] == 'help'
puts 'lux assets rm gzip s3://assets'
puts ' rm - remove local cached folder for assets'
puts ' gzip - gzip files (for nginx)'
puts ' s3://path - copy files to bucket (must be last argument)'
@@ -13,20 +15,22 @@
system 'rm -rf ./public/assets'
end
require './config/application'
-assets = Dir['./app/assets/*/index.*'].map { |el| el.sub('./app/assets/','') }
+assets = Dir['./app/assets/**/index.*'].map { |el| el.sub('./app/assets/','') }
Lux.config.assets_precompile = true
speed = Lux.speed do
# tpool is not showing compile errors
# tpool(assets) do |file|
for file in assets
- asset = MiniAsset.create file
- asset.compile ARGV
- puts "Generated #{file.green} -> #{asset.production_file}"
+ assets = MiniAssets.new file
+
+ # asset = MiniAsset.create file
+ # asset.compile ARGV
+ puts "Generated #{file.green} -> #{assets.render}"
end
end
puts "Asset precomlile done in #{speed}"