fxpotato 0.2.6 → 0.3.0
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/Rakefile +22 -2
- data/config/schedule.rb +5 -0
- data/fxpotato.gemspec +1 -0
- data/lib/fxpotato/version.rb +1 -1
- data/lib/fxpotato.rb +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fe9531af0a524378b7343d4eeb9924a767a6c3b
|
4
|
+
data.tar.gz: 0aaeb6e4f51814629fbbd186ff088fc8e480b5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f672e9d623cbc3520d1bd0e460aaf3df20e838c7a5e6ee66d93c1c6f27870b57c726b22012009bb2d5fb7e2160e7834ec08bfd68780ae939387bdee7484c85
|
7
|
+
data.tar.gz: 2e572241dce3595257fc85ac1faa587de596e8d9eb9ef605f1e5217c84f0ebf7ed39ec1c7e8d1061835f855a2e28d616b7112a524653783c0c74da310e897152
|
data/Rakefile
CHANGED
@@ -8,6 +8,16 @@ Rake::TestTask.new(:unit_test) do |t|
|
|
8
8
|
t.test_files = FileList['test/**/*_test.rb']
|
9
9
|
end
|
10
10
|
|
11
|
+
desc "Update crontab"
|
12
|
+
task :update_crontab do
|
13
|
+
sh %{ whenever --update-crontab }
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Clear crontab"
|
17
|
+
task :clear_crontab do
|
18
|
+
sh %{ whenever -c }
|
19
|
+
end
|
20
|
+
|
11
21
|
desc "Download new exchange rate data"
|
12
22
|
task :fetch_new_rates do
|
13
23
|
FxPotato.fetch_new_rates
|
@@ -23,11 +33,21 @@ task :docker_test do
|
|
23
33
|
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato }
|
24
34
|
end
|
25
35
|
|
26
|
-
desc "Build, test, bump version, and release in a container"
|
27
|
-
task :
|
36
|
+
desc "Build, test, bump patch version, and release in a container"
|
37
|
+
task :docker_release_patch do
|
28
38
|
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato rake test && gem bump && rake release }
|
29
39
|
end
|
30
40
|
|
41
|
+
desc "Build, test, bump minor version, and release in a container"
|
42
|
+
task :docker_release_minor do
|
43
|
+
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato rake test && gem bump --version minor && rake release }
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "Build, test, bump major version, and release in a container"
|
47
|
+
task :docker_release_major do
|
48
|
+
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato rake test && gem bump --version major && rake release }
|
49
|
+
end
|
50
|
+
|
31
51
|
desc "Run feature and unit tests"
|
32
52
|
task :test => :unit_test do
|
33
53
|
sh %{ bundle exec cucumber features }
|
data/config/schedule.rb
ADDED
data/fxpotato.gemspec
CHANGED
data/lib/fxpotato/version.rb
CHANGED
data/lib/fxpotato.rb
CHANGED
@@ -10,6 +10,7 @@ module FxPotato
|
|
10
10
|
raise "Must specify date" if date.nil?
|
11
11
|
raise "Must specify from_currency" if from_currency.nil?
|
12
12
|
raise "Must specify to_currency" if to_currency.nil?
|
13
|
+
|
13
14
|
from = RateStore.get(self.repo, date, from_currency)
|
14
15
|
to = RateStore.get(self.repo, date, to_currency)
|
15
16
|
RateCalculator.calculate(from, to)
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Stupid Name Humphreys
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '1.6'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: whenever
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.9'
|
132
|
+
type: :runtime
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0.9'
|
125
139
|
description: Uses last daily feed from European Central Bank website, and exposes
|
126
140
|
a simple interface to get the conversion rates for one currency to another on a
|
127
141
|
given day.
|
@@ -141,6 +155,7 @@ files:
|
|
141
155
|
- Rakefile
|
142
156
|
- bin/console
|
143
157
|
- bin/setup
|
158
|
+
- config/schedule.rb
|
144
159
|
- exe/fxpotato
|
145
160
|
- fxpotato.gemspec
|
146
161
|
- lib/fxpotato.rb
|