SassyExport 1.0.12 → 1.0.13
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.
- data/README.md +4 -3
- data/lib/SassyExport.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# SassyExport
|
1
|
+
# SassyExport [](http://badge.fury.io/rb/SassyExport)
|
2
2
|
|
3
3
|
SassyExport is a lightweight plugin for [SassyJSON](https://github.com/HugoGiraudel/SassyJSON) that allows you to export an encoded Sass map into an external JSON file. Use it anyway you like.
|
4
4
|
|
@@ -18,6 +18,7 @@ root
|
|
18
18
|
├── sass
|
19
19
|
│ ├── style.scss
|
20
20
|
└── json
|
21
|
+
config.rb
|
21
22
|
```
|
22
23
|
|
23
24
|
Sass,
|
@@ -35,12 +36,12 @@ $map: (
|
|
35
36
|
|
36
37
|
#### Result
|
37
38
|
|
38
|
-
New JSON file is created
|
39
|
+
New JSON file is created at `./json/hello.json`. As you can see, `$path` is relative to where your `config.rb` is located. Simply calling `@include SassyExport("/", "hello", $map)` will write to your directory root.
|
39
40
|
```json
|
40
41
|
{"hello": "world"}
|
41
42
|
```
|
42
43
|
|
43
|
-
|
44
|
+
#### Breakdown
|
44
45
|
|
45
46
|
The `json_export()` mixin takes a directory `$path`, `$filename`, and a Sass `$map` as arguments. It then converts the `$map` into a JSON map with SassyJSON's `json_encode()` function, then Ruby creates a new file (or updates an existing file), and writes the contents of the json string to it. I'm no Ruby expert, so if you belive that you could improve the small amount of code here, feel free to.
|
46
47
|
|
data/lib/SassyExport.rb
CHANGED
@@ -11,7 +11,7 @@ Compass::Frameworks.register('SassyExport', :path => extension_path)
|
|
11
11
|
# Version is a number. If a version contains alphas, it will be created as a prerelease version
|
12
12
|
# Date is in the form of YYYY-MM-DD
|
13
13
|
module SassyExport
|
14
|
-
VERSION = "1.0.
|
14
|
+
VERSION = "1.0.13"
|
15
15
|
DATE = "2014-05-31"
|
16
16
|
end
|
17
17
|
|
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.0.
|
4
|
+
version: 1.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,7 +27,8 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 1.1.7
|
30
|
-
description: SassyExport
|
30
|
+
description: SassyExport is a lightweight plugin for SassyJSON that allows you to
|
31
|
+
export an encoded Sass map into an external JSON file.
|
31
32
|
email:
|
32
33
|
- ezekg@yahoo.com
|
33
34
|
executables: []
|
@@ -62,6 +63,5 @@ rubyforge_project: SassyExport
|
|
62
63
|
rubygems_version: 1.8.28
|
63
64
|
signing_key:
|
64
65
|
specification_version: 3
|
65
|
-
summary: SassyExport
|
66
|
-
an encoded Sass map into an external JSON file.
|
66
|
+
summary: SassyExport allows you to export a Sass map into an external JSON file.
|
67
67
|
test_files: []
|