diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3e276b6..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,70 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '15 17 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'ruby' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://git.io/codeql-language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 236c1e8..7069c86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,39 +15,40 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', '3.4', 'jruby-9.4'] + ruby: ['3.2', '3.3', '3.4', 'jruby-10.0'] env: BUNDLE_WITHOUT: optional steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6.0.1 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Tests for Ruby ${{ matrix.ruby }} run: bundle exec rake - coverage: - needs: test - runs-on: ubuntu-latest - env: - BUNDLE_WITHOUT: optional - steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - - name: Publish code coverage - uses: paambaati/codeclimate-action@v9 - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - with: - coverageCommand: bundle exec rake + # CodeClimate has become qlth.sh, this integration is currently broken. + # coverage: + # needs: test + # runs-on: ubuntu-latest + # env: + # BUNDLE_WITHOUT: optional + # steps: + # - uses: actions/checkout@v6.0.1 + # - uses: ruby/setup-ruby@v1 + # with: + # bundler-cache: true + # - name: Publish code coverage + # uses: paambaati/codeclimate-action@v9 + # env: + # CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + # with: + # coverageCommand: bundle exec rake yard: runs-on: ubuntu-latest env: BUNDLE_WITHOUT: optional steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6.0.1 - uses: ruby/setup-ruby@v1 with: bundler-cache: true diff --git a/.ruby-version b/.ruby-version index 9cec716..e650c01 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.1.6 +3.2.9 diff --git a/.tool-versions b/.tool-versions index 007d4c3..1faa5d2 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -java adoptopenjdk-18.0.1+10 -ruby 3.1.6 +java adoptopenjdk-jre-21.0.9+10.0.LTS +ruby 3.2.9 diff --git a/Gemfile.lock b/Gemfile.lock index 7308734..a8656b5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -6,32 +6,38 @@ PATH GEM remote: https://rubygems.org/ specs: - ast (2.4.2) + ast (2.4.3) backport (1.2.0) - benchmark (0.4.0) - bigdecimal (3.1.9) - bigdecimal (3.1.9-java) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) + bigdecimal (4.0.1-java) coderay (1.1.3) - date (3.4.1) - date (3.4.1-java) - debug (1.10.0) + date (3.5.1) + date (3.5.1-java) + debug (1.11.1) irb (~> 1.10) reline (>= 0.3.8) - diff-lcs (1.5.1) + diff-lcs (1.6.2) docile (1.4.1) e2mmap (0.1.0) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-java) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) - formatador (1.1.0) + erb (6.0.1) + erb (6.0.1-java) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-java) + ffi (1.17.2-x86_64-darwin) + ffi (1.17.2-x86_64-linux-gnu) + formatador (1.2.3) + reline gem-ctags (1.0.9) - guard (2.19.0) + guard (2.19.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) + logger (~> 1.6) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) + ostruct (~> 0.6) pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) @@ -40,42 +46,50 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - io-console (0.8.0) - io-console (0.8.0-java) - irb (1.14.3) + io-console (0.8.2) + io-console (0.8.2-java) + irb (1.16.0) + pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) - jar-dependencies (0.5.1) - jaro_winkler (1.6.0) - jaro_winkler (1.6.0-java) - json (2.9.1) - json (2.9.1-java) + jar-dependencies (0.5.5) + jaro_winkler (1.6.1) + jaro_winkler (1.6.1-java) + json (2.18.0) + json (2.18.0-java) kramdown (2.5.1) rexml (>= 3.3.9) kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) - language_server-protocol (3.17.0.3) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - lumberjack (1.2.10) + logger (1.7.0) + lumberjack (1.4.2) method_source (1.1.0) nenv (0.3.0) - nokogiri (1.18.0-arm64-darwin) + nokogiri (1.18.10-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.0-java) + nokogiri (1.18.10-java) racc (~> 1.4) - nokogiri (1.18.0-x86_64-darwin) + nokogiri (1.18.10-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.0-x86_64-linux-gnu) + nokogiri (1.18.10-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - parallel (1.26.3) - parser (3.3.6.0) + ostruct (0.6.3) + parallel (1.27.0) + parser (3.3.10.0) ast (~> 2.4.1) racc + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.7.0) pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) @@ -83,104 +97,111 @@ GEM coderay (~> 1.1) method_source (~> 1.0) spoon (~> 0.0) - psych (5.2.2) + psych (5.3.1) date stringio - psych (5.2.2-java) + psych (5.3.1-java) date jar-dependencies (>= 0.1.7) racc (1.8.1) racc (1.8.1-java) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.1) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rbs (2.8.4) - rdoc (6.10.0) + rdoc (7.0.1) + erb psych (>= 4.0.0) - redcarpet (3.6.0) - regexp_parser (2.10.0) - reline (0.6.0) + tsort + redcarpet (3.6.1) + regexp_parser (2.11.3) + reline (0.6.3) io-console (~> 0.5) reverse_markdown (2.1.1) nokogiri - rexml (3.4.0) - rspec (3.13.0) + rexml (3.4.4) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.2) + rspec-core (3.13.6) rspec-support (~> 3.13.0) - rspec-expectations (3.13.3) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.2) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.2) - rubocop (1.69.2) + rspec-support (3.13.6) + rubocop (1.82.0) json (~> 2.3) - language_server-protocol (>= 3.17.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.36.2, < 2.0) + rubocop-ast (>= 1.48.0, < 2.0) ruby-progressbar (~> 1.7) 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.3.0) - rubocop (~> 1.61) + rubocop-ast (1.48.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-rake (0.7.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1) + rubocop-rspec (3.8.0) + lint_roller (~> 1.1) + rubocop (~> 1.81) ruby-maven (3.9.3) ruby-maven-libs (~> 3.9.9) ruby-maven-libs (3.9.9) - ruby-prof (1.7.1) + ruby-prof (1.7.2) + base64 ruby-progressbar (1.13.0) shellany (0.0.1) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.1) + simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) - solargraph (0.50.0) + solargraph (0.48.0) backport (~> 1.2) benchmark - bundler (~> 2.0) + bundler (>= 1.17.2) diff-lcs (~> 1.4) e2mmap jaro_winkler (~> 1.5) kramdown (~> 2.3) kramdown-parser-gfm (~> 1.1) parser (~> 3.0) - rbs (~> 2.0) - reverse_markdown (~> 2.0) - rubocop (~> 1.38) + reverse_markdown (>= 1.0.5, < 3) + rubocop (>= 0.52) thor (~> 1.0) tilt (~> 2.0) yard (~> 0.9, >= 0.9.24) spoon (0.0.6) ffi - stringio (3.1.2) + stringio (3.2.0) terminal-notifier (2.0.0) terminal-notifier-guard (1.7.0) - thor (1.3.2) - 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) + thor (1.4.0) + tilt (2.6.1) + tsort (0.2.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + webrick (1.9.2) + yard (0.9.38) PLATFORMS arm64-darwin-21 arm64-darwin-22 arm64-darwin-23 arm64-darwin-24 + arm64-darwin-25 java universal-java-11 universal-java-18 @@ -211,4 +232,4 @@ DEPENDENCIES yard BUNDLED WITH - 2.6.2 + 4.0.2 diff --git a/README.md b/README.md index ab8ef09..8861475 100644 --- a/README.md +++ b/README.md @@ -302,7 +302,7 @@ end ``` | Option | Description | Valid Values | Default | -|-----------|------------------------------------------------------------------------------------------------------------------------|---------------------------|-------------| +| --------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------- | ----------- | | format | Only used for output formatting. `:rational` is formatted like `3 m/s^2`. `:exponential` is formatted like `3 m*s^-2`. | `:rational, :exponential` | `:rational` | | separator | Use a space separator for output. `true` is formatted like `3 m/s`, `false` is like `3m/s`. | `true, false` | `true` | diff --git a/lib/ruby_units/unit.rb b/lib/ruby_units/unit.rb index 5de4930..53d558b 100644 --- a/lib/ruby_units/unit.rb +++ b/lib/ruby_units/unit.rb @@ -2,7 +2,7 @@ require "date" module RubyUnits - # Copyright 2006-2024 + # Copyright 2006-2026 # @author Kevin C. Olbrich, Ph.D. # @see https://github.com/olbrich/ruby-units #