Skip to content

Commit

Permalink
fix frozen string literal warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansing committed Jan 30, 2025
1 parent b15a7be commit b46a4aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0']
ruby: ["3.1", "3.2", "3.3", "3.4"]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ gemspec
gem 'rake'
gem 'rdoc'
gem 'activesupport'

group :test do
gem 'mutex_m'
end
12 changes: 6 additions & 6 deletions lib/iq_rdf/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,16 @@ def to_ntriples
def to_turtle
s = ""
@namespaces.values.sort{ |n1, n2| n1.turtle_token <=> n2.turtle_token }.each do |namespace|
s << "@prefix #{namespace.turtle_token}: <#{namespace.uri_prefix}>.\n"
s += "@prefix #{namespace.turtle_token}: <#{namespace.uri_prefix}>.\n"
end
s << "\n"
s += "\n"
@nodes.each do |subject|
pref = subject.to_s(@document_language)
indent = "".ljust(pref.length)

# Render subject, if it is defined as a RDF-type.
if subject.rdf_type
s << "#{pref} a #{subject.rdf_type}"
s += "#{pref} a #{subject.rdf_type}"
pref = ";\n" + indent
end

Expand All @@ -163,13 +163,13 @@ def to_turtle
objects = predicate.nodes.map { |object| object.to_s(indent: indent, lang: predicate.lang || subject.lang || @document_language) }
.join(", ")

s << "#{pref} #{predicate.to_s} #{objects}"
s += "#{pref} #{predicate.to_s} #{objects}"

pref = ";\n" + indent
end
s << ".\n"
s += ".\n"
if @config[:empty_line_between_triples]
s << "\n"
s += "\n"
end
end
s
Expand Down

0 comments on commit b46a4aa

Please sign in to comment.