0.02
No commit activity in last 3 years
No release in over 3 years
Create .torrent files easily with this gem. The code is ugly, but it works :)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.8
 Project Readme

mktorrent

A Ruby Gem for easily creating .torrent files.

To get started:

git clone https://github.com/mukaibot/mktorrent.git
gem build mktorrent.gemspec
gem install mktorrent

Then in your Ruby code:

require 'mktorrent'
t = Torrent.new("http://your.tracker.com")
t.add_file("path/to/your.file")
t.add_file("path/to/another.file")
t.add_tracker("udp://your.secondtracker.tk:80") # Optional
t.add_tracker("http://third.tracker.com:6500/announce") # Optional
t.add_directory("path/to/directory")
t.add_webseed("http://your.webseed.com") # Optional!
t.defaultdir = "Your Torrent"
t.write_torrent("Yourtorrent.torrent")

Development

Pull requests are very welcome!

Running unit tests

The unit tests just use minitest

bundle exec rake test

Running the acceptance tests

The acceptance tests run the command from the contents of

test/acceptance_test_command

On a torrent created from sample data. The string <TORRENT_FILE> will be replaced with the path to the created torrent. If the command exits with 0 the torrent is deemed to be valid.

A sample file could look like this:

/usr/local/Cellar/torrentcheck/1.00/bin/torrentcheck -t <TORRENT_FILE>