accodeing / fortnox-api

Gem that abstracts Fortnox's F3 API
GNU Lesser General Public License v3.0
9 stars 8 forks source link

Add support for Ruby 3 #212

Closed ehannes closed 1 year ago

ehannes commented 2 years ago

Travis build is not even working now:

Setting environment variables from .travis.yml
$ export CC_TEST_REPORTER_ID=[filtered-id]
1.10s$ rvm get head
Downloading https://get.rvm.io
Downloading https://bitbucket.org/mpapis/rvm/raw/master/binscripts/rvm-installer.asc
Micros.asc
The command "rvm get head" failed and exited with 3 during .
Your build has been stopped.
ehannes commented 2 years ago

e93fb785108497dede6248928105b64f9ea2c4ef fixed the above error. Simply added an explicit Ubuntu version to run Travis with. It was by default running on Xenial before, which is Ubuntu 16.04! That's 5 years old now, time to upgrade! Interesting that Travis uses that distro by default...

Now we have another problem, in both 3.0.4 and 3.1.2 when loading dry-struct in ./lib/fortnox/api.rb:4:

An error occurred while loading ./spec/fortnox/api/circular_queue_spec.rb.
Failure/Error: require 'dry-struct'
ArgumentError:
  wrong number of arguments (given 2, expected 1)

followed by a lot of warnings from dry libs as well as a lot of these errors:

Failure/Error: require 'dry-struct'
Dry::Container::Error:
  There is already an item registered with the key "string"

dry-struct version 0.4.0 is used:

Fetching dry-struct 0.4.0
Installing dry-struct 0.4.0

That's the same version that the build for 2.7.6 is using and that build is not crashing...

ehannes commented 2 years ago

The above problem might be because the current used version of dry-struct is not supporting Ruby 3. That version is released 2017-11-04, more than 4 years ago and long before Ruby 3 was around!

ehannes commented 1 year ago

Resolved in #228