podtergeist 0.0.10 → 0.0.11

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: b38f6ea9f5cca1bbd76801093762e65cf50faaa9
4
- data.tar.gz: 761260b69de79968611aa96a134350b006d1b8bb
3
+ metadata.gz: db24c84c8de0d5f3e42b10dd89a63eb2b5eb3cb8
4
+ data.tar.gz: 337038259c970dfa05639960122d561e000ff261
5
5
  SHA512:
6
- metadata.gz: 6ff8869b0053bb4103f5e6d2529195a258f0824068a5e373cb7f21eaf04cdd399bf74c317d361e533b51ad6771839feac0e7b40606e1a40f95a0076aa9943d61
7
- data.tar.gz: 62d0b05aae97409054eb1bd492bb2ff8c7a747b6ce8201583015010e9f8318e1988cc1d79e7e96c6b20e64b3c86eef23297fbd19cf0b628ec25e067ef5d73359
6
+ metadata.gz: 737129d72b18b5e2689a9937e6191a7300de0a8412fd07cbfa71c627505c3e92588e07f6756c8a232ea8c6fdd4ca6e62d5cd67f3e6ed7f12fa965853bab336e8
7
+ data.tar.gz: 85f7d5a5e3523b96c93618382e2cfe167a9227e098d09074ef18dc6ddb532f47c8b4982d71e9481ba9eecd246414d21e03fc0ba8705793a6aad308261f83cace
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Robert Coleman
1
+ Copyright (c) 2013-2014 Robert Coleman
2
2
 
3
3
  MIT License
4
4
 
data/bin/podtergeist CHANGED
@@ -2,35 +2,38 @@
2
2
  require 'thor'
3
3
  require 'podtergeist'
4
4
 
5
+ Signal.trap("INT") do
6
+ puts "\nSIGINT recieved.. terminated."
7
+ exit 1
8
+ end
9
+
5
10
  class PodtergeistCLI < Thor
6
11
  default_task :help
7
12
 
8
- method_option :destination, :required => true, :type => :string
9
- method_option :local_file, :required => true, :type => :string
10
- method_option :host, :required => true, :type => :string
11
- method_option :show_title, :required => false, :type => :string
12
- method_option :show_link, :required => true, :type => :string
13
- method_option :show_description, :required => false, :type => :string
14
- method_option :episode_link, :required => true, :type => :string
15
- method_option :episode_pubdate, :required => true, :type => :string
16
-
13
+ method_option :destination, required: true, type: :string
14
+ method_option :local_file, required: true, type: :string
15
+ method_option :host, required: false, type: :string
16
+ method_option :show_title, required: false, type: :string
17
+ method_option :show_link, required: true, type: :string
18
+ method_option :show_description, required: false, type: :string
19
+ method_option :episode_link, required: true, type: :string
20
+ method_option :episode_pubdate, required: true, type: :string
17
21
  desc 'add', 'Add item to a podcast feed (creating the feed if does not exist)'
18
22
  def add
19
- Podtergeist::Feed.add(options[:destination],options)
23
+ Podtergeist::Feed.add(options[:destination], options)
20
24
  end
21
25
 
22
- method_option :destination, :required => true, :type => :string
23
- method_option :show_title, :required => false, :type => :string
24
- method_option :show_link, :required => true, :type => :string
25
- method_option :show_description, :required => false, :type => :string
26
- method_option :episode_link, :required => false, :type => :string
27
- method_option :episode_pubdate, :required => false, :type => :string
28
- method_option :local_directory, :required => true, :type => :string
29
- method_option :host, :required => true, :type => :string
30
-
26
+ method_option :destination, required: true, type: :string
27
+ method_option :show_title, required: false, type: :string
28
+ method_option :show_link, required: true, type: :string
29
+ method_option :show_description, required: false, type: :string
30
+ method_option :episode_link, required: false, type: :string
31
+ method_option :episode_pubdate, required: false, type: :string
32
+ method_option :local_directory, required: true, type: :string
33
+ method_option :host, required: false, type: :string
31
34
  desc 'existing', 'Add items in existing directory to a podcast feed (creating the feed if does not exist)'
32
35
  def existing
33
- Podtergeist::Feed.existing(options[:destination],options)
36
+ Podtergeist::Feed.existing(options[:destination], options)
34
37
  end
35
38
  end
36
39
 
@@ -9,16 +9,16 @@ module Podtergeist
9
9
  class Feed
10
10
  class << self
11
11
 
12
- def add(feed,params)
13
- create_channel(feed,params) unless feed_exists?(feed)
14
- append_item(feed,params)
12
+ def add(feed, params)
13
+ create_channel(feed, params) unless feed_exists?(feed)
14
+ append_item(feed, params)
15
15
  end
16
16
 
17
- def existing(feed,params)
17
+ def existing(feed, params)
18
18
  shows = Dir.glob("#{params['local_directory']}/*.{m4a,mp3}").sort_by{ |f| File.ctime(f) }.reverse
19
- create_channel(feed,params,shows.first)
19
+ create_channel(feed, params, shows.first)
20
20
  shows.each do |file|
21
- append_item(feed,params,file)
21
+ append_item(feed, params, file)
22
22
  end
23
23
  end
24
24
 
@@ -30,7 +30,7 @@ module Podtergeist
30
30
  end
31
31
 
32
32
  # create
33
- def create_channel(path,params,local_file=params['local_file'])
33
+ def create_channel(path, params, local_file=params['local_file'])
34
34
  rss = RSS::Rss.new('2.0')
35
35
  channel = RSS::Rss::Channel.new
36
36
 
@@ -45,7 +45,7 @@ module Podtergeist
45
45
  end
46
46
 
47
47
  # add item
48
- def append_item(path,params,local_file=params['local_file'])
48
+ def append_item(path, params, local_file=params['local_file'])
49
49
  rss = RSS::Parser.parse(File.new(path))
50
50
  rss.items << rss_channel_item(local_file, params)
51
51
  write_rss_file!(path, rss)
@@ -81,7 +81,11 @@ module Podtergeist
81
81
 
82
82
  item.description = tag.comment
83
83
 
84
- remote = URI.escape("#{params['host']}/#{File.basename(local_file)}")
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
89
  item.enclosure = RSS::Rss::Channel::Item::Enclosure.new(
86
90
  remote, properties.length, MIME::Types.type_for(local_file).first
87
91
  )
@@ -1,3 +1,3 @@
1
1
  module Podtergeist
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
data/podtergeist.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.add_dependency 'thor', '~> 0.18'
20
20
  spec.add_dependency 'taglib-ruby', '~> 0.6'
21
21
  spec.add_dependency 'mime-types', '~> 1.23'
22
-
22
+
23
23
  spec.add_development_dependency 'bundler', '~> 1.3'
24
24
  spec.add_development_dependency 'rake'
25
25
  spec.add_development_dependency 'pry'
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: podtergeist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Coleman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-26 00:00:00.000000000 Z
11
+ date: 2014-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.18'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.18'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: taglib-ruby
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mime-types
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.23'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.23'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: pry-nav
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: CLI to create or append to podcast-compatible rss via args
@@ -116,7 +116,7 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
- - .gitignore
119
+ - ".gitignore"
120
120
  - Gemfile
121
121
  - LICENSE
122
122
  - README.md
@@ -136,17 +136,17 @@ require_paths:
136
136
  - lib
137
137
  required_ruby_version: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
148
  rubyforge_project:
149
- rubygems_version: 2.0.3
149
+ rubygems_version: 2.2.2
150
150
  signing_key:
151
151
  specification_version: 4
152
152
  summary: CLI to create or append to podcast-compatible rss via args