middleman-torrent 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/middleman-torrent/extension.rb +11 -2
- data/lib/middleman-torrent/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6736400dd340b7ebfd73780817f6723849af24ce
|
4
|
+
data.tar.gz: 96c5f71cf212b96f1f34832be87708dea29070a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fca0406172ddf96d0cb2cf686ce92acb79490eae844679e9c5a03a1fd28eda8f1ff60b85fa78920a5c4ecbe4e4b05e52c47663e2c8e2944a8346c0612c3ad1db
|
7
|
+
data.tar.gz: 8fd12ff6c60adc604983c137ecc09b58440af6c808071f9abcbc54ec649fc17caa6921102a0d3137228202c73e835b3e2c6497d3196957f7ef93b6c431fa1b55
|
data/README.md
CHANGED
@@ -42,6 +42,9 @@ Every option with default values:
|
|
42
42
|
# Make torrent private
|
43
43
|
private: false
|
44
44
|
|
45
|
+
You can access this values in your app with `torrent_<option>` (e. g.
|
46
|
+
`torrent_file`).
|
47
|
+
|
45
48
|
## Contributing
|
46
49
|
|
47
50
|
1. Fork it ( https://github.com/[my-github-username]/middleman-torrent/fork )
|
@@ -10,6 +10,14 @@ module MiddlemanTorrent
|
|
10
10
|
require 'mktorrent'
|
11
11
|
end
|
12
12
|
|
13
|
+
# Expose configuration values
|
14
|
+
def after_configuration
|
15
|
+
app.set :torrent_tracker, options.tracker
|
16
|
+
app.set :torrent_file, options.file
|
17
|
+
app.set :torrent_name, options.name
|
18
|
+
app.set :torrent_private, options.private
|
19
|
+
end
|
20
|
+
|
13
21
|
# Create the torrent after the site is built
|
14
22
|
def after_build(builder)
|
15
23
|
torrent = Torrent.new options.tracker
|
@@ -20,8 +28,9 @@ module MiddlemanTorrent
|
|
20
28
|
# Move to build_dir so it's not added to the torrent
|
21
29
|
within_build_path do
|
22
30
|
app.sitemap.resources.each do |file|
|
23
|
-
|
24
|
-
|
31
|
+
# We decode the path because it can have spaces (%20) and stuff
|
32
|
+
torrent.add_file URI.decode(file.path)
|
33
|
+
builder.say_status 'to torrent', URI.decode(file.path)
|
25
34
|
end
|
26
35
|
|
27
36
|
torrent.write_torrent options.file
|