jekyll-pants 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/jekyll-pants.gemspec +1 -1
- data/lib/jekyll/pants/filter.rb +8 -2
- data/spec/jekyll-pants_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 358d698d714a84f82649d2a811f64b0aef89bdf8
|
4
|
+
data.tar.gz: aa95ccd527ae01c66ed3aded496e498481fa25b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a9c239d1879a1a90aea75106ca2c780ec6a81ed1abf3a59aa117461a22f810958dfb8adaaac2370e0187e347661851815a6c73d83a82be63c8ca55ebf9c957b
|
7
|
+
data.tar.gz: fd2b607e0e5c35e01c6d4af459db7a97856e7b1065e653a2dc261643f50c07a6e4a84d5eb454d0ad16880e64c1126d011a790245671ad02aea75c8ed91573a2f
|
data/README.md
CHANGED
data/jekyll-pants.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "jekyll-pants"
|
3
3
|
spec.summary = "Jekyll plugin to run rubypants on generated HTML"
|
4
|
-
spec.version = "0.2.
|
4
|
+
spec.version = "0.2.1"
|
5
5
|
spec.authors = ["Aron Griffis"]
|
6
6
|
spec.email = "aron@scampersand.com"
|
7
7
|
spec.homepage = "https://github.com/scampersand/jekyll-pants"
|
data/lib/jekyll/pants/filter.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'jekyll'
|
1
2
|
require 'rubypants'
|
2
3
|
|
3
4
|
module Jekyll
|
@@ -12,14 +13,19 @@ since they're positional arguments to RubyPants.new
|
|
12
13
|
EOF
|
13
14
|
end
|
14
15
|
|
16
|
+
# Ideally don't populate args to avoid overriding RubyPants defaults.
|
17
|
+
# Unfortunately if entities is provided, then options must also be
|
18
|
+
# provided since they're positional parameters.
|
15
19
|
args = []
|
20
|
+
|
16
21
|
if config.include?('options')
|
17
|
-
args.push(config['options'])
|
22
|
+
args.push(config['options'].map {|o| o.to_sym rescue o})
|
18
23
|
elsif config.include?('entities')
|
19
24
|
args.push([2]) # default in RubyPants
|
20
25
|
end
|
26
|
+
|
21
27
|
if config.include?('entities')
|
22
|
-
args.push(config['entities'])
|
28
|
+
args.push(Jekyll::Utils.symbolize_hash_keys(config['entities']))
|
23
29
|
end
|
24
30
|
|
25
31
|
RubyPants.new(input, *args).to_html
|
data/spec/jekyll-pants_spec.rb
CHANGED
@@ -88,7 +88,7 @@ describe(Jekyll::PantsFilter) do
|
|
88
88
|
'pants' => {
|
89
89
|
# 1 means -- is em-dash
|
90
90
|
'options' => [1],
|
91
|
-
'entities' => {
|
91
|
+
'entities' => {'em_dash' => '_mmm_', 'en_dash' => '_nnn_'},
|
92
92
|
}
|
93
93
|
}
|
94
94
|
Jekyll.configuration(Jekyll::Utils.deep_merge_hashes(overrides, pants_config))
|
@@ -105,7 +105,7 @@ describe(Jekyll::PantsFilter) do
|
|
105
105
|
let(:config) do
|
106
106
|
pants_config = {
|
107
107
|
'pants' => {
|
108
|
-
'entities' => {
|
108
|
+
'entities' => {'em_dash' => '_mmm_', 'en_dash' => '_nnn_'},
|
109
109
|
}
|
110
110
|
}
|
111
111
|
Jekyll.configuration(Jekyll::Utils.deep_merge_hashes(overrides, pants_config))
|