Skip to content
Snippets Groups Projects
Unverified Commit 3bfcbaba authored by fauno's avatar fauno
Browse files

move to transmission-create

parent 91e31938
No related branches found
No related tags found
No related merge requests found
Copyright (c) 2012 Nicolás Reynolds <fauno@endefensadelsl.org>
Mauricio Pasquier Juan <mpj@endefensadelsl.org>
Copyright (c) 2012-2018 Mauricio Pasquier Juan <mpj@endefensadelsl.org>
fauno <fauno@endefensadelsl.org>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......
# A torrent plugin for jekyll
A simple plugin that uses [mktorrent][1] to create a .torrent file with your
whole site after it's generated by jekyll. It monkeypatches
`Jekyll::Site.process`.
A simple plugin that uses [transmission-create][1] to create a .torrent
file with your whole site after it's generated by jekyll. It
monkeypatches `Jekyll::Site.process`.
It's used on [En Defensa del Software Libre][0].
It's used on [En Defensa del Software Libre][0] and [Utopía Pirata][2]
[0]: http://endefensadelsl.org
[1]: http://mktorrent.sourceforge.net/
[0]: https://endefensadelsl.org/
[1]: https://transmissionbt.com/
[2]: https://utopia.partidopirata.com.ar/
## Configuration
Default configuration (change it by superseding in `_config.yml`):
torrent:
announce: 'udp://tracker.publicbt.com:80'
announce: 'udp://9.rarbg.to:2710/announce'
file: 'site.torrent'
flags: '--verbose'
bin: 'mktorrent'
flags: ''
bin: 'transmission-create'
* `announce` is the URL of the tracker.
* `file` is the torrent filename.
* `flags` is a string with the flags you will normally pass to `mktorrent` on
cli, besides `--output` and `--announce`
* `flags` is a string with the flags you will normally pass to
`transmission-create` on cli, besides `--outfile` and `--tracker`
* `bin` is the `mktorrent` binary path
* `bin` is the `transmission-create` binary path
## How to run
Execute `jekyll` like always, just make sure you have `mktorrent` installed and
it's binary is accessible.
Execute `jekyll` like always, just make sure you have
`transmission-create` installed and it's binary is accessible.
......@@ -6,13 +6,13 @@ require 'jekyll-torrent/version'
Gem::Specification.new do |gem|
gem.name = "jekyll-torrent"
gem.version = JekyllTorrent::VERSION
gem.authors = ["Mauricio Pasquier Juan"]
gem.email = ["mauricio@pasquierjuan.com.ar"]
gem.authors = ["Mauricio Pasquier Juan", "fauno"]
gem.email = ["mauricio@pasquierjuan.com.ar", "fauno@endefensadelsl.org"]
gem.description = %q{A simple plugin that creates a .torrent file with your
whole site after it's generated by jekyll. It
monkeypatches `Jekyll::Site.process`.}
gem.summary = %q{Create a .torrent file with your whole site!}
gem.homepage = "https://github.com/mauriciopasquier/jekyll-torrent"
gem.homepage = "https://github.com/edsl/jekyll-torrent"
gem.license = "MIT"
gem.files = `git ls-files`.split($/)
......
require 'jekyll-torrent/version'
# Creates a torrent file with your generated site. You should serve the files
# with your cliente.
#
# Default config values:
#
# torrent:
# announce: 'udp://tracker.publicbt.com:80'
# file: 'site.torrent'
# flags: '--verbose'
# bin: 'mktorrent'
#
# with your client.
module Jekyll
class Site
......@@ -28,7 +19,8 @@ module Jekyll
File.delete(file) if File.exists?(file)
puts "Generating torrent file at #{file}"
puts `#{torrent['bin']} -a #{torrent['announce']} -o #{file} #{torrent['flags']} #{dest}`
# TODO usar popen3
puts `#{torrent[:bin]} --tracker "#{torrent[:announce]}" --outfile "#{file}" #{torrent[:flags]} "#{dest}"`
end
# Alias method chain
......@@ -39,11 +31,11 @@ module Jekyll
# Merges config with default values
def torrent
@torrent_config ||= {
'announce' => 'udp://tracker.publicbt.com:80',
'file' => 'site.torrent',
'flags' => '--verbose',
'bin' => 'mktorrent'
}.merge(config['torrent'] || {})
announce: 'udp://9.rarbg.to:2710/announce',
file: 'site.torrent',
flags: '',
bin: 'transmission-create'
}.merge(config.fetch('torrent', {}))
end
end
end
module JekyllTorrent
VERSION = "0.0.2"
VERSION = "0.0.3"
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment