hyperbuild 0.0.28 → 0.0.37

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97f5a53d0edfa1c0d48de35b710be8a28720d531d5d103ac444c61a966d54945
4
- data.tar.gz: 34843de3acf3029b8ca4627b88a3cfcc7c16bc5db8505f909c8f22c9b24a1a4a
3
+ metadata.gz: 7b23b9c0aacb7a786afdf9c80453c9725810ff205db9de642a84384085a5e306
4
+ data.tar.gz: 8bfc69dba0c8ed40a6e399089a69bc46f1c5e2363a994d94e565b2ba397eb7de
5
5
  SHA512:
6
- metadata.gz: d6f894c0c4db260af124633733eabf6462f7034ee2306148dba7037b7d6b8a90454e1fb4777e0b98333207490ff060c756fe7c390fdf0f289b028ced43975ce5
7
- data.tar.gz: 6ec47700614cb897f1bab5bf23d5f7fa86cc4f4b56bd41d7e4d45fdd8adcf4542c1bd4a72d0ec8d7d56ce0253485dead9d60c617b19aacb62d93ce8138f9cfae
6
+ metadata.gz: 371fdf501b2e92993fc8c356d81c8bde4ea74320122a294fa848b56471db6e6bcbfff301032860a4f7d69c38ca4246eb7a8141a27d9a85338c395bc3309ac53b
7
+ data.tar.gz: 512b0672e6030bd8ba72be66b034978aec75a69950ef4c7141d5be5129de0bf7b45c147461c667d351f53293e28661fe4ea3f8621401fbb88a8893c28e332f7b
data/README.md CHANGED
@@ -17,7 +17,7 @@ Available as:
17
17
 
18
18
  Speed and effectiveness of Node.js version compared to [html-minfier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize). See [bench](./bench) folder for more details.
19
19
 
20
- <img width="435" alt="Chart showing speed of HTML minifiers" src="./bench/results/average-speeds.png"> <img width="435" alt="Chart showing effectiveness of HTML minifiers" src="./bench/results/average-sizes.png">
20
+ <img width="435" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/hyperbuild/bench/0.0.37/average-speeds.png"> <img width="435" alt="Chart showing effectiveness of HTML minifiers" src="https://wilsonl.in/hyperbuild/bench/0.0.37/average-sizes.png">
21
21
 
22
22
  ## Usage
23
23
 
@@ -25,9 +25,9 @@ Speed and effectiveness of Node.js version compared to [html-minfier](https://gi
25
25
 
26
26
  ##### Get
27
27
 
28
- [Windows](https://wilsonl.in/hyperbuild/bin/0.0.28-windows-x86_64.exe) |
29
- [macOS](https://wilsonl.in/hyperbuild/bin/0.0.28-macos-x86_64) |
30
- [Linux](https://wilsonl.in/hyperbuild/bin/0.0.28-linux-x86_64)
28
+ [Windows](https://wilsonl.in/hyperbuild/bin/0.0.37-windows-x86_64.exe) |
29
+ [macOS](https://wilsonl.in/hyperbuild/bin/0.0.37-macos-x86_64) |
30
+ [Linux](https://wilsonl.in/hyperbuild/bin/0.0.37-linux-x86_64)
31
31
 
32
32
  ##### Use
33
33
 
@@ -44,7 +44,7 @@ hyperbuild --src /path/to/src.html --out /path/to/output.min.html
44
44
 
45
45
  ```toml
46
46
  [dependencies]
47
- hyperbuild = "0.0.28"
47
+ hyperbuild = "0.0.37"
48
48
  ```
49
49
 
50
50
  ##### Use
@@ -99,11 +99,17 @@ hyperbuild is available via [JNI](https://github.com/jni-rs/jni-rs), and support
99
99
 
100
100
  ##### Get
101
101
 
102
- Download the [JAR](https://wilsonl.in/hyperbuild/bin/0.0.28.jar) file.
102
+ Add as a Maven dependency:
103
103
 
104
- ##### Use
104
+ ```xml
105
+ <dependency>
106
+ <groupId>in.wilsonl.hyperbuild</groupId>
107
+ <artifactId>hyperbuild</artifactId>
108
+ <version>0.0.37</version>
109
+ </dependency>
110
+ ```
105
111
 
106
- Make sure to add the JAR file to the class path.
112
+ ##### Use
107
113
 
108
114
  ```java
109
115
  import in.wilsonl.hyperbuild.Hyperbuild;
@@ -120,18 +126,14 @@ class Main {
120
126
  <details>
121
127
  <summary><strong>Python</strong></summary>
122
128
 
123
- hyperbuild is available as a [native module](https://github.com/PyO3/pyo3), and supports CPython (the default Python interpreter) versions 3.5 and higher.
129
+ hyperbuild is [on PyPI](https://pypi.org/project/hyperbuild), available as a [native module](https://github.com/PyO3/pyo3), and supports CPython (the default Python interpreter) versions 3.5 and higher.
124
130
 
125
131
  ##### Get
126
132
 
127
- Download the native module for [Windows](https://wilsonl.in/hyperbuild/bin/0.0.28-windows-x86_64-python.pyd), [macOS](https://wilsonl.in/hyperbuild/bin/0.0.28-macos-x86_64-python.so), or [Linux](https://wilsonl.in/hyperbuild/bin/0.0.28-linux-x86_64-python.so).
128
-
129
- Rename the file to `hyperbuild.pyd` on Windows or `hyperbuild.so` on macOS/Linux.
133
+ Add the PyPI project as a dependency and install it using `pip` or `pipenv`.
130
134
 
131
135
  ##### Use
132
136
 
133
- Make sure the native module can be [found by Python](https://docs.python.org/3/tutorial/modules.html#the-module-search-path). This is usually done by placing it into a folder declared in the `PYTHONPATH` environment variable or `sys.path` value, or the same folder as the script that will import it.
134
-
135
137
  ```python
136
138
  import hyperbuild
137
139
 
@@ -143,18 +145,18 @@ minified = hyperbuild.minify("<p> Hello, world! </p>")
143
145
  <details>
144
146
  <summary><strong>Ruby</strong></summary>
145
147
 
146
- hyperbuild is available as a [native module](https://github.com/danielpclark/rutie) for macOS and Linux, and supports Ruby versions 2.5 and higher.
148
+ hyperbuild is published on [RubyGems](https://rubygems.org/gems/hyperbuild), available as a [native module](https://github.com/danielpclark/rutie) for macOS and Linux, and supports Ruby versions 2.5 and higher.
147
149
 
148
150
  ##### Get
149
151
 
150
- Download and install the [gem](https://wilsonl.in/hyperbuild/bin/0.0.28.gem).
152
+ Add the library as a dependency to `Gemfile` or `*.gemspec`.
151
153
 
152
154
  ##### Use
153
155
 
154
156
  ```ruby
155
157
  require 'hyperbuild'
156
158
 
157
- print hyperbuild.minify "<p> Hello, world! </p>"
159
+ print Hyperbuild.minify "<p> Hello, world! </p>"
158
160
  ```
159
161
 
160
162
  </details>
@@ -363,10 +365,10 @@ Any entities in attribute values are decoded, and then the shortest representati
363
365
  - Single quoted, with any `'` encoded.
364
366
  - Unquoted, with `"`/`'` first character (if applicable), `>` last character (if applicable), and any whitespace encoded.
365
367
 
366
- `class` attributes have their whitespace (after any decoding) trimmed and collapsed.
368
+ `class` and `d` attributes have their whitespace (after any decoding) trimmed and collapsed.
367
369
 
368
370
  [Boolean attribute](./gen/attrs.json) values are removed.
369
- [Some attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
371
+ [Some other attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
370
372
 
371
373
  `type` attributes on `script` tags with a value equaling a [JavaScript MIME type](https://mimesniff.spec.whatwg.org/#javascript-mime-type) are removed.
372
374
 
@@ -378,10 +380,12 @@ Spaces are removed between attributes if possible.
378
380
 
379
381
  Entities are decoded if valid (see relevant parsing section) and their decoded characters as UTF-8 is shorter or equal in length.
380
382
 
381
- Numeric entities that do not refer to a valid Unicode Scalar Value are decoded to U+FFFD REPLACEMENT CHARACTER.
383
+ Numeric entities that do not refer to a valid [Unicode Scalar Value](https://www.unicode.org/glossary/#unicode_scalar_value) are replaced with the [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character).
382
384
 
383
385
  If an entity is unintentionally formed after decoding, the leading ampersand is encoded, e.g. `&&#97;&#109;&#112;;` becomes `&ampamp;`. This is done as `&amp` is equal to or shorter than all other entity representations of characters part of an entity (`[&#a-zA-Z0-9;]`), and there is no other conflicting entity name that starts with `amp`.
384
386
 
387
+ Right chevrons after any decoding in text are encoded to `&GT` if possible or `&GT;` otherwise.
388
+
385
389
  ### Comments
386
390
 
387
391
  Comments are removed.
@@ -398,7 +402,7 @@ hyperbuild simply does HTML minification, and almost does no syntax checking or
398
402
 
399
403
  For example, this means that it's not an error to have self-closing tags, declare multiple `<body>` elements, use incorrect attribute names and values, or write something like `<br>alert('');</br>`
400
404
 
401
- However, there are some syntax requirements for speed and sanity reasons.
405
+ However, there are some syntax requirements for speed and sanity.
402
406
 
403
407
  ### Tags
404
408
 
@@ -423,7 +427,7 @@ Numeric character references that do not reference a valid [Unicode Scalar Value
423
427
  Backticks (`` ` ``) are not valid quote marks and not interpreted as such.
424
428
  However, backticks are valid attribute value quotes in Internet Explorer.
425
429
 
426
- Special handling of some attributes require case sensitive names and values. For example, `CLASS` won't be recognised as an attribute to minify, and `type="Text/JavaScript"` on a `<script>` will cause the element to be parsed as a [data block](https://html.spec.whatwg.org/dev/scripting.html#data-block) instead of JavaScript code.
430
+ Special handling of some attributes require case sensitive names and values. For example, `CLASS` won't be recognised as an attribute to minify, and `type="Text/JavaScript"` on a `<script>` will not be removed.
427
431
 
428
432
  ### Script and style
429
433
 
@@ -433,6 +437,6 @@ hyperbuild does **not** handle [escaped and double-escaped](./notes/Script%20dat
433
437
 
434
438
  ## Issues and contributions
435
439
 
436
- Contributions welcome!
440
+ Pull requests and any contributions welcome!
437
441
 
438
- If hyperbuild did something unexpected, such as misunderstood some syntax, or incorrectly did/didn't do some minification, [raise an issue](https://github.com/wilsonzlin/hyperbuild/issues) with some relevant code that causes the issue.
442
+ If hyperbuild did something unexpected, misunderstood some syntax, or incorrectly kept/removed some code, [raise an issue](https://github.com/wilsonzlin/hyperbuild/issues) with some relevant code that can be used to reproduce and investigate the issue.
@@ -11,7 +11,7 @@ class HyperbuildLoader
11
11
  end
12
12
 
13
13
  def self.lib_path
14
- File.join(__dir__, operating_system)
14
+ File.join(__dir__, [operating_system, '-ruby', RUBY_VERSION.split('.')[0...-1].join('.')].join(''))
15
15
  end
16
16
  end
17
17
 
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hyperbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wilson Lin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-19 00:00:00.000000000 Z
11
+ date: 2020-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddle
@@ -33,8 +33,12 @@ extra_rdoc_files: []
33
33
  files:
34
34
  - README.md
35
35
  - lib/hyperbuild.rb
36
- - lib/linux
37
- - lib/macos
36
+ - lib/linux-ruby2.5
37
+ - lib/linux-ruby2.6
38
+ - lib/linux-ruby2.7
39
+ - lib/macos-ruby2.5
40
+ - lib/macos-ruby2.6
41
+ - lib/macos-ruby2.7
38
42
  homepage: https://github.com/wilsonzlin/hyperbuild
39
43
  licenses:
40
44
  - MIT
data/lib/macos DELETED
Binary file