From 6752f9cc672e0e3308ff05fe496b4a106bad9ed8 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Mar 2022 15:36:17 -0800 Subject: [PATCH 1/3] Migrate CI to GitHub actions --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..ff3bdcd8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake +# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby + +name: build + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + ruby: + - '3.1' + - '3.0' + - '2.7' + - '2.6' + - '2.5' + - '2.4' + - '2.3' + - '2.2' + - '2.1' + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake From e8be0f546368cce844bf68c0c443bdeb42b6af72 Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Mar 2022 15:53:37 -0800 Subject: [PATCH 2/3] Fix Integer / BigDecimal issue - wrap in BigDecimal before calling to_s("F") --- lib/stupidedi/versions/common/element_types/r.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/stupidedi/versions/common/element_types/r.rb b/lib/stupidedi/versions/common/element_types/r.rb index 1772c34b..706c93a3 100644 --- a/lib/stupidedi/versions/common/element_types/r.rb +++ b/lib/stupidedi/versions/common/element_types/r.rb @@ -284,7 +284,9 @@ def to_x12(truncate = true) if rounded.zero? "0" * definition.min_length else - sign + rounded.abs.to_s("F"). + base = rounded.abs + base = base.is_a?(BigDecimal) ? base : BigDecimal(base) + sign + base.to_s("F"). gsub(/^0+/, ""). # leading zeros gsub(/0+$/, ""). # trailing zeros gsub(/\.$/, ""). # trailing decimal point From 3ec699b76749e64d29ed1b49f1037cd03dfc9e1f Mon Sep 17 00:00:00 2001 From: Peter Goldstein Date: Mon, 7 Mar 2022 15:58:28 -0800 Subject: [PATCH 3/3] Remove the .travis.yml file --- .travis.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4f2ecb06..00000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: ruby -before_install: - - if [[ $(ruby -v) < "ruby 2.3" ]]; - then - gem install bundler -v "< 2"; - else - gem update --system; - gem install bundler; - bundle update --bundler; - fi - -rvm: -# 2.0.0 -- 2.1.0 -- 2.1.1 -- 2.1.2 -- 2.1.6 -- 2.1.7 -- 2.1.8 -- 2.2.0 -- 2.2.1 -- 2.2.2 -- 2.2.3 -- 2.2.4 -- 2.3.0 -- 2.3.1 -- 2.3.2 -- 2.3.3 -- 2.4.1 -- 2.4.3 -- 2.5.0 -- 2.5.1 -- 2.5.3 -- 2.6.3 -- 2.7.0 -- 2.7.1