fxpotato 0.4.1 → 0.5.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 +1 -5
- data/lib/fxpotato/paths.rb +1 -1
- data/lib/fxpotato/railtie.rb +7 -0
- data/lib/fxpotato/version.rb +1 -1
- data/lib/fxpotato.rb +1 -0
- data/lib/tasks/clear_crontab.rake +6 -0
- data/lib/tasks/fetch_new_rates.rake +6 -0
- data/lib/tasks/update_crontab.rake +11 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77ec5cac8e5822903ba1ca50a3bc988e0434e89c
|
4
|
+
data.tar.gz: 9ffe01bde5b8508c86f1568b94244544f3b577fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 696cfb64d037139e2019e38601d600d5eea86c189ee1bdd792cb76722316b6930138abc9ef5634adc92b69eba88702e0d2f6312e012eeda1593e9f965c5bca5d
|
7
|
+
data.tar.gz: fb33b0acf0e464f81c53936a00868e2bf02d0717debe7a4f6fbe20d443ccd4a77fee8f59ccab546d9baccb5d8a3ebb6392c6121e06ae146980221aa606b365e4
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'fxpotato'
|
4
|
+
Dir.glob('lib/tasks/*.rake').each { |r| import r }
|
4
5
|
|
5
6
|
Rake::TestTask.new(:unit_test) do |t|
|
6
7
|
t.libs << 'test'
|
@@ -8,11 +9,6 @@ Rake::TestTask.new(:unit_test) do |t|
|
|
8
9
|
t.test_files = FileList['test/**/*_test.rb']
|
9
10
|
end
|
10
11
|
|
11
|
-
desc "Update crontab"
|
12
|
-
task :update_crontab do
|
13
|
-
sh %{ whenever --update-crontab }
|
14
|
-
end
|
15
|
-
|
16
12
|
desc "Clear crontab"
|
17
13
|
task :clear_crontab do
|
18
14
|
sh %{ whenever -c }
|
data/lib/fxpotato/paths.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module FxPotato
|
2
|
-
DATA_DIRECTORY = File.join(File.expand_path(File.dirname(__FILE__) + "/../../"), "data")
|
2
|
+
DATA_DIRECTORY = File.join(defined?(Rails) ? Rails.root : (File.expand_path(File.dirname(__FILE__)) + "/../../"), "data")
|
3
3
|
DATA_FILE = 'rates.xml'
|
4
4
|
DATA_SOURCE_URL = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'
|
5
5
|
end
|
data/lib/fxpotato/version.rb
CHANGED
data/lib/fxpotato.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
namespace :fxpotato do
|
2
|
+
desc "Update crontab with fetch_new_rates job"
|
3
|
+
task :update_crontab do
|
4
|
+
if defined?(Rails)
|
5
|
+
source = File.join(Gem.loaded_specs["fxpotato"].full_gem_path, "config", "schedule.rb")
|
6
|
+
target = File.join(Rails.root, "config", "schedule.rb")
|
7
|
+
FileUtils.cp_r source, target
|
8
|
+
end
|
9
|
+
sh %{ whenever --update-crontab }
|
10
|
+
end
|
11
|
+
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Stupid Name Humphreys
|
@@ -161,11 +161,15 @@ files:
|
|
161
161
|
- lib/fxpotato.rb
|
162
162
|
- lib/fxpotato/cli.rb
|
163
163
|
- lib/fxpotato/paths.rb
|
164
|
+
- lib/fxpotato/railtie.rb
|
164
165
|
- lib/fxpotato/rate_calculator.rb
|
165
166
|
- lib/fxpotato/rate_fetcher.rb
|
166
167
|
- lib/fxpotato/rate_store.rb
|
167
168
|
- lib/fxpotato/version.rb
|
168
169
|
- lib/fxpotato/xml_repo.rb
|
170
|
+
- lib/tasks/clear_crontab.rake
|
171
|
+
- lib/tasks/fetch_new_rates.rake
|
172
|
+
- lib/tasks/update_crontab.rake
|
169
173
|
- shippable.yml
|
170
174
|
homepage: https://github.com/Angry-Potato/fxpotato
|
171
175
|
licenses:
|