woody 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,8 +9,10 @@ module Woody
9
9
  meta = YAML.load_file("content/metadata.yml")
10
10
 
11
11
  # instantiate the metadata hash so shit doesn't explode in our faces
12
- meta = Hash.new if meta.empty?
13
-
12
+ # WEIRD SHIT: used .empty? here before but fails if used on hash seemingly
13
+ if meta == false
14
+ meta = Hash.new
15
+ end
14
16
 
15
17
  episodes = Array.new
16
18
  filesfound = Array.new
@@ -83,12 +85,12 @@ module Woody
83
85
  puts "Warning: content/iTunes.png missing!"
84
86
  end
85
87
 
86
- # Update iTunes RSS
88
+ # Update (iTunes) RSS
87
89
  $config['itunes']['explicit'] = "no" if $config['itunes']['explicit'].nil?
88
- itunes = File.read "#{$source_root}/itunes.xml" # Use itunes.xml template in gem, not in site's template folder.
89
- itunes = Erubis::Eruby.new(itunes)
90
- itunes_compiled = itunes.result(config: $config, episodes: episodes)
91
- write_output_file("itunes.xml") {|f| f.write(itunes_compiled) }
90
+ feedxml = File.read File.join($source_root, "feed.xml") # Use feed.xml template in gem, not in site's template folder.
91
+ feed = Erubis::Eruby.new(feedxml)
92
+ feed_compiled = feed.result(config: $config, episodes: episodes)
93
+ write_output_file("feed.xml") {|f| f.write(feed_compiled) }
92
94
 
93
95
 
94
96
 
data/lib/woody/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Woody
2
2
  # Specifies Woody gem version
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
@@ -1,9 +1,10 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
2
+ <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
3
3
  <channel>
4
4
  <title><%= config['title'] %></title>
5
5
  <link><%= config['urlbase'] %></link>
6
- <language>en</language>
6
+ <language><%= config['lang'] %></language>
7
+
7
8
  <copyright>℗ &amp; © <%= config['author'] %></copyright>
8
9
  <itunes:subtitle><%= config['subtitle'] %></itunes:subtitle>
9
10
  <itunes:author><%= config['author'] %></itunes:author>
@@ -18,19 +19,23 @@
18
19
 
19
20
  <itunes:image href="<%= $config['urlbase'] + "/assets/iTunes.png" %>"/>
20
21
  <itunes:category text="<%= $config['itunes']['category'] %>"/>
21
-
22
-
23
- <%- episodes.each do |episode| %>
22
+
23
+ <atom:link href="<%= $config['urlbase'] %>/feed.xml" rel="self" type="application/rss+xml" />
24
+
25
+
26
+ <%- episodes.each do |episode| %>
24
27
  <item>
25
28
  <title><%= episode.title %></title>
26
29
  <itunes:subtitle><%= episode.subtitle %></itunes:subtitle>
27
30
  <itunes:summary><%= episode.synopsis %></itunes:summary>
28
- <enclosure url="<%= episode.file_url %>" length="<%= episode.size %>" type="audio/mpeg"/>
29
31
  <pubDate><%= episode.date.rfc2822 %></pubDate>
30
32
  <itunes:duration><%= episode.duration %></itunes:duration>
31
33
  <itunes:keywords><%= episode.keywords %></itunes:keywords>
32
34
  <itunes:explicit><%= episode.explicit_string %></itunes:explicit>
35
+ <description><%= episode.synopsis %></description>
36
+ <enclosure url="<%= episode.file_url %>" length="<%= episode.size %>" type="audio/mpeg"/>
33
37
  <guid><%= episode.url %></guid>
38
+ <category>Podcasts</category>
34
39
  </item>
35
40
  <% end %>
36
41
 
data/templates/index.html CHANGED
@@ -1,4 +1,5 @@
1
1
  <h2>Episodes:</h2>
2
+ <%= link_to "RSS Feed", "#{$config['urlbase']}/feed.xml" %>
2
3
  <% episodes.each do |episode| %>
3
4
  <div class="episode">
4
5
  <%= yield episode %>
@@ -1,29 +1,93 @@
1
- title: Title
2
- subtitle: Subtitle
3
- author: Author
1
+ #############################################################
2
+ # #
3
+ # dP ALPHA #
4
+ # 88 #
5
+ # dP dP dP .d8888b. .d8888b. .d888b88 dP dP #
6
+ # 88 88 88 88' `88 88' `88 88' `88 88 88 #
7
+ # 88.88b.88' 88. .88 88. .88 88. .88 88. .88 #
8
+ # 8888P Y8P `88888P' `88888P' `88888P8 `8888P88 #
9
+ # .88 #
10
+ # d8888P #
11
+ # #
12
+ #############################################################
13
+ # #
14
+ # Welcome to Woody, the best way to generate iTunes-ready #
15
+ # podcast feeds and websites! #
16
+ # #
17
+ # To get started, please fill out this wee config file, #
18
+ # drop some mp3s in the content folder and run: #
19
+ # #
20
+ # $ woody compile #
21
+ # #
22
+ # To build and compile your site! For more help see the #
23
+ # readme included. Have fun! #
24
+ # #
25
+ # Visit us on github - github.com/davidjrobertson/woody #
26
+ # #
27
+ #############################################################
4
28
 
5
- # Include http://, domain name, but *NO trailing slash*
6
- urlbase: http://example.com
29
+ ################
30
+ # BASIC INFO #
31
+ ################
32
+
33
+ # Title and subtitle of your podcast
34
+ title: David's World of Spoons
35
+ subtitle: From Teaspoons to Ladels
36
+
37
+ # A short description of your podcast. (Also used for iTunes)
38
+ summary: Hey there. I'm David, and this is my amazing world of spoons and other crockery!
39
+
40
+ # The name of the podcast's author
41
+ author: David "Spoonmad" Hewitson
42
+
43
+ # Primary language of the podcast - please see http://www.w3.org/WAI/ER/IG/ert/iso639.htm
44
+ lang: en
45
+
46
+ # Base URL of the podcast - used to generate links
47
+ urlbase: http://example.com
48
+
49
+ #######################
50
+ # ID3 CONFIGURATION #
51
+ #######################
7
52
 
8
53
  mp3:
9
- # NOT YET IMPLEMENTED! Do you want to have ID3v2 tags for artist/title automatically set? N.B., may be truncated.
54
+ # NYI! Do you want to have ID3v2 tags for artist/title automatically set? N.B., may be truncated.
10
55
  setartist: true
11
56
  settitle: true
12
57
 
58
+ ##########################
59
+ # ITUNES-SPECIFIC INFO #
60
+ ##########################
61
+
13
62
  itunes:
14
- summary: iTunes Summary
63
+ # Full name and email address of podcast owner
15
64
  owner:
16
65
  name: Owner
17
66
  email: owner@example.com
18
- # Category MUST be one of the ones listed here http://www.apple.com/itunes/podcasts/specs.html#categories
67
+
68
+ # One of the categories listed here: http://www.apple.com/itunes/podcasts/specs.html#categories
19
69
  category: Comedy
20
- explicit: "no" # yes/no/clean
21
70
 
71
+ # Is the podcast explicit? (yes/no/clean) You can type 'clean' to have your
72
+ # podcast show up with a 'clean' icon in iTunes search results
73
+ explicit: "no"
74
+
75
+ ###############################
76
+ # DISTRIBUTION CONFIGURATION #
77
+ ###############################
78
+
79
+ # NOTE: currently only Amazon S3 (AWS) is available - more soon!
80
+
81
+ distributiontype: s3
82
+
22
83
  s3:
23
- # Set the relevant s3 endpoint here. For eu-west-1 (Ireland), use this default.
84
+ # Set the relevant s3 endpoint here. For eu-west-1 (Ireland), use this default.
24
85
  hostname: s3-eu-west-1.amazonaws.com
25
86
  #prefix: podcast # Uncomment this to upload in a 'subdirectory' of the S3 bucket?
26
87
  accesskey:
88
+ # Your AWS access key and secret
27
89
  id: your-aws-access-key-id
28
90
  secret: your-aws-access-key-secret
91
+
92
+ # The bucket the podcast site should be uploaded to
29
93
  bucket: example.com
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -112,9 +112,9 @@ files:
112
112
  - lib/woody/generator.rb
113
113
  - lib/woody/version.rb
114
114
  - templates/episode.html
115
+ - templates/feed.xml
115
116
  - templates/iTunes.png
116
117
  - templates/index.html
117
- - templates/itunes.xml
118
118
  - templates/layout.html
119
119
  - templates/metadata.yml
120
120
  - templates/stylesheet.css