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

Update to allow use of Ruby 3.0 #106

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ jobs:
matrix:
os:
- ubuntu-latest
ruby-version: [2.6, 2.7]
ruby-version: [2.6, 2.7, '3.0', 3.1]

steps:
- uses: actions/checkout@v2

- name: Set up Ruby
uses: ruby/setup-ruby@a699edbce608a2c128dedad88e3b6a0e28687b3c
uses: ruby/setup-ruby@v1
BiggerNoise marked this conversation as resolved.
Show resolved Hide resolved
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
Expand Down
10 changes: 8 additions & 2 deletions lib/propono/services/publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ class PublisherError < ProponoError
end

class Publisher
def self.publish(*args)
new(*args).publish
if RUBY_VERSION < '3'
def self.publish(*args)
new(*args).publish
end
BiggerNoise marked this conversation as resolved.
Show resolved Hide resolved
else
def self.publish(aws_client, propono_config, topic_name, message, options = {})
new(aws_client, propono_config, topic_name, message, **options).publish
end
end

attr_reader :aws_client, :propono_config, :topic_name, :message, :id, :async
Expand Down
1 change: 1 addition & 0 deletions propono.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", "~> 2.1"
spec.add_development_dependency "rake"
spec.add_development_dependency "mocha"
spec.add_development_dependency "nokogiri"
BiggerNoise marked this conversation as resolved.
Show resolved Hide resolved
spec.add_development_dependency "yard"
spec.add_development_dependency "minitest", "~> 5.0.8"
end
4 changes: 2 additions & 2 deletions test/services/publisher_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def test_initialization
def test_self_publish_calls_new
topic = "topic123"
message = "message123"
Publisher.expects(:new).with(aws_client, topic, message).returns(mock(publish: nil))
Publisher.publish(aws_client, topic, message)
Publisher.expects(:new).with(aws_client, propono_config, topic, message).returns(mock(publish: nil))
Publisher.publish(aws_client, propono_config, topic, message)
BiggerNoise marked this conversation as resolved.
Show resolved Hide resolved
end

def test_initializer_generates_an_id
Expand Down