SassyExport 1.3.0 → 1.3.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/SassyExport.rb +6 -3
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 209b92c58f8a66df4c8200ab402b9d3b7269cca3
4
- data.tar.gz: 41915122116682b4a85deff0d33bf8f35aa1acf7
3
+ metadata.gz: 875b72084fad3d502ad40961e06d1f9988557ea0
4
+ data.tar.gz: ab9a9c200b55347db06b0178ab6fb93fe884b6f9
5
5
  SHA512:
6
- metadata.gz: e9cb0a58d571f571afb7a7c47c43de9fb4cee2ee9d85ba6f5ff8b6860c6ddf8aeafa30e1ad2f12a58fc42fd36c0c85383b3d86b96c1450718dce99c4c249a94a
7
- data.tar.gz: 5cd16df1d381401af1494a59279e614c8aaf4eddb52b57b0a0a633218e837131b48b04d3f1a551dd551dd24c199154d30a0d7e504b25e629cfb11c21dcdfddda
6
+ metadata.gz: 6e59df5bc10bee17f113dea3e6cb8a7ca98992be0cd5cd0cf883b82e41b57cb71cc570fa80a8f6121364dfba1ff905b9dd9ca2727ef575a3f6201b032c7a6766
7
+ data.tar.gz: 8b34a55e3a21ea95db205e992873f669175e9fab2696f27ea895c2e88a5ff4cf80422c192b684d6604f71d03b231cbcce1287cbd6b6c1fa916058ece94503ac1
data/README.md CHANGED
@@ -54,7 +54,7 @@ New JSON file is created at `./json/hello.json`. As you can see, `$path` is rela
54
54
 
55
55
  #### Breakdown
56
56
 
57
- The `SassyExport()` mixin takes a <directory>/<filename>.<ext> `$path` and a Sass `$map` as arguments. You can export straight to a Javascript object by using the extension `.js` instead of `.json`.
57
+ The `SassyExport()` mixin takes a \<directory\>/\<filename\>.\<ext\> `$path` and a Sass `$map` as arguments. You can export straight to a Javascript object by using the extension `.js` instead of `.json`.
58
58
  There are also optional arguments: `$pretty` which defaults to `false`, but will print pretty JSON (nicely indented) if set to `true`; and `$debug` which will print debug information if set to `true`.
59
59
 
60
60
  It converts the `$map` into either a JSON map or Javascript object through Ruby, then creates a new directory/file (or updates an existing directory/file), and writes the contents of the JSON string to it.
@@ -7,7 +7,7 @@ Compass::Frameworks.register('SassyExport', :path => extension_path)
7
7
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
8
8
  # Date is in the form of YYYY-MM-DD
9
9
  module SassyExport
10
- VERSION = "1.3.0"
10
+ VERSION = "1.3.1"
11
11
  DATE = "2014-07-24"
12
12
  end
13
13
 
@@ -145,12 +145,15 @@ module Sass::Script::Functions
145
145
  # if we're turning it straight to js put a variable name in front
146
146
  ext == '.js' ? json = "var " + filename + " = " + json : json = json
147
147
 
148
- # define flag
148
+ # define flags
149
149
  flag = 'w'
150
150
  flag = 'wb' if Sass::Util.windows? && options[:unix_newlines]
151
151
 
152
152
  # open file [create new file if file does not exist], write string to root/path/to/filename.json
153
- File.open("#{dir_path}", flag) { |f| f.write(json) }
153
+ File.open("#{dir_path}", flag) do |file|
154
+ file.set_encoding(json.encoding) unless Sass::Util.ruby1_8?
155
+ file.print(json)
156
+ end
154
157
 
155
158
  # define message
156
159
  debug_msg = "#{ext == '.json' ? 'JSON' : 'JavaScript'} was successfully exported to #{dir_path}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SassyExport
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezekiel Gabrielse