fxpotato 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 29ae96920ba8c98cef30d15708ff6f6d132c7cb9
4
- data.tar.gz: 90f96cb9dcf1c51e9f66b8436cdbccd6c450a20f
3
+ metadata.gz: 020e1b769d3f87e2da58999d13c1db7a019df85a
4
+ data.tar.gz: c2e11872230a35f400930cd523a324b71e18097d
5
5
  SHA512:
6
- metadata.gz: 410dc82aa15bf53f4e0657dada71a0eec874785cbc195dd68767468155e0cf04394c2b62278e78c154c01125ca9511b8a5e7a9e8c6d7682b3bb13a51bb0a856a
7
- data.tar.gz: 285709d76c220bf7a044242c889f46709f5f4c5b14b9e17e0b26c05dbadc2758361ffcbee71b40e897ddf50fbfe35c814f36643a8c8fd87bc3ea1f213c28e8e9
6
+ metadata.gz: 7c02d00a4f0e445349a656396c7fef2d2a7bc6dd48717ee06cd44d11be5e442638da2e7319b26dede8d2719a2b9ac79836f77b908c384578f46017bd5bd953f9
7
+ data.tar.gz: ac2250a1c7e88d58fc5f9c7479e143bf188123277ffb8ccd8b01bb1c4aed019ef7806076936969c31037824adcdd58660ef0a74cefe872dd57b7f8f74ee3eb6e
data/Dockerfile CHANGED
@@ -3,10 +3,15 @@ FROM ruby:2.4.1-alpine
3
3
  RUN apk update && apk upgrade && \
4
4
  apk add --no-cache bash git libxml2-dev libxslt-dev build-base
5
5
 
6
- COPY . /usr/src/app/
6
+ COPY Gemfile /usr/src/app/
7
+ COPY Gemfile.lock /usr/src/app/
8
+ COPY fxpotato.gemspec /usr/src/app/
9
+ COPY lib/fxpotato/version.rb /usr/src/app/lib/fxpotato/
7
10
 
8
11
  WORKDIR /usr/src/app
9
12
 
10
13
  RUN bundle install
11
14
 
15
+ COPY . /usr/src/app/
16
+
12
17
  CMD rake test
@@ -1,3 +1,3 @@
1
1
  module FxPotato
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
data/lib/fxpotato.rb CHANGED
@@ -7,6 +7,12 @@ module FxPotato
7
7
  raise "Must specify date" if date.nil?
8
8
  raise "Must specify from_currency" if from_currency.nil?
9
9
  raise "Must specify to_currency" if to_currency.nil?
10
- true
10
+ from = @rate_store.get(date, from_currency)
11
+ to = @rate_store.get(date, to_currency)
12
+ RateCalculator.calculate(from, to)
11
13
  end
14
+
15
+ module_function
16
+ def rate_store; @rate_store ||= RateStore.new() end
17
+ def rate_store= v; @rate_store = v end
12
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fxpotato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam Stupid Name Humphreys