diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89d3af6..01b7919 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,21 +4,22 @@ on: [push] jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['3.3', '3.4', '4.0'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1 + ruby-version: ${{ matrix.ruby-version }} bundler-cache: true - - run: bundle install - run: bundle exec rspec rubocop: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: 3.1 + ruby-version: '4.0' bundler-cache: true - - run: bundle install - run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index bcfe7df..8680011 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,9 +1,9 @@ -require: - - rubocop-performance - AllCops: NewCops: enable - TargetRubyVersion: 2.6 + SuggestExtensions: false + +plugins: + - rubocop-performance Metrics/AbcSize: Enabled: false Metrics/BlockLength: diff --git a/.ruby-version b/.ruby-version index be94e6f..1454f6e 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.2.2 +4.0.1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..551bee7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [1.1.0] - 2026-02-11 + +### Breaking Changes +- Now requires Faraday 2.x (previously supported Faraday 1.x) +- Dropped support for Ruby versions older than 3.3. Officially supported versions are Ruby 3.3, 3.4, and 4.0. \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6d0d94f..cf3d97f 100644 --- a/Gemfile +++ b/Gemfile @@ -6,3 +6,14 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } # Specify your gem's dependencies in action_network_rest.gemspec gemspec + +group :development do + gem 'bundler', '>= 2.0', '< 5.0' + gem 'debug', '~> 1.0' + gem 'dotenv', '~> 2.7' + gem 'rake', '~> 13.0' + gem 'rspec', '~> 3.0' + gem 'rubocop', '~> 1.0' + gem 'rubocop-performance', '~> 1.0' + gem 'webmock', '~> 3.0' +end diff --git a/README.md b/README.md index dfdb8db..512bab4 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ Ruby client for interacting with the [ActionNetwork REST API](https://actionnetw [![CI Status](https://github.com/controlshift/action-network-rest/actions/workflows/ci.yml/badge.svg)](https://github.com/controlshift/action-network-rest/actions/workflows/ci.yml) +## Requirements + +- Ruby 3.3, 3.4, or 4.0 +- Faraday ~> 2.0 + ## Installation Add this line to your application's Gemfile: diff --git a/action_network_rest.gemspec b/action_network_rest.gemspec index e11399d..06955ba 100644 --- a/action_network_rest.gemspec +++ b/action_network_rest.gemspec @@ -7,8 +7,8 @@ require 'action_network_rest/version' Gem::Specification.new do |spec| spec.name = 'action_network_rest' spec.version = ActionNetworkRest::VERSION - spec.authors = ['Grey Moore'] - spec.email = ['grey@controlshiftlabs.com'] + spec.authors = ['Grey Moore', 'Owens Ehimen', 'Diego Marcet'] + spec.email = ['talk@controlshiftlabs.com'] spec.summary = 'Ruby client for interacting with the ActionNetwork REST API' spec.homepage = 'https://github.com/controlshift/action-network-rest' @@ -21,17 +21,11 @@ Gem::Specification.new do |spec| end spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = ['>= 3.3', '< 5.0'] - spec.add_runtime_dependency 'vertebrae', '>= 1.0.0' + spec.add_dependency 'faraday', '~> 2.0' + spec.add_dependency 'faraday-mashify', '~> 1.0' + spec.add_dependency 'vertebrae', '~> 1.0' - spec.add_development_dependency 'bundler', '~> 2.1' - spec.add_development_dependency 'debug', '> 0' - spec.add_development_dependency 'dotenv', '~> 2.7' - spec.add_development_dependency 'rake', '~> 13.0' - spec.add_development_dependency 'rspec', '~> 3.0' - spec.add_development_dependency 'rubocop', '> 0' - spec.add_development_dependency 'rubocop-performance', '> 0' - spec.add_development_dependency 'webmock', '~> 3.8.3' spec.metadata['rubygems_mfa_required'] = 'true' end diff --git a/bin/rake b/bin/rake index 9c4fca6..ed705ab 100755 --- a/bin/rake +++ b/bin/rake @@ -8,7 +8,6 @@ # this file is here to facilitate running it. # -require 'pathname' ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath) diff --git a/bin/rspec b/bin/rspec index e6dd588..956b1d8 100755 --- a/bin/rspec +++ b/bin/rspec @@ -8,7 +8,6 @@ # this file is here to facilitate running it. # -require 'pathname' ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath) diff --git a/lib/action_network_rest.rb b/lib/action_network_rest.rb index 309c8c9..34f508d 100644 --- a/lib/action_network_rest.rb +++ b/lib/action_network_rest.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'vertebrae' +require 'faraday/mashify' module ActionNetworkRest extend Vertebrae::Base diff --git a/lib/action_network_rest/advocacy_campaigns.rb b/lib/action_network_rest/advocacy_campaigns.rb index 34d4aec..2f3ae6c 100644 --- a/lib/action_network_rest/advocacy_campaigns.rb +++ b/lib/action_network_rest/advocacy_campaigns.rb @@ -2,10 +2,6 @@ module ActionNetworkRest class AdvocacyCampaigns < Base - def initialize(client:) - super(client: client) - end - def base_path 'advocacy_campaigns/' end diff --git a/lib/action_network_rest/campaigns.rb b/lib/action_network_rest/campaigns.rb index 1bd36d7..20dc28c 100644 --- a/lib/action_network_rest/campaigns.rb +++ b/lib/action_network_rest/campaigns.rb @@ -4,10 +4,6 @@ module ActionNetworkRest class Campaigns < Base attr_accessor :campaign_id - def initialize(client:) - super(client: client) - end - def base_path 'campaigns/' end diff --git a/lib/action_network_rest/client.rb b/lib/action_network_rest/client.rb index b243e89..265c082 100644 --- a/lib/action_network_rest/client.rb +++ b/lib/action_network_rest/client.rb @@ -4,9 +4,9 @@ module ActionNetworkRest class Client < API attr_accessor :api_key - def initialize(options = {}, &block) + def initialize(options = {}, &) self.api_key = options[:api_key] - super(options, &block) + super end def default_options diff --git a/lib/action_network_rest/forms.rb b/lib/action_network_rest/forms.rb index 0a1de37..80de9e5 100644 --- a/lib/action_network_rest/forms.rb +++ b/lib/action_network_rest/forms.rb @@ -2,10 +2,6 @@ module ActionNetworkRest class Forms < Base - def initialize(client:) - super(client: client) - end - def base_path 'forms/' end diff --git a/lib/action_network_rest/version.rb b/lib/action_network_rest/version.rb index b0c4dfb..f51ed95 100644 --- a/lib/action_network_rest/version.rb +++ b/lib/action_network_rest/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActionNetworkRest - VERSION = '1.0.1' + VERSION = '1.1.0' end diff --git a/spec/people_spec.rb b/spec/people_spec.rb index 7d818c1..ebc7f37 100644 --- a/spec/people_spec.rb +++ b/spec/people_spec.rb @@ -216,7 +216,7 @@ { _embedded: { 'osdi:people': [ - identifiers: ["action_network:#{person_id}"] + { identifiers: ["action_network:#{person_id}"] } ] } }.to_json @@ -265,7 +265,7 @@ { _embedded: { 'osdi:people': [ - identifiers: ["action_network:#{person_id}"] + { identifiers: ["action_network:#{person_id}"] } ] } }.to_json diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 102adb9..158d6ef 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,7 +5,7 @@ require 'webmock/rspec' # Require everything in the `support` directory -Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].sort.each { |f| require f } +Dir[File.join(File.dirname(__FILE__), 'support', '**', '*.rb')].each { |f| require f } RSpec.configure do |config| # Enable flags like --only-failures and --next-failure