Skip to content

Commit

Permalink
add frozen_string_literal: true magic comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Mar 18, 2018
1 parent 966efcb commit d690911
Show file tree
Hide file tree
Showing 178 changed files with 214 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/rouge.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# stdlib
require 'pathname'
Expand Down
3 changes: 2 additions & 1 deletion lib/rouge/cli.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# not required by the main lib.
# to use this module, require 'rouge/cli'.
Expand Down Expand Up @@ -363,7 +364,7 @@ def run
puts "== Available Lexers =="

Lexer.all.sort_by(&:tag).each do |lexer|
desc = "#{lexer.desc}"
desc = String.new("#{lexer.desc}")
if lexer.aliases.any?
desc << " [aliases: #{lexer.aliases.join(',')}]"
end
Expand Down
3 changes: 2 additions & 1 deletion lib/rouge/formatter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
# A Formatter takes a token stream and formats it for human viewing.
Expand Down Expand Up @@ -33,7 +34,7 @@ def initialize(opts={})
def format(tokens, &b)
return stream(tokens, &b) if block_given?

out = ''
out = String.new('')
stream(tokens) { |piece| out << piece }

out
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/html.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/html_inline.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/html_legacy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# stdlib
require 'cgi'
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/html_linewise.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/formatters/html_pygments.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Formatters
class HTMLPygments < Formatter
Expand Down
3 changes: 2 additions & 1 deletion lib/rouge/formatters/html_table.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand All @@ -22,7 +23,7 @@ def style(scope)
def stream(tokens, &b)
num_lines = 0
last_val = ''
formatted = ''
formatted = String.new('')

tokens.each do |tok, val|
last_val = val
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/null.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/formatters/terminal256.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Formatters
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guesser.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
class Guesser
class Ambiguous < StandardError
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/disambiguation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
class Disambiguation < Guesser
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/filename.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
class Filename < Guesser
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/glob_mapping.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
# This class allows for custom behavior
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/mimetype.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
class Mimetype < Guesser
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/modeline.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
class Modeline < Guesser
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/source.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
class Source < Guesser
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/guessers/util.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Guessers
module Util
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# stdlib
require 'strscan'
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/abap.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# ABAP elements taken from http://help.sap.com/abapdocu_750/en/index.htm?file=abapdo.htm

module Rouge
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/actionscript.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/apache.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'yaml'

module Rouge
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/apiblueprint.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Lexers
load_lexer 'markdown.rb'
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/apple_script.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
class AppleScript < RegexLexer
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/awk.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/biml.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Lexers
load_lexer 'xml.rb'
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/bsl.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/c.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/ceylon.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/cfscript.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/clojure.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/cmake.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/coffeescript.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/common_lisp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/conf.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/console.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/coq.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/cpp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/csharp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/css.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/d.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/dart.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/diff.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Rouge
module Lexers
class Diff < RegexLexer
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/digdag.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'set'
module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/docker.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/dot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/eiffel.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/elixir.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/elm.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/erb.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/erlang.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/factor.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
2 changes: 2 additions & 0 deletions lib/rouge/lexers/fortran.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# vim: set ts=2 sw=2 et:

# TODO: Implement format list support.
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/fsharp.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/gherkin.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/glsl.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/go.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/gradle.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/graphql.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/groovy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

module Rouge
module Lexers
Expand Down
Loading

0 comments on commit d690911

Please sign in to comment.