Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -12,7 +12,7 @@ class HtmlPrettify < String
new(html).to_html
end
# Create a new RubyPants instance with the text in +string+.
# Create a new RubyPants instance with the text in +string+.
#
# Allowed elements in the options array:
#
@ -50,7 +50,7 @@ class HtmlPrettify < String
# <tt>:ellipsis</tt> :: <tt>&#8230;</tt>
# <tt>:html_quote</tt> :: <tt>&quot; </tt>
#
def initialize(string, options=[2], entities = {})
def initialize(string, options = [2], entities = {})
super string
@options = [*options]
@ -173,7 +173,6 @@ class HtmlPrettify < String
protected
# The string, with each instance of "<tt>--</tt>" translated to an
# em-dash HTML entity.
#
@ -319,14 +318,14 @@ class HtmlPrettify < String
new_str = str.dup
{
:en_dash => '-',
:em_dash => '--',
:single_left_quote => "'",
:single_right_quote => "'",
:double_left_quote => '"',
:double_right_quote => '"',
:ellipsis => '...'
}.each do |k,v|
en_dash: '-',
em_dash: '--',
single_left_quote: "'",
single_right_quote: "'",
double_left_quote: '"',
double_right_quote: '"',
ellipsis: '...'
}.each do |k, v|
new_str.gsub!(/#{entity(k)}/, v)
end