Sha256: 2d45d42925bc39f6310a4a961d93e3c28916a4aa3a138b60f84f2d564e84f7d7

Contents?: true

Size: 1.16 KB

Versions: 3

Compression:

Stored size: 1.16 KB

Contents

#!/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')
send_test_email = ARGV.delete('--test-email')

if ARGV.length != 1
  puts "Usage: #{$0} <configfile> [--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 "  --test-email        Send a test email"
  puts
  puts "Report bugs at: https://github.com/TvL2386/feed_torrents/issues"
  exit 1
else
  FeedTorrents.configuration.yaml_from_file ARGV[0]
end

if send_test_email
  FeedTorrents::Mail.new.send_test_email
  exit 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!

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
feed_torrents-0.2.2 bin/feed_torrents
feed_torrents-0.2.1 bin/feed_torrents
feed_torrents-0.2.0 bin/feed_torrents