-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
50 lines (44 loc) · 946 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# encoding: UTF-8
require_relative File.join('lib', 'price_list')
desc 'API Routes'
task :routes do
PriceList::Api.routes.each do |api|
method = api.route_method.ljust(10)
path = api.route_path
puts " #{method} #{path}"
end
end
desc 'Plot all price charts'
task :plot_price_charts do
Item.available.each(&:plot_price_chart!)
end
desc 'test parser ENV["URL"]'
task :parse do
parser= PriceList::Parser.
responsible_class_name(ENV['URL']).
constantize.
new(ENV['URL'])
parser.parse
pp parser
end
desc 'run plotter'
task :plot do
PriceList::Models.initialize_db
Item.available.each do |item|
item.plot_price_chart!
end
end
desc 'refetch'
task :refetch do
PriceList::Models.initialize_db
Supplier.refetch_prices
end
desc 'console'
task :console do
require 'irb'
require 'irb/completion'
PriceList::Models.initialize_db
ActiveRecord::Base.connection
ARGV.clear
IRB.start()
end