diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-18 21:19:18 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-18 21:19:18 +0000 |
commit | 7bbf2f308580f468802cd7d32c94fce1b9f1779e (patch) | |
tree | 0a680f59e70a78d60e776d7b763e618fb2fec624 /lib/rss/maker | |
parent | 34276148c4450faa77bb298cfbe005f7c263f802 (diff) | |
download | ruby-7bbf2f308580f468802cd7d32c94fce1b9f1779e.tar.gz |
* lib: Convert tabs to spaces for ruby files per
http://redmine.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#coding-style
Patch by Steve Klabnik [Ruby 1.9 - Bug #4730]
Patch by Jason Dew [Ruby 1.9 - Feature #4718]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/maker')
-rw-r--r-- | lib/rss/maker/base.rb | 56 | ||||
-rw-r--r-- | lib/rss/maker/image.rb | 16 |
2 files changed, 36 insertions, 36 deletions
diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb index 88ea831164..78fc9f8acb 100644 --- a/lib/rss/maker/base.rb +++ b/lib/rss/maker/base.rb @@ -51,7 +51,7 @@ module RSS module_eval(<<-EOC, __FILE__, __LINE__ + 1) def new_#{name} - #{name} = self.class::#{klass_name}.new(@maker) + #{name} = self.class::#{klass_name}.new(@maker) @#{plural} << #{name} if block_given? yield #{name} @@ -63,14 +63,14 @@ module RSS def to_feed(*args) @#{plural}.each do |#{name}| - #{name}.to_feed(*args) + #{name}.to_feed(*args) end end def replace(elements) @#{plural}.replace(elements.to_a) end - EOC + EOC end def def_classed_element_without_accessor(name, class_name=nil) @@ -88,7 +88,7 @@ module RSS def make_#{name} self.class::#{class_name}.new(@maker) end - EOC + EOC end def def_classed_element(name, class_name=nil, attribute_name=nil) @@ -106,7 +106,7 @@ module RSS def #{name}=(new_value) @#{name}.#{attribute_name} = new_value end - EOC + EOC else attr_reader name end @@ -126,17 +126,17 @@ module RSS end module_eval(<<-EOC, __FILE__, __LINE__ + 1) def #{name} - #{local_variable_name} = #{plural_name}.first - #{local_variable_name} ? #{local_variable_name}.#{attribute} : nil + #{local_variable_name} = #{plural_name}.first + #{local_variable_name} ? #{local_variable_name}.#{attribute} : nil end def #{name}=(#{new_value_variable_name}) - #{local_variable_name} = - #{plural_name}.first || #{plural_name}.new_#{new_name} - #{additional_setup_code} - #{local_variable_name}.#{attribute} = #{new_value_variable_name} + #{local_variable_name} = + #{plural_name}.first || #{plural_name}.new_#{new_name} + #{additional_setup_code} + #{local_variable_name}.#{attribute} = #{new_value_variable_name} end - EOC + EOC end def def_other_element(name) @@ -153,7 +153,7 @@ module RSS current.#{name} = @#{name} end end - EOC + EOC end def def_csv_element(name, type=nil) @@ -167,7 +167,7 @@ module RSS def #{name}=(value) @#{name} = Utils::CSV.parse(value)#{converter} end - EOC + EOC end end @@ -308,7 +308,7 @@ module RSS def ensure_xml_content(content) xhtml_uri = ::RSS::Atom::XHTML_URI unless content.is_a?(RSS::XML::Element) and - ["div", xhtml_uri] == [content.name, content.uri] + ["div", xhtml_uri] == [content.name, content.uri] children = content children = [children] unless content.is_a?(Array) children = set_xhtml_uri_as_default_uri(children) @@ -331,7 +331,7 @@ module RSS def set_xhtml_uri_as_default_uri(children) children.collect do |child| if child.is_a?(RSS::XML::Element) and - child.prefix.nil? and child.uri.nil? + child.prefix.nil? and child.uri.nil? RSS::XML::Element.new(child.name, nil, ::RSS::Atom::XHTML_URI, child.attributes.dup, set_xhtml_uri_as_default_uri(child.children)) @@ -385,7 +385,7 @@ module RSS } _language = language if _language and - !dc_languages.any? {|dc_language| dc_language.value == _language} + !dc_languages.any? {|dc_language| dc_language.value == _language} dc_language = self.class::DublinCoreLanguages::DublinCoreLanguage.new(self) dc_language.value = _language.dup dc_languages.unshift(dc_language) @@ -417,7 +417,7 @@ module RSS def make_#{element} self.class::#{Utils.to_class_name(element)}.new(self) end - EOC + EOC end attr_reader :feed_version @@ -500,9 +500,9 @@ module RSS end [ - ["link", "href", Proc.new {|target,| "#{target}.href = 'self'"}], - ["author", "name"], - ["contributor", "name"], + ["link", "href", Proc.new {|target,| "#{target}.href = 'self'"}], + ["author", "name"], + ["contributor", "name"], ].each do |name, attribute, additional_setup_maker| def_classed_elements(name, attribute, &additional_setup_maker) end @@ -511,7 +511,7 @@ module RSS managingEditor webMaster rating docs ttl).each do |element| attr_accessor element add_need_initialize_variable(element) - end + end %w(date lastBuildDate).each do |date_element| attr_reader date_element @@ -713,12 +713,12 @@ module RSS end [ - ["author", "name"], - ["link", "href", Proc.new {|target,| "#{target}.href = 'alternate'"}], - ["contributor", "name"], + ["author", "name"], + ["link", "href", Proc.new {|target,| "#{target}.href = 'alternate'"}], + ["contributor", "name"], ].each do |name, attribute| def_classed_elements(name, attribute) - end + end %w(comments id published).each do |element| attr_accessor element @@ -795,10 +795,10 @@ module RSS %w(authors categories contributors generator icon logo rights subtitle title).each do |name| def_classed_element(name) - end + end [ - ["link", "href"], + ["link", "href"], ].each do |name, attribute| def_classed_elements(name, attribute) end diff --git a/lib/rss/maker/image.rb b/lib/rss/maker/image.rb index e2b36e0a08..6b8f4f8e57 100644 --- a/lib/rss/maker/image.rb +++ b/lib/rss/maker/image.rb @@ -13,11 +13,11 @@ module RSS end def self.install_image_item(klass) - klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) + klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) class ImageItem < ImageItemBase DublinCoreModel.install_dublin_core(self) end -EOC + EOC end class ImageItemBase < Base @@ -29,9 +29,9 @@ EOC add_need_initialize_variable("image_width") add_need_initialize_variable("image_height") alias width= image_width= - alias width image_width + alias width image_width alias height= image_height= - alias height image_height + alias height image_height def have_required_values? @about @@ -57,7 +57,7 @@ EOC end def self.install_image_favicon(klass) - klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) + klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) class ImageFavicon < ImageFaviconBase DublinCoreModel.install_dublin_core(self) end @@ -73,9 +73,9 @@ EOC alias size image_size alias size= image_size= - def have_required_values? - @about and @image_size - end + def have_required_values? + @about and @image_size + end def to_feed(feed, current) if current.respond_to?(:image_favicon=) and have_required_values? |