squoosh 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/squoosh.rb +3 -5
- data/lib/squoosh/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65d794e4fa97573f5ffe9fbc8339df1fcd8ef91908d743be565345a0e5a7b92f
|
4
|
+
data.tar.gz: 857fb11296b5e4a3989a06d660e44a4c6536780f21d85092e2ab5b11f82bcceb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6487482bb47b8c43b7215ca3d901128fe39abc33044c7ac9cd0d8b2b9f09ac90f9b9ff1d7750bea6ea907b31c4044b0c05e19231871bb9306cb54b508de0dd34
|
7
|
+
data.tar.gz: 3693641100489cc0128c5f0569eca44607ddac2c126b265b0a837653b6e847e04887034dea3a648049a3841e8d6e368f9d628e375b16eb33c22402328c42d0b2
|
data/README.md
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
Minifies HTML, JavaScript, and CSS, including inline JavaScript and CSS.
|
4
4
|
|
5
|
+
[](https://travis-ci.org/stevecheckoway/squoosh)
|
7
|
+
|
5
8
|
CSS minification is handled by [Sass](http://www.rubydoc.info/gems/sass)
|
6
9
|
whereas JavaScript minification is handled by
|
7
10
|
[Uglifier](http://www.rubydoc.info/gems/uglifier) which requires node.js.
|
@@ -50,6 +53,9 @@ Or install it yourself as:
|
|
50
53
|
|
51
54
|
## Usage
|
52
55
|
|
56
|
+
You can read the documentation
|
57
|
+
[here](https://www.rubydoc.info/github/stevecheckoway/squoosh/v0.2.0).
|
58
|
+
|
53
59
|
The three basic minification functions are
|
54
60
|
|
55
61
|
- `Squoosh::minify_html`
|
data/lib/squoosh.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'squoosh/version'
|
4
4
|
require 'nokogumbo'
|
5
|
-
require '
|
5
|
+
require 'sassc'
|
6
6
|
require 'set'
|
7
7
|
require 'uglifier'
|
8
8
|
|
@@ -44,8 +44,7 @@ module Squoosh
|
|
44
44
|
# * ++uglifier_options++ Options to pass to
|
45
45
|
# {https://www.rubydoc.info/gems/uglifier Uglifier}
|
46
46
|
# * ++sass_options++ Options to pass to
|
47
|
-
# {
|
48
|
-
# Sass}
|
47
|
+
# {https://github.com/sass/sassc-ruby#readme Sassc}
|
49
48
|
DEFAULT_OPTIONS = {
|
50
49
|
remove_comments: true,
|
51
50
|
omit_tags: true,
|
@@ -102,8 +101,7 @@ module Squoosh
|
|
102
101
|
# @return [String] the minified CSS
|
103
102
|
def minify_css(content)
|
104
103
|
@css_cache[content] ||= begin
|
105
|
-
root =
|
106
|
-
root.options = @options[:sass_options]
|
104
|
+
root = SassC::Engine.new(content, @options[:sass_options])
|
107
105
|
root.render.rstrip
|
108
106
|
end
|
109
107
|
end
|
data/lib/squoosh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: squoosh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Checkoway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -109,19 +109,19 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '2.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: sassc
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '2.0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '2.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: uglifier
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -170,8 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- !ruby/object:Gem::Version
|
171
171
|
version: '0'
|
172
172
|
requirements: []
|
173
|
-
|
174
|
-
rubygems_version: 2.7.7
|
173
|
+
rubygems_version: 3.0.3
|
175
174
|
signing_key:
|
176
175
|
specification_version: 4
|
177
176
|
summary: Minify HTML/CSS/JavaScript files.
|