mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 02:52:49 +01:00
Move rate tasks into a namespace
This commit is contained in:
parent
09e7502d42
commit
ef70f38789
6
Rakefile
6
Rakefile
@ -4,17 +4,21 @@ require 'fixer'
|
||||
require 'rake/testtask'
|
||||
require 'db'
|
||||
|
||||
task :load do
|
||||
namespace :rates do
|
||||
desc 'Reload all rates'
|
||||
task :reload do
|
||||
Currency.delete
|
||||
data = Fixer::Feed.new(:historical)
|
||||
Currency.multi_insert(data.to_a)
|
||||
end
|
||||
|
||||
desc 'Update rates'
|
||||
task :update do
|
||||
Fixer::Feed.new.each do |hsh|
|
||||
Currency.find_or_create(hsh)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Rake::TestTask.new do |t|
|
||||
t.libs.push('lib')
|
||||
|
Loading…
Reference in New Issue
Block a user