Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New maintainable fork #21

Open
kraft001 opened this issue Mar 20, 2023 · 1 comment
Open

New maintainable fork #21

kraft001 opened this issue Mar 20, 2023 · 1 comment

Comments

@kraft001
Copy link

Hi, RubyGarage team!

Many thanks for the amazing gem!

However, it hasn't been updated for quite a long time, so we had to fork and upgrade it to make compatible with new ruby versions:
https://github.com/uploadcare/uploadcare-api_struct
https://rubygems.org/gems/uploadcare-api_struct

Please, let me know if you decide to revive this gem and I'll prepare a PR to copy changes from the fork.

Thanks!

@jaykilleen
Copy link

jaykilleen commented Mar 30, 2023

Thanks for this @kraft001.
I have switched mine over to your fork as I was running ruby 3.2.1 and
getting an error something to do with dry-monads Transform / Transformer ... (should have copied it down) or something to that effect.

Once I forked...
I had the error uninitialized constant ApiStruct (NameError) thrown
which was resolved by simply adding require 'api_struct' to the top of my initializer.

Hopefully this helps someone else so thought I should share the experience.

/config/initializers/api_struct.rb

require 'api_struct'

ApiStruct::Settings.configure do |config|
  config.endpoints = {
    api: {
      root: 'https://api.service.com/external/v1',
      headers: {
        'content-type': 'application/json',
        'Authorization': "Bearer #{ Rails.application.credentials.gospotcheck_api_token }"
      }
    }
  }
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants