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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

## Upcoming release (unreleased)

## 2.0.0 (Dec 9 2025)

* **Breaking change**: Require Ruby >= 3.1
* **Breaking change**: Update Money dependency to 7.0. Make sure to read [the upgrade
guide](https://github.com/RubyMoney/money/blob/main/UPGRADING-7.0.md).
* Update YAML loading from compatibility with recent Psych versions.
* Move Croatian Kuna (HRK) and Russian Ruble (RUB) to legacy currencies
* Add `EuCentralBank::VERSION`.

## 1.7.0 (Nov 17 2021)

Expand Down
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
source 'https://rubygems.org'
source "https://rubygems.org"

gemspec

group :test do
gem 'rake'
end
# Tasks
gem "rake"

# Specs
gem "rspec", "~> 3.13"
17 changes: 11 additions & 6 deletions eu_central_bank.gemspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#!/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true

Gem::Specification.new do |s|
s.name = "eu_central_bank"
s.version = "1.7.0"

# Please also update `eu_central_bank/version.rb`.
#
# We cannot use this constant here because of the `money` dependency when
# inheriting from `Money::Bank::VariableExchange`.
s.version = "2.0.0"

s.platform = Gem::Platform::RUBY
s.authors = ["Shane Emmons"]
s.email = ["shane@emmons.io"]
Expand All @@ -19,10 +26,8 @@ Gem::Specification.new do |s|

s.add_dependency "bigdecimal"
s.add_dependency "nokogiri", "~> 1.11"
s.add_dependency "money", "~> 6.19"

s.add_development_dependency "rspec", "~> 3.13"
s.add_dependency "money", "~> 7.0"

s.files = Dir.glob("lib/**/*") + %w(CHANGELOG.md LICENSE README.md)
s.files = Dir.glob("lib/**/*.rb") + %w[CHANGELOG.md LICENSE README.md]
s.require_path = "lib"
end
1 change: 1 addition & 0 deletions lib/eu_central_bank.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'money'
require 'money/rates_store/store_with_historical_data_support'
require 'eu_central_bank/rates_document'
require 'eu_central_bank/version'

class InvalidCache < StandardError ; end

Expand Down
5 changes: 5 additions & 0 deletions lib/eu_central_bank/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class EuCentralBank < Money::Bank::VariableExchange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops, the test failure is legit. It should not inherit from Money::Bank::VariableExchange 😊

Copy link
Member Author

@sunny sunny Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we have to use the same inheritance as in lib/eu_central_bank.rb or we’d risk a superclass mismatch for class EuCentralBank (TypeError) when loading the version after the class. 🫠

I’ve opted to add a comment instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok!

VERSION = "2.0.0"
end
6 changes: 5 additions & 1 deletion spec/eu_central_bank_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "EuCentralBank" do
describe EuCentralBank do
before(:each) do
Money.rounding_mode = BigDecimal::ROUND_HALF_UP

Expand All @@ -21,6 +21,10 @@
end
end

it "has a version" do
expect(EuCentralBank::VERSION).to be_a(String)
end

it "should save the xml file from ecb given a file path" do
@bank.save_rates(@tmp_cache_path)
expect(File.exist?(@tmp_cache_path)).to eq(true)
Expand Down