historical-bank 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +6 -10
- data/Gemfile +2 -0
- data/historical-bank.gemspec +2 -2
- data/spec/spec_helper.rb +2 -0
- metadata +9 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5dc86ffbc4737ecef88ce3256b07798260e0d0c44e66d0ecb5063afdc3d0d794
|
|
4
|
+
data.tar.gz: 042e953a894217ca110d13f9f5cbf5459275d6d4586a0df93896d89449d7a2be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d064bdab5bdcb746a3439084faf89f35aec97065532650934f1238bca31b39c2dac64a1f447bf94d6eff0e383b56e51eeb500ce303b43ba805c393af33bb4a52
|
|
7
|
+
data.tar.gz: 93a56e864a3507fb688c004a6e8f01d27761aeb6b447bb8e683060e7da3a6d02a7f495a4514d7675f0b52b53d40dabdc3b72ab132ef16aae7fca377df7d567d6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
- Add support for `money` gem version 7.x (while retaining 6.x compatibility). Note: `money` 7.0 changes the default rounding mode from `ROUND_HALF_EVEN` to `ROUND_HALF_UP`. If upgrading to `money` 7.x, set `Money.rounding_mode = BigDecimal::ROUND_HALF_EVEN` in your initializer to preserve the previous behavior.
|
|
6
|
+
|
|
3
7
|
## 0.1.8
|
|
4
8
|
|
|
5
9
|
- Add optional `redis_params` configuration to pass extra parameters to `Redis.new` (e.g. SSL options). Thank you @cattekin!
|
data/CONTRIBUTING.md
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
# Contributing to historical-bank-ruby
|
|
2
2
|
|
|
3
|
-
We're glad you want to make a contribution!
|
|
3
|
+
We're glad you want to make a contribution!
|
|
4
4
|
|
|
5
|
-
Fork this repository and send in a pull request when you're finished with your changes. Link any relevant issues in too.
|
|
6
|
-
|
|
7
|
-
Take note of the build status of your pull request, only builds that pass will be accepted. Please also keep to our conventions and style so we can keep this repository as clean as possible.
|
|
5
|
+
Fork this repository and send in a pull request when you're finished with your changes. Link any relevant issues in too.
|
|
8
6
|
|
|
7
|
+
Take note of the build status of your pull request, only builds that pass will be accepted. Please also keep to our conventions and style so we can keep this repository as clean as possible.
|
|
9
8
|
|
|
10
9
|
## Steps
|
|
11
10
|
|
|
12
11
|
1. Fork the repo
|
|
13
12
|
2. Grab dependencies: `bundle install`
|
|
14
|
-
3. Make sure specs are green: `./spec/redis-server.sh` to run the Redis server and `bundle exec rspec` to run the specs. Alternatively, you can run your own Redis server in `localhost`, and add the port as an env var before running the specs, `REDIS_PORT=6379 bundle exec rspec`
|
|
13
|
+
3. Make sure specs are green: `./spec/redis-server.sh` to run the Redis server and `bundle exec appraisal rspec` to run the specs. Alternatively, you can run your own Redis server in `localhost`, and add the port as an env var before running the specs, `REDIS_PORT=6379 bundle exec rspec`
|
|
15
14
|
4. Make your changes
|
|
16
15
|
5. Run `rubocop -a`
|
|
17
16
|
6. Make sure specs are still green
|
|
18
17
|
7. Update `CHANGELOG.md` and `AUTHORS`
|
|
19
18
|
8. Issue a Pull Request and link any relevant issues
|
|
20
19
|
|
|
21
|
-
|
|
22
20
|
## Tips
|
|
23
21
|
|
|
24
22
|
Please make sure you read [README.md](README.md) before you start hacking so that you understand how the gem works :)
|
|
@@ -29,6 +27,7 @@ The Redis cache that we use stores Hashes with keys formatted as `[namespace]:[b
|
|
|
29
27
|
These hashes contain ISO dates as keys with base currency rates as values.
|
|
30
28
|
For example, if `currency` is the Redis namespace we used in the config,
|
|
31
29
|
USD is the base currency, and we're looking for HUF rates, they can be found in the `currency:USD:HUF` key, and their format will be
|
|
30
|
+
|
|
32
31
|
```
|
|
33
32
|
{
|
|
34
33
|
"2016-05-01": "0.272511002E3", # Rates are stored as BigDecimal Strings
|
|
@@ -39,7 +38,6 @@ USD is the base currency, and we're looking for HUF rates, they can be found in
|
|
|
39
38
|
|
|
40
39
|
The first key of this Hash translates to: "on May 1st 2016, 1 USD was equivalent to 272.511002 HUF".
|
|
41
40
|
|
|
42
|
-
|
|
43
41
|
### Memory caching
|
|
44
42
|
|
|
45
43
|
Apart from Redis, rates are also cached in the Bank's memory,
|
|
@@ -49,15 +47,13 @@ When they don't exist in memory, they are retrieved from the Store,
|
|
|
49
47
|
and when they don't exist in the Store, they are retrieved from the
|
|
50
48
|
Provider.
|
|
51
49
|
|
|
52
|
-
|
|
53
50
|
## Possible improvements
|
|
54
51
|
|
|
55
52
|
- Make Redis optional
|
|
56
53
|
- Add another provider (e.g. XE.com)
|
|
57
54
|
- Add another store (e.g. DynamoDB, MongoDB, Cassandra, Postgres, etc)
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
## License
|
|
56
|
+
## License
|
|
61
57
|
|
|
62
58
|
By contributing your code, you agree to license your contribution under the terms of the APLv2: https://github.com/jeopard/historical-bank-ruby/blob/master/LICENSE
|
|
63
59
|
|
data/Gemfile
CHANGED
data/historical-bank.gemspec
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
Gem::Specification.new do |s|
|
|
18
18
|
s.name = 'historical-bank'
|
|
19
|
-
s.version = '0.1.
|
|
19
|
+
s.version = '0.1.9'
|
|
20
20
|
s.summary = 'Historical Bank'
|
|
21
21
|
s.description = 'A `Money::Bank::Base` with historical exchange rates'
|
|
22
22
|
s.authors = ['Kostis Dadamis', 'Emili Parreno']
|
|
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
|
|
|
39
39
|
s.required_ruby_version = '>= 3.1.0'
|
|
40
40
|
|
|
41
41
|
s.add_dependency 'httparty', '~> 0.14'
|
|
42
|
-
s.add_dependency 'money', '
|
|
42
|
+
s.add_dependency 'money', '>= 6.7', '< 8'
|
|
43
43
|
s.add_dependency 'redis', ['>=4.0', '~> 5.0']
|
|
44
44
|
|
|
45
45
|
s.add_development_dependency 'faker', '~> 3.0'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: historical-bank
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kostis Dadamis
|
|
@@ -28,16 +28,22 @@ dependencies:
|
|
|
28
28
|
name: money
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: '6.7'
|
|
34
|
+
- - "<"
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: '8'
|
|
34
37
|
type: :runtime
|
|
35
38
|
prerelease: false
|
|
36
39
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
40
|
requirements:
|
|
38
|
-
- - "
|
|
41
|
+
- - ">="
|
|
39
42
|
- !ruby/object:Gem::Version
|
|
40
43
|
version: '6.7'
|
|
44
|
+
- - "<"
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '8'
|
|
41
47
|
- !ruby/object:Gem::Dependency
|
|
42
48
|
name: redis
|
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|