#!/usr/bin/env ruby root = File.expand_path(File.join(File.dirname(__FILE__),'..')) if File.directory?(File.join(root,'.git')) Dir.chdir(root) do begin require 'bundler/setup' rescue LoadError => e warn e.message warn "Run `gem install bundler` to install Bundler" exit -1 end end end require 'feed_torrents' FeedTorrents.configuration.filter_testing = true if ARGV.delete('--test-filters') if ARGV.length != 1 puts "Usage: #{$0} [--test-filters]" puts "Retrieves rss lists every interval and downloads new torrents from torrent or magnet links" puts puts " --test-filters Prints all matches to STDOUT and won't do anything else" puts puts "Report bugs at: https://github.com/TvL2386/feed_torrents/issues" exit 1 else FeedTorrents.configuration.yaml_from_file ARGV[0] end if FeedTorrents.configuration.filter_testing? puts 'Filter testing enabled. Please press CTRL+C when you are done'.yellow.bold puts end FeedTorrents::Reactor.start!