uglifier 2.6.1 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of uglifier might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -1
- data/lib/uglifier.rb +1 -1
- data/lib/uglifier/version.rb +1 -1
- data/spec/uglifier_spec.rb +9 -0
- data/uglifier.gemspec +3 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb026fa4f1d075fee10aa54bc2e86f50bc688cfb
|
4
|
+
data.tar.gz: 52bf135ebd2d66a0bb0041908df6c88b0572f966
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56a67dd0bb264a5a0ecc863bb775d9fe5e559712c958cca43cd829d3461286f27d639d54efa8764b16de11067efeb8394ae6e3f4abffae563b6418f5180e8798
|
7
|
+
data.tar.gz: c01510deda6fb3fbf9816e2572edbbffd9808a13691d0e0ee7f55b8f1a6c8acb29f57d47e2b2c98833110524be4d39a9d41897fb3868e7f34038817614bcf25e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -45,7 +45,7 @@ Available options and their defaults are
|
|
45
45
|
{
|
46
46
|
:output => {
|
47
47
|
:ascii_only => true, # Escape non-ASCII characters
|
48
|
-
:comments => :copyright, # Preserve comments (:all, :jsdoc, :copyright, :none)
|
48
|
+
:comments => :copyright, # Preserve comments (:all, :jsdoc, :copyright, :none, Regexp (see below))
|
49
49
|
:inline_script => false, # Escape occurrences of </script in strings
|
50
50
|
:quote_keys => false, # Quote keys in object literals
|
51
51
|
:max_line_len => 32 * 1024, # Maximum line length in minified code
|
@@ -101,6 +101,18 @@ Available options and their defaults are
|
|
101
101
|
}
|
102
102
|
```
|
103
103
|
|
104
|
+
When passing a regular expression to the output => comments option, be sure to pass a valid Ruby Regexp.
|
105
|
+
The beginning and ending of comments are removed and cannot be matched (/*, */, //). For example:
|
106
|
+
When matching
|
107
|
+
|
108
|
+
```
|
109
|
+
/*!
|
110
|
+
* comment
|
111
|
+
*/
|
112
|
+
```
|
113
|
+
|
114
|
+
use `Uglifier.new(output: {comments: /^!/})`.
|
115
|
+
|
104
116
|
## Development
|
105
117
|
|
106
118
|
Tests are run using
|
data/lib/uglifier.rb
CHANGED
data/lib/uglifier/version.rb
CHANGED
data/spec/uglifier_spec.rb
CHANGED
@@ -60,8 +60,11 @@ describe "Uglifier" do
|
|
60
60
|
/* @preserve Copyright Notice */
|
61
61
|
/* (c) 2011 */
|
62
62
|
// INCLUDED
|
63
|
+
//! BANG
|
63
64
|
function identity(p) { return p; }
|
64
65
|
/* Another Copyright */
|
66
|
+
/*! Another Bang */
|
67
|
+
// A comment!
|
65
68
|
function add(a, b) { return a + b; }
|
66
69
|
EOS
|
67
70
|
end
|
@@ -79,8 +82,14 @@ describe "Uglifier" do
|
|
79
82
|
expect(subject).to match(/Another Copyright/)
|
80
83
|
end
|
81
84
|
|
85
|
+
it "preserves comments that start with a bang (!)" do
|
86
|
+
expect(subject).to match(/! BANG/)
|
87
|
+
expect(subject).to match(/! Another Bang/)
|
88
|
+
end
|
89
|
+
|
82
90
|
it "ignores other comments" do
|
83
91
|
expect(subject).not_to match(/INCLUDED/)
|
92
|
+
expect(subject).not_to match(/A comment!/)
|
84
93
|
end
|
85
94
|
end
|
86
95
|
|
data/uglifier.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uglifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ville Lautanala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|
@@ -117,6 +117,8 @@ extensions: []
|
|
117
117
|
extra_rdoc_files:
|
118
118
|
- LICENSE.txt
|
119
119
|
- README.md
|
120
|
+
- CHANGELOG.md
|
121
|
+
- CONTRIBUTING.md
|
120
122
|
files:
|
121
123
|
- ".document"
|
122
124
|
- ".gitignore"
|