refinerycms-podcast 0.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/app/controllers/refinery/podcasts/admin/podcasts_controller.rb +24 -0
  3. data/app/controllers/refinery/podcasts/podcasts_controller.rb +39 -0
  4. data/app/models/refinery/podcasts/podcast.rb +41 -0
  5. data/app/views/refinery/podcasts/admin/podcasts/_actions.html.erb +23 -0
  6. data/app/views/refinery/podcasts/admin/podcasts/_form.html.erb +98 -0
  7. data/app/views/refinery/podcasts/admin/podcasts/_podcast.html.erb +22 -0
  8. data/app/views/refinery/podcasts/admin/podcasts/_podcasts.html.erb +2 -0
  9. data/app/views/refinery/podcasts/admin/podcasts/_records.html.erb +18 -0
  10. data/app/views/refinery/podcasts/admin/podcasts/_sortable_list.html.erb +5 -0
  11. data/app/views/refinery/podcasts/admin/podcasts/edit.html.erb +1 -0
  12. data/app/views/refinery/podcasts/admin/podcasts/index.html.erb +7 -0
  13. data/app/views/refinery/podcasts/admin/podcasts/new.html.erb +1 -0
  14. data/app/views/refinery/podcasts/podcasts/index.html.erb +11 -0
  15. data/app/views/refinery/podcasts/podcasts/index.rss.builder +71 -0
  16. data/app/views/refinery/podcasts/podcasts/show.html.erb +59 -0
  17. data/config/locales/cs.yml +34 -0
  18. data/config/locales/en.yml +32 -14
  19. data/config/locales/es.yml +35 -0
  20. data/config/locales/fr.yml +34 -0
  21. data/config/locales/nb.yml +34 -0
  22. data/config/locales/nl.yml +32 -14
  23. data/config/routes.rb +15 -6
  24. data/db/migrate/1_create_refinery_podcasts.rb +33 -0
  25. data/db/migrate/2_add_slug_to_refinery_podcasts.rb +8 -0
  26. data/db/migrate/3_add_image_id_to_refinery_podcasts.rb +8 -0
  27. data/db/seeds.rb +25 -0
  28. data/lib/generators/refinery/podcasts/podcasts_generator.rb +24 -0
  29. data/lib/generators/refinery/podcasts/templates/config/initializers/refinery/podcasts.rb.erb +47 -0
  30. data/lib/refinery/podcasts.rb +22 -0
  31. data/lib/refinery/podcasts/configuration.rb +20 -0
  32. data/lib/refinery/podcasts/engine.rb +22 -0
  33. data/lib/refinerycms-podcast.rb +1 -0
  34. data/lib/tasks/refinery/podcasts.rake +13 -0
  35. data/readme.md +10 -44
  36. metadata +125 -62
  37. data/app/controllers/admin/podcasts_controller.rb +0 -5
  38. data/app/controllers/podcasts_controller.rb +0 -12
  39. data/app/models/podcast.rb +0 -24
  40. data/app/views/admin/podcasts/_form.html.erb +0 -59
  41. data/app/views/admin/podcasts/_podcast.html.erb +0 -16
  42. data/app/views/admin/podcasts/edit.html.erb +0 -1
  43. data/app/views/admin/podcasts/index.html.erb +0 -34
  44. data/app/views/admin/podcasts/new.html.erb +0 -1
  45. data/app/views/podcasts/index.rss.builder +0 -56
  46. data/generators/podcast/podcast_generator.rb +0 -23
  47. data/generators/podcast/templates/migration.rb +0 -32
  48. data/lib/gemspec.rb +0 -30
  49. data/lib/refinery/podcast.rb +0 -15
  50. data/lib/tasks/podcast.rake +0 -35
  51. data/license.md +0 -21
  52. data/rails/init.rb +0 -14
@@ -1 +0,0 @@
1
- <%= render :partial => "form" %>
@@ -1,34 +0,0 @@
1
- <div id='actions'>
2
- <ul>
3
- <li>
4
- <%= render :partial => "/shared/admin/search", :locals => {:url => admin_podcasts_url} %>
5
- </li>
6
- <li>
7
- <%= link_to "Create New Podcast", new_admin_podcast_url, :class => "add_icon" %>
8
- </li>
9
- </ul>
10
- </div>
11
- <div id='records'>
12
- <% if searching? %>
13
- <h2><%= t('admin.search_results_for', :query => params[:search]) %></h2>
14
- <% if @podcasts.any? %>
15
- <%= render :partial => "podcast", :collection => @podcasts %>
16
- <% else %>
17
- <p><%= t('admin.search_no_results') %></p>
18
- <% end %>
19
- <% else %>
20
- <% if @podcasts.any? %>
21
- <%= will_paginate @podcasts, :previous_label => '&laquo;', :next_label => '&raquo;' %>
22
- <ul id='sortable_list'>
23
- <%= render :partial => "podcast", :collection => @podcasts %>
24
- </ul>
25
- <%= will_paginate @podcasts, :previous_label => '&laquo;', :next_label => '&raquo;' %>
26
- <% else %>
27
- <p>
28
- <strong>
29
- <%= t('.no_items_yet') %>
30
- </strong>
31
- </p>
32
- <% end %>
33
- <% end %>
34
- </div>
@@ -1 +0,0 @@
1
- <%= render :partial => "form" %>
@@ -1,56 +0,0 @@
1
- xml.instruct!
2
-
3
- xml.rss 'xmlns:itunes' => 'http://www.itunes.com/dtds/podcast-1.0.dtd', :version => "2.0"
4
- xml.channel do
5
- # NOTE: Fill in everything with your own data down to the categories.
6
- xml.title 'Your Podcast Title'
7
- xml.link 'http://yoursite.com/'
8
-
9
- # Accepted values are those in the ISO 639-1 Alpha-2 list (two-letter language codes, some with possible modifiers, such as "en-us").
10
- xml.language 'en-us'
11
-
12
- xml.copyright "&#x2117; &amp; &#xA9; #{Time.now.year} Jack &amp; Jill"
13
- xml.tag!('itunes:subtitle', 'A show about everything')
14
-
15
- # The content of this tag is shown in the Artist column in iTunes.
16
- xml.tag!('itunes:author', 'John Doe')
17
-
18
- # The contents of this tag are shown in a separate window that appears when the
19
- # "circled i" in the Description column is clicked. It also appears on the iTunes
20
- # page for your podcast. This field can be up to 4000 characters.
21
- 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"
22
-
23
- xml.tag!('itunes:summary', description)
24
- xml.description description
25
-
26
- # This tag contains information that will be used to contact the owner of the podcast
27
- # for communication specifically about their podcast. It will not be publicly displayed.
28
- xml.tag!('itunes:owner') do |owner|
29
- xml.tag!('itunes:name', 'John Doe')
30
- xml.tag!('itunes:email', 'john.doe@example.com')
31
- end
32
-
33
- # upload an image to your resources tab and link it in here
34
- # iTunes prefers square .jpg images that are at least 600 x 600 pixels
35
- xml.tag!('itunes:image', 'http://mysite.com/system/0000/1000x1000.jpg')
36
-
37
- # select from the list of categories here:
38
- # http://www.apple.com/itunes/podcasts/specs.html#categories
39
- xml.tag!('itunes:category', :text => "Technology") do |category|
40
- xml.tag!('itunes:category', :text => "Software How-To")
41
- end
42
-
43
- @items.each do |item|
44
- xml.item do
45
- xml.title item.title
46
- xml.tag!('itunes:author', item.author)
47
- xml.subtitle item.subtitle
48
- xml.summary item.summary
49
- xml.enclosure :url => item.file.public_filename, :length => item.file.size, :length => item.file.content_type
50
- xml.tag!('pubDate', item.published.strftime("%a, %d %b %Y %H:%M:%S %Z"))
51
- xml.tag!('itunes:duration', item.duration)
52
- xml.tag!('itunes:keywords', item.keywords)
53
- end
54
- end
55
- end
56
-
@@ -1,23 +0,0 @@
1
- class PodcastGenerator < Rails::Generator::NamedBase
2
-
3
- def initialize(*runtime_args)
4
- # set first argument to the table's name so that the user doesn't have to pass it in.
5
- runtime_args[0] = ["podcasts"]
6
- super(*runtime_args)
7
- end
8
-
9
- def banner
10
- "Usage: script/generate podcast"
11
- end
12
-
13
- def manifest
14
- record do |m|
15
- m.migration_template 'migration.rb', 'db/migrate',
16
- :migration_file_name => "create_structure_for_podcast",
17
- :assigns => {
18
- :migration_name => "CreateStructureForPodcast"
19
- }
20
- end
21
- end
22
-
23
- end if defined?(Rails::Generator::NamedBase)
@@ -1,32 +0,0 @@
1
- class <%= migration_name %> < ActiveRecord::Migration
2
-
3
- def self.up
4
- create_table :podcasts do |t|
5
- t.string :title
6
- t.string :author
7
- t.string :subtitle
8
- t.integer :file_id
9
- t.date :published
10
- t.string :duration
11
- t.string :keywords
12
- t.text :summary
13
- t.integer :position
14
-
15
- t.timestamps
16
- end
17
-
18
- add_index :podcasts, :id
19
-
20
- User.find(:all).each do |user|
21
- user.plugins.create(:name => "Podcast",
22
- :position => (user.plugins.maximum(:position) || -1) +1)
23
- end
24
- end
25
-
26
- def self.down
27
- UserPlugin.destroy_all({:title => "Podcast"})
28
-
29
- drop_table :podcasts
30
- end
31
-
32
- end
data/lib/gemspec.rb DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../refinery/podcast.rb', __FILE__)
3
- version = Refinery::Podcast.version
4
- raise "Could not get version so gemspec can not be built" if version.nil?
5
- files = Dir.glob("**/*").flatten.reject do |file|
6
- file =~ /\.gem(spec)?$/
7
- end
8
-
9
- gemspec = <<EOF
10
- Gem::Specification.new do |s|
11
- s.name = %q{refinerycms-podcast}
12
- s.version = %q{#{version}}
13
- s.description = %q{Plugin for Refinery CMS to manage and publish podcasts to iTunes}
14
- s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
15
- s.summary = %q{Ruby on Rails podcast plugin for RefineryCMS.}
16
- s.email = %q{info@refinerycms.com}
17
- s.homepage = %q{http://refinerycms.com}
18
- s.authors = %w(David\\ Jones)
19
- s.require_paths = %w(lib)
20
-
21
- s.files = [
22
- '#{files.join("',\n '")}'
23
- ]
24
- #{"s.test_files = [
25
- '#{Dir.glob("test/**/*.rb").join("',\n '")}'
26
- ]" if File.directory?("test")}
27
- end
28
- EOF
29
-
30
- File.open(File.expand_path("../../refinerycms-podcast.gemspec", __FILE__), 'w').puts(gemspec)
@@ -1,15 +0,0 @@
1
- module Refinery
2
- module Podcast
3
-
4
- def self.version
5
- ::Refinery::Podcast::Version.to_s
6
- end
7
-
8
- class Version
9
- def self.to_s
10
- %q{0.5}
11
- end
12
- end
13
-
14
- end
15
- end
@@ -1,35 +0,0 @@
1
- namespace :refinery do
2
- namespace :podcast do
3
- desc "Install extra files from the podcast plugin"
4
-
5
- task :install do
6
- [%w(db migrate), %w(app views podcasts)].each do |dir|
7
- Rails.root.join(dir.join(File::SEPARATOR)).mkpath
8
- end
9
-
10
- podcast_root = Pathname.new(File.expand_path("../../../", __FILE__))
11
- copies = [
12
- {:from => %w(app views podcasts), :to => %w(app views podcasts), :filename => "index.rss.builder"},
13
- ]
14
- puts "\nCopying files...\n\n"
15
- copies.each do |copy|
16
- copy_from = podcast_root.join(copy[:from].join(File::SEPARATOR), copy[:filename])
17
- copy_to = Rails.root.join(copy[:to].join(File::SEPARATOR), copy[:filename])
18
- unless copy_to.exist? and ENV["force"].presence.to_s != "true"
19
- FileUtils::cp copy_from.to_s, copy_to.to_s
20
- puts "Copied to #{copy_to}"
21
- else
22
- puts "'#{File.join copy[:to], copy[:filename]}' already existed in your application so your existing file was not overwritten - use force=true to overwrite."
23
- puts "Without this file being up to date, the podcast may not function properly."
24
- end
25
- end
26
-
27
- puts "\nCopied all files."
28
- puts "\nGenerating migration..."
29
- puts `ruby #{Rails.root.join('script', 'generate').cleanpath.to_s.gsub(/\/$/, '')} podcast`
30
- puts "\nNow, run these tasks:"
31
- puts " rake db:migrate"
32
- puts "\nWe hope you enjoy using our podcast plugin!\n\n"
33
- end
34
- end
35
- end
data/license.md DELETED
@@ -1,21 +0,0 @@
1
- # MIT License
2
-
3
- Copyright (c) 2005-2010 [Resolve Digital Ltd.](http://www.resolvedigital.co.nz)
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
data/rails/init.rb DELETED
@@ -1,14 +0,0 @@
1
- Refinery::Plugin.register do |plugin|
2
- plugin.title = "Podcasts"
3
- plugin.name = "podcasts"
4
- plugin.description = "Manage Podcasts"
5
- plugin.version = 1.0
6
- plugin.url = {:controller => "/admin/podcasts", :action => "index"}
7
- plugin.activity = {
8
- :class => Podcast,
9
- :url_prefix => "edit",
10
- :title => 'title'
11
- }
12
- # this tells refinery where this plugin is located on the filesystem and helps with urls.
13
- plugin.directory = directory
14
- end