From 0a2fddddd03e55dd9f74594251c3e2638065135b Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Mon, 16 Sep 2024 16:21:34 -0300 Subject: [PATCH 01/10] Update nokogiri gem --- Gemfile.lock | 8 ++++---- ofx.gemspec | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 06b55b4..a0fdd7a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,15 +2,15 @@ PATH remote: . specs: ofx (0.3.3) - nokogiri (~> 1.13.1) + nokogiri (~> 1.14.5) GEM remote: https://rubygems.org/ specs: byebug (11.1.3) diff-lcs (1.5.0) - mini_portile2 (2.8.0) - nokogiri (1.13.8) + mini_portile2 (2.8.7) + nokogiri (1.14.5) mini_portile2 (~> 2.8.0) racc (~> 1.4) racc (1.6.0) @@ -39,4 +39,4 @@ DEPENDENCIES rspec (~> 3.10) BUNDLED WITH - 1.16.4 + 2.5.5 diff --git a/ofx.gemspec b/ofx.gemspec index 5849825..2da4511 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.licenses = ['MIT'] - s.add_dependency 'nokogiri', '~> 1.13.1' + s.add_dependency 'nokogiri', '~> 1.14.5' s.add_development_dependency 'byebug', '~> 11.1.3' s.add_development_dependency 'rake', '~> 13.0.6' s.add_development_dependency 'rspec', '~> 3.10' From d6b9942c0edcc248b78af4b10367f8fcf5e65192 Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Mon, 16 Sep 2024 16:29:12 -0300 Subject: [PATCH 02/10] Update gem version --- Gemfile.lock | 2 +- lib/ofx/version.rb | 7 +------ ofx.gemspec | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index a0fdd7a..aa0c2d8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ofx (0.3.3) + ofx (0.4.0) nokogiri (~> 1.14.5) GEM diff --git a/lib/ofx/version.rb b/lib/ofx/version.rb index 6c82f02..9ae16ca 100644 --- a/lib/ofx/version.rb +++ b/lib/ofx/version.rb @@ -1,8 +1,3 @@ module OFX - module Version - MAJOR = 0 - MINOR = 3 - PATCH = 3 - STRING = "#{MAJOR}.#{MINOR}.#{PATCH}" - end + VERSION = '0.4.0'.freeze end diff --git a/ofx.gemspec b/ofx.gemspec index 2da4511..4717eac 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -3,7 +3,7 @@ require 'ofx/version' Gem::Specification.new do |s| s.name = 'ofx' - s.version = OFX::Version::STRING + s.version = OFX::VERSION s.platform = Gem::Platform::RUBY s.authors = ['Nando Vieira', 'Anna Cruz'] s.email = ['fnando.vieira@gmail.com', 'anna.cruz@gmail.com'] From d72bec0c6da96facd51f756acd8469c3c3373d86 Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Mon, 16 Sep 2024 16:59:07 -0300 Subject: [PATCH 03/10] Fix github actions (#2) --- .github/workflows/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/config.yml b/.github/workflows/config.yml index bba9c29..0e65bc8 100644 --- a/.github/workflows/config.yml +++ b/.github/workflows/config.yml @@ -11,7 +11,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.3.2 bundler-cache: true - run: bundle exec rspec From baa78641801f2b8d602d7f763b3cb45caba3f42e Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Tue, 17 Sep 2024 09:52:34 -0300 Subject: [PATCH 04/10] Update the README (#3) --- Gemfile.lock | 2 +- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++ README.rdoc | 51 --------------------------------- lib/ofx/version.rb | 2 +- 4 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 README.md delete mode 100644 README.rdoc diff --git a/Gemfile.lock b/Gemfile.lock index aa0c2d8..ab57161 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ofx (0.4.0) + ofx (0.4.1) nokogiri (~> 1.14.5) GEM diff --git a/README.md b/README.md new file mode 100644 index 0000000..bb66bb9 --- /dev/null +++ b/README.md @@ -0,0 +1,70 @@ +# OFX + +[![Gem Version](https://badge.fury.io/rb/ofx.svg)](https://badge.fury.io/rb/ofx) +[![Build Status](https://github.com/annacruz/ofx/actions/workflows/config.yml/badge.svg)](https://github.com/annacruz/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. + +## 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 + +### New version + +1. New version at `lib/ofx/version.rb`; +2. Execute `$ bundle`; +3. Commit and push to Github; + +### Release at Github + +1. Create a [new release on Github](https://github.com/asseinfo/ofx/releases/new) +1. Fill the **the new tag**. Ex.: v4.0.1 +1. Target `master` +1. Fill the **Release title**. Ex.: 4.0.1 (March 3, 2020) +1. Click at **Generate release notes** +1. Click at **Publish release** + + [Reference here](https://help.github.com/en/github/administering-a-repository/managing-releases-in-a-repository) + +## 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. diff --git a/README.rdoc b/README.rdoc deleted file mode 100644 index 71dc812..0000000 --- a/README.rdoc +++ /dev/null @@ -1,51 +0,0 @@ -= OFX - -{Gem Version}[https://badge.fury.io/rb/ofx] -{Build Status}[https://github.com/annacruz/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 - - require "ofx" - - OFX("file.ofx") do - p account - p account.balance - p account.transactions - end - -Invalid files will raise an OFX::UnsupportedFileError. - -== 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. diff --git a/lib/ofx/version.rb b/lib/ofx/version.rb index 9ae16ca..b3577e6 100644 --- a/lib/ofx/version.rb +++ b/lib/ofx/version.rb @@ -1,3 +1,3 @@ module OFX - VERSION = '0.4.0'.freeze + VERSION = '0.4.1'.freeze end From 34d8fa07269c6297c13d09708b829228f914c878 Mon Sep 17 00:00:00 2001 From: Rafael Fernandes <86632943+rafaelfernandes98@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:18:44 -0300 Subject: [PATCH 05/10] Configure gem guard (#4) --- .gitignore | 4 +++- Gemfile.lock | 36 ++++++++++++++++++++++++++++++++++++ Guardfile | 14 ++++++++++++++ ofx.gemspec | 2 ++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 Guardfile diff --git a/.gitignore b/.gitignore index 3a3f5f1..7f62820 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store *.gem pkg -Gemfile.lock \ No newline at end of file +Gemfile.lock +.tool-versions +bin diff --git a/Gemfile.lock b/Gemfile.lock index ab57161..ce6067f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,13 +8,45 @@ GEM remote: https://rubygems.org/ specs: byebug (11.1.3) + coderay (1.1.3) diff-lcs (1.5.0) + ffi (1.16.3) + formatador (1.1.0) + guard (2.18.1) + formatador (>= 0.2.4) + listen (>= 2.7, < 4.0) + lumberjack (>= 1.0.12, < 2.0) + nenv (~> 0.1) + notiffany (~> 0.0) + pry (>= 0.13.0) + shellany (~> 0.0) + thor (>= 0.18.1) + guard-compat (1.2.1) + guard-rspec (4.7.3) + guard (~> 2.1) + guard-compat (~> 1.1) + rspec (>= 2.99.0, < 4.0) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + lumberjack (1.2.10) + method_source (1.0.0) mini_portile2 (2.8.7) + nenv (0.3.0) nokogiri (1.14.5) mini_portile2 (~> 2.8.0) racc (~> 1.4) + notiffany (0.1.3) + nenv (~> 0.1) + shellany (~> 0.0) + pry (0.14.2) + coderay (~> 1.1) + method_source (~> 1.0) racc (1.6.0) rake (13.0.6) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) rspec (3.11.0) rspec-core (~> 3.11.0) rspec-expectations (~> 3.11.0) @@ -28,12 +60,16 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) rspec-support (3.11.0) + shellany (0.0.1) + thor (1.3.1) PLATFORMS ruby DEPENDENCIES byebug (~> 11.1.3) + guard (~> 2.18.0) + guard-rspec (~> 4.7.3) ofx! rake (~> 13.0.6) rspec (~> 3.10) diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..f1aa05b --- /dev/null +++ b/Guardfile @@ -0,0 +1,14 @@ +guard :rspec, cmd: "bundle exec rspec" do + require "guard/rspec/dsl" + dsl = Guard::RSpec::Dsl.new(self) + + # RSpec files + rspec = dsl.rspec + watch(rspec.spec_helper) { rspec.spec_dir } + watch(rspec.spec_support) { rspec.spec_dir } + watch(rspec.spec_files) + + # Ruby files + ruby = dsl.ruby + dsl.watch_spec_files_for(ruby.lib_files) +end diff --git a/ofx.gemspec b/ofx.gemspec index 4717eac..55eabc2 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -28,4 +28,6 @@ Gem::Specification.new do |s| 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_development_dependency 'guard', '~> 2.18.0' + s.add_development_dependency 'guard-rspec', '~> 4.7.3' end From b2296bf080edae55896b5f2502914fe4d2579275 Mon Sep 17 00:00:00 2001 From: Rafael Fernandes <86632943+rafaelfernandes98@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:22:04 -0300 Subject: [PATCH 06/10] Remove should method (#5) --- spec/ofx/account_spec.rb | 91 +++++++++++++++++---------------- spec/ofx/ofx102_spec.rb | 52 +++++++++---------- spec/ofx/ofx103_spec.rb | 37 +++++++------- spec/ofx/ofx211_spec.rb | 65 +++++++++++------------- spec/ofx/ofx_parser_spec.rb | 98 ++++++++++++++++++------------------ spec/ofx/ofx_spec.rb | 15 +++--- spec/ofx/sign_on_spec.rb | 16 +++--- spec/ofx/statement_spec.rb | 58 ++++++++++----------- spec/ofx/status_spec.rb | 32 ++++++------ spec/ofx/transaction_spec.rb | 78 ++++++++++++++-------------- 10 files changed, 271 insertions(+), 271 deletions(-) diff --git a/spec/ofx/account_spec.rb b/spec/ofx/account_spec.rb index 4612648..58f2dc4 100644 --- a/spec/ofx/account_spec.rb +++ b/spec/ofx/account_spec.rb @@ -8,57 +8,57 @@ end describe "account" do - it "should return currency" do - @account.currency.should == "BRL" + it "returns currency" do + expect(@account.currency).to eql "BRL" end - it "should return bank id" do - @account.bank_id.should == "0356" + it "returns bank id" do + expect(@account.bank_id).to eql "0356" end - it "should return id" do - @account.id.should == "03227113109" + it "returns id" do + expect(@account.id).to eql "03227113109" end - it "should return type" do - @account.type.should == :checking + it "returns type" do + expect(@account.type).to eql :checking end - it "should return transactions" do - @account.transactions.should be_a_kind_of(Array) - @account.transactions.size.should == 36 + it "returns transactions" do + expect(@account.transactions).to be_a_kind_of(Array) + expect(@account.transactions.size).to eql 36 end - it "should return balance" do - @account.balance.amount.should == BigDecimal('598.44') + it "returns balance" do + expect(@account.balance.amount).to eql BigDecimal('598.44') end - it "should return balance in pennies" do - @account.balance.amount_in_pennies.should == 59844 + it "returns balance in pennies" do + expect(@account.balance.amount_in_pennies).to eql 59844 end - it "should return balance date" do - @account.balance.posted_at.should == Time.gm(2009,11,1) + it "returns balance date" do + expect(@account.balance.posted_at).to eql Time.gm(2009,11,1) end context "available_balance" do - it "should return available balance" do - @account.available_balance.amount.should == BigDecimal('1555.99') + it "returns available balance" do + expect(@account.available_balance.amount).to eql BigDecimal('1555.99') end - it "should return available balance in pennies" do - @account.available_balance.amount_in_pennies.should == 155599 + it "returns available balance in pennies" do + expect(@account.available_balance.amount_in_pennies).to eql 155599 end - it "should return available balance date" do - @account.available_balance.posted_at.should == Time.gm(2009,11,1) + it "returns available balance date" do + expect(@account.available_balance.posted_at).to eql Time.gm(2009,11,1) end - it "should return nil if AVAILBAL not found" do + it "returns nil if AVAILBAL not found" do @ofx = OFX::Parser::Base.new("spec/fixtures/utf8.ofx") @parser = @ofx.parser @account = @parser.account - @account.available_balance.should be_nil + expect(@account.available_balance).to be_nil end end @@ -69,14 +69,15 @@ @account = @parser.account end - it "should return id" do - @account.id.should == "XXXXXXXXXXXX1111" + it "returns id" do + expect(@account.id).to eql "XXXXXXXXXXXX1111" end - it "should return currency" do - @account.currency.should == "USD" + it "returns currency" do + expect(@account.currency).to eql "USD" end end + context "With Issue" do # Bradesco do not provide a valid date in balance before do @ofx = OFX::Parser::Base.new("spec/fixtures/dtsof_balance_issue.ofx") @@ -84,8 +85,8 @@ @account = @parser.account end - it "should return nil for date balance" do - @account.balance.posted_at.should be_nil + it "returns nil for date balance" do + expect(@account.balance.posted_at).to be_nil end end @@ -94,12 +95,14 @@ @ofx = OFX::Parser::Base.new("spec/fixtures/bradesco.ofx") @parser = @ofx.parser end - it "should not raise error when balance has date zero" do - expect { @parser.account.balance }.to_not raise_error + + it "is not raise error when balance has date zero" do + expect { @parser.account.balance }.not_to raise_error + end + + it "returns NIL in balance.posted_at when balance date is zero" do + expect(@parser.account.balance.posted_at).to be_nil end - it "should return NIL in balance.posted_at when balance date is zero" do - @parser.account.balance.posted_at.should be_nil - end end context "decimal values using a comma" do @@ -109,21 +112,21 @@ @account = @parser.account end - it "should return balance" do - @account.balance.amount.should == BigDecimal('348.29') + it "returns balance" do + expect(@account.balance.amount).to eql BigDecimal('348.29') end - it "should return balance in pennies" do - @account.balance.amount_in_pennies.should == 34829 + it "returns balance in pennies" do + expect(@account.balance.amount_in_pennies).to eql 34829 end context "available_balance" do - it "should return available balance" do - @account.available_balance.amount.should == BigDecimal('2415.87') + it "returns available balance" do + expect(@account.available_balance.amount).to eql BigDecimal('2415.87') end - it "should return available balance in pennies" do - @account.available_balance.amount_in_pennies.should == 241587 + it "returns available balance in pennies" do + expect(@account.available_balance.amount_in_pennies).to eql 241587 end end end diff --git a/spec/ofx/ofx102_spec.rb b/spec/ofx/ofx102_spec.rb index d6329a6..c636aee 100644 --- a/spec/ofx/ofx102_spec.rb +++ b/spec/ofx/ofx102_spec.rb @@ -6,61 +6,61 @@ @parser = @ofx.parser end - it "should have a version" do - OFX::Parser::OFX102::VERSION.should == "1.0.2" + it "has a version" do + expect(OFX::Parser::OFX102::VERSION).to eql "1.0.2" end - it "should set headers" do - @parser.headers.should == @ofx.headers + it "sets headers" do + expect(@parser.headers).to eql @ofx.headers end - it "should trim trailing whitespace from headers" do + it "trims trailing whitespace from headers" do headers = OFX::Parser::OFX102.parse_headers("VERSION:102 ") - headers["VERSION"].should == "102" + expect(headers["VERSION"]).to eql "102" end - it "should set body" do - @parser.body.should == @ofx.body + it "sets body" do + expect(@parser.body).to eql @ofx.body end - it "should set account" do - @parser.account.should be_a_kind_of(OFX::Account) + it "sets account" do + expect(@parser.account).to be_a_kind_of(OFX::Account) end - it "should set account" do - @parser.sign_on.should be_a_kind_of(OFX::SignOn) + it "sets account" do + expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) end - it "should set statements" do - @parser.statements.size.should == 1 - @parser.statements.first.should be_a_kind_of(OFX::Statement) + it "sets statements" do + expect(@parser.statements.size).to eql 1 + expect(@parser.statements.first).to be_a_kind_of(OFX::Statement) end - - it "should know about all transaction types" do + + it "knows about all transaction types" do valid_types = [ 'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER' ] - valid_types.sort.should == OFX::Parser::OFX102::TRANSACTION_TYPES.keys.sort + expect(valid_types.sort).to eql OFX::Parser::OFX102::TRANSACTION_TYPES.keys.sort valid_types.each do |transaction_type| - transaction_type.downcase.to_sym.should equal OFX::Parser::OFX102::TRANSACTION_TYPES[transaction_type] + expect(transaction_type.downcase.to_sym).to eql OFX::Parser::OFX102::TRANSACTION_TYPES[transaction_type] end end describe "#build_date" do context "without a Time Zone" do - it "should default to GMT" do - @parser.send(:build_date, "20170904").should == Time.gm(2017, 9, 4) - @parser.send(:build_date, "20170904082855").should == Time.gm(2017, 9, 4, 8, 28, 55) + it "defaults to GMT" do + expect(@parser.send(:build_date, "20170904")).to eql Time.gm(2017, 9, 4) + expect(@parser.send(:build_date, "20170904082855")).to eql Time.gm(2017, 9, 4, 8, 28, 55) end end context "with a Time Zone" do - it "should returns the correct date" do - @parser.send(:build_date, "20150507164333[-0300:BRT]").should == Time.new(2015, 5, 7, 16, 43, 33, "-03:00") - @parser.send(:build_date, "20180507120000[0:GMT]").should == Time.gm(2018, 5, 7, 12) - @parser.send(:build_date, "20170904082855[-3:GMT]").should == Time.new(2017, 9, 4, 8, 28, 55, "-03:00") + it "returns the correct date" do + expect(@parser.send(:build_date, "20150507164333[-0300:BRT]")).to eql Time.new(2015, 5, 7, 16, 43, 33, "-03:00") + expect(@parser.send(:build_date, "20180507120000[0:GMT]")).to eql Time.gm(2018, 5, 7, 12) + expect(@parser.send(:build_date, "20170904082855[-3:GMT]")).to eql Time.new(2017, 9, 4, 8, 28, 55, "-03:00") end end end diff --git a/spec/ofx/ofx103_spec.rb b/spec/ofx/ofx103_spec.rb index abb05f4..754353c 100644 --- a/spec/ofx/ofx103_spec.rb +++ b/spec/ofx/ofx103_spec.rb @@ -6,45 +6,46 @@ @parser = @ofx.parser end - it "should have a version" do - OFX::Parser::OFX103::VERSION.should == "1.0.3" + it "has a version" do + expect(OFX::Parser::OFX103::VERSION).to eql "1.0.3" end - it "should set headers" do - @parser.headers.should == @ofx.headers + it "sets headers" do + expect(@parser.headers).to eql @ofx.headers end - it "should trim trailing whitespace from headers" do + it "trims trailing whitespace from headers" do headers = OFX::Parser::OFX103.parse_headers("VERSION:103 ") - headers["VERSION"].should == "103" + + expect(headers["VERSION"]).to eql "103" end - it "should set body" do - @parser.body.should == @ofx.body + it "sets body" do + expect(@parser.body).to eql @ofx.body end - it "should set account" do - @parser.account.should be_a_kind_of(OFX::Account) + it "sets account" do + expect(@parser.account).to be_a_kind_of(OFX::Account) end - it "should set account" do - @parser.sign_on.should be_a_kind_of(OFX::SignOn) + it "sets account" do + expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) end - it "should set statements" do - @parser.statements.size.should == 1 - @parser.statements.first.should be_a_kind_of(OFX::Statement) + it "sets statements" do + expect(@parser.statements.size).to eql 1 + expect(@parser.statements.first).to be_a_kind_of(OFX::Statement) end - it "should know about all transaction types" do + it "knows about all transaction types" do valid_types = [ 'CREDIT', 'DEBIT', 'INT', 'DIV', 'FEE', 'SRVCHG', 'DEP', 'ATM', 'POS', 'XFER', 'CHECK', 'PAYMENT', 'CASH', 'DIRECTDEP', 'DIRECTDEBIT', 'REPEATPMT', 'OTHER' ] - valid_types.sort.should == OFX::Parser::OFX103::TRANSACTION_TYPES.keys.sort + expect(valid_types.sort).to eql OFX::Parser::OFX103::TRANSACTION_TYPES.keys.sort valid_types.each do |transaction_type| - transaction_type.downcase.to_sym.should equal OFX::Parser::OFX103::TRANSACTION_TYPES[transaction_type] + expect(transaction_type.downcase.to_sym).to eql OFX::Parser::OFX103::TRANSACTION_TYPES[transaction_type] end end end diff --git a/spec/ofx/ofx211_spec.rb b/spec/ofx/ofx211_spec.rb index 2e30052..2a99a5c 100644 --- a/spec/ofx/ofx211_spec.rb +++ b/spec/ofx/ofx211_spec.rb @@ -6,33 +6,28 @@ @parser = @ofx.parser end - it "should have a version" do - OFX::Parser::OFX211::VERSION.should == "2.1.1" + it "has a version" do + expect(OFX::Parser::OFX211::VERSION).to eql "2.1.1" end - it "should set headers" do - @parser.headers.should == @ofx.headers + it "sets headers" do + expect(@parser.headers).to eql @ofx.headers end - it "should set body" do - @parser.body.should == @ofx.body + it "sets body" do + expect(@parser.body).to eql @ofx.body end - it "should set account" do - @parser.account.should be_a_kind_of(OFX::Account) + it "sets account" do + expect(@parser.account).to be_a_kind_of(OFX::Account) end - it "should set account" do - @parser.sign_on.should be_a_kind_of(OFX::SignOn) + it "sets sign_on" do + expect(@parser.sign_on).to be_a_kind_of(OFX::SignOn) end - it "should set accounts" do - @parser.accounts.size.should == 2 - end - - it "should set statements" do - @parser.statements.size.should == 2 - @parser.statements.first.should be_a_kind_of(OFX::Statement) + it "sets accounts" do + expect(@parser.accounts.size).to eql 2 end context "transactions" do @@ -43,12 +38,12 @@ @t = @parser.accounts[0].transactions[0] end - it "should contain the correct values" do - @t.amount.should == BigDecimal('-80') - @t.fit_id.should == "219378" - @t.memo.should be_empty - @t.posted_at.should == Time.parse("2005-08-24 08:00:00 +0000") - @t.name.should == "FrogKick Scuba Gear" + it "contains the correct values" do + expect(@t.amount).to eql BigDecimal('-80') + expect(@t.fit_id).to eql "219378" + expect(@t.memo).to be_empty + expect(@t.posted_at).to eql Time.parse("2005-08-24 08:00:00 +0000") + expect(@t.name).to eql "FrogKick Scuba Gear" end end @@ -57,12 +52,12 @@ @t = @parser.accounts[1].transactions[0] end - it "should contain the correct values" do - @t.amount.should == BigDecimal('-23') - @t.fit_id.should == "219867" - @t.memo.should be_empty - @t.posted_at.should == Time.parse("2005-08-11 08:00:00 +0000") - @t.name.should == "Interest Charge" + it "contains the correct values" do + expect(@t.amount).to eql BigDecimal('-23') + expect(@t.fit_id).to eql "219867" + expect(@t.memo).to be_empty + expect(@t.posted_at).to eql Time.parse("2005-08-11 08:00:00 +0000") + expect(@t.name).to eql "Interest Charge" end end @@ -71,12 +66,12 @@ @t = @parser.accounts[1].transactions[1] end - it "should contain the correct values" do - @t.amount.should == BigDecimal('350') - @t.fit_id.should == "219868" - @t.memo.should be_empty - @t.posted_at.should == Time.parse("2005-08-11 08:00:00 +0000") - @t.name.should == "Payment - Thank You" + it "contains the correct values" do + expect(@t.amount).to eql BigDecimal('350') + expect(@t.fit_id).to eql "219868" + expect(@t.memo).to be_empty + expect(@t.posted_at).to eql Time.parse("2005-08-11 08:00:00 +0000") + expect(@t.name).to eql "Payment - Thank You" end end end diff --git a/spec/ofx/ofx_parser_spec.rb b/spec/ofx/ofx_parser_spec.rb index 6e8968b..9e1c51a 100644 --- a/spec/ofx/ofx_parser_spec.rb +++ b/spec/ofx/ofx_parser_spec.rb @@ -5,108 +5,110 @@ @ofx = OFX::Parser::Base.new("spec/fixtures/sample.ofx") end - it "should accept file path" do + it "accepts file path" do @ofx = OFX::Parser::Base.new("spec/fixtures/sample.ofx") - @ofx.content.should_not be_nil + expect(@ofx.content).not_to be_nil end - it "should accept file handler" do + it "accepts file handler" do file = open("spec/fixtures/sample.ofx") @ofx = OFX::Parser::Base.new(file) - @ofx.content.should_not be_nil + expect(@ofx.content).not_to be_nil end - it "should accept file content" do + it "accepts file content" do file = open("spec/fixtures/sample.ofx").read @ofx = OFX::Parser::Base.new(file) - @ofx.content.should_not be_nil + expect(@ofx.content).not_to be_nil end - it "should set content" do - @ofx.content.should == open("spec/fixtures/sample.ofx").read + it "sets content" do + expect(@ofx.content).to eql open("spec/fixtures/sample.ofx").read end - it "should work with UTF8 and Latin1 encodings" do + it "works with UTF8 and Latin1 encodings" do @ofx = OFX::Parser::Base.new("spec/fixtures/utf8.ofx") - @ofx.content.should == open("spec/fixtures/utf8.ofx").read + expect(@ofx.content).to eql open("spec/fixtures/utf8.ofx").read end - it "should set body" do - @ofx.body.should_not be_nil + it "sets body" do + expect(@ofx.body).not_to be_nil end - it "should raise exception when trying to parse an unsupported OFX version" do - lambda { + it "raises the exception when trying to parse an unsupported OFX version" do + expect{ OFX::Parser::Base.new("spec/fixtures/invalid_version.ofx") - }.should raise_error(OFX::UnsupportedFileError) + }.to raise_error(OFX::UnsupportedFileError) end - it "should raise exception when trying to parse an invalid file" do - lambda { + it "raises the exception when trying to parse an invalid file" do + expect{ OFX::Parser::Base.new("spec/fixtures/avatar.gif") - }.should raise_error(OFX::UnsupportedFileError) + }.to raise_error(OFX::UnsupportedFileError) end - it "should use 211 parser to parse version 200 ofx files" do - OFX::Parser::OFX211.stub(:new).and_return('ofx-211-parser') + it "uses 211 parser to parse version 200 ofx files" do + expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') + ofx = OFX::Parser::Base.new(ofx_2_example('200')) - ofx.parser.should == 'ofx-211-parser' + expect(ofx.parser).to eql 'ofx-211-parser' end - it "should use 211 parser to parse version 202 ofx files" do - OFX::Parser::OFX211.stub(:new).and_return('ofx-211-parser') + it "uses 211 parser to parse version 202 ofx files" do + expect(OFX::Parser::OFX211).to receive(:new).and_return('ofx-211-parser') + ofx = OFX::Parser::Base.new(ofx_2_example('202')) - ofx.parser.should == 'ofx-211-parser' + expect(ofx.parser).to eql 'ofx-211-parser' end describe "headers" do - it "should have OFXHEADER" do - @ofx.headers["OFXHEADER"].should == "100" + it "has OFXHEADER" do + expect(@ofx.headers["OFXHEADER"]).to eql "100" end - it "should have DATA" do - @ofx.headers["DATA"].should == "OFXSGML" + it "has DATA" do + expect(@ofx.headers["DATA"]).to eql "OFXSGML" end - it "should have VERSION" do - @ofx.headers["VERSION"].should == "102" + it "has VERSION" do + expect(@ofx.headers["VERSION"]).to eql "102" end - it "should have SECURITY" do - @ofx.headers.should have_key("SECURITY") - @ofx.headers["SECURITY"].should be_nil + it "has SECURITY" do + expect(@ofx.headers).to have_key("SECURITY") + expect(@ofx.headers["SECURITY"]).to be_nil end - it "should have ENCODING" do - @ofx.headers["ENCODING"].should == "USASCII" + it "has ENCODING" do + expect(@ofx.headers["ENCODING"]).to eql "USASCII" end - it "should have CHARSET" do - @ofx.headers["CHARSET"].should == "1252" + it "has CHARSET" do + expect(@ofx.headers["CHARSET"]).to eql "1252" end - it "should have COMPRESSION" do - @ofx.headers.should have_key("COMPRESSION") - @ofx.headers["COMPRESSION"].should be_nil + it "has COMPRESSION" do + expect(@ofx.headers).to have_key("COMPRESSION") + expect(@ofx.headers["COMPRESSION"]).to be_nil end - it "should have OLDFILEUID" do - @ofx.headers.should have_key("OLDFILEUID") - @ofx.headers["OLDFILEUID"].should be_nil + it "has OLDFILEUID" do + expect(@ofx.headers).to have_key("OLDFILEUID") + expect(@ofx.headers["OLDFILEUID"]).to be_nil end - it "should have NEWFILEUID" do - @ofx.headers.should have_key("NEWFILEUID") - @ofx.headers["NEWFILEUID"].should be_nil + it "has NEWFILEUID" do + expect(@ofx.headers).to have_key("NEWFILEUID") + expect(@ofx.headers["NEWFILEUID"]).to be_nil end - it "should parse headers with CR and without LF" do + it "parses headers with CR and without LF" do header = %{OFXHEADER:100\rDATA:OFXSGML\rVERSION:102\rSECURITY:NONE\rENCODING:USASCII\rCHARSET:1252\rCOMPRESSION:NONE\rOLDFILEUID:NONE\rNEWFILEUID:NONE\r} body = open("spec/fixtures/sample.ofx").read.split(//, 2)[1] ofx_with_carriage_return = header + "" + body @ofx = OFX::Parser::Base.new(ofx_with_carriage_return) - @ofx.headers.size.should be(9) + expect(@ofx.headers.size).to be(9) end end diff --git a/spec/ofx/ofx_spec.rb b/spec/ofx/ofx_spec.rb index 87c10a9..0766983 100644 --- a/spec/ofx/ofx_spec.rb +++ b/spec/ofx/ofx_spec.rb @@ -2,20 +2,19 @@ describe OFX do describe "#OFX" do - it "should yield an OFX instance" do + it "creates the OFX instance" do OFX("spec/fixtures/sample.ofx") do |ofx| - ofx.class.should == OFX::Parser::OFX102 + expect(ofx.class).to eql OFX::Parser::OFX102 end end - it "should be an OFX instance" do - OFX("spec/fixtures/sample.ofx") do - self.class.should == OFX::Parser::OFX102 - end + it "returns the OFX instance" do + ofx_instace = OFX("spec/fixtures/sample.ofx") + expect(ofx_instace.class).to eql OFX::Parser::OFX102 end - it "should return parser" do - OFX("spec/fixtures/sample.ofx").class.should == OFX::Parser::OFX102 + it "returns the parser" do + expect(OFX("spec/fixtures/sample.ofx").class).to eql OFX::Parser::OFX102 end end end diff --git a/spec/ofx/sign_on_spec.rb b/spec/ofx/sign_on_spec.rb index daa1475..ca48015 100644 --- a/spec/ofx/sign_on_spec.rb +++ b/spec/ofx/sign_on_spec.rb @@ -8,20 +8,20 @@ end describe "sign_on" do - it "should return language" do - @sign_on.language.should == "ENG" + it "returns language" do + expect(@sign_on.language).to eql "ENG" end - it "should return Financial Institution ID" do - @sign_on.fi_id.should == "24909" + it "returns Financial Institution ID" do + expect(@sign_on.fi_id).to eql "24909" end - it "should return Financial Institution Name" do - @sign_on.fi_name.should == "Citigroup" + it "returns Financial Institution Name" do + expect(@sign_on.fi_name).to eql "Citigroup" end - it "should return status" do - @sign_on.status.should be_a(OFX::Status) + it "returns status" do + expect(@sign_on.status).to be_a(OFX::Status) end end end diff --git a/spec/ofx/statement_spec.rb b/spec/ofx/statement_spec.rb index 612c265..7d9e7a1 100644 --- a/spec/ofx/statement_spec.rb +++ b/spec/ofx/statement_spec.rb @@ -8,41 +8,41 @@ let(:ofx) { OFX::Parser::Base.new("spec/fixtures/sample.ofx") } it "returns currency" do - statement.currency.should == "BRL" + expect(statement.currency).to eql "BRL" end it "returns start date" do - statement.start_date.should == Time.parse("2009-10-09 08:00:00 +0000") + expect(statement.start_date).to eql Time.parse("2009-10-09 08:00:00 +0000") end it "returns end date" do - statement.end_date.should == Time.parse("2009-11-03 08:00:00 +0000") + expect(statement.end_date).to eql Time.parse("2009-11-03 08:00:00 +0000") end it "returns account" do - statement.account.should be_a(OFX::Account) - statement.account.id.should == '03227113109' - statement.account.type.should == :checking + expect(statement.account).to be_a(OFX::Account) + expect(statement.account.id).to eql '03227113109' + expect(statement.account.type).to eql :checking end it "returns transactions" do - statement.transactions.should be_a(Array) - statement.transactions.size.should == 36 + expect(statement.transactions).to be_a(Array) + expect(statement.transactions.size).to eql 36 end describe "balance" do let(:balance) { statement.balance } it "returns balance" do - balance.amount.should == BigDecimal('598.44') + expect(balance.amount).to eql BigDecimal('598.44') end it "returns balance in pennies" do - balance.amount_in_pennies.should == 59844 + expect(balance.amount_in_pennies).to eql 59844 end it "returns balance date" do - balance.posted_at.should == Time.parse("2009-11-01 00:00:00 +0000") + expect(balance.posted_at).to eql Time.parse("2009-11-01 00:00:00 +0000") end end @@ -50,22 +50,22 @@ let(:available_balance) { statement.available_balance } it "returns available balance" do - available_balance.amount.should == BigDecimal('1555.99') + expect(available_balance.amount).to eql BigDecimal('1555.99') end it "returns available balance in pennies" do - available_balance.amount_in_pennies.should == 155599 + expect(available_balance.amount_in_pennies).to eql 155599 end it "returns available balance date" do - available_balance.posted_at.should == Time.parse("2009-11-01 00:00:00 +0000") + expect(available_balance.posted_at).to eql Time.parse("2009-11-01 00:00:00 +0000") end context "when AVAILBAL not found" do let(:ofx) { OFX::Parser::Base.new("spec/fixtures/utf8.ofx") } - it "returns nil " do - available_balance.should be_nil + it "returns nil" do + expect(available_balance).to be_nil end end end @@ -75,40 +75,40 @@ let(:ofx) { OFX::Parser::Base.new("spec/fixtures/creditcard.ofx") } it "returns currency" do - statement.currency.should == "USD" + expect(statement.currency).to eql "USD" end it "returns start date" do - statement.start_date.should == Time.parse("2007-05-09 12:00:00 +0000") + expect(statement.start_date).to eql Time.parse("2007-05-09 12:00:00 +0000") end it "returns end date" do - statement.end_date.should == Time.parse("2007-06-08 12:00:00 +0000") + expect(statement.end_date).to eql Time.parse("2007-06-08 12:00:00 +0000") end it "returns account" do - statement.account.should be_a(OFX::Account) - statement.account.id.should == 'XXXXXXXXXXXX1111' + expect(statement.account).to be_a(OFX::Account) + expect(statement.account.id).to eql 'XXXXXXXXXXXX1111' end it "returns transactions" do - statement.transactions.should be_a(Array) - statement.transactions.size.should == 3 + expect(statement.transactions).to be_a(Array) + expect(statement.transactions.size).to eql 3 end describe "balance" do let(:balance) { statement.balance } it "returns balance" do - balance.amount.should == BigDecimal('-1111.01') + expect(balance.amount).to eql BigDecimal('-1111.01') end it "returns balance in pennies" do - balance.amount_in_pennies.should == -111101 + expect(balance.amount_in_pennies).to eql -111101 end it "returns balance date" do - balance.posted_at.should == Time.parse("2007-06-23 19:20:13 +0000") + expect(balance.posted_at).to eql Time.parse("2007-06-23 19:20:13 +0000") end end @@ -116,15 +116,15 @@ let(:available_balance) { statement.available_balance } it "returns available balance" do - available_balance.amount.should == BigDecimal('19000.99') + expect(available_balance.amount).to eql BigDecimal('19000.99') end it "returns available balance in pennies" do - available_balance.amount_in_pennies.should == 1900099 + expect(available_balance.amount_in_pennies).to eql 1900099 end it "returns available balance date" do - available_balance.posted_at.should == Time.parse("2007-06-23 19:20:13 +0000") + expect(available_balance.posted_at).to eql Time.parse("2007-06-23 19:20:13 +0000") end end end diff --git a/spec/ofx/status_spec.rb b/spec/ofx/status_spec.rb index 5b36418..c901d5c 100644 --- a/spec/ofx/status_spec.rb +++ b/spec/ofx/status_spec.rb @@ -8,40 +8,40 @@ context "success" do let(:ofx_file) { "spec/fixtures/creditcard.ofx" } - it "should return code" do - status.code.should == 0 + it "returns code" do + expect(status.code).to eql 0 end - it "should return severity" do - status.severity.should == :info + it "returns severity" do + expect(status.severity).to eql :info end - it "should return message" do - status.message.should == "" + it "returns message" do + expect(status.message).to eql "" end - it "should be successful" do - status.success?.should == true + it "is successful" do + expect(status.success?).to be true end end context "error" do let(:ofx_file) { "spec/fixtures/error.ofx" } - it "should return code" do - status.code.should == 2000 + it "returns code" do + expect(status.code).to eql 2000 end - it "should return severity" do - status.severity.should == :error + it "returns severity" do + expect(status.severity).to eql :error end - it "should return message" do - status.message.should == "We were unable to process your request. Please try again later." + it "returns message" do + expect(status.message).to eql "We were unable to process your request. Please try again later." end - it "should not be successful" do - status.success?.should == false + it "is not successful" do + expect(status.success?).to be false end end end diff --git a/spec/ofx/transaction_spec.rb b/spec/ofx/transaction_spec.rb index 32709c2..9e2dd7c 100644 --- a/spec/ofx/transaction_spec.rb +++ b/spec/ofx/transaction_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -describe OFX::Transaction do +RSpec.describe OFX::Transaction do before do @ofx = OFX::Parser::Base.new("spec/fixtures/sample.ofx") @parser = @ofx.parser @@ -12,43 +12,43 @@ @transaction = @account.transactions[0] end - it "should set amount" do + it "sets amount" do expect(@transaction.amount).to eql BigDecimal('-35.34') end - it "should cast amount to BigDecimal" do + it "casts amount to BigDecimal" do expect(@transaction.amount.class).to be BigDecimal end - it "should set amount in pennies" do + it "sets amount in pennies" do expect(@transaction.amount_in_pennies).to eql -3534 end - it "should set fit id" do + it "sets fit id" do expect(@transaction.fit_id).to eql "200910091" end - it "should set memo" do + it "sets memo" do expect(@transaction.memo).to eql "COMPRA VISA ELECTRON" end - it "should set check number" do + it "sets check number" do expect(@transaction.check_number).to eql "0001223" end - it "should have date" do + it "has date" do expect(@transaction.posted_at).to eql Time.parse("2009-10-09 08:00:00 +0000") end - it 'should have user date' do + it 'has user date' do expect(@transaction.occurred_at).to eql Time.parse("2009-09-09 08:00:00 +0000") end - it "should have type" do + it "has type" do expect(@transaction.type).to eql :debit end - it "should have sic" do + it "has sic" do expect(@transaction.sic).to eql '5072' end end @@ -58,39 +58,39 @@ @transaction = @account.transactions[1] end - it "should set amount" do + it "sets amount" do expect(@transaction.amount).to eql BigDecimal('60.39') end - it "should set amount in pennies" do + it "sets amount in pennies" do expect(@transaction.amount_in_pennies).to eql 6039 end - it "should set fit id" do + it "sets fit id" do expect(@transaction.fit_id).to eql "200910162" end - it "should set memo" do + it "sets memo" do expect(@transaction.memo).to eql "DEPOSITO POUP.CORRENTE" end - it "should set check number" do + it "sets check number" do expect(@transaction.check_number).to eql "0880136" end - it "should have date" do + it "has date" do expect(@transaction.posted_at).to eql Time.parse("2009-10-16 08:00:00 +0000") end - it "should have user date" do + it "has user date" do expect(@transaction.occurred_at).to eql Time.parse("2009-09-16 08:00:00 +0000") end - it "should have type" do + it "has type" do expect(@transaction.type).to eql :credit end - it "should have empty sic" do + it "has empty sic" do expect(@transaction.sic).to eql '' end end @@ -100,27 +100,27 @@ @transaction = @account.transactions[2] end - it "should set payee" do + it "sets payee" do expect(@transaction.payee).to eql "Pagto conta telefone" end - it "should set check number" do + it "sets check number" do expect(@transaction.check_number).to eql "000000101901" end - it "should have date" do + it "has date" do expect(@transaction.posted_at).to eql Time.parse("2009-10-19 12:00:00 -0300") end - it "should have user date" do + it "has user date" do expect(@transaction.occurred_at).to eql Time.parse("2009-10-17 12:00:00 -0300") end - it "should have type" do + it "has type" do expect(@transaction.type).to eql :other end - it "should have reference number" do + it "has reference number" do expect(@transaction.ref_number).to eql "101.901" end end @@ -130,7 +130,7 @@ @transaction = @account.transactions[3] end - it "should set name" do + it "sets name" do expect(@transaction.name).to eql "Pagto conta telefone" end end @@ -142,22 +142,22 @@ @account = @parser.account end - it "should return dep" do + it "returns dep" do @transaction = @account.transactions[9] expect(@transaction.type).to eql :dep end - it "should return xfer" do + it "returns xfer" do @transaction = @account.transactions[18] expect(@transaction.type).to eql :xfer end - it "should return cash" do + it "returns cash" do @transaction = @account.transactions[45] expect(@transaction.type).to eql :cash end - it "should return check" do + it "returns check" do @transaction = @account.transactions[0] expect(@transaction.type).to eql :check end @@ -175,11 +175,11 @@ @transaction = @account.transactions[0] end - it "should set amount" do + it "sets amount" do expect(@transaction.amount).to eql BigDecimal('-11.76') end - it "should set amount in pennies" do + it "sets amount in pennies" do expect(@transaction.amount_in_pennies).to eql -1176 end end @@ -189,11 +189,11 @@ @transaction = @account.transactions[3] end - it "should set amount" do + it "sets amount" do expect(@transaction.amount).to eql BigDecimal('47.01') end - it "should set amount in pennies" do + it "sets amount in pennies" do expect(@transaction.amount_in_pennies).to eql 4701 end end @@ -205,15 +205,15 @@ @parser = @ofx.parser end - it "should not raise error" do - expect { @parser.account.transactions }.to_not raise_error + it "does not raise error" do + expect { @parser.account.transactions }.not_to raise_error end - it "should return zero in amount" do + it "returns zero in amount" do expect(@parser.account.transactions[0].amount).to eql BigDecimal('0.0') end - it "should return zero in amount_in_pennies" do + it "returns zero in amount_in_pennies" do expect(@parser.account.transactions[0].amount_in_pennies).to eql 0 end end From d6ecfb274a26f342fdf352715b4ad3222ccccd2d Mon Sep 17 00:00:00 2001 From: Rafael Fernandes <86632943+rafaelfernandes98@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:27:13 -0300 Subject: [PATCH 07/10] Update Bigdecimal gem (#6) --- Gemfile.lock | 2 ++ ofx.gemspec | 1 + 2 files changed, 3 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index ce6067f..bb80215 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,11 +2,13 @@ PATH remote: . specs: ofx (0.4.1) + bigdecimal (~> 3.1.8) nokogiri (~> 1.14.5) GEM remote: https://rubygems.org/ specs: + bigdecimal (3.1.8) byebug (11.1.3) coderay (1.1.3) diff-lcs (1.5.0) diff --git a/ofx.gemspec b/ofx.gemspec index 55eabc2..07d3a7d 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |s| s.licenses = ['MIT'] s.add_dependency 'nokogiri', '~> 1.14.5' + s.add_dependency 'bigdecimal', '~> 3.1.8' s.add_development_dependency 'byebug', '~> 11.1.3' s.add_development_dependency 'rake', '~> 13.0.6' s.add_development_dependency 'rspec', '~> 3.10' From be3376906c31cc82fc7f9f681d7e5ddd0a523fc7 Mon Sep 17 00:00:00 2001 From: Rafael Fernandes <86632943+rafaelfernandes98@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:33:16 -0300 Subject: [PATCH 08/10] Update nkf gem (#7) --- Gemfile.lock | 2 ++ ofx.gemspec | 1 + 2 files changed, 3 insertions(+) diff --git a/Gemfile.lock b/Gemfile.lock index bb80215..2ead9ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: . specs: ofx (0.4.1) + nkf (~> 0.2.0) bigdecimal (~> 3.1.8) nokogiri (~> 1.14.5) @@ -35,6 +36,7 @@ GEM method_source (1.0.0) mini_portile2 (2.8.7) nenv (0.3.0) + nkf (0.2.0) nokogiri (1.14.5) mini_portile2 (~> 2.8.0) racc (~> 1.4) diff --git a/ofx.gemspec b/ofx.gemspec index 07d3a7d..59e5a28 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |s| s.licenses = ['MIT'] s.add_dependency 'nokogiri', '~> 1.14.5' + s.add_dependency 'nkf', '~> 0.2.0' s.add_dependency 'bigdecimal', '~> 3.1.8' s.add_development_dependency 'byebug', '~> 11.1.3' s.add_development_dependency 'rake', '~> 13.0.6' From c36d80376168e07c450b0e332069c2acdb94a167 Mon Sep 17 00:00:00 2001 From: Rafael Fernandes <86632943+rafaelfernandes98@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:44:15 -0300 Subject: [PATCH 09/10] Update dependencies (#8) --- Gemfile.lock | 52 ++++++++++++++++++++++++++-------------------------- ofx.gemspec | 14 +++++++------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2ead9ea..d0c6453 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,8 +2,8 @@ PATH remote: . specs: ofx (0.4.1) - nkf (~> 0.2.0) - bigdecimal (~> 3.1.8) + bigdecimal (= 3.1.8) + nkf (= 0.2.0) nokogiri (~> 1.14.5) GEM @@ -12,8 +12,8 @@ GEM bigdecimal (3.1.8) byebug (11.1.3) coderay (1.1.3) - diff-lcs (1.5.0) - ffi (1.16.3) + diff-lcs (1.5.1) + ffi (1.17.0) formatador (1.1.0) guard (2.18.1) formatador (>= 0.2.4) @@ -29,11 +29,11 @@ GEM guard (~> 2.1) guard-compat (~> 1.1) rspec (>= 2.99.0, < 4.0) - listen (3.8.0) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) lumberjack (1.2.10) - method_source (1.0.0) + method_source (1.1.0) mini_portile2 (2.8.7) nenv (0.3.0) nkf (0.2.0) @@ -46,37 +46,37 @@ GEM pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - racc (1.6.0) - rake (13.0.6) + racc (1.8.1) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rspec (3.11.0) - rspec-core (~> 3.11.0) - rspec-expectations (~> 3.11.0) - rspec-mocks (~> 3.11.0) - rspec-core (3.11.0) - rspec-support (~> 3.11.0) - rspec-expectations (3.11.0) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.1) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-mocks (3.11.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.11.0) - rspec-support (3.11.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.1) shellany (0.0.1) - thor (1.3.1) + thor (1.3.2) PLATFORMS ruby DEPENDENCIES - byebug (~> 11.1.3) - guard (~> 2.18.0) - guard-rspec (~> 4.7.3) + byebug (= 11.1.3) + guard (= 2.18.1) + guard-rspec (= 4.7.3) ofx! - rake (~> 13.0.6) - rspec (~> 3.10) + rake (= 13.2.1) + rspec (= 3.13.0) BUNDLED WITH 2.5.5 diff --git a/ofx.gemspec b/ofx.gemspec index 59e5a28..2802a9e 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -25,11 +25,11 @@ Gem::Specification.new do |s| s.licenses = ['MIT'] s.add_dependency 'nokogiri', '~> 1.14.5' - s.add_dependency 'nkf', '~> 0.2.0' - s.add_dependency 'bigdecimal', '~> 3.1.8' - 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_development_dependency 'guard', '~> 2.18.0' - s.add_development_dependency 'guard-rspec', '~> 4.7.3' + s.add_dependency 'nkf', '0.2.0' + s.add_dependency 'bigdecimal', '3.1.8' + s.add_development_dependency 'byebug', '11.1.3' + s.add_development_dependency 'rake', '13.2.1' + s.add_development_dependency 'rspec', '3.13.0' + s.add_development_dependency 'guard', '2.18.1' + s.add_development_dependency 'guard-rspec', '4.7.3' end From 4c88a5cbefb6e539497d73cda35e223eaa2feb78 Mon Sep 17 00:00:00 2001 From: Marcos de Melo Date: Wed, 23 Oct 2024 23:29:09 -0300 Subject: [PATCH 10/10] Update nokogiri version --- Gemfile.lock | 2 +- ofx.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d0c6453..44376d9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ PATH ofx (0.4.1) bigdecimal (= 3.1.8) nkf (= 0.2.0) - nokogiri (~> 1.14.5) + nokogiri (>= 1.14.5) GEM remote: https://rubygems.org/ diff --git a/ofx.gemspec b/ofx.gemspec index 2802a9e..320c32f 100644 --- a/ofx.gemspec +++ b/ofx.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.licenses = ['MIT'] - s.add_dependency 'nokogiri', '~> 1.14.5' + s.add_dependency 'nokogiri', '>= 1.14.5' s.add_dependency 'nkf', '0.2.0' s.add_dependency 'bigdecimal', '3.1.8' s.add_development_dependency 'byebug', '11.1.3'