Skip to content
Merged
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
34 changes: 0 additions & 34 deletions .buildkite/pipeline.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/.pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Pull Request
about: Propose a change to the code repository
title: ''
labels: ''
assignees: ''

---

## 📝 Description
<!-- Link to the issue related to this work -->
Issue Reference: <ISSUE_REFERENCE>

<!-- What and why is this change being made? -->
Details of change
- <CHANGE_DETAIL_1>
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Runtime environment**

- Version of the gem in use
- Ruby version in use
- OS that issues was seen under

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 2
updates:
- package-ecosystem: bundler
directory: /gemfiles/ruby3.2
schedule:
interval: weekly
groups:
non-major-dependencies:
update-types:
- "minor"
- "patch"
- package-ecosystem: bundler
directory: /gemfiles/ruby3.3
schedule:
interval: weekly
groups:
non-major-dependencies:
update-types:
- "minor"
- "patch"
- package-ecosystem: bundler
directory: /gemfiles/ruby3.4
schedule:
interval: weekly
groups:
non-major-dependencies:
update-types:
- "minor"
- "patch"
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: build and test

on:
push:
branches:
- main
tags:
- '*.*.*'
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version:
- 3.2
- 3.3
- 3.4
steps:
- uses: actions/checkout@v4

- name: Set up Ruby and Install Gem
uses: ruby/setup-ruby@v1
env:
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Run rubocop
env:
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
run: |
bundle exec rubocop

- name: Run rspec test
env:
BUNDLE_GEMFILE: gemfiles/ruby${{ matrix.ruby-version }}/Gemfile
run: |
bundle exec rspec

publish-gem:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
environment: release
permissions:
id-token: write
needs:
- build-and-test
steps:
- uses: actions/checkout@v4

- name: Validate Base Ref
id: validate_base_ref
env:
JSON_ENV_VARS: ${{ inputs.credentials_json }}
shell: bash
run: |
if [ "${{ github.event.base_ref }}" != "refs/heads/main" ]; then
echo "Only main branch tags can be published"
echo "Tag's BASE_REF [${{ github.event.base_ref }}] is not [refs/heads/main]"
exit 1
fi

- name: Validate Tag
id: validate_tag
uses: rubenesp87/semver-validation-action@1aa67a60c04f1f6cccd1bcd93885f25f612bcc35
with:
version: ${{ github.ref_name }}

- name: Update version
shell: bash
run: |
echo "Using TAG ${{ github.ref_name }}"
sed -i "s/0.0.0.pre.build/${{ github.ref_name }}/" lib/fat_zebra/version.rb

- name: Configure trusted publishing credentials
uses: rubygems/configure-rubygems-credentials@v1.0.0

- name: Build and publish
shell: bash
run: |
gem build
gem push *.gem
env:
GIT_AUTHOR_NAME: Fat Zebra
GIT_AUTHOR_EMAIL: support@fatzebra.com
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
*.gem
.bundle
Gemfile.lock
pkg/*
.yardoc
doc/
Expand Down
43 changes: 22 additions & 21 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.2
Exclude:
- vendor/**/*
- spec/**/*

Layout/EmptyLinesAroundClassBody:
Enabled: false
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/LineLength:
Max: 200

Style/Documentation:
Enabled: false
Style/MapIntoArray:
Enabled: false
Style/MissingRespondToMissing:
Enabled: false
Style/NumericPredicate:
Enabled: false
Style/SuperArguments:
Enabled: false

Lint/MissingSuper:
Enabled: false
Style/NumericPredicate:

Gemspec/DevelopmentDependencies:
Enabled: false

Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
Max: 27
Metrics/LineLength:
Max: 200
Metrics/ClassLength:
CountComments: false
Max: 200
Metrics/MethodLength:
CountComments: false
Max: 25
Metrics/ModuleLength:
CountComments: false
Max: 200
Metrics/CyclomaticComplexity:
Max: 7

Documentation:
Naming/PredicateMethod:
Enabled: false

AllCops:
TargetRubyVersion: 2.7
Exclude:
- bin/**/*
- vendor/**/*
- tmp/**/*
- spec/**/*
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
Ruby API Library for Fat Zebra
==============================

[![Build Status](https://travis-ci.org/fatzebra/Ruby-Library.svg?branch=master)](https://travis-ci.org/fatzebra/Ruby-Library)

Release 3.2.6 for API version 1.0

A Ruby client for the [Fat Zebra](https://www.fatzebra.com) Online Payment Gateway

Dependencies
------------

* Ruby (tested on 2.3, 2.4, 2.5, 2.6)
* Rest Client
- [Latest releases](https://github.com/fatzebra/Ruby-Library/releases)
- [Published Gem versions](https://rubygems.org/gems/fat_zebra)

Installing
----------
Expand Down
18 changes: 9 additions & 9 deletions fat_zebra.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ Gem::Specification.new do |s|
s.summary = 'Fat Zebra payments gem - integrate your ruby app with Fat Zebra'
s.description = 'Provides integration with the Fat Zebra internet payment gateway (www.fatzebra.com), including purchase, refund, auth, capture and recurring billing functionality.'

s.metadata['homepage_uri'] = s.homepage
s.metadata['source_code_uri'] = s.homepage
s.metadata['homepage_uri'] = s.homepage
s.metadata['source_code_uri'] = s.homepage
s.metadata['rubygems_mfa_required'] = 'true'

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {spec}/*`.split("\n")
s.require_paths = %w[lib]
s.files = Dir.glob('lib/**/*') + %w[README.md fat_zebra.gemspec]
s.require_paths = ['lib']

s.required_ruby_version = '>= 2.7'
s.required_ruby_version = '>= 3.2'

s.add_development_dependency 'byebug'
s.add_development_dependency 'rake'
s.add_development_dependency 'rspec', '~> 3.6'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rubocop'
s.add_development_dependency 'vcr', '~> 3.0'
s.add_development_dependency 'webmock', '~> 3.0'
s.add_development_dependency 'vcr'
s.add_development_dependency 'webmock'
end
4 changes: 3 additions & 1 deletion Gemfile → gemfiles/ruby3.2/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

source 'http://rubygems.org'

ruby '3.2.9'

# Specify your gem's dependencies in FatZebra.gemspec
gemspec
gemspec path: '../../'
Loading