Sha256: a0f36e1dc6ea4f7a979d0f1fd9458163e67d06715bcd4b06d9847260bd829472
Contents?: true
Size: 609 Bytes
Versions: 8
Compression:
Stored size: 609 Bytes
Contents
namespace :i18n do namespace :js do namespace :export do task :assets => [:environment] do require 'fileutils' Dir.glob(Rails.application.assets.paths.map { |path| File.join(path, "#{I18n::Js.config[:asset_path]}*") }) do |asset_path| asset = Rails.application.assets[asset_path] export_path = Rails.root.join('public', asset.logical_path) FileUtils.mkdir_p File.dirname(export_path) File.open(export_path, 'w') do |file| file.write(asset.to_a.map { |x| x.body }.join("\n")) end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems