Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix frozen string literal warnings #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/psych/comments/emitter.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Psych
module Comments
module NodeUtils
Expand Down Expand Up @@ -64,7 +66,8 @@ module NodeUtils
class Emitter
include NodeUtils

INDENT = " "
INDENT = " ".freeze
SPACE = " ".freeze

DEFAULT_TAGMAP = {
'!' => '!',
Expand All @@ -74,7 +77,7 @@ class Emitter
attr_reader :out

def initialize
@out = ""
@out = String.new
@state = :init
@indent = 0
@flow = false
Expand All @@ -85,7 +88,7 @@ def initialize
def print(text)
case @state
when :word_end
@out << " "
@out << SPACE
when :line_start
@out << INDENT * @indent
end
Expand Down
2 changes: 2 additions & 0 deletions lib/psych/comments/parsing.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Psych
module Comments
class Analyzer
Expand Down