dropcaster 0.0.4 → 0.0.5.rc1
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 +7 -0
- data/.document +5 -5
- data/.gitignore +14 -0
- data/.travis.yml +6 -0
- data/Gemfile +2 -13
- data/Gemfile.lock +94 -29
- data/Guardfile +12 -0
- data/LICENSE.txt +20 -20
- data/{README.md → README.markdown} +185 -171
- data/Rakefile +11 -47
- data/TODO +13 -12
- data/bin/dropcaster +129 -117
- data/bin/lstags +51 -45
- data/doc/sample-channel.yml +88 -81
- data/doc/sample-sidecar.yml +19 -19
- data/dropcaster.gemspec +36 -97
- data/lib/dropcaster/channel.rb +195 -159
- data/lib/dropcaster/channel_file_locator.rb +57 -57
- data/lib/dropcaster/errors.rb +25 -25
- data/lib/dropcaster/item.rb +28 -47
- data/lib/dropcaster/log_formatter.rb +9 -9
- data/lib/dropcaster/version.rb +3 -0
- data/lib/dropcaster.rb +28 -30
- data/templates/channel.html.erb +45 -43
- data/templates/channel.rss.erb +65 -64
- data/test/extensions/windows.rb +12 -12
- data/test/fixtures/channel.yml +16 -15
- data/test/fixtures/test_template.json.erb +40 -40
- data/test/helper.rb +10 -14
- data/test/unit/test_app.rb +129 -99
- data/test/unit/test_channel.rb +80 -73
- data/test/unit/test_channel_locator.rb +76 -93
- data/test/unit/test_channel_xml.rb +90 -89
- data/test/unit/test_item.rb +51 -63
- metadata +225 -158
- data/VERSION +0 -1
- data/lib/dropcaster/hashkeys.rb +0 -12
data/lib/dropcaster/item.rb
CHANGED
@@ -1,47 +1,28 @@
|
|
1
|
-
require 'mp3info'
|
2
|
-
require 'digest/sha1'
|
3
|
-
|
4
|
-
module Dropcaster
|
5
|
-
class Item
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
if options && options[:strip_itunes_private]
|
30
|
-
Dropcaster.logger.info("Removing iTunes' private normalization information from comments")
|
31
|
-
self.tag2.COM.delete_if{|comment|
|
32
|
-
comment =~ /^( [0-9A-F]{8}){10}$/
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
# Convert lyrics frame into a hash, keyed by the three-letter language code
|
37
|
-
if tag2.ULT
|
38
|
-
lyrics_parts = tag2.ULT.split(0.chr)
|
39
|
-
|
40
|
-
if lyrics_parts && 3 == lyrics_parts.size
|
41
|
-
self.lyrics = Hash.new
|
42
|
-
self.lyrics[lyrics_parts[1]] = lyrics_parts[2]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
1
|
+
require 'mp3info'
|
2
|
+
require 'digest/sha1'
|
3
|
+
|
4
|
+
module Dropcaster
|
5
|
+
class Item
|
6
|
+
attr_reader :file_name, :tag, :tag2, :duration, :file_size, :uuid, :pub_date, :pub_date, :lyrics
|
7
|
+
attr_accessor :artist, :image_url, :url, :keywords
|
8
|
+
|
9
|
+
def initialize(file_path, options = nil)
|
10
|
+
Mp3Info.open(file_path){|mp3info|
|
11
|
+
@file_name = Pathname.new(File.expand_path(file_path)).relative_path_from(Pathname.new(Dir.pwd)).cleanpath.to_s
|
12
|
+
@tag = mp3info.tag
|
13
|
+
@tag2 = mp3info.tag2
|
14
|
+
@duration = mp3info.length
|
15
|
+
}
|
16
|
+
|
17
|
+
@file_size = File.new(@file_name).stat.size
|
18
|
+
@uuid = Digest::SHA1.hexdigest(File.read(file_name))
|
19
|
+
|
20
|
+
unless tag2.TDR.blank?
|
21
|
+
@pub_date = DateTime.parse(tag2.TDR)
|
22
|
+
else
|
23
|
+
Dropcaster.logger.info("#{file_path} has no pub date set, using the file's modification time")
|
24
|
+
@pub_date = DateTime.parse(File.new(file_name).mtime.to_s)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
require 'logger'
|
2
|
-
|
3
|
-
module Dropcaster
|
4
|
-
class LogFormatter < Logger::Formatter
|
5
|
-
def call(severity, time, program_name, message)
|
6
|
-
"#{severity}: #{message}\n"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
require 'logger'
|
2
|
+
|
3
|
+
module Dropcaster
|
4
|
+
class LogFormatter < Logger::Formatter
|
5
|
+
def call(severity, time, program_name, message)
|
6
|
+
"#{severity}: #{message}\n"
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
data/lib/dropcaster.rb
CHANGED
@@ -1,30 +1,28 @@
|
|
1
|
-
$:.unshift File.dirname(__FILE__)
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require 'active_support/core_ext/
|
7
|
-
require 'active_support/core_ext/
|
8
|
-
|
9
|
-
require 'logger'
|
10
|
-
require 'active_support/core_ext/logger'
|
11
|
-
|
12
|
-
require 'dropcaster/errors'
|
13
|
-
require 'dropcaster/log_formatter'
|
14
|
-
require 'dropcaster/
|
15
|
-
require 'dropcaster/
|
16
|
-
require 'dropcaster/
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
@@logger =
|
27
|
-
|
28
|
-
|
29
|
-
end
|
30
|
-
end
|
1
|
+
$:.unshift File.dirname(__FILE__)
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'yaml'
|
5
|
+
require 'active_support/core_ext/date_time/conversions'
|
6
|
+
require 'active_support/core_ext/object/blank'
|
7
|
+
require 'active_support/core_ext/module/attribute_accessors'
|
8
|
+
|
9
|
+
require 'logger'
|
10
|
+
require 'active_support/core_ext/logger'
|
11
|
+
|
12
|
+
require 'dropcaster/errors'
|
13
|
+
require 'dropcaster/log_formatter'
|
14
|
+
require 'dropcaster/channel'
|
15
|
+
require 'dropcaster/item'
|
16
|
+
require 'dropcaster/channel_file_locator'
|
17
|
+
|
18
|
+
module Dropcaster
|
19
|
+
CHANNEL_YML = 'channel.yml'
|
20
|
+
|
21
|
+
mattr_accessor :logger
|
22
|
+
|
23
|
+
unless @@logger
|
24
|
+
@@logger = Logger.new(STDERR)
|
25
|
+
@@logger.level = Logger::WARN
|
26
|
+
@@logger.formatter = LogFormatter.new
|
27
|
+
end
|
28
|
+
end
|
data/templates/channel.html.erb
CHANGED
@@ -1,43 +1,45 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html lang="<%= h(language) %>">
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8"/>
|
5
|
-
<title><%= h(title) %></title>
|
6
|
-
<meta name="generator" content="Dropcaster <%= Dropcaster::VERSION%>"/>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
<%
|
20
|
-
|
21
|
-
<%
|
22
|
-
<
|
23
|
-
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
<%
|
31
|
-
|
32
|
-
|
33
|
-
<%
|
34
|
-
<
|
35
|
-
|
36
|
-
<
|
37
|
-
|
38
|
-
<p
|
39
|
-
<%
|
40
|
-
|
41
|
-
|
42
|
-
</
|
43
|
-
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="<%= h(language) %>">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8"/>
|
5
|
+
<title><%= h(title) %></title>
|
6
|
+
<meta name="generator" content="Dropcaster <%= Dropcaster::VERSION%>"/>
|
7
|
+
<meta name="keywords" content="<%= keywords.map{|k| h(k)}.join(', ') %>"/>
|
8
|
+
<% unless copyright.blank? %>
|
9
|
+
<meta name="copyright" content="<%= h(copyright) %>"/>
|
10
|
+
<% end %>
|
11
|
+
<link rel="canonical" href="<%= h(url) %>"/>
|
12
|
+
<link rel="alternate" type="application/rss+xml" title="<%= h(title) %> Podcast Feed" href="<%= h(url) %>">
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body id="home">
|
16
|
+
<h1><%= h(title) %></h1>
|
17
|
+
<% unless subtitle.blank? %>
|
18
|
+
<h2><%= h(subtitle) %></h2>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<% unless image_url.blank? %>
|
22
|
+
<img src="<%= image_url %>"/>
|
23
|
+
<% end %>
|
24
|
+
<p><%= h(description) %></p>
|
25
|
+
|
26
|
+
<h1>Episodes</h1>
|
27
|
+
<% items.each{|item| %>
|
28
|
+
<div class="item" id="<%= h(item.uuid) %>">
|
29
|
+
<h1><%= item.tag.title || item.tag2.TIT2%></h1>
|
30
|
+
<% unless item.tag2.SUBTITLE.blank? %>
|
31
|
+
<h2><%= h(item.tag2.SUBTITLE) %></h2>
|
32
|
+
<% end %>
|
33
|
+
<% unless item.tag2.TT3.blank? %>
|
34
|
+
<p><%= h(item.tag2.TT3) %></p>
|
35
|
+
<% end %>
|
36
|
+
<img src="<%= item.image_url %>"/>
|
37
|
+
<p>Download: <a href="<%= item.url %>">MP3</a> (<%= humanize_time(item.duration.to_i) %>, <%= humanize_size(item.file_size) %>)</p>
|
38
|
+
<p>Published <%= h(item.pub_date.to_formatted_s(:rfc822)) %></p>
|
39
|
+
<% unless item.keywords.blank? %>
|
40
|
+
<p><%= item.keywords.map{|k| h(k)}.join(',') %></p>
|
41
|
+
<% end %>
|
42
|
+
</div>
|
43
|
+
<% } %>
|
44
|
+
</body>
|
45
|
+
</html>
|
data/templates/channel.rss.erb
CHANGED
@@ -1,64 +1,65 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!-- This file generated by Dropcaster <%= Dropcaster::VERSION%> -->
|
3
|
-
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
|
4
|
-
<channel>
|
5
|
-
<title><%= h(title) %></title>
|
6
|
-
<link><%= h(url) %></link>
|
7
|
-
<description><%= h(description) %></description>
|
8
|
-
<itunes:summary><%= h(description) %></itunes:summary>
|
9
|
-
<% unless language.blank? %>
|
10
|
-
<language><%= h(language) %></language>
|
11
|
-
<% end %>
|
12
|
-
<% unless copyright.blank? %>
|
13
|
-
<copyright><%= h(copyright) %></copyright>
|
14
|
-
<% end %>
|
15
|
-
<% unless subtitle.blank? %>
|
16
|
-
<itunes:subtitle><%= h(subtitle) %></itunes:subtitle>
|
17
|
-
<% end %>
|
18
|
-
<% unless author.blank? %>
|
19
|
-
<itunes:author><%= h(author) %></itunes:author>
|
20
|
-
<% end %>
|
21
|
-
<% unless owner.nil? %>
|
22
|
-
<itunes:owner>
|
23
|
-
<itunes:name><%= h(owner[:name]) %></itunes:name>
|
24
|
-
<itunes:email><%= h(owner[:email]) %></itunes:email>
|
25
|
-
</itunes:owner>
|
26
|
-
<% end %>
|
27
|
-
<% unless image_url.blank? %>
|
28
|
-
<itunes:image href="<%= image_url %>"/>
|
29
|
-
<% end %>
|
30
|
-
<% categories.each{|category| %>
|
31
|
-
<% if category.respond_to?(:each_line) %>
|
32
|
-
<itunes:category text="<%= h(category) %>"/>
|
33
|
-
<% else %>
|
34
|
-
<itunes:category text="<%= h(category.first) %>">
|
35
|
-
<itunes:category text="<%= h(category.last) %>"/>
|
36
|
-
</itunes:category>
|
37
|
-
<% end %>
|
38
|
-
<% } unless categories.blank? %>
|
39
|
-
<% unless explicit.blank? %>
|
40
|
-
<itunes:explicit><%= h(explicit) %></itunes:explicit>
|
41
|
-
<% end %>
|
42
|
-
<generator>Dropcaster <%= Dropcaster::VERSION%></generator>
|
43
|
-
|
44
|
-
<
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
<
|
49
|
-
|
50
|
-
<% unless item.tag2.TT3.blank? %>
|
51
|
-
<itunes:
|
52
|
-
|
53
|
-
|
54
|
-
<
|
55
|
-
<
|
56
|
-
<
|
57
|
-
<
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
</
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- This file generated by Dropcaster <%= Dropcaster::VERSION %> -->
|
3
|
+
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
|
4
|
+
<channel>
|
5
|
+
<title><%= h(title) %></title>
|
6
|
+
<link><%= h(url) %></link>
|
7
|
+
<description><%= h(description) %></description>
|
8
|
+
<itunes:summary><%= h(description) %></itunes:summary>
|
9
|
+
<% unless language.blank? %>
|
10
|
+
<language><%= h(language) %></language>
|
11
|
+
<% end %>
|
12
|
+
<% unless copyright.blank? %>
|
13
|
+
<copyright><%= h(copyright) %></copyright>
|
14
|
+
<% end %>
|
15
|
+
<% unless subtitle.blank? %>
|
16
|
+
<itunes:subtitle><%= h(subtitle) %></itunes:subtitle>
|
17
|
+
<% end %>
|
18
|
+
<% unless author.blank? %>
|
19
|
+
<itunes:author><%= h(author) %></itunes:author>
|
20
|
+
<% end %>
|
21
|
+
<% unless owner.nil? %>
|
22
|
+
<itunes:owner>
|
23
|
+
<itunes:name><%= h(owner[:name]) %></itunes:name>
|
24
|
+
<itunes:email><%= h(owner[:email]) %></itunes:email>
|
25
|
+
</itunes:owner>
|
26
|
+
<% end %>
|
27
|
+
<% unless image_url.blank? %>
|
28
|
+
<itunes:image href="<%= image_url %>"/>
|
29
|
+
<% end %>
|
30
|
+
<% categories.each{|category| %>
|
31
|
+
<% if category.respond_to?(:each_line) %>
|
32
|
+
<itunes:category text="<%= h(category) %>"/>
|
33
|
+
<% else %>
|
34
|
+
<itunes:category text="<%= h(category.first) %>">
|
35
|
+
<itunes:category text="<%= h(category.last) %>"/>
|
36
|
+
</itunes:category>
|
37
|
+
<% end %>
|
38
|
+
<% } unless categories.blank? %>
|
39
|
+
<% unless explicit.blank? %>
|
40
|
+
<itunes:explicit><%= h(explicit) %></itunes:explicit>
|
41
|
+
<% end %>
|
42
|
+
<generator>Dropcaster <%= Dropcaster::VERSION%></generator>
|
43
|
+
<% unless keywords.blank? %>
|
44
|
+
<itunes:keywords><%= keywords.map{|k| h(k)}.join(',') %></itunes:keywords>
|
45
|
+
<% end %>
|
46
|
+
<% items.each{|item| %>
|
47
|
+
<item>
|
48
|
+
<title><%= item.tag.title || item.tag2.TIT2%></title>
|
49
|
+
<itunes:author><%= h(item.tag2.TP1 || item.tag2.TPE1) %></itunes:author>
|
50
|
+
<% unless item.tag2.TT3.blank? %>
|
51
|
+
<itunes:subtitle><%= h(truncate(item.tag2.TT3, 50)) %></itunes:subtitle>
|
52
|
+
<itunes:summary><%= h(item.tag2.TT3) %></itunes:summary>
|
53
|
+
<% end %>
|
54
|
+
<itunes:image href="<%= item.image_url %>"/>
|
55
|
+
<enclosure url="<%= item.url %>" length="<%= item.file_size %>" type="audio/mp3"/>
|
56
|
+
<guid isPermaLink="false"><%= h(item.uuid) %></guid>
|
57
|
+
<pubDate><%= h(item.pub_date.to_formatted_s(:rfc822)) %></pubDate>
|
58
|
+
<itunes:duration><%= item.duration.to_i %></itunes:duration>
|
59
|
+
<% unless item.keywords.blank? %>
|
60
|
+
<itunes:keywords><%= item.keywords.map{|k| h(k)}.join(',') %></itunes:keywords>
|
61
|
+
<% end %>
|
62
|
+
</item>
|
63
|
+
<% } %>
|
64
|
+
</channel>
|
65
|
+
</rss>
|
data/test/extensions/windows.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
# Returns true if we run on a windows platform
|
2
|
-
#
|
3
|
-
# Sample:
|
4
|
-
#
|
5
|
-
# puts "Windows" if Kernel.is_windows?
|
6
|
-
#
|
7
|
-
# http://snippets.dzone.com/posts/show/2112
|
8
|
-
#
|
9
|
-
def Kernel.is_windows?
|
10
|
-
processor, platform, *rest = RUBY_PLATFORM.split("-")
|
11
|
-
platform == 'mingw32'
|
12
|
-
end
|
1
|
+
# Returns true if we run on a windows platform
|
2
|
+
#
|
3
|
+
# Sample:
|
4
|
+
#
|
5
|
+
# puts "Windows" if Kernel.is_windows?
|
6
|
+
#
|
7
|
+
# http://snippets.dzone.com/posts/show/2112
|
8
|
+
#
|
9
|
+
def Kernel.is_windows?
|
10
|
+
processor, platform, *rest = RUBY_PLATFORM.split("-")
|
11
|
+
platform == 'mingw32'
|
12
|
+
end
|
data/test/fixtures/channel.yml
CHANGED
@@ -1,15 +1,16 @@
|
|
1
|
-
:title: All About Everything
|
2
|
-
:subtitle: A show about everything
|
3
|
-
:url: http://www.example.com/podcasts/everything/
|
4
|
-
:language: en-us
|
5
|
-
:copyright: © 2011 John Doe and Family
|
6
|
-
:author: John Doe
|
7
|
-
:description: All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Store!
|
8
|
-
:owner:
|
9
|
-
:name: John Doe
|
10
|
-
:email: john.doe@example.com
|
11
|
-
:image_url: AllAboutEverything.jpg
|
12
|
-
:
|
13
|
-
|
14
|
-
-
|
15
|
-
|
1
|
+
:title: All About Everything
|
2
|
+
:subtitle: A show about everything
|
3
|
+
:url: http://www.example.com/podcasts/everything/
|
4
|
+
:language: en-us
|
5
|
+
:copyright: © 2011 John Doe and Family
|
6
|
+
:author: John Doe
|
7
|
+
:description: All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our Podcast in the iTunes Store!
|
8
|
+
:owner:
|
9
|
+
:name: John Doe
|
10
|
+
:email: john.doe@example.com
|
11
|
+
:image_url: AllAboutEverything.jpg
|
12
|
+
:keywords: [bumm, zack, return]
|
13
|
+
:categories:
|
14
|
+
- [Technology, Gadgets]
|
15
|
+
- TV & Film
|
16
|
+
:explicit: No
|
@@ -1,40 +1,40 @@
|
|
1
|
-
{
|
2
|
-
"generator" : {
|
3
|
-
"name" : "Dropcaster",
|
4
|
-
"version" : "<%= Dropcaster::VERSION%>"
|
5
|
-
},
|
6
|
-
"channel" : {
|
7
|
-
"title" : "<%= title %>",
|
8
|
-
"link" : "<%= url %>",
|
9
|
-
"description" : "<%= description %>",
|
10
|
-
"language" : "<%= language %>",
|
11
|
-
"copyright" : "<%= copyright %>",
|
12
|
-
"subtitle" : "<%= subtitle %>",
|
13
|
-
"author" : "<%= author %>",
|
14
|
-
"owner" : {
|
15
|
-
"name" : "<%= owner[:name] %>",
|
16
|
-
"email" : "<%= owner[:email] %>"
|
17
|
-
},
|
18
|
-
"image" : "<%= image_url %>",
|
19
|
-
"categories": ["<% categories.join('\",\"') %>"],
|
20
|
-
"explicit" : "<%= explicit %>",
|
21
|
-
"items" : [<% items.collect{|item| %>{
|
22
|
-
"title" : "<%= item.tag.title || item.tag2.TIT2 %>",
|
23
|
-
"author" : "<%= item.tag2.TP1 || item.tag2.TPE1 %>",
|
24
|
-
"subtitle" : "<%= item.tag2.SUBTITLE %>",
|
25
|
-
"summary" : "<%= item.tag2.TT3 %>",
|
26
|
-
"image" : "<%= item.image_url %>",
|
27
|
-
"enclosure" : {
|
28
|
-
"url" : "<%= item.url %>",
|
29
|
-
"length" : "<%= item.file_size %>",
|
30
|
-
"type" : "audio/mp3"
|
31
|
-
},
|
32
|
-
"guid" : "<%= item.uuid %>",
|
33
|
-
"pubDate" : "<%= item.pub_date.to_formatted_s(:rfc822) %>",
|
34
|
-
"duration" : "<%= item.duration.to_i %>",
|
35
|
-
"keywords" : "<%= item.keywords %>"
|
36
|
-
}
|
37
|
-
<% }.join(',') %>
|
38
|
-
]
|
39
|
-
}
|
40
|
-
}
|
1
|
+
{
|
2
|
+
"generator" : {
|
3
|
+
"name" : "Dropcaster",
|
4
|
+
"version" : "<%= Dropcaster::VERSION%>"
|
5
|
+
},
|
6
|
+
"channel" : {
|
7
|
+
"title" : "<%= title %>",
|
8
|
+
"link" : "<%= url %>",
|
9
|
+
"description" : "<%= description %>",
|
10
|
+
"language" : "<%= language %>",
|
11
|
+
"copyright" : "<%= copyright %>",
|
12
|
+
"subtitle" : "<%= subtitle %>",
|
13
|
+
"author" : "<%= author %>",
|
14
|
+
"owner" : {
|
15
|
+
"name" : "<%= owner[:name] %>",
|
16
|
+
"email" : "<%= owner[:email] %>"
|
17
|
+
},
|
18
|
+
"image" : "<%= image_url %>",
|
19
|
+
"categories": ["<% categories.join('\",\"') %>"],
|
20
|
+
"explicit" : "<%= explicit %>",
|
21
|
+
"items" : [<% items.collect{|item| %>{
|
22
|
+
"title" : "<%= item.tag.title || item.tag2.TIT2 %>",
|
23
|
+
"author" : "<%= item.tag2.TP1 || item.tag2.TPE1 %>",
|
24
|
+
"subtitle" : "<%= item.tag2.SUBTITLE %>",
|
25
|
+
"summary" : "<%= item.tag2.TT3 %>",
|
26
|
+
"image" : "<%= item.image_url %>",
|
27
|
+
"enclosure" : {
|
28
|
+
"url" : "<%= item.url %>",
|
29
|
+
"length" : "<%= item.file_size %>",
|
30
|
+
"type" : "audio/mp3"
|
31
|
+
},
|
32
|
+
"guid" : "<%= item.uuid %>",
|
33
|
+
"pubDate" : "<%= item.pub_date.to_formatted_s(:rfc822) %>",
|
34
|
+
"duration" : "<%= item.duration.to_i %>",
|
35
|
+
"keywords" : "<%= item.keywords %>"
|
36
|
+
}
|
37
|
+
<% }.join(',') %>
|
38
|
+
]
|
39
|
+
}
|
40
|
+
}
|
data/test/helper.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
FIXTURES_DIR = File.join(File.dirname(__FILE__), 'fixtures')
|
12
|
-
FIXTURE_ITUNES_MP3 = File.join(FIXTURES_DIR, 'iTunes.mp3')
|
13
|
-
NS_ITUNES = "itunes:http://www.itunes.com/dtds/podcast-1.0.dtd"
|
14
|
-
end
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'dropcaster'
|
3
|
+
|
4
|
+
require_relative 'extensions/windows'
|
5
|
+
|
6
|
+
module DropcasterTest
|
7
|
+
FIXTURES_DIR = File.join(File.dirname(__FILE__), 'fixtures')
|
8
|
+
FIXTURE_ITUNES_MP3 = File.join(FIXTURES_DIR, 'iTunes.mp3')
|
9
|
+
NS_ITUNES = "itunes:http://www.itunes.com/dtds/podcast-1.0.dtd"
|
10
|
+
end
|