rmustafin / russian_central_bank Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
wasabi-3.2.3/lib/wasabi/resolver.rb:44:in load_from_remote'", wasabi-3.2.3/lib/wasabi/resolver.rb:32:in
resolve'", "wasabi-3.2.3/lib/wasabi/document.rb:141:in xml'", "wasabi-3.2.3/lib/wasabi/document.rb:159:in
parse'", "wasabi-3.2.3/lib/wasabi/document.rb:146:in parser'", "wasabi-3.2.3/lib/wasabi/document.rb:63:in
soap_actions'", "savon-2.3.3/lib/savon/operation.rb:21:in ensure_exists!'", "savon-2.3.3/lib/savon/operation.rb:14:in
create'", "savon-2.3.3/lib/savon/client.rb:32:in operation'", "savon-2.3.3/lib/savon/client.rb:36:in
call'", "russian_central_bank-0.2.1/lib/russian_central_bank.rb:46:in exchange_rates'", "russian_central_bank-0.2.1/lib/russian_central_bank.rb:20:in
block in update_rates'", "russian_central_bank-0.2.1/lib/russian_central_bank.rb:19:in synchronize'", "russian_central_bank-0.2.1/lib/russian_central_bank.rb:19:in
update_rates'"
russian_central_bank на wasabi, wasabi на savon, savon не переходит дальше при 302, а центробанк любит его отдавать
при update_state, возникает ошибка в russian_central_bank.rb:17
Версия 1.0.0
money - 6.5.0
Undefined method index for #Money::RatesStore::Memory:xxx
RubyMoney/money@57c3da8
This method was replaced with private :rates
My PR is #19
Привет!
Это не фатальный, но неприятный баг встречающийся у тех кто не обновил вовремя библиотеку.
Система уходит в бесконечную рекурсию здесь:
https://github.com/rmustafin/russian_central_bank/blob/master/lib/russian_central_bank.rb#L33
Лечится обновлением библиотеки, но правильно было бы сообщить что для искомой валютной пары нет курса обмена, вместо того чтобы падать из-за переполнения стека.
Hello.
How to implement caching of exchange rates in Rails application?
For example I want to update rates every 24 hours and not to access CBR on every restart.
As I understand this code should be added to initializer, yes?
bank = Money::Bank::RussianCentralBank.new
bank.update_rates
Money.default_bank = bank
Thanks!
I did notice that last version of this gem does not play with money 6.5.1 i have due API change.
Need update dependencies to spec.add_dependency 'money', '~> 6.7.0'
При замене
Money.default_bank = Money::Bank::GoogleCurrency.new
на
Money.default_bank = Money::Bank::RussianCentralBank.new
Получаю следующую ошибку
Undefined method `/' for nil:NilClass
Extracted source (around line #242):
def self.euro_rate
Money.new(1_00, 'EUR').exchange_to(:RUB)
end
/home/bets/.gems/ruby/2.1.0/bundler/gems/russian_central_bank-a2314ec89fd1/lib/russian_central_bank.rb:73:in indirect_rate' /home/bets/.gems/ruby/2.1.0/bundler/gems/russian_central_bank-a2314ec89fd1/lib/russian_central_bank.rb:47:in
get_rate'
money (6.5.1) lib/money/bank/variable_exchange.rb:92:in exchange_with' money (6.5.1) lib/money/money.rb:412:in
exchange_to'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.