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

CircleCI Commit #78

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2.1

executors:
default:
working_directory: ~/sdk
docker:
- image: cimg/ruby:2.7

jobs:
build:
executor: default
steps:
- checkout
- run:
name: Install bundler & gems
command: |
gem install bundler
bundle install --jobs 4 --retry 3
- run:
name: Rubocop
command: bundle exec rubocop --parallel
# - run:
# name: Run Tests
# command: bundle exec rake tests
publish:
executor: default
steps:
- checkout
- run:
name: Publish to RubyGems
command: |
mkdir -p ~/.gem
touch ~/.gem/credentials
chmod 0600 ~/.gem/credentials
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > ~/.gem/credentials
gem build *.gemspec
gem push *.gem
environment:
GEM_HOST_API_KEY: $RUBYGEMS_AUTH_TOKEN

workflows:
build_and_test:
jobs:
- build
publish:
jobs:
- publish:
filters:
branches:
only:
- master
32 changes: 0 additions & 32 deletions .github/workflows/gem-push.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/ruby.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/paymentrails/Client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def send_request(endPoint, method, body = '')
'Authorization': generate_authorization(time, endPoint, method, body),
'Content-Type': 'application/json',
'Trolley-Source': "ruby-sdk_#{spec.version}"}

if method === "GET"
request = Net::HTTP::Get.new(uri.request_uri, headers)
elsif method === "POST"
Expand Down
2 changes: 2 additions & 0 deletions lib/paymentrails/gateways/GatewayHelper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module PaymentRails
module GatewayHelper
# rubocop:disable Lint/SuppressedException
def loosely_hydrate_model(klass_instance, attributes)
attributes.each do |k, v|
begin
Expand All @@ -12,5 +13,6 @@ def loosely_hydrate_model(klass_instance, attributes)

klass_instance
end
# rubocop:enable Lint/SuppressedException
end
end
4 changes: 2 additions & 2 deletions paymentrails.gemspec
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$:.push File.expand_path("../lib", __FILE__)

Gem::Specification.new do |s|
s.name = "paymentrails"
s.name = "paymentrails-zero"
s.summary = "Trolley Ruby SDK"
s.description = "Ruby SDK for interacting with the Trolley API"
s.version = '0.2.13'
s.version = '0.2.14'
s.homepage = 'https://trolley.com/'
s.email = ['[email protected]']
s.license = "MIT"
Expand Down
2 changes: 2 additions & 0 deletions spec/integration/RecipientTest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def test_lifecycle
assert_equal(recipient.status, 'archived')
end

# rubocop:disable Metrics/MethodLength
def test_account
uuid = SecureRandom.uuid.to_s
recipient = @client.recipient.create(
Expand Down Expand Up @@ -88,4 +89,5 @@ def test_account
accountList = @client.recipient_account.all(recipient.id)
assert_equal(1, accountList.count)
end
# rubocop:enable Metrics/MethodLength
end