forked from boncey/ruby-podcast
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tidied up some annoying code styles Added github link to README Added test and data for corrupt mp3s
- Loading branch information
boncey
committed
Feb 8, 2012
1 parent
490d421
commit 10bc458
Showing
5 changed files
with
38 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
# | ||
# == Author | ||
# Ed Summers <[email protected]> | ||
# Darren Greaves https://github.com/boncey | ||
# | ||
# == Copyright | ||
# Copyright (c) 2004 Ed Summers. | ||
|
@@ -35,26 +36,26 @@ podcast = Podcast::Feed.new() | |
|
||
# read options | ||
opts = OptionParser.new | ||
opts.on( "-d", "--dir VAL", String ) { |val| dir=val } | ||
opts.on( "-o", "--out VAL", String ) { |val| podcast_file=val } | ||
opts.on( "-b", "--base VAL", String ) { |val| podcast.base=val } | ||
opts.on( "-l", "--link VAL", String ) { |val| podcast.link=val } | ||
opts.on( "-t", "--title VAL", String ) { |val| podcast.title=val } | ||
opts.on( "-a", "--about VAL", String ) { |val| podcast.about=val } | ||
opts.on( "-i", "--image VAL", String ) { |val| podcast.image=val } | ||
opts.on( "-v", "--version VAL", String ) { |val| version=val } | ||
opts.on( "-e", "--description VAL", String ) { |val| podcast.description=val } | ||
opts.parse(ARGV) rescue RDoc::usage( 'usage' ) | ||
RDoc::usage( 'usage' ) if dir == nil || podcast.title == nil || podcast.description == nil | ||
opts.on("-d", "--dir VAL", String) { |val| dir=val } | ||
opts.on("-o", "--out VAL", String) { |val| podcast_file=val } | ||
opts.on("-b", "--base VAL", String) { |val| podcast.base=val } | ||
opts.on("-l", "--link VAL", String) { |val| podcast.link=val } | ||
opts.on("-t", "--title VAL", String) { |val| podcast.title=val } | ||
opts.on("-a", "--about VAL", String) { |val| podcast.about=val } | ||
opts.on("-i", "--image VAL", String) { |val| podcast.image=val } | ||
opts.on("-v", "--version VAL", String) { |val| version=val } | ||
opts.on("-e", "--description VAL", String) { |val| podcast.description=val } | ||
opts.parse(ARGV) rescue RDoc::usage('usage') | ||
RDoc::usage('usage') if dir == nil || podcast.title == nil || podcast.description == nil | ||
|
||
# add a directory | ||
podcast.add_dir( dir ) | ||
podcast.add_dir(dir) | ||
podcast.version = version ? version : "0.9" | ||
|
||
# write off the rss | ||
if podcast_file | ||
file = File.new( podcast_file, 'w' ) | ||
file.write( podcast.get_rss() ) | ||
file = File.new(podcast_file, 'w') | ||
file.write(podcast.get_rss()) | ||
file.close | ||
else | ||
puts "Outputting podcast" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters