fxpotato 0.2.5 → 0.2.6
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 +1 -1
- data/Rakefile +8 -3
- data/lib/fxpotato/cli.rb +4 -2
- data/lib/fxpotato/version.rb +1 -1
- data/lib/fxpotato/xml_repo.rb +2 -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: 4dc221a4fe6ed20600d9588fec08eb89c9fc587a
|
4
|
+
data.tar.gz: e5e02f7941cdc9a2321a57238cc92e4edbc471fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1bc64f9b24257b055faea693b8a752ad31c7064348e910d788c25fc6c89d4667d0d269677e03edaa324c29754d2dae87fa658e0b2eeaa754f7df33e3a23a6929
|
7
|
+
data.tar.gz: 61d2c2c95b29822e01fc9d917f473ab5ed7e54fda7d72efc233b58c751ed69d97808f754fe14191ce09b46ae51e611ef3393694255b37c8ed5bd9cd62182a39a
|
data/Dockerfile
CHANGED
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'bundler/gem_tasks'
|
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'fxpotato'
|
4
4
|
|
5
|
-
Rake::TestTask.new(:
|
5
|
+
Rake::TestTask.new(:unit_test) do |t|
|
6
6
|
t.libs << 'test'
|
7
7
|
t.libs << 'lib'
|
8
8
|
t.test_files = FileList['test/**/*_test.rb']
|
@@ -25,7 +25,12 @@ end
|
|
25
25
|
|
26
26
|
desc "Build, test, bump version, and release in a container"
|
27
27
|
task :docker_release do
|
28
|
-
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato
|
28
|
+
sh %{ docker build --force-rm -t fx-potato . && docker run --rm fx-potato rake test && gem bump && rake release }
|
29
29
|
end
|
30
30
|
|
31
|
-
|
31
|
+
desc "Run feature and unit tests"
|
32
|
+
task :test => :unit_test do
|
33
|
+
sh %{ bundle exec cucumber features }
|
34
|
+
end
|
35
|
+
|
36
|
+
task :default => :unit_test
|
data/lib/fxpotato/cli.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'fxpotato'
|
3
|
+
require 'date'
|
3
4
|
|
4
5
|
module FxPotato
|
5
6
|
class CLI < Thor
|
6
7
|
desc "getrate BASE TARGET", "Gets the foreign exchange rate for the given currencies on the chosen date."
|
7
|
-
method_option :date, :aliases => "-d"
|
8
|
+
method_option :date, :aliases => "-d", :desc => "A specific date to get the rate for, e.g. -d 2017-05-29"
|
8
9
|
def getrate(base, target)
|
9
|
-
|
10
|
+
date = options[:date] || Date.today
|
11
|
+
puts "Exchange rate from #{base} to #{target} on #{date}: #{FxPotato.at(date, base, target)}"
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
data/lib/fxpotato/version.rb
CHANGED
data/lib/fxpotato/xml_repo.rb
CHANGED