jekyll-pants 0.2.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18cd8e967afd6c5cbe5f220f62bf0134f7a780f1
4
- data.tar.gz: 2a62173d28a1f8f907e8bdcafb30a8d9a4fd8fff
3
+ metadata.gz: 358d698d714a84f82649d2a811f64b0aef89bdf8
4
+ data.tar.gz: aa95ccd527ae01c66ed3aded496e498481fa25b3
5
5
  SHA512:
6
- metadata.gz: d2e544e0b3be9ffac0235fda920b541a0dfb4c4a7ba92028f1075b251530fc03939bd55c27e88cf064a709836537b8786ac183220f3b0235a6ef418ee1566422
7
- data.tar.gz: e926cedaba9ca6595fd245360fd0c62efe1dfd99b04755b43925c3ce712e40936644922b3c04e7dd9446c931e0def65e2eb927cc7064df5751721e8c53a90cbd
6
+ metadata.gz: 0a9c239d1879a1a90aea75106ca2c780ec6a81ed1abf3a59aa117461a22f810958dfb8adaaac2370e0187e347661851815a6c73d83a82be63c8ca55ebf9c957b
7
+ data.tar.gz: fd2b607e0e5c35e01c6d4af459db7a97856e7b1065e653a2dc261643f50c07a6e4a84d5eb454d0ad16880e64c1126d011a790245671ad02aea75c8ed91573a2f
data/README.md CHANGED
@@ -73,8 +73,7 @@ example:
73
73
 
74
74
  ```yaml
75
75
  pants:
76
- options: [1, :prevent_breaks]
77
- entities: {:em_dash => '—'}
76
+ options: [1, 'prevent_breaks']
78
77
  ```
79
78
 
80
79
  For the available options, see https://github.com/jmcnevin/rubypants/blob/master/lib/rubypants/core.rb
@@ -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.0"
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"
@@ -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
@@ -88,7 +88,7 @@ describe(Jekyll::PantsFilter) do
88
88
  'pants' => {
89
89
  # 1 means -- is em-dash
90
90
  'options' => [1],
91
- 'entities' => {:em_dash => '_mmm_', :en_dash => '_nnn_'},
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' => {:em_dash => '_mmm_', :en_dash => '_nnn_'},
108
+ 'entities' => {'em_dash' => '_mmm_', 'en_dash' => '_nnn_'},
109
109
  }
110
110
  }
111
111
  Jekyll.configuration(Jekyll::Utils.deep_merge_hashes(overrides, pants_config))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-pants
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aron Griffis