podtergeist 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db24c84c8de0d5f3e42b10dd89a63eb2b5eb3cb8
4
- data.tar.gz: 337038259c970dfa05639960122d561e000ff261
3
+ metadata.gz: 4977f319dbae229dc0b2b140dc1ebc0aa9368f0a
4
+ data.tar.gz: d8cfebdf7a7290422a4b62dcd669c0a7b7d47e1d
5
5
  SHA512:
6
- metadata.gz: 737129d72b18b5e2689a9937e6191a7300de0a8412fd07cbfa71c627505c3e92588e07f6756c8a232ea8c6fdd4ca6e62d5cd67f3e6ed7f12fa965853bab336e8
7
- data.tar.gz: 85f7d5a5e3523b96c93618382e2cfe167a9227e098d09074ef18dc6ddb532f47c8b4982d71e9481ba9eecd246414d21e03fc0ba8705793a6aad308261f83cace
6
+ metadata.gz: ae20ad533984754d78000373e083f1f68756074d718d487f090ef629feeca7884da34f5448462025cb9e6c781601c6529e9a84f928f6fa56fb6420c2c39a4a92
7
+ data.tar.gz: 083d3dcdfb714b54434700e2d7f4c37ee9370d2bae4bc2e4b60fd36bcfed8742736a0c1564784f654b0e8c18a9dbd5c92f3adffda30cee164754b50ab36f700c
@@ -12,7 +12,8 @@ class PodtergeistCLI < Thor
12
12
 
13
13
  method_option :destination, required: true, type: :string
14
14
  method_option :local_file, required: true, type: :string
15
- method_option :host, required: false, type: :string
15
+ method_option :host, required: true, type: :string
16
+ method_option :webroot, required: true, type: :string
16
17
  method_option :show_title, required: false, type: :string
17
18
  method_option :show_link, required: true, type: :string
18
19
  method_option :show_description, required: false, type: :string
@@ -30,7 +31,8 @@ class PodtergeistCLI < Thor
30
31
  method_option :episode_link, required: false, type: :string
31
32
  method_option :episode_pubdate, required: false, type: :string
32
33
  method_option :local_directory, required: true, type: :string
33
- method_option :host, required: false, type: :string
34
+ method_option :host, required: true, type: :string
35
+ method_option :webroot, required: true, type: :string
34
36
  desc 'existing', 'Add items in existing directory to a podcast feed (creating the feed if does not exist)'
35
37
  def existing
36
38
  Podtergeist::Feed.existing(options[:destination], options)
@@ -4,6 +4,7 @@ require 'mime/types'
4
4
  require 'taglib'
5
5
  require 'uri'
6
6
  require 'fileutils'
7
+ require 'pathname'
7
8
 
8
9
  module Podtergeist
9
10
  class Feed
@@ -81,11 +82,10 @@ module Podtergeist
81
82
 
82
83
  item.description = tag.comment
83
84
 
84
- if params['host']
85
- remote = URI.escape("#{File.basename(local_file)}")
86
- else
87
- remote = URI.escape("#{params['host']}/#{File.basename(local_file)}")
88
- end
85
+ local_directory = Pathname.new(params['local_directory'])
86
+ webroot = Pathname.new(params['webroot'])
87
+ url = params['host'] + '/' + local_directory.relative_path_from(webroot).to_s
88
+ remote = URI.escape("#{url}/#{File.basename(local_file)}")
89
89
  item.enclosure = RSS::Rss::Channel::Item::Enclosure.new(
90
90
  remote, properties.length, MIME::Types.type_for(local_file).first
91
91
  )
@@ -1,3 +1,3 @@
1
1
  module Podtergeist
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podtergeist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Coleman