Skip to content

Commit

Permalink
Merge pull request #1 from Sage/ruby-3-2-support
Browse files Browse the repository at this point in the history
Update dependencies and test on Ruby 3.2
  • Loading branch information
robkilby authored Oct 9, 2023
2 parents ee01638 + 673c0ed commit 04bc71e
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 128 deletions.
19 changes: 8 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
version: 2

updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
time: "08:00"
open-pull-requests-limit: 10
ignore:
- dependency-name: nokogiri
versions:
- 1.11.1
- 1.11.2
- package-ecosystem: bundler
directory: "/"
schedule:
interval: weekly
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 0
43 changes: 38 additions & 5 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,50 @@
name: Tests
on:
push:

on: [push]

jobs:
rspec:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.2
bundler-cache: true

- run: bundle exec rspec

release:
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

env:
GEMS_PATH: "pkg/*.gem"
RUBYGEMS_HOST: "https://sageonegems.jfrog.io/artifactory/api/gems/gems-local"
JFROG_USER: "${{ secrets.JFROG_USER }}"
JFROG_PASS: "${{ secrets.JFROG_PASS }}"

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true

- name: Clear any existing packages
run: rm -f $GEMS_PATH

- name: Retrieve credentials
run: |
mkdir -p $HOME/.gem
curl -u $JFROG_USER:$JFROG_PASS $RUBYGEMS_HOST/api/v1/api_key.yaml > $HOME/.gem/credentials
chmod 600 $HOME/.gem/credentials
- name: Build gem
run: bundle exec rake build ofx.gemspec

- name: Publish
run: gem push $GEMS_PATH
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
#
# See https://docs.rubocop.org/rubocop/configuration
AllCops:
TargetRubyVersion: 2.7.5
TargetRubyVersion: 3.2
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
source "https://rubygems.org"

gemspec

gem 'byebug', '>= 11.1.3'
gem 'rake', '>= 13.0.6'
gem 'rspec', '>= 3.10'
42 changes: 0 additions & 42 deletions Gemfile.lock

This file was deleted.

69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# OFX

[![Build Status](https://github.com/Sage/ofx/actions/workflows/config.yml/badge.svg)](https://github.com/Sage/ofx/actions)

A simple OFX (Open Financial Exchange) parser built on top of Nokogiri. Currently supports both OFX 1.0.2 and 2.1.1.

Works on both ruby 1.9 and 2.0.

## Usage

```ruby
require "ofx"

OFX("file.ofx") do
p account
p account.balance
p account.transactions
end
```

Invalid files will raise an OFX::UnsupportedFileError.


## Deploy

1. Create and send the new version to Rubygems

```ruby
bundle exec rake release
```

2. Create a [new release on Github](https://github.com/annacruz/ofx/releases/new)

* Choose **the new tag** (Ex.: v0.10.1)
* Fill the **Release title** (Ex.: 0.10.1)
* Click at **Generate release notes**
* Click at **Publish release**

3. Done!

## Creator

* Nando Vieira - http://simplesideias.com.br

## Maintainer

* Anna Cruz - http://anna-cruz.com

## License

(The MIT License)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the 'Software'), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
51 changes: 0 additions & 51 deletions README.rdoc

This file was deleted.

2 changes: 1 addition & 1 deletion lib/ofx/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def open_resource(resource)
if resource.respond_to?(:read)
resource
else
open(resource)
open(resource, encoding: 'UTF-8')
end
rescue
StringIO.new(resource)
Expand Down
6 changes: 3 additions & 3 deletions lib/ofx/version.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module OFX
module Version
MAJOR = 0
MINOR = 3
PATCH = 3
MAJOR = 1
MINOR = 0
PATCH = 0
STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
end
end
5 changes: 1 addition & 4 deletions ofx.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,5 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.licenses = ['MIT']

s.add_dependency 'nokogiri', '~> 1.13.1'
s.add_development_dependency 'byebug', '~> 11.1.3'
s.add_development_dependency 'rake', '~> 13.0.6'
s.add_development_dependency 'rspec', '~> 3.10'
s.add_dependency 'nokogiri', '>= 1.13.1'
end
2 changes: 1 addition & 1 deletion spec/ofx/ofx_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

it "should work with UTF8 and Latin1 encodings" do
@ofx = OFX::Parser::Base.new("spec/fixtures/utf8.ofx")
@ofx.content.should == open("spec/fixtures/utf8.ofx").read
@ofx.content.should == open("spec/fixtures/utf8.ofx", encoding: 'UTF-8').read
end

it "should set body" do
Expand Down

0 comments on commit 04bc71e

Please sign in to comment.