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 +4 -4
- data/Dockerfile +6 -1
- data/lib/fxpotato/version.rb +1 -1
- data/lib/fxpotato.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 020e1b769d3f87e2da58999d13c1db7a019df85a
|
|
4
|
+
data.tar.gz: c2e11872230a35f400930cd523a324b71e18097d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|
data/lib/fxpotato/version.rb
CHANGED
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
|
-
|
|
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
|