Skip to content

Commit

Permalink
Update to be frozen string literal safe
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Dec 16, 2024
1 parent 9f3e898 commit 8e08a60
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ jobs:
bundler-cache: true # 'bundle install' and cache gems
ruby-version: ${{ matrix.ruby-version }}
- name: Run tests
env:
RUBYOPT: ${{ matrix.ruby == 'ruby-head' && '--enable=frozen-string-literal' || '' }}
run: bundle exec rspec
4 changes: 3 additions & 1 deletion lib/timeliness/format_set.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

module Timeliness
class FormatSet
attr_reader :formats, :regexp
Expand All @@ -15,7 +17,7 @@ def initialize(formats)
# Compiles the formats into one big regexp. Stores the index of where
# each format's capture values begin in the matchdata.
def compile!
regexp_string = ''
regexp_string = +''
@formats.inject(0) { |index, format_string|
format = Format.new(format_string).compile!
@formats_hash[format_string] = format
Expand Down
3 changes: 3 additions & 0 deletions timeliness.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Gem::Specification.new do |s|
s.add_development_dependency 'tzinfo', '>= 0.3.31'
s.add_development_dependency 'rspec', '~> 3.4'
s.add_development_dependency 'timecop'
s.add_development_dependency 'base64'
s.add_development_dependency 'bigdecimal'
s.add_development_dependency 'mutex_m'
s.add_development_dependency 'i18n'

s.files = `git ls-files`.split("\n")
Expand Down

0 comments on commit 8e08a60

Please sign in to comment.