jekyll-sass-converter 1.3.0 → 1.4.0

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: 5e214a22000c306efb48b4912d4c7b6e9d78990a
4
- data.tar.gz: 08c40d1cfb885f62ba399078cc3cbba2407dcf86
3
+ metadata.gz: 71288fcd81a667822653dc71bd95ccedd9be0428
4
+ data.tar.gz: 71e8375de0f5aa7795850292b905c079a33054ba
5
5
  SHA512:
6
- metadata.gz: 543425ee1744268bf5999cae33e8faca593181b99b4b90f098751f3803a68d570d1ea6476821ed67886bc12b49a4908fdc2d65ed84c96c6602c4d7cb0c4d3dad
7
- data.tar.gz: 6ccb8315e233073715dd970ad7076a18de04d370130e606b2136df72e22ce202c09226e6fbcb74c28b20a38f5040ec85cb7829165857e9641b354d2cac22a798
6
+ metadata.gz: 0cc730a8eac61db90a74430bf0c0d865b580262bd19e2d0697fb66b0edb2bc704c10ec2996dbb7db826e1485223e5cda882434e92ad564a02bbee3ef252ea060
7
+ data.tar.gz: fee08ad83bd90778f43e144e48775ea00594d820c8e78f435f9f14eed19fb9584f9d41497e5217d4184cc51d1c05501b42ab07dc8a14131c077ceca975371163
@@ -1,3 +1,3 @@
1
1
  module JekyllSassConverter
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -1,9 +1,12 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'sass'
2
4
  require 'jekyll/utils'
3
5
 
4
6
  module Jekyll
5
7
  module Converters
6
8
  class Scss < Converter
9
+ BYTE_ORDER_MARK = /^\xEF\xBB\xBF/
7
10
  SyntaxError = Class.new(ArgumentError)
8
11
 
9
12
  safe true
@@ -83,6 +86,10 @@ module Jekyll
83
86
  !safe?
84
87
  end
85
88
 
89
+ def add_charset?
90
+ !!jekyll_sass_configuration["add_charset"]
91
+ end
92
+
86
93
  def sass_configs
87
94
  sass_build_configuration_options({
88
95
  "syntax" => syntax,
@@ -92,7 +99,9 @@ module Jekyll
92
99
  end
93
100
 
94
101
  def convert(content)
95
- ::Sass.compile(content, sass_configs)
102
+ output = ::Sass.compile(content, sass_configs)
103
+ replacement = add_charset? ? '@charset "UTF-8";' : ''
104
+ output.sub(BYTE_ORDER_MARK, replacement)
96
105
  rescue ::Sass::SyntaxError => e
97
106
  raise SyntaxError.new("#{e.to_s} on line #{e.sass_line}")
98
107
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-sass-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-08 00:00:00.000000000 Z
11
+ date: 2015-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '3.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '3.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,14 +70,14 @@ dependencies:
70
70
  name: jekyll
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '2.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '2.0'
83
83
  description:
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  version: '0'
112
112
  requirements: []
113
113
  rubyforge_project:
114
- rubygems_version: 2.2.2
114
+ rubygems_version: 2.2.5
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: A basic Sass converter for Jekyll.