squishy 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/htmlcompressor.jar +0 -0
- data/lib/squishy.rb +26 -0
- data/lib/yuicompressor.jar +0 -0
- metadata +48 -0
Binary file
|
data/lib/squishy.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
class Squishy
|
2
|
+
def self.squish(site_dir)
|
3
|
+
jar_file_path = File.join(File.dirname(__FILE__), *%w"htmlcompressor.jar")
|
4
|
+
puts "\nSquishing..."
|
5
|
+
html_options = [
|
6
|
+
'--type html', # squish html files
|
7
|
+
'--remove-intertag-spaces', # squish moar!
|
8
|
+
'--compress-js', # squish inline js (yui)
|
9
|
+
'--compress-css' # squish inline css (yui)
|
10
|
+
]
|
11
|
+
|
12
|
+
xml_options = [
|
13
|
+
'--type xml' # and squish xml files
|
14
|
+
]
|
15
|
+
|
16
|
+
options = [
|
17
|
+
"#{jar_file_path}", # path to squisher jar
|
18
|
+
'-r', # recursivly find and squish all files
|
19
|
+
"#{site_dir}", # the directory we read from
|
20
|
+
"-o #{site_dir}" # output directory
|
21
|
+
]
|
22
|
+
|
23
|
+
system("java -jar #{[options, html_options].flatten.join(' ')}")
|
24
|
+
system("java -jar #{[options, xml_options].flatten.join(' ')}")
|
25
|
+
end
|
26
|
+
end
|
Binary file
|
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: squishy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ryan Seys
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-10-02 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Squish your html and xml files
|
15
|
+
email: ryan@ryanseys.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- lib/squishy.rb
|
21
|
+
- lib/htmlcompressor.jar
|
22
|
+
- lib/yuicompressor.jar
|
23
|
+
homepage: http://rubygems.org/gems/squishy
|
24
|
+
licenses:
|
25
|
+
- MIT
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ! '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
36
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
requirements: []
|
43
|
+
rubyforge_project:
|
44
|
+
rubygems_version: 1.8.23
|
45
|
+
signing_key:
|
46
|
+
specification_version: 3
|
47
|
+
summary: Squish stuff!
|
48
|
+
test_files: []
|