money-oxr 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/money_oxr/rates_store.rb +6 -1
- data/money-oxr.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbcc251c771bd1631fd40854de0e85d80c168f49
|
4
|
+
data.tar.gz: 8911f59f2da0450bdaceb4674c202b8eb5bf94b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3b745972f2157c830acca225c16aa556da1c94228663da013f4af1c40501e5fad4e437435cfe5df3baa9766e47e1c74ab48f289c9621a5e7288811782a97fde
|
7
|
+
data.tar.gz: 1e1ca2d53a229e3573d9be103031475b8d5afab8fd4e67cb3c4aaf6a9e332a49f829ebe6d7efb371fce459bf6c0e5c127dfe3bd473ec03058a9029c112e842a8
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
5
5
|
[How to use a CHANGELOG](http://keepachangelog.com/)
|
6
6
|
|
7
|
-
## [
|
7
|
+
## [0.4.0] - 2018-11-29
|
8
|
+
- Use `base` instead of `source` for base currency.
|
9
|
+
- Use Time.now as last_updated_at timestamp when fetching data over the API
|
8
10
|
|
9
11
|
## [0.3.0] - 2018-03-21
|
10
12
|
### Changed
|
@@ -55,6 +55,10 @@ module MoneyOXR
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def load_from_api
|
58
|
+
# When loading from the API, set the last_updated_at to now.
|
59
|
+
# "timestamp" value in response may be days old (it may not update over
|
60
|
+
# the weekend)
|
61
|
+
now = Time.now
|
58
62
|
json = get_json_from_api
|
59
63
|
# Protect against saving or loading nil/bad data from API.
|
60
64
|
return unless json && json =~ /rates/
|
@@ -64,6 +68,7 @@ module MoneyOXR
|
|
64
68
|
else
|
65
69
|
load_json(json)
|
66
70
|
end
|
71
|
+
@last_updated_at = now
|
67
72
|
end
|
68
73
|
|
69
74
|
def get_json_from_api
|
@@ -75,7 +80,7 @@ module MoneyOXR
|
|
75
80
|
end
|
76
81
|
|
77
82
|
def api_uri
|
78
|
-
"https://openexchangerates.org/api/latest.json?
|
83
|
+
"https://openexchangerates.org/api/latest.json?base=#{source}&app_id=#{app_id}"
|
79
84
|
end
|
80
85
|
|
81
86
|
def load_from_cache_path
|
data/money-oxr.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: money-oxr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Lebert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: money
|