From ae37ea5192b7cd39794c090d69a830536cc8bb35 Mon Sep 17 00:00:00 2001 From: Yoshikazu Kaneta Date: Thu, 20 Jun 2024 18:14:51 +0900 Subject: [PATCH] Add frozen_string_literal: true --- .github/workflows/ci.yml | 2 +- gemfiles/rails60.gemfile | 1 + gemfiles/rails61.gemfile | 1 + gemfiles/rails70.gemfile | 1 + gemfiles/rails71.gemfile | 1 + lib/logical_query_parser.rb | 2 ++ lib/logical_query_parser/assoc.rb | 2 ++ lib/logical_query_parser/assoc_resolver.rb | 2 ++ lib/logical_query_parser/nodes/active_record.rb | 4 +++- lib/logical_query_parser/nodes/base.rb | 2 ++ lib/logical_query_parser/version.rb | 2 ++ 11 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 732a077..cd0b9a2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,7 +76,7 @@ jobs: BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/gemfiles/rails60.gemfile b/gemfiles/rails60.gemfile index 602a8c7..672d4cf 100644 --- a/gemfiles/rails60.gemfile +++ b/gemfiles/rails60.gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gem "activerecord", "~> 6.0.0" +gem "sqlite3", "~> 1.4.0" gem "psych", "~> 3.3.0" gemspec path: "../" diff --git a/gemfiles/rails61.gemfile b/gemfiles/rails61.gemfile index 6386a71..9169ae7 100644 --- a/gemfiles/rails61.gemfile +++ b/gemfiles/rails61.gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gem "rails", "~> 6.1.0" +gem "sqlite3", "~> 1.4.0" gemspec path: "../" diff --git a/gemfiles/rails70.gemfile b/gemfiles/rails70.gemfile index 095ed23..2c916ba 100644 --- a/gemfiles/rails70.gemfile +++ b/gemfiles/rails70.gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gem "rails", "~> 7.0.1" +gem "sqlite3", "~> 1.4.0" gemspec path: "../" diff --git a/gemfiles/rails71.gemfile b/gemfiles/rails71.gemfile index 9b0fa07..ab431d7 100644 --- a/gemfiles/rails71.gemfile +++ b/gemfiles/rails71.gemfile @@ -1,5 +1,6 @@ source 'https://rubygems.org' gem "rails", "~> 7.1.0" +gem "sqlite3", "~> 1.6.6" gemspec path: "../" diff --git a/lib/logical_query_parser.rb b/lib/logical_query_parser.rb index 2848478..d7afdae 100644 --- a/lib/logical_query_parser.rb +++ b/lib/logical_query_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'treetop' Treetop.load File.expand_path("../logical_query_parser.treetop", __FILE__) diff --git a/lib/logical_query_parser/assoc.rb b/lib/logical_query_parser/assoc.rb index 9779328..2a43946 100644 --- a/lib/logical_query_parser/assoc.rb +++ b/lib/logical_query_parser/assoc.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LogicalQueryParser class Assoc attr_accessor :column_mapping, :structure diff --git a/lib/logical_query_parser/assoc_resolver.rb b/lib/logical_query_parser/assoc_resolver.rb index 985ba75..1a27a34 100644 --- a/lib/logical_query_parser/assoc_resolver.rb +++ b/lib/logical_query_parser/assoc_resolver.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative 'assoc' module LogicalQueryParser diff --git a/lib/logical_query_parser/nodes/active_record.rb b/lib/logical_query_parser/nodes/active_record.rb index caa6165..9d633ef 100644 --- a/lib/logical_query_parser/nodes/active_record.rb +++ b/lib/logical_query_parser/nodes/active_record.rb @@ -1,7 +1,9 @@ +# frozen_string_literal: true + module LogicalQueryParser module ExpNode def to_sql(params = {}) - params[:sql] ||= '' + params[:sql] ||= ''.dup exp.to_sql(params) end end diff --git a/lib/logical_query_parser/nodes/base.rb b/lib/logical_query_parser/nodes/base.rb index 9c28433..e96511a 100644 --- a/lib/logical_query_parser/nodes/base.rb +++ b/lib/logical_query_parser/nodes/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LogicalQueryParser module ExpNode end diff --git a/lib/logical_query_parser/version.rb b/lib/logical_query_parser/version.rb index e95d378..f125525 100644 --- a/lib/logical_query_parser/version.rb +++ b/lib/logical_query_parser/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module LogicalQueryParser VERSION = "0.3.4" end