diff --git a/CHANGELOG.md b/CHANGELOG.md index f018c04..d8f0871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/Gemfile b/Gemfile index 32eb4b1..5bdd86f 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/eu_central_bank.gemspec b/eu_central_bank.gemspec index af1af90..cad114d 100755 --- a/eu_central_bank.gemspec +++ b/eu_central_bank.gemspec @@ -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"] @@ -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 diff --git a/lib/eu_central_bank.rb b/lib/eu_central_bank.rb index 2d6aee9..788ec9a 100644 --- a/lib/eu_central_bank.rb +++ b/lib/eu_central_bank.rb @@ -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 diff --git a/lib/eu_central_bank/version.rb b/lib/eu_central_bank/version.rb new file mode 100644 index 0000000..f5fa267 --- /dev/null +++ b/lib/eu_central_bank/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class EuCentralBank < Money::Bank::VariableExchange + VERSION = "2.0.0" +end diff --git a/spec/eu_central_bank_spec.rb b/spec/eu_central_bank_spec.rb index 0010c8c..ff56185 100644 --- a/spec/eu_central_bank_spec.rb +++ b/spec/eu_central_bank_spec.rb @@ -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 @@ -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)