terser 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +95 -20
- data/.travis.yml +2 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/LICENSE.txt +3 -3
- data/Rakefile +1 -1
- data/lib/terser.rb +6 -6
- data/lib/terser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79d0688a70b6f77b0e45737ae90c958734d11080febb1f80887ed9a535ede05
|
4
|
+
data.tar.gz: 733c3240a15b13ca63b4761bd275cd8e223712fee89f2c3b0713221414e92d6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d1c473588c4428de591ad2fd0aa59e39dfcf2fd7d98ab935ce9055393abf386940e49f65e39c8b0a1f07151302c80e6b7ae9245c139ffc1f0843d240c928dc2
|
7
|
+
data.tar.gz: 8aabca2f15a1127158edc010b51b7514531ce66364ba0d610e19163e1810644fe1b39114dae86b5642cd68578759a74d1705531420021095d3b406d12783ef9b
|
data/.rubocop.yml
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisplayCopNames: true
|
3
|
-
TargetRubyVersion: 2.
|
3
|
+
TargetRubyVersion: 2.5
|
4
4
|
Exclude:
|
5
|
-
-
|
6
|
-
- lib/
|
5
|
+
- terser.gemspec
|
6
|
+
- lib/terser/version.rb
|
7
7
|
- "vendor/**/*"
|
8
8
|
- "benchmark/*"
|
9
9
|
- "gemfiles/vendor/**/*"
|
@@ -18,55 +18,130 @@ Metrics/BlockLength:
|
|
18
18
|
|
19
19
|
Metrics/ClassLength:
|
20
20
|
Enabled: false
|
21
|
-
|
22
21
|
Layout/LineLength:
|
23
22
|
Max: 150
|
24
|
-
|
25
23
|
Metrics/MethodLength:
|
26
24
|
Max: 20
|
27
|
-
|
28
25
|
Style/Encoding:
|
29
26
|
Enabled: false
|
30
|
-
|
31
27
|
Style/HashSyntax:
|
32
28
|
EnforcedStyle: hash_rockets
|
33
|
-
|
34
29
|
Style/PercentLiteralDelimiters:
|
35
30
|
Enabled: false
|
36
|
-
|
37
31
|
Style/PreferredHashMethods:
|
38
32
|
Enabled: false
|
39
|
-
|
40
33
|
Style/SignalException:
|
41
34
|
Enabled: false
|
42
|
-
|
43
35
|
Style/StringLiterals:
|
44
36
|
Enabled: false
|
45
|
-
|
46
37
|
Style/SymbolArray:
|
47
38
|
Enabled: false
|
48
|
-
|
49
39
|
Style/Alias:
|
50
40
|
Enabled: false
|
51
|
-
|
52
41
|
Style/MutableConstant:
|
53
42
|
Enabled: false
|
54
|
-
|
55
43
|
Style/ExpandPathArguments:
|
56
44
|
Enabled: false
|
57
|
-
|
58
45
|
Lint/RaiseException:
|
59
46
|
Enabled: true
|
60
|
-
|
61
47
|
Lint/StructNewOverride:
|
62
48
|
Enabled: true
|
63
|
-
|
64
49
|
Style/HashEachMethods:
|
65
50
|
Enabled: true
|
66
|
-
|
67
51
|
Style/HashTransformKeys:
|
68
52
|
Enabled: true
|
69
|
-
|
70
53
|
Style/HashTransformValues:
|
71
54
|
Enabled: true
|
55
|
+
Layout/BeginEndAlignment:
|
56
|
+
Enabled: true
|
57
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
58
|
+
Enabled: true
|
59
|
+
Layout/SpaceAroundMethodCallOperator:
|
60
|
+
Enabled: true
|
61
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
62
|
+
Enabled: true
|
63
|
+
Lint/ConstantDefinitionInBlock:
|
64
|
+
Enabled: true
|
65
|
+
Lint/DeprecatedOpenSSLConstant:
|
66
|
+
Enabled: true
|
67
|
+
Lint/DuplicateElsifCondition:
|
68
|
+
Enabled: true
|
69
|
+
Lint/DuplicateRequire:
|
70
|
+
Enabled: true
|
71
|
+
Lint/DuplicateRescueException:
|
72
|
+
Enabled: true
|
73
|
+
Lint/EmptyConditionalBody:
|
74
|
+
Enabled: true
|
75
|
+
Lint/EmptyFile:
|
76
|
+
Enabled: true
|
77
|
+
Lint/FloatComparison:
|
78
|
+
Enabled: true
|
79
|
+
Lint/HashCompareByIdentity:
|
80
|
+
Enabled: true
|
81
|
+
Lint/IdentityComparison:
|
82
|
+
Enabled: true
|
83
|
+
Lint/MissingSuper:
|
84
|
+
Enabled: true
|
85
|
+
Lint/MixedRegexpCaptureTypes:
|
86
|
+
Enabled: true
|
87
|
+
Lint/OutOfRangeRegexpRef:
|
88
|
+
Enabled: true
|
89
|
+
Lint/RedundantSafeNavigation:
|
90
|
+
Enabled: true
|
91
|
+
Lint/SelfAssignment:
|
92
|
+
Enabled: true
|
93
|
+
Lint/TopLevelReturnWithArgument:
|
94
|
+
Enabled: true
|
95
|
+
Lint/TrailingCommaInAttributeDeclaration:
|
96
|
+
Enabled: true
|
97
|
+
Lint/UnreachableLoop:
|
98
|
+
Enabled: true
|
99
|
+
Lint/UselessMethodDefinition:
|
100
|
+
Enabled: true
|
101
|
+
Lint/UselessTimes:
|
102
|
+
Enabled: true
|
103
|
+
Style/AccessorGrouping:
|
104
|
+
Enabled: true
|
105
|
+
Style/BisectedAttrAccessor:
|
106
|
+
Enabled: true
|
107
|
+
Style/CaseLikeIf:
|
108
|
+
Enabled: true
|
109
|
+
Style/ClassEqualityComparison:
|
110
|
+
Enabled: true
|
111
|
+
Style/CombinableLoops:
|
112
|
+
Enabled: true
|
113
|
+
Style/ExplicitBlockArgument:
|
114
|
+
Enabled: true
|
115
|
+
Style/ExponentialNotation:
|
116
|
+
Enabled: true
|
117
|
+
Style/GlobalStdStream:
|
118
|
+
Enabled: true
|
119
|
+
Style/HashAsLastArrayItem:
|
120
|
+
Enabled: true
|
121
|
+
Style/HashLikeCase:
|
122
|
+
Enabled: true
|
123
|
+
Style/KeywordParametersOrder:
|
124
|
+
Enabled: true
|
125
|
+
Style/OptionalBooleanParameter:
|
126
|
+
Enabled: true
|
127
|
+
Style/RedundantAssignment:
|
128
|
+
Enabled: true
|
129
|
+
Style/RedundantFetchBlock:
|
130
|
+
Enabled: true
|
131
|
+
Style/RedundantFileExtensionInRequire:
|
132
|
+
Enabled: true
|
133
|
+
Style/RedundantRegexpCharacterClass:
|
134
|
+
Enabled: true
|
135
|
+
Style/RedundantRegexpEscape:
|
136
|
+
Enabled: true
|
137
|
+
Style/RedundantSelfAssignment:
|
138
|
+
Enabled: true
|
139
|
+
Style/SingleArgumentDig:
|
140
|
+
Enabled: true
|
141
|
+
Style/SlicingWithRange:
|
142
|
+
Enabled: true
|
143
|
+
Style/SoleNestedConditional:
|
144
|
+
Enabled: true
|
145
|
+
Style/StringConcatenation:
|
146
|
+
Enabled: true
|
72
147
|
|
data/.travis.yml
CHANGED
@@ -9,6 +9,7 @@ rvm:
|
|
9
9
|
- jruby-head
|
10
10
|
- jruby-9.2.12.0
|
11
11
|
- truffleruby
|
12
|
+
- truffleruby-head
|
12
13
|
before_install:
|
13
14
|
- gem install bundler -v 1.17.3
|
14
15
|
git:
|
@@ -23,4 +24,5 @@ matrix:
|
|
23
24
|
- rvm: ruby-head
|
24
25
|
- rvm: truffleruby
|
25
26
|
- rvm: jruby-head
|
27
|
+
- rvm: truffleruby-head
|
26
28
|
fast_finish: true
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2020 Pavel
|
3
|
+
Copyright (c) 2020 Pavel Rosický
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -77,7 +77,7 @@ https://github.com/mishoo/UglifyJS
|
|
77
77
|
disclaimer in the documentation and/or other materials
|
78
78
|
provided with the distribution.
|
79
79
|
|
80
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER
|
80
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
|
81
81
|
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
82
82
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
83
83
|
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
|
@@ -90,4 +90,4 @@ https://github.com/mishoo/UglifyJS
|
|
90
90
|
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
91
91
|
SUCH DAMAGE.
|
92
92
|
|
93
|
-
***********************************************************************/
|
93
|
+
***********************************************************************/
|
data/Rakefile
CHANGED
data/lib/terser.rb
CHANGED
@@ -143,9 +143,9 @@ class Terser
|
|
143
143
|
#
|
144
144
|
# @param options [Hash] optional overrides to +Terser::DEFAULTS+
|
145
145
|
def initialize(options = {})
|
146
|
-
|
147
|
-
|
148
|
-
|
146
|
+
missing = options.keys - DEFAULTS.keys - EXTRA_OPTIONS
|
147
|
+
raise ArgumentError, "Invalid option: #{missing.first}" if missing.any?
|
148
|
+
|
149
149
|
@options = options
|
150
150
|
end
|
151
151
|
|
@@ -195,8 +195,8 @@ class Terser
|
|
195
195
|
return '' unless source_map_options[:source_map].respond_to?(:[])
|
196
196
|
|
197
197
|
suffix = ''
|
198
|
-
suffix += "\n//# sourceMappingURL
|
199
|
-
suffix += "\n//# sourceURL
|
198
|
+
suffix += "\n//# sourceMappingURL=#{source_map_options[:source_map][:map_url]}" if source_map_options[:source_map][:map_url]
|
199
|
+
suffix += "\n//# sourceURL=#{source_map_options[:source_map][:url]}" if source_map_options[:source_map][:url]
|
200
200
|
suffix
|
201
201
|
end
|
202
202
|
|
@@ -432,7 +432,7 @@ class Terser
|
|
432
432
|
def enclose_options
|
433
433
|
if @options[:enclose]
|
434
434
|
@options[:enclose].map do |pair|
|
435
|
-
pair.first
|
435
|
+
"#{pair.first}:#{pair.last}"
|
436
436
|
end
|
437
437
|
else
|
438
438
|
false
|
data/lib/terser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: terser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Rosicky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: execjs
|