middleman-torrent 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49ca47948821e0b5650dd793d5c230fc206d6d6b
4
- data.tar.gz: 63673337a805043ba5e11286ee9bc923e4390bf8
3
+ metadata.gz: 6736400dd340b7ebfd73780817f6723849af24ce
4
+ data.tar.gz: 96c5f71cf212b96f1f34832be87708dea29070a2
5
5
  SHA512:
6
- metadata.gz: 916eafe2edbd6e85d5c22f77164d0fc9c3c3719d57b3ed94d89a2d7b6c05b531fbe3bd9eb5d6b6feabc931b752203b7cebdce96182edf39b313992fc42b51ca1
7
- data.tar.gz: 2c493339a8d33b18bf68828128df4136e4b58776d64600d30dbfcd1a0fc31be9c6a7d7a847c3a2f32204348a988bf4d04d6e8781caea75f7d49ffb774560f300
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
- torrent.add_file file.path
24
- builder.say_status 'to torrent', file.path
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
@@ -1,3 +1,3 @@
1
1
  module MiddlemanTorrent
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-torrent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - En Defensa del Software Libre