Skip to content

Commit

Permalink
Update dependencies 2024-12-27 and add Ruby 3.4 support to test matrix (
Browse files Browse the repository at this point in the history
  • Loading branch information
olbrich authored Dec 27, 2024
1 parent 782c3d2 commit ef74ee8
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.1', '3.2', '3.3', 'jruby-9.4']
ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.4']
env:
BUNDLE_WITHOUT: optional
steps:
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source "https://rubygems.org"
# The CI process will not install them.
group :optional do
gem "debug", ">= 1.0.0", platform: :mri
gem "gem-ctags"
gem "guard-rspec"
gem "pry"
gem "redcarpet", platform: :mri # redcarpet doesn't support jruby
Expand All @@ -21,6 +22,9 @@ group :optional do
gem "webrick"
end

gem "bigdecimal"
gem "rake"
gem "rspec", "~> 3.0"
gem "simplecov"
gem "yard"

Expand Down
74 changes: 43 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ GEM
ast (2.4.2)
backport (1.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
bigdecimal (3.1.9-java)
coderay (1.1.3)
debug (1.9.2)
date (3.4.1)
date (3.4.1-java)
debug (1.10.0)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
Expand All @@ -21,6 +25,7 @@ GEM
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
formatador (1.1.0)
gem-ctags (1.0.9)
guard (2.19.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand All @@ -35,16 +40,16 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
io-console (0.7.2)
io-console (0.7.2-java)
irb (1.14.1)
io-console (0.8.0)
io-console (0.8.0-java)
irb (1.14.3)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jar-dependencies (0.4.1)
jar-dependencies (0.5.1)
jaro_winkler (1.6.0)
jaro_winkler (1.6.0-java)
json (2.8.2)
json (2.8.2-java)
json (2.9.1)
json (2.9.1-java)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
Expand All @@ -56,13 +61,13 @@ GEM
lumberjack (1.2.10)
method_source (1.1.0)
nenv (0.3.0)
nokogiri (1.16.7-arm64-darwin)
nokogiri (1.18.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-java)
nokogiri (1.18.0-java)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-darwin)
nokogiri (1.18.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
nokogiri (1.18.0-x86_64-linux-gnu)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand All @@ -71,16 +76,18 @@ GEM
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pry (0.15.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry (0.15.0-java)
pry (0.15.2-java)
coderay (~> 1.1)
method_source (~> 1.0)
spoon (~> 0.0)
psych (5.2.0)
psych (5.2.2)
date
stringio
psych (5.2.0-java)
psych (5.2.2-java)
date
jar-dependencies (>= 0.1.7)
racc (1.8.1)
racc (1.8.1-java)
Expand All @@ -90,15 +97,15 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (2.8.4)
rdoc (6.8.1)
rdoc (6.10.0)
psych (>= 4.0.0)
redcarpet (3.6.0)
regexp_parser (2.9.2)
reline (0.5.11)
regexp_parser (2.10.0)
reline (0.6.0)
io-console (~> 0.5)
reverse_markdown (2.1.1)
nokogiri
rexml (3.3.9)
rexml (3.4.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -111,24 +118,24 @@ GEM
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.68.0)
rspec-support (3.13.2)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.36.1)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (3.2.0)
rubocop-rspec (3.3.0)
rubocop (~> 1.61)
ruby-maven (3.9.2)
ruby-maven (3.9.3)
ruby-maven-libs (~> 3.9.9)
ruby-maven-libs (3.9.9)
ruby-prof (1.7.1)
Expand Down Expand Up @@ -162,23 +169,28 @@ GEM
terminal-notifier (2.0.0)
terminal-notifier-guard (1.7.0)
thor (1.3.2)
tilt (2.4.0)
unicode-display_width (2.6.0)
webrick (1.9.0)
tilt (2.5.0)
unicode-display_width (3.1.3)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
webrick (1.9.1)
yard (0.9.37)

PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-23
arm64-darwin-24
java
universal-java-11
universal-java-18
x86_64-darwin-19
x86_64-linux

DEPENDENCIES
bigdecimal
debug (>= 1.0.0)
gem-ctags
guard-rspec
pry
rake
Expand All @@ -199,4 +211,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.5.18
2.6.2
8 changes: 4 additions & 4 deletions lib/ruby_units/definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def unity?
# units are base units if the scalar is one, and the unit is defined in terms of itself.
# @return [Boolean]
def base?
(denominator == RubyUnits::Unit::UNITY_ARRAY) &&
(numerator != RubyUnits::Unit::UNITY_ARRAY) &&
(numerator.size == 1) &&
(scalar == 1) &&
(denominator == RubyUnits::Unit::UNITY_ARRAY) &&
(numerator != RubyUnits::Unit::UNITY_ARRAY) &&
(numerator.size == 1) &&
(scalar == 1) &&
(numerator.first == self.name)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ruby_units/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def self.temp_regex
temp_units = %w[tempK tempC tempF tempR degK degC degF degR]
aliases = temp_units.map do |unit|
d = definition(unit)
d && d.aliases
d&.aliases
end.flatten.compact
regex_str = aliases.empty? ? "(?!x)x" : aliases.join("|")
Regexp.new "(?:#{regex_str})"
Expand Down
36 changes: 18 additions & 18 deletions ruby-units.gemspec
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
lib = File.expand_path('lib', __dir__)
# frozen_string_literal: true

lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ruby_units/version'
require "ruby_units/version"

Gem::Specification.new do |spec|
spec.name = 'ruby-units'
spec.name = "ruby-units"
spec.version = RubyUnits::Unit::VERSION
spec.authors = ['Kevin Olbrich']
spec.email = ['[email protected]']
spec.authors = ["Kevin Olbrich"]
spec.email = ["[email protected]"]

spec.required_rubygems_version = '>= 2.0'
spec.required_ruby_version = '>= 2.7'
spec.summary = 'Provides classes and methods to perform unit math and conversions'
spec.description = 'Provides classes and methods to perform unit math and conversions'
spec.homepage = 'https://github.com/olbrich/ruby-units'
spec.license = 'MIT'
spec.required_rubygems_version = ">= 2.0"
spec.required_ruby_version = ">= 2.7"
spec.summary = "Provides classes and methods to perform unit math and conversions"
spec.description = "Provides classes and methods to perform unit math and conversions"
spec.homepage = "https://github.com/olbrich/ruby-units"
spec.license = "MIT"

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/olbrich/ruby-units'
spec.metadata['changelog_uri'] = 'https://github.com/olbrich/ruby-units/releases'
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/olbrich/ruby-units"
spec.metadata["changelog_uri"] = "https://github.com/olbrich/ruby-units/releases"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(File.expand_path(__dir__)) do
`git ls-files -z`.split("\x0").reject { _1.match(%r{^(test|spec|features)/}) }
end
spec.require_paths = ['lib']

spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.require_paths = ["lib"]
spec.metadata["rubygems_mfa_required"] = "true"
end
2 changes: 1 addition & 1 deletion spec/ruby_units/unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@
end

context RubyUnits::Unit.new("1 m") do
it { expect(subject**0).to eq(1) }
it { expect(subject**0).to eq(1) } # rubocop:disable Lint/NumericOperationWithConstantResult
it { expect(subject**1).to eq(subject) } # rubocop:disable Lint/UselessNumericOperation
it { expect(subject**-1).to eq(1 / subject) }
it { expect(subject**2).to eq(RubyUnits::Unit.new("1 m^2")) }
Expand Down

0 comments on commit ef74ee8

Please sign in to comment.