Sha256: a416a222877e305b7064cbbf89a73997ec8a28da26650a689f80f3bbe6f4595f
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 KB
Contents
# gem install vendorer # vendorer require 'zip' vendor_js = 'vendor/assets/javascripts/' vendor_css = 'vendor/assets/stylesheets/' vendor_img = 'vendor/assets/images/' vendor_tmp = 'vendor/assets/' def get to, form, rm = true FileUtils.rm to if rm && File.exist?(to) file to, form end def get_zip to, url get "#{to}.zip", url, false Zip::File.open("#{to}.zip").each do |f| f_path = File.join(to, f.name) FileUtils.mkdir_p File.dirname(f_path) f.extract(f_path) unless File.exist?(f_path) end end def cp_img to, from, clear = true FileUtils.mkdir_p to FileUtils.rm Dir.glob("#{to}/*") if clear Dir["#{from}/*"].select{ |f| /\.(eot|svg|ttf|woff|gif|png|jpe?g)$/ =~ f }.each do |f| FileUtils.cp f, "#{to}/#{File.basename f}" end end # jquery get "#{vendor_js}jquery/1.0.js", 'https://code.jquery.com/jquery-1.11.2.min.js' get "#{vendor_js}jquery/2.0.js", 'https://code.jquery.com/jquery-2.1.3.min.js' # jquery cookie get "#{vendor_js}jquery.cookie.js", 'https://rawgithub.com/carhartl/jquery-cookie/master/jquery.cookie.js' # jQuery-ujs get "#{vendor_js}jquery.ujs.js", 'https://raw.github.com/indirect/jquery-rails/master/vendor/assets/javascripts/jquery_ujs.js' list = `git grep -n sourceMappingURL`.split("\n") list.delete_at 0 list.each do |path| p path file = path[/^[^:]+/] line = path[/:[0-9]+/].gsub(':', '').to_i body = File.readlines(file) body.delete_at(line - 1) File.open(file, 'w') do |f| f.write body.join('') end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
h2ocube_rails_assets-0.3.0 | Vendorfile |
h2ocube_rails_assets-0.2.2 | Vendorfile |
h2ocube_rails_assets-0.2.1 | Vendorfile |