20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/scruber/cli.rb', line 20
def start(name)
if defined?(APP_PATH)
scraper_path = Scruber::AppSearcher.find_scraper(name, APP_PATH)
raise ::Thor::Error, "ERROR: Scraper not found." if scraper_path.nil?
say "booting..."
require APP_PATH
Dir[File.expand_path('../initializers/*.rb', APP_PATH)].sort.each do |i|
require i
end
ENV['SCRUBER_SCRAPER_NAME'] = File.basename(scraper_path).gsub(/\.rb\Z/, '').underscore
say "starting #{ENV['SCRUBER_SCRAPER_NAME']}"
Scruber.configuration.silent = options[:silent]
require scraper_path
else
raise ::Thor::Error, "ERROR: Scruber project not found."
end
end
|