mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-22 02:52:49 +01:00
25 lines
408 B
Ruby
25 lines
408 B
Ruby
require_relative 'lib/db'
|
|
require 'fixer'
|
|
require 'rake/testtask'
|
|
|
|
task :reset do
|
|
data = Fixer::Feed.new(:historical).to_a
|
|
|
|
Currency.delete
|
|
Currency.multi_insert data
|
|
end
|
|
|
|
task :update do
|
|
Fixer::Feed.new.each do |hsh|
|
|
Currency.find_or_create hsh
|
|
end
|
|
end
|
|
|
|
Rake::TestTask.new do |t|
|
|
t.libs.push 'lib'
|
|
t.test_files = FileList['spec/*_spec.rb']
|
|
t.verbose = true
|
|
end
|
|
|
|
task :default => [:test]
|