diff --git a/Gemfile b/Gemfile
index 20ae645f3..1704bcd26 100644
--- a/Gemfile
+++ b/Gemfile
@@ -13,6 +13,6 @@ gem 'zeus', require: false
# YARD
gem 'fssm'
-gem 'pygments.rb'
+gem 'rouge'
gem 'redcarpet'
gem 'yard'
diff --git a/Gemfile.lock b/Gemfile.lock
index f4b0e879a..629a48822 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -11,7 +11,6 @@ GEM
diff-lcs (1.3)
fssm (0.2.10)
method_source (1.0.0)
- multi_json (1.14.1)
parallel (1.19.2)
parser (2.7.1.4)
ast (~> 2.4.1)
@@ -21,14 +20,13 @@ GEM
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (2.2.2)
rainbow (3.0.0)
rake (13.0.1)
redcarpet (3.5.0)
regexp_parser (1.7.1)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -73,9 +71,9 @@ DEPENDENCIES
fssm
pry
pry-byebug
- pygments.rb
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rubocop
rubocop-rails
diff --git a/doc_config/yard/setup.rb b/doc_config/yard/setup.rb
index eb654f5b6..6483b4c22 100644
--- a/doc_config/yard/setup.rb
+++ b/doc_config/yard/setup.rb
@@ -1,20 +1,20 @@
YARD::Templates::Engine.register_template_path(File.dirname(__FILE__) + '/templates')
-require 'pygments.rb'
+require 'rouge'
module YARD
module Templates
module Helpers
module HtmlSyntaxHighlightHelper
def html_syntax_highlight_ruby(source)
- highlight_with_pygments(:ruby, source)
+ highlight(:ruby, source)
end
private
- def highlight_with_pygments(language, source)
- html = Pygments.highlight(source, lexer: language.to_s)
- html.sub(%r{\A
\Z}, '')
+ def highlight(language, source)
+ lexer = Rouge::Lexers.const_get(language.capitalize)
+ Rouge::Formatters::HTML.new.format(lexer.new.lex(source))
end
end
end
diff --git a/gemfiles/rails_4_2.gemfile b/gemfiles/rails_4_2.gemfile
index b90bb032c..b58c8b2fe 100644
--- a/gemfiles/rails_4_2.gemfile
+++ b/gemfiles/rails_4_2.gemfile
@@ -13,7 +13,7 @@ gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
-gem "pygments.rb"
+gem "rouge"
gem "redcarpet"
gem "yard"
gem "spring"
diff --git a/gemfiles/rails_4_2.gemfile.lock b/gemfiles/rails_4_2.gemfile.lock
index 7d9bc6912..cbbc45ff8 100644
--- a/gemfiles/rails_4_2.gemfile.lock
+++ b/gemfiles/rails_4_2.gemfile.lock
@@ -83,7 +83,6 @@ GEM
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
- multi_json (1.14.1)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
parallel (1.19.2)
@@ -98,8 +97,6 @@ GEM
pry-byebug (3.9.0)
byebug (~> 11.0)
pry (~> 0.13.0)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (1.6.13)
rack-test (0.6.3)
rack (>= 1.0)
@@ -138,6 +135,7 @@ GEM
redcarpet (3.5.0)
regexp_parser (1.7.1)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -233,10 +231,10 @@ DEPENDENCIES
protected_attributes (~> 1.0.6)
pry
pry-byebug
- pygments.rb
rails (= 4.2.11.1)
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rspec-rails (~> 3.9)
rubocop
diff --git a/gemfiles/rails_5_0.gemfile b/gemfiles/rails_5_0.gemfile
index 8295baca9..0bb6362fe 100644
--- a/gemfiles/rails_5_0.gemfile
+++ b/gemfiles/rails_5_0.gemfile
@@ -13,7 +13,7 @@ gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
-gem "pygments.rb"
+gem "rouge"
gem "redcarpet"
gem "yard"
gem "spring"
diff --git a/gemfiles/rails_5_0.gemfile.lock b/gemfiles/rails_5_0.gemfile.lock
index e5e4304c2..ecb83c944 100644
--- a/gemfiles/rails_5_0.gemfile.lock
+++ b/gemfiles/rails_5_0.gemfile.lock
@@ -76,7 +76,6 @@ GEM
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
- multi_json (1.14.1)
nio4r (2.5.2)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
@@ -91,8 +90,6 @@ GEM
byebug (~> 11.0)
pry (~> 0.13.0)
puma (3.12.2)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (2.2.2)
rack-test (0.6.3)
rack (>= 1.0)
@@ -131,6 +128,7 @@ GEM
redcarpet (3.5.0)
regexp_parser (1.7.1)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -225,11 +223,11 @@ DEPENDENCIES
pry
pry-byebug
puma (~> 3.0)
- pygments.rb
rails (= 5.0.7.2)
rails-controller-testing (>= 1.0.1)
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rspec-rails (~> 3.9)
rubocop
diff --git a/gemfiles/rails_5_1.gemfile b/gemfiles/rails_5_1.gemfile
index ebe601837..ac7a944d6 100644
--- a/gemfiles/rails_5_1.gemfile
+++ b/gemfiles/rails_5_1.gemfile
@@ -13,7 +13,7 @@ gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
-gem "pygments.rb"
+gem "rouge"
gem "redcarpet"
gem "yard"
gem "spring"
diff --git a/gemfiles/rails_5_1.gemfile.lock b/gemfiles/rails_5_1.gemfile.lock
index 58e4412c7..3c60b9d00 100644
--- a/gemfiles/rails_5_1.gemfile.lock
+++ b/gemfiles/rails_5_1.gemfile.lock
@@ -83,7 +83,6 @@ GEM
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.13.0)
- multi_json (1.14.1)
nio4r (2.5.2)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
@@ -99,8 +98,6 @@ GEM
pry (~> 0.13.0)
public_suffix (4.0.1)
puma (3.12.2)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -139,6 +136,7 @@ GEM
redcarpet (3.5.0)
regexp_parser (1.7.1)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -240,11 +238,11 @@ DEPENDENCIES
pry
pry-byebug
puma (~> 3.7)
- pygments.rb
rails (= 5.1.7)
rails-controller-testing (>= 1.0.1)
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rspec-rails (~> 3.9)
rubocop
diff --git a/gemfiles/rails_5_2.gemfile b/gemfiles/rails_5_2.gemfile
index c53dac15c..7a253fe31 100644
--- a/gemfiles/rails_5_2.gemfile
+++ b/gemfiles/rails_5_2.gemfile
@@ -13,7 +13,7 @@ gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
-gem "pygments.rb"
+gem "rouge"
gem "redcarpet"
gem "yard"
gem "spring"
diff --git a/gemfiles/rails_5_2.gemfile.lock b/gemfiles/rails_5_2.gemfile.lock
index 079a57541..52124b0d4 100644
--- a/gemfiles/rails_5_2.gemfile.lock
+++ b/gemfiles/rails_5_2.gemfile.lock
@@ -99,7 +99,6 @@ GEM
mini_portile2 (2.4.0)
minitest (5.13.0)
msgpack (1.3.1)
- multi_json (1.14.1)
nio4r (2.5.2)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
@@ -115,8 +114,6 @@ GEM
pry (~> 0.13.0)
public_suffix (4.0.1)
puma (3.12.2)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -156,6 +153,7 @@ GEM
redcarpet (3.5.0)
regexp_parser (1.7.1)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -259,11 +257,11 @@ DEPENDENCIES
pry
pry-byebug
puma (~> 3.11)
- pygments.rb
rails (= 5.2.4.1)
rails-controller-testing (>= 1.0.1)
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rspec-rails (~> 3.9)
rubocop
diff --git a/gemfiles/rails_6_0.gemfile b/gemfiles/rails_6_0.gemfile
index f7d5c94d5..c702b8203 100644
--- a/gemfiles/rails_6_0.gemfile
+++ b/gemfiles/rails_6_0.gemfile
@@ -13,7 +13,7 @@ gem "rubocop-rails", require: false
gem "warnings_logger"
gem "zeus", require: false
gem "fssm"
-gem "pygments.rb"
+gem "rouge"
gem "redcarpet"
gem "yard"
gem "spring"
diff --git a/gemfiles/rails_6_0.gemfile.lock b/gemfiles/rails_6_0.gemfile.lock
index f3b3a2c57..e75a49623 100644
--- a/gemfiles/rails_6_0.gemfile.lock
+++ b/gemfiles/rails_6_0.gemfile.lock
@@ -107,7 +107,6 @@ GEM
mini_portile2 (2.4.0)
minitest (5.13.0)
msgpack (1.3.1)
- multi_json (1.14.1)
nio4r (2.5.2)
nokogiri (1.10.7)
mini_portile2 (~> 2.4.0)
@@ -124,8 +123,6 @@ GEM
public_suffix (4.0.1)
puma (4.3.1)
nio4r (~> 2.0)
- pygments.rb (1.2.1)
- multi_json (>= 1.0.0)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -167,6 +164,7 @@ GEM
redcarpet (3.5.0)
regexp_parser (1.6.0)
rexml (3.2.4)
+ rouge (3.22.0)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
@@ -273,11 +271,11 @@ DEPENDENCIES
pry
pry-byebug
puma (~> 4.1)
- pygments.rb
rails (= 6.0.2.1)
rails-controller-testing (>= 1.0.1)
rake (= 13.0.1)
redcarpet
+ rouge
rspec (~> 3.9)
rspec-rails (~> 3.9)
rubocop