Skip to content

Commit

Permalink
freeze string literals in files
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Sep 9, 2018
1 parent 473d1d1 commit c76677a
Show file tree
Hide file tree
Showing 166 changed files with 199 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'http://rubygems.org'

gemspec
Expand Down
2 changes: 2 additions & 0 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

guard :shell do
watch(/\.rb$/) { `rake` }
end
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'rake/clean'
require 'pathname'
require "bundler/gem_tasks"
Expand Down
1 change: 1 addition & 0 deletions bin/rougify
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pathname'
ROOT_DIR = Pathname.new(__FILE__).dirname.parent
Expand Down
2 changes: 2 additions & 0 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'pathname'

here = Pathname.new(__FILE__).dirname
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def run
puts "== Available Lexers =="

Lexer.all.sort_by(&:tag).each do |lexer|
desc = String.new("#{lexer.desc}")
desc = +"#{lexer.desc}"
if lexer.aliases.any?
desc << " [aliases: #{lexer.aliases.join(',')}]"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rouge/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def initialize(opts={})
def format(tokens, &b)
return stream(tokens, &b) if block_given?

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

out
Expand Down
4 changes: 2 additions & 2 deletions lib/rouge/formatters/html_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def style(scope)

def stream(tokens, &b)
num_lines = 0
last_val = ''
formatted = String.new('')
last_val = ''
formatted = +''

tokens.each do |tok, val|
last_val = val
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/crystal.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/gherkin/keywords.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# automatically generated by `rake builtins:gherkin`
module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/hcl.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/jsp.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/lua/builtins.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# automatically generated by `rake builtins:lua`
module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/m68k.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/mathematica.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/mathematica/builtins.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

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

# automatically generated by `rake builtins:matlab`
module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/sqf.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/sqf/commands.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

# automatically generated by `rake builtins:sqf`
module Rouge
module Lexers
Expand Down
1 change: 1 addition & 0 deletions lib/rouge/lexers/terraform.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/viml/keywords.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# encoding: utf-8
# frozen_string_literal: true

# DO NOT EDIT: automatically generated by `rake builtins:vim`.
# see tasks/vim.rake for more info.
module Rouge
Expand Down
2 changes: 2 additions & 0 deletions rouge.gemspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require './lib/rouge/version'

Gem::Specification.new do |s|
Expand Down
1 change: 1 addition & 0 deletions spec/cli_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

require 'rouge/cli'

Expand Down
2 changes: 2 additions & 0 deletions spec/formatter_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

describe Rouge::Formatter do
it 'finds terminal256' do
assert { Rouge::Formatter.find('terminal256') }
Expand Down
1 change: 1 addition & 0 deletions spec/formatters/html_linewise_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Formatters::HTMLLinewise do
let(:subject) { Rouge::Formatters::HTMLLinewise.new(formatter, options) }
Expand Down
2 changes: 2 additions & 0 deletions spec/formatters/html_pygments_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

describe Rouge::Formatters::HTMLPygments do
let(:formatter) { Rouge::Formatters::HTML.new }
let(:source) { 'echo "Hello World"' }
Expand Down
1 change: 1 addition & 0 deletions spec/formatters/html_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Formatters::HTML do
let(:subject) { Rouge::Formatters::HTMLLegacy.new(options) }
Expand Down
1 change: 1 addition & 0 deletions spec/formatters/null_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Formatters::Null do
let(:subject) { Rouge::Formatters::Null.new }
Expand Down
1 change: 1 addition & 0 deletions spec/formatters/terminal256_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Formatters::Terminal256 do
let(:subject) { Rouge::Formatters::Terminal256.new }
Expand Down
2 changes: 2 additions & 0 deletions spec/guesser_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

describe Rouge::Guesser do
include Support::Guessing

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

describe Rouge::Lexer do
include Support::Lexing
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/abap_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::ABAP do
let(:subject) { Rouge::Lexers::ABAP.new }
Expand Down
2 changes: 2 additions & 0 deletions spec/lexers/apache_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

describe Rouge::Lexers::Apache do
let(:subject) { Rouge::Lexers::Apache.new }

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

describe Rouge::Lexers::APIBlueprint do
let(:subject) { Rouge::Lexers::APIBlueprint.new }

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

describe Rouge::Lexers::AppleScript do
let(:subject) { Rouge::Lexers::AppleScript.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/awk_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Awk do
let(:subject) { Rouge::Lexers::Awk.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/biml_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::BIML do
let(:subject) { Rouge::Lexers::BIML.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/bsl_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Bsl do
let(:subject) { Rouge::Lexers::Bsl.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/c_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::C do
let(:subject) { Rouge::Lexers::C.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/ceylon_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Ceylon do
let(:subject) { Rouge::Lexers::Ceylon.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/cfscript_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Cfscript do
let(:subject) { Rouge::Lexers::Cfscript.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/clojure_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Clojure do
let(:subject) { Rouge::Lexers::Clojure.new }
Expand Down
2 changes: 2 additions & 0 deletions spec/lexers/cmake_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

describe Rouge::Lexers::CMake do
let(:subject) { Rouge::Lexers::CMake.new }

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

describe Rouge::Lexers::Coffeescript do
let(:subject) { Rouge::Lexers::Coffeescript.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/common_lisp_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::CommonLisp do
let(:subject) { Rouge::Lexers::CommonLisp.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/conf_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Conf do
let(:subject) { Rouge::Lexers::Conf.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/coq_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Coq do
let(:subject) { Rouge::Lexers::Coq.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/cpp_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Cpp do
let(:subject) { Rouge::Lexers::Cpp.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/crystal_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Crystal do
let(:subject) { Rouge::Lexers::Crystal.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/csharp_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::CSharp do
let(:subject) { Rouge::Lexers::CSharp.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/css_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::CSS do
let(:subject) { Rouge::Lexers::CSS.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/d_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::D do
let(:subject) { Rouge::Lexers::D.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/dart_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Dart do
let(:subject) { Rouge::Lexers::Dart.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/diff_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Diff do
let(:subject) { Rouge::Lexers::Diff.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/digdag_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Digdag do
let(:subject) { Rouge::Lexers::Digdag.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/docker_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Docker do
let(:subject) { Rouge::Lexers::Docker.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/dot_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Dot do
let(:subject) { Rouge::Lexers::Dot.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/eiffel_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Eiffel do
let(:subject) { Rouge::Lexers::Eiffel.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/elixir_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Elixir do
let(:subject) { Rouge::Lexers::Elixir.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/elm_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Elm do
let(:subject) { Rouge::Lexers::Elm.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/erb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::ERB do
let(:subject) { Rouge::Lexers::ERB.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/erlang_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Erlang do
let(:subject) { Rouge::Lexers::Erlang.new }
Expand Down
1 change: 1 addition & 0 deletions spec/lexers/factor_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- #
# frozen_string_literal: true

describe Rouge::Lexers::Factor do
let(:subject) { Rouge::Lexers::Factor.new }
Expand Down
Loading

0 comments on commit c76677a

Please sign in to comment.