jekyll-ultraviolet 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,23 +13,23 @@ module Jekyll
13
13
  def initialize(tag, lang, tokens)
14
14
  super
15
15
  @theme = "twilight"
16
- @lang = lang.strip rescue "ruby"
16
+ @lang = lang.empty? ? "ruby" : lang.strip
17
17
  end
18
18
 
19
19
  def render(context)
20
20
  output = []
21
21
  output << context["pygments_prefix"]
22
- output << Uv.parse(remove_leading_spaces(super.join), "xhtml", @lang, false, theme)
22
+ output << Uv.parse(trim(super.join), "xhtml", @lang, false, theme)
23
23
  output << context["pygments_suffix"]
24
24
  output.join
25
25
  rescue LoadError
26
26
  raise "Ultraviolet not installed."
27
27
  end
28
28
 
29
- def remove_leading_spaces(text)
29
+ def trim(text)
30
30
  padding = text.match(/\n?(\s+)/)[1]
31
- return text if padding == "\n"
32
- text.each_line.map { |l| l.gsub(/^#{padding}/, "") }.join
31
+ return text.rstrip if padding == "\n"
32
+ text.each_line.map { |l| l.gsub(/^#{padding}/, "") }.join.rstrip
33
33
  end
34
34
 
35
35
  def theme
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Ultraviolet
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-ultraviolet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-15 00:00:00.000000000Z
12
+ date: 2011-10-19 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: liquid
16
- requirement: &70367021988580 !ruby/object:Gem::Requirement
16
+ requirement: &70278244140280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70367021988580
24
+ version_requirements: *70278244140280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: spox-ultraviolet
27
- requirement: &70367021979020 !ruby/object:Gem::Requirement
27
+ requirement: &70278244139840 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70367021979020
35
+ version_requirements: *70278244139840
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70367021978240 !ruby/object:Gem::Requirement
38
+ requirement: &70278244139180 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 2.6.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70367021978240
46
+ version_requirements: *70278244139180
47
47
  description: Ultraviolet syntax highlighting in Jekyll
48
48
  email:
49
49
  - me@mattenoble.com