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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a78c4042069543504046019138cdd47c392e5678
4
- data.tar.gz: 1d4e24e15a908d05e413ffd7f1b45f74c15f46f1
3
+ metadata.gz: be417ef07044a8d64a731882eac29df80e945be5
4
+ data.tar.gz: d109d654fb824aba8d57872aa7db0b715b476c07
5
5
  SHA512:
6
- metadata.gz: 42b3b1a5f58e70b59d5da39a747ca9c820961318e0bc1fd544f5097f91963b97a6bb33c5337a336729b0d29b3725a847c3ff1e907437487114a8990d9a58236f
7
- data.tar.gz: 69926678c9b4ec47812794938f8f4ed0b9f9ec3c1a64393b58a941251b65a47acb4f614993460b6b007d8db7f72436c6c7cf215c213cc087939790d127177a24
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
@@ -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
  module Guard
2
4
  class Entangle
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'guard/entangle/entangler'
2
4
  require 'guard/entangle/formatter'
3
5
  require 'guard/entangle/writer'
@@ -1,5 +1,7 @@
1
+ # encoding: utf-8
2
+
1
3
  module Guard
2
4
  class EntangleVersion
3
- VERSION = "0.0.4.1"
5
+ VERSION = "0.0.4.2"
4
6
  end
5
7
  end
@@ -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.1
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-12 00:00:00.000000000 Z
11
+ date: 2014-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard