Skip to content

Commit

Permalink
Merge pull request #61 from railslove/ci/github-actions
Browse files Browse the repository at this point in the history
ci: fix pipeline
  • Loading branch information
janz93 authored Jan 6, 2025
2 parents 1f447c8 + 01169a2 commit 2be8345
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:
Expand All @@ -17,7 +17,7 @@ jobs:
- 3.2
- 3.1
- "3.0"
- jruby-9.4
- jruby-9.4

steps:
- uses: actions/checkout@v4
Expand All @@ -27,4 +27,4 @@ jobs:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run tests
run: bundle exec rake
run: bundle exec rake
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ spec/reports
test/tmp
test/version_tmp
tmp
.byebug_history
2 changes: 1 addition & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--color
--color
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Gem Version](https://badge.fury.io/rb/cmxl.svg)](http://badge.fury.io/rb/cmxl)
[![CI](https://github.com/railslove/cmxl/actions/workflows/ci.yml/badge.svg)](https://github.com/railslove/cmxl/actions/workflows/ci.yml)
[![Gem Version](https://badge.fury.io/rb/cmxl.svg)](https://rubygems.org/gems/cmxl)

# Cmxl - your friendly ruby MT940 parser

Expand All @@ -15,7 +16,7 @@ For more information have a look at the different [SWIFT message types](http://e

At some point in the future MT940 file should be exchanged with newer XML documents - but banking institutions are slow, so MT940 will stick around for a while.

## Reqirements
## Requirements

Cmxl is a pure ruby parser and has no dependency on native extensions.

Expand Down Expand Up @@ -95,7 +96,7 @@ If that fails, try to modify the file before you pass it to the parser - and ple
### MT940 SWIFT header data

Cmxl currently does not support parsing of the SWIFT headers (like {1:F01AXISINBBA ....)
If your file comes with these headers try the `strip_headers` configuration option to strip data execpt the actual MT940 fields.
If your file comes with these headers try the `strip_headers` configuration option to strip data except the actual MT940 fields.

```ruby
Cmxl.config[:strip_headers] = true
Expand Down Expand Up @@ -186,6 +187,6 @@ other parsers:

---
built with love by [Railslove](http://railslove.com) and some [amazing people](https://github.com/railslove/cmxl/graphs/contributors).
Released under the MIT-Licence.
Released under the MIT-License.

Railslove builds FinTech products, if you need support for your project we are happy to help. Please contact us at [email protected].
5 changes: 2 additions & 3 deletions cmxl.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_dependency 'rchardet'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'pry'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~>3.0'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'byebug'

spec.add_dependency 'rchardet'
end
2 changes: 1 addition & 1 deletion lib/cmxl/field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def to_h

# The parser class variable is the registry of all available parser.
# It is a hash with the tag (MT940 field number/tag) as key and the class as value
# When parsing a statment line we look for a matching entry or use the Unknown class as default
# When parsing a statement line we look for a matching entry or use the Unknown class as default
@@parsers = {}
@@parsers.default = Unknown
def self.parsers
Expand Down
8 changes: 4 additions & 4 deletions spec/fields/transaction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
subject(:ocmt_cghs_transaction) { Cmxl::Fields::Transaction.parse(fixture_line(:statement_ocmt_chgs)) }
subject(:supplementary_transaction) { Cmxl::Fields::Transaction.parse(fixture_line(:statement_supplementary_plain)) }
subject(:complex_supplementary_transaction) { Cmxl::Fields::Transaction.parse(fixture_line(:statement_supplementary_complex)) }
subject(:valuta_after_enty_date) { Cmxl::Fields::Transaction.parse(fixture[3]) }
subject(:valuta_after_entry_date) { Cmxl::Fields::Transaction.parse(fixture[3]) }
subject(:entry_before_valuta_transaction) { Cmxl::Fields::Transaction.parse(fixture[2]) }
subject(:transaction_type_swift) { Cmxl::Fields::Transaction.parse(fixture[4]) }

Expand Down Expand Up @@ -82,14 +82,14 @@
end

context 'valuta and entry-date assumptions' do
it 'entry_date before valuta is recognized correclty when including year-change' do
it 'entry_date before valuta is recognized correctly when including year-change' do
expect(entry_before_valuta_transaction.date).to eql(Date.new(2014, 1, 10))
expect(entry_before_valuta_transaction.entry_date).to eql(Date.new(2013, 12, 24))
end

it 'entry_date after valuta is recognized correctly when including year-change' do
expect(valuta_after_enty_date.date).to eql(Date.new(2014, 12, 24))
expect(valuta_after_enty_date.entry_date).to eql(Date.new(2015, 1, 2))
expect(valuta_after_entry_date.date).to eql(Date.new(2014, 12, 24))
expect(valuta_after_entry_date.entry_date).to eql(Date.new(2015, 1, 2))
end
end

Expand Down

0 comments on commit 2be8345

Please sign in to comment.