SassyExport 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/SassyExport.rb +21 -4
  2. metadata +1 -1
data/lib/SassyExport.rb CHANGED
@@ -1,17 +1,34 @@
1
1
  # SassyExport is a lightweight plugin for SassyJSON
2
2
  # ----------------------------------------------------------------------------------------------------
3
- # @online https://github.com/HugoGiraudel/SassyJSON
3
+ # @dependency https://github.com/HugoGiraudel/SassyJSON
4
4
  # ----------------------------------------------------------------------------------------------------
5
5
 
6
6
  require "SassyJSON"
7
+
7
8
  extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
9
+ Compass::Frameworks.register('SassyExport', :path => extension_path)
10
+
11
+ # Monkey Path Sass
12
+ # Adapted from: https://github.com/chriseppstein/sass-css-importer
13
+ class Sass::Engine
14
+ alias initialize_without_json_exporter initialize
15
+
16
+ def initialize(template, options={})
17
+ initialize_without_json_exporter(template, options)
18
+
19
+ json_exporter = self.options[:load_paths].find {|lp| lp.is_a?(Sass::Exporters::JsonExporter) }
20
+
21
+ unless json_exporter
22
+ root = File.dirname(options[:filename] || ".")
23
+ self.options[:load_paths] << Sass::Exporters::JsonExporter.new(root)
24
+ end
25
+ end
26
+ end
8
27
 
9
28
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
10
29
  # Date is in the form of YYYY-MM-DD
11
- # ----------------------------------------------------------------------------------------------------
12
-
13
30
  module SassyExport
14
- VERSION = "1.0.6"
31
+ VERSION = "1.0.7"
15
32
  DATE = "2014-05-31"
16
33
  end
17
34
 
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.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: