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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d40cd83560c6539f8aab07757780f58fe9fa78d
4
- data.tar.gz: 100dfdab0c1e84cfe0bbe736913aca1bb2382571
3
+ metadata.gz: cbcc251c771bd1631fd40854de0e85d80c168f49
4
+ data.tar.gz: 8911f59f2da0450bdaceb4674c202b8eb5bf94b3
5
5
  SHA512:
6
- metadata.gz: 2b985081fda88720bede03904f2533002a66d09da3eaa0c085e198267c69103d3e812c1f582f07731c5db9c2bda87c3bc942ea5e85b5263ae3ecc21839d2dc42
7
- data.tar.gz: f6e6bef059fb61f9828bb4eb91557f50a4d3530a1dfe6dc31c5c57a580f8c1ef7ce8afba05cd597d64a4ba954ce5a9f42221f9b226624f51befe5c76853ac55e
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
- ## [Unreleased]
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?source=#{source}&app_id=#{app_id}"
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "money-oxr"
5
- spec.version = "0.3.0"
5
+ spec.version = "0.4.0"
6
6
  spec.authors = ["Ed Lebert"]
7
7
 
8
8
  spec.summary = %q{A Money-compatible rate store that uses exchange rates from openexchangerates.org.}
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.3.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-03-22 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: money