content-pipeline 0.1.0 → 0.2.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: 82e18bcc2d6c061a7b0ea5a7d1e2a2557718bbf1
4
- data.tar.gz: f6aaedc35707c3d056556a0a890f25867392a353
3
+ metadata.gz: 9483f7e3ac36d2ec6ff0c4910eebe19dfe92f98f
4
+ data.tar.gz: f4fdd75c783504c952dc7fd7ef22221cc1958694
5
5
  SHA512:
6
- metadata.gz: 7303628384ea53a2854832749a465a08721861dbe9f48a36361f4577e6635d6c03538b988aed7ecfc8cea62311be285ed217add4ad38c81403ea47ee767e9aad
7
- data.tar.gz: 06f12ee5b5df5aa9b69b8ff4129f5b0ec99ce1e628db1184402b5e0195671965f6497c2913b66d626273d5a074ea4378be606e5b6339e1d6556d6dd39327406f
6
+ metadata.gz: 7240b94490a5c12ae1d73122bfd4c6558701b840489bfb499a2107f5c741ae783a369cc021179116168e1ef48eaf331e7cd9d3655a95c1329450c842285c3dac
7
+ data.tar.gz: 93cea0fa41702be77982bc347bed02727d2b436a0e2c5ca7b348e9986472cde431338948d8fd79fdb11678cd4c22c261c63d8c46313d4cc00f121cf94f704353
data/Gemfile CHANGED
@@ -6,10 +6,8 @@ group :development do
6
6
  gem "pry"
7
7
  end
8
8
 
9
- gem "envygeeks-coveralls"
10
9
  gem "kramdown"
11
10
  gem "rake"
12
- gem "luna-rspec-formatters"
13
11
 
14
12
  unless RbConfig::CONFIG["ruby_install_name"] == "jruby"
15
13
  gem "pygments.rb"
data/Readme.md CHANGED
@@ -54,3 +54,6 @@ better than the other, it's done so that people can remain agnostic.*
54
54
  ### Content::Pipeline::Filters::CodeHighlight
55
55
 
56
56
  The code highlight filter allows you to highlight code, with or without Pygments. If Pygments is supported it will require it and syntax highlight, otherwise it will simply wrap your code in the normal code style and not syntax highlight it. You will still have the line numbers, just not the fancy syntax highlight.
57
+
58
+ Options:
59
+ * `:default` - The default syntax language -- If not defined it will default to "ruby".
@@ -40,8 +40,8 @@ class Content::Pipeline::Filters::CodeHighlight < Content::Pipeline::Filter
40
40
  def highlight
41
41
  @str = @str.to_nokogiri_fragment
42
42
  @str.search('pre').each do |node|
43
- node.replace Templates[:wrap] %
44
- wrap(pygments(node.inner_text, node[:lang]), node[:lang] || "text")
43
+ lang = node[:lang] || @opts[:default] || "ruby"
44
+ node.replace Templates[:wrap] % wrap(pygments(node.inner_text, lang), lang)
45
45
  end
46
46
  end
47
47
 
@@ -66,6 +66,7 @@ class Content::Pipeline::Filters::CodeHighlight < Content::Pipeline::Filter
66
66
  private
67
67
  def pygments(str, lang)
68
68
  return str if jruby? || !Pygments::Lexer[lang]
69
+ # Protects you against a possible Pygments error.
69
70
  Pygments::Lexer[lang].highlight(str) =~ Matcher ? $1 : str
70
71
  end
71
72
  end
@@ -1,5 +1,5 @@
1
1
  module Content
2
2
  class Pipeline
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: content-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordon Bedwell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-29 00:00:00.000000000 Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -42,16 +42,44 @@ dependencies:
42
42
  name: rspec-expect_error
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.4
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.4
55
+ - !ruby/object:Gem::Dependency
56
+ name: envygeeks-coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
46
60
  - !ruby/object:Gem::Version
47
61
  version: 0.0.2
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - '='
66
+ - - ~>
53
67
  - !ruby/object:Gem::Version
54
68
  version: 0.0.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: luna-rspec-formatters
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.4.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.4.2
55
83
  description: A less restrictive version of html-pipeline for content.
56
84
  email: envygeeks@gmail.com
57
85
  executables: []