Sha256: 044e62bacd05f8cada3ca39b4c2be3fa7f1c1a2502d53783d23fa0dcc3af7d15
Contents?: true
Size: 448 Bytes
Versions: 1
Compression:
Stored size: 448 Bytes
Contents
require 'uglifier' require 'pad_utils' require_relative 'config_reader' module Jshandler def self.minify_js js_path = ConfigReader.options[:js_path] Dir["#{js_path}/*.js"].each do |file| unless file.include? '.min.js' jsmin = Uglifier.new.compile(File.read(file)) File.write(name_min_file(file), jsmin) end end end def self.name_min_file(file) file.gsub(/(.*)(.js)(.*)/, '\1.min.js\3') end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
qbuild-0.1.0.pre1 | lib/qbuild/jshandler.rb |