guard-entangle 0.0.4.1 → 0.0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/guard/entangle.rb +3 -0
- data/lib/guard/entangle/formatter.rb +2 -0
- data/lib/guard/entangle/runner.rb +2 -0
- data/lib/guard/entangle/version.rb +3 -1
- data/lib/guard/entangle/writer.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be417ef07044a8d64a731882eac29df80e945be5
|
4
|
+
data.tar.gz: d109d654fb824aba8d57872aa7db0b715b476c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02d10da20469321575ddc6a89767dfa624f63ccf259b6be26b54ac318dd9ecf1665a03f365c61854d7a82d6601f78318eda2f55f4112624f27b3bc9c97dafe20
|
7
|
+
data.tar.gz: ed7f00dea3251cf283665ad85f8ad593fc886a267987e8386f50855a23784927e10b5753a25595e4038d24a444192a829e0f6dd7c20d7b68f0273ccc9bfc8580
|
data/README.md
CHANGED
@@ -93,6 +93,7 @@ The options that can be passed are
|
|
93
93
|
* :uglify = If js files should be uglified
|
94
94
|
* :all_on_start = If all files should be engtangled when guard has started
|
95
95
|
* :uglifier_options = {} Pass a Hash of any [uglifier options](https://github.com/lautis/uglifier)
|
96
|
+
* :force_utf8 = Default is false. If content should be forced to UTF-8 before uglifying
|
96
97
|
* :copy = Saves a copy of the non uglified file along with the min file
|
97
98
|
|
98
99
|
## Contributing
|
data/lib/guard/entangle.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'guard'
|
2
4
|
require 'guard/plugin'
|
3
5
|
|
@@ -14,6 +16,7 @@ module Guard
|
|
14
16
|
:all_on_start => false,
|
15
17
|
:hide_success => false,
|
16
18
|
:uglifier_options => {},
|
19
|
+
:force_utf8 => false,
|
17
20
|
:copy => true #save a copy of the original file
|
18
21
|
}
|
19
22
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'uglifier'
|
2
4
|
require 'guard/entangle/formatter'
|
3
5
|
|
@@ -60,6 +62,10 @@ module Guard
|
|
60
62
|
if File.extname(path) == '.js'
|
61
63
|
min = path.gsub(/\.[^.]+$/, '.min.js')
|
62
64
|
begin
|
65
|
+
if (options[:force_utf8])
|
66
|
+
content.encoding
|
67
|
+
content.force_encoding 'utf-8'
|
68
|
+
end
|
63
69
|
uglify = Uglifier.new(options[:uglifier_options]).compile(content)
|
64
70
|
save(uglify, min)
|
65
71
|
rescue Exception => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-entangle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.4.
|
4
|
+
version: 0.0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Deshi Rahim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|