commonmarker-rouge 1.1.0 → 1.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: d71f8505f1dabd01cb8c1a45b12242fdcff30882
4
- data.tar.gz: a90f9683a0c5248d4e34004d27ab1f6c4b3413ec
3
+ metadata.gz: 3988f3d4beea39349738e654bff3ce512c7477e2
4
+ data.tar.gz: 0bac1fd892578296cd32b4ea7e43c8fae0e25eb4
5
5
  SHA512:
6
- metadata.gz: 534959c54af71b74d50e5fdeddec614141b5a27f35ead5831ad3f3a9e04bf3d4956535e79cb8d7b5c4111925fdc3d922a4748bd3b9b8b9342b6ee646afdc64ee
7
- data.tar.gz: d3bab76c5ab5706eceecd6254413d9e3ce3ee65d8a6c4d7daccea14e0b7bca99d0101a1d947564ca834aa1d2b92ea6688f295e3396778b7f47f0c5a88f7327a7
6
+ metadata.gz: 22e9e4f2111a44be574ae0d5f585363ef80974923817a365f7a317b6015d80354eddaa21bca8f1927523c49ebd20d46b7342feebd1586348af91e0b551bb7390
7
+ data.tar.gz: 2ecd6fbd84c0a9b4985e7e31e6c6063f1acb591ba4ff4790b80326683a0b5efbf31a32b5edc3afc6f36730da47022c37a0495bc60145c3a03af0fda375739b00
@@ -1,8 +1,11 @@
1
1
  language: ruby
2
+ dist: trusty
2
3
  rvm:
3
- - 2.0.0
4
- - 2.1.10
5
- - 2.2.4
6
- - 2.3.0
7
- - rbx
8
- before_install: gem install bundler -v 1.11.2
4
+ - '2.0.0'
5
+ - '2.1.10'
6
+ - '2.2.6'
7
+ - '2.3.3'
8
+ - '2.4.0'
9
+ - ruby-head
10
+ before_install: gem install bundler
11
+ script: bundle exec rspec && if [ -d coverage ]; then bundle exec codeclimate-test-reporter; fi
@@ -1,9 +1,10 @@
1
1
  The MIT License (MIT)
2
+ =====================
2
3
 
3
- Copyright (c) 2016 Anton Smirnov
4
+ Copyright © 2016 Anton Smirnov
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
+ of this software and associated documentation files (the Software), to deal
7
8
  in the Software without restriction, including without limitation the rights
8
9
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
10
  copies of the Software, and to permit persons to whom the Software is
@@ -12,7 +13,7 @@ furnished to do so, subject to the following conditions:
12
13
  The above copyright notice and this permission notice shall be included in all
13
14
  copies or substantial portions of the Software.
14
15
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ THE SOFTWARE IS PROVIDED AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
17
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
18
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
19
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
data/README.md CHANGED
@@ -1,7 +1,10 @@
1
1
  # CommonMarker+Rouge
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/commonmarker-rouge.svg)](https://badge.fury.io/rb/commonmarker-rouge)
4
- [![Code Climate](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/badges/gpa.svg)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge)
3
+ [![Gem](https://img.shields.io/gem/v/commonmarker-rouge.svg?maxAge=2592000)](https://rubygems.org/gems/commonmarker-rouge)
4
+ [![Travis](https://img.shields.io/travis/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://travis-ci.org/sandfoxme/commonmarker-rouge)
5
+ [![Code Climate](https://img.shields.io/codeclimate/github/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge)
6
+ [![Code Climate](https://img.shields.io/codeclimate/coverage/github/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://codeclimate.com/github/sandfoxme/commonmarker-rouge/coverage)
7
+ [![Gemnasium](https://img.shields.io/gemnasium/sandfoxme/commonmarker-rouge.svg?maxAge=2592000)](https://gemnasium.com/sandfoxme/commonmarker-rouge)
5
8
 
6
9
  A [CommonMarker](https://rubygems.org/gems/commonmarker) wrapper with
7
10
  syntax highlight support by [Rouge](https://rubygems.org/gems/rouge).
@@ -21,10 +21,12 @@ Gem::Specification.new do |spec|
21
21
  spec.required_ruby_version = '>= 2.0.0'
22
22
 
23
23
  spec.add_dependency 'commonmarker', '>= 0.14.5', '< 1.0'
24
- spec.add_dependency 'rouge', '~> 1.10'
24
+ spec.add_dependency 'rouge', '>= 1.10', '< 3'
25
25
 
26
26
  spec.add_development_dependency 'bundler', '~> 1.11'
27
- spec.add_development_dependency 'rake', '~> 10.0'
27
+ spec.add_development_dependency 'rake', '~> 12.0'
28
28
  spec.add_development_dependency 'rspec', '~> 3.0'
29
+ spec.add_development_dependency 'codeclimate-test-reporter'
29
30
  spec.add_development_dependency 'simplecov'
31
+ spec.add_development_dependency 'pry'
30
32
  end
@@ -2,6 +2,7 @@ require 'commonmarker/rouge/version'
2
2
 
3
3
  require 'commonmarker'
4
4
  require 'rouge'
5
+ require 'cgi'
5
6
 
6
7
  module CommonMarker
7
8
  module Rouge
@@ -26,11 +27,11 @@ module CommonMarker
26
27
 
27
28
  source = node.string_content
28
29
 
29
- lexer = ::Rouge::Lexer.find_fancy(node.fence_info)
30
+ lexer = ::Rouge::Lexer.find_fancy(node.fence_info) || ::Rouge::Lexers::PlainText.new
30
31
 
31
32
  formatter = (highmark_options[:formatter] || ::Rouge::Formatters::HTML).new(highmark_options[:options] || {})
32
33
 
33
- html = '<div class="highlighter-rouge">' + formatter.format(lexer.lex(source)) + '</div>'
34
+ html = '<div class="highlighter-rouge language-' + CGI.escapeHTML(node.fence_info) + '">' + formatter.format(lexer.lex(source)) + '</div>'
34
35
 
35
36
  new_node = ::CommonMarker::Node.new(:html)
36
37
  new_node.string_content = html
@@ -1,5 +1,5 @@
1
1
  module CommonMarker
2
2
  module Rouge
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commonmarker-rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Smirnov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-24 00:00:00.000000000 Z
11
+ date: 2017-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commonmarker
@@ -34,16 +34,22 @@ dependencies:
34
34
  name: rouge
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.10'
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '3'
40
43
  type: :runtime
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
44
- - - "~>"
47
+ - - ">="
45
48
  - !ruby/object:Gem::Version
46
49
  version: '1.10'
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '3'
47
53
  - !ruby/object:Gem::Dependency
48
54
  name: bundler
49
55
  requirement: !ruby/object:Gem::Requirement
@@ -64,14 +70,14 @@ dependencies:
64
70
  requirements:
65
71
  - - "~>"
66
72
  - !ruby/object:Gem::Version
67
- version: '10.0'
73
+ version: '12.0'
68
74
  type: :development
69
75
  prerelease: false
70
76
  version_requirements: !ruby/object:Gem::Requirement
71
77
  requirements:
72
78
  - - "~>"
73
79
  - !ruby/object:Gem::Version
74
- version: '10.0'
80
+ version: '12.0'
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: rspec
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -86,6 +92,20 @@ dependencies:
86
92
  - - "~>"
87
93
  - !ruby/object:Gem::Version
88
94
  version: '3.0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: codeclimate-test-reporter
97
+ requirement: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
89
109
  - !ruby/object:Gem::Dependency
90
110
  name: simplecov
91
111
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +120,20 @@ dependencies:
100
120
  - - ">="
101
121
  - !ruby/object:Gem::Version
102
122
  version: '0'
123
+ - !ruby/object:Gem::Dependency
124
+ name: pry
125
+ requirement: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ type: :development
131
+ prerelease: false
132
+ version_requirements: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
103
137
  description:
104
138
  email:
105
139
  - sandfox@sandfox.me
@@ -111,7 +145,7 @@ files:
111
145
  - ".rspec"
112
146
  - ".travis.yml"
113
147
  - Gemfile
114
- - LICENSE
148
+ - LICENSE.md
115
149
  - README.md
116
150
  - Rakefile
117
151
  - bin/console
@@ -139,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
173
  version: '0'
140
174
  requirements: []
141
175
  rubyforge_project:
142
- rubygems_version: 2.6.12
176
+ rubygems_version: 2.5.2
143
177
  signing_key:
144
178
  specification_version: 4
145
179
  summary: CommonMarker wrapper with Rouge syntax highlighter