~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to lib/rss/maker/syndication.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'rss/syndication'
 
2
require 'rss/maker/1.0'
 
3
 
 
4
module RSS
 
5
  module Maker
 
6
    module SyndicationModel
 
7
      def self.append_features(klass)
 
8
        super
 
9
 
 
10
        ::RSS::SyndicationModel::ELEMENTS.each do |element|
 
11
          klass.add_need_initialize_variable(element)
 
12
          klass.add_other_element(element)
 
13
          klass.module_eval(<<-EOC, __FILE__, __LINE__+1)
 
14
            attr_accessor :#{element}
 
15
            def setup_#{element}(rss, current)
 
16
              if #{element} and current.respond_to?(:#{element}=)
 
17
                current.#{element} = @#{element} if @#{element}
 
18
              end
 
19
            end
 
20
          EOC
 
21
        end
 
22
      end
 
23
    end
 
24
 
 
25
    class ChannelBase; include SyndicationModel; end
 
26
  end
 
27
end