[DRE-commits] [ruby-org] 240/303: Slight changes.

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:34:05 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit 71eeb6b041e4199b33b9f31c15c1e9d0627b5026
Author: vonavi <ivvl82 at gmail.com>
Date:   Sun Jan 27 01:35:38 2013 +0200

    Slight changes.
---
 lib/org-ruby/html_output_buffer.rb |   30 ++++++++++++++++--------------
 lib/org-ruby/output_buffer.rb      |   11 +++--------
 2 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index 3bdae94..d31cd2a 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -15,8 +15,8 @@ module Orgmode
 
     HtmlBlockTag = {
       :paragraph => "p",
-      :unordered_list => "ul",
       :ordered_list => "ol",
+      :unordered_list => "ul",
       :list_item => "li",
       :definition_list => "dl",
       :definition_term => "dt",
@@ -47,7 +47,7 @@ module Orgmode
         @title_decoration = ""
       end
       @options = opts
-      @indentation = :start
+      @add_newline = :start
       @footnotes = {}
       @unclosed_tags = []
       @logger.debug "HTML export options: #{@options.inspect}"
@@ -76,11 +76,11 @@ module Orgmode
                         @title_decoration
                       end
 
-          unless @indentation == :start
+          unless @add_newline == :start
             @output << "\n"
             output_indentation
           end
-          @indentation = :output
+          @add_newline = true
 
           @logger.debug "#{mode}: <#{HtmlBlockTag[mode]}#{css_class}>"
           @output << "<#{HtmlBlockTag[mode]}#{css_class}>"
@@ -97,11 +97,11 @@ module Orgmode
       if HtmlBlockTag[m]
         unless ((mode_is_table?(m) and skip_tables?) or
                 (m == :src and defined? Pygments))
-          if @indentation
+          if @add_newline
             @output << "\n"
             output_indentation
           end
-          @indentation = :output
+          @add_newline = true
           @logger.debug "</#{HtmlBlockTag[m]}>"
           @output << "</#{HtmlBlockTag[m]}>"
         end
@@ -152,7 +152,7 @@ module Orgmode
       when @buffer.length > 0
         @buffer.lstrip!
         escape_buffer!
-        @indentation = nil
+        @add_newline = nil
         @logger.debug "FLUSH      ==========> #{current_mode}"
 
         case
@@ -176,15 +176,17 @@ module Orgmode
           indent = @list_indent_stack.last
           pop_mode
 
-          @indentation = :start
+          @add_newline = :start
           push_mode(:definition_descr, indent)
           @output << inline_formatting(d[1].strip)
-          @indentation = nil
+          @add_newline = nil
 
-        when @output_type == :horizontal_rule
-          @output << "\n"
-          @indentation = :output
-          output_indentation
+        when current_mode == :horizontal_rule
+          unless @add_newline == :start
+            @output << "\n"
+            output_indentation
+          end
+          @add_newline = true
           @output << "<hr />"
 
         else
@@ -232,7 +234,7 @@ module Orgmode
 
     def buffer_indentation
       indent = "  " * @list_indent_stack.length
-      self << indent
+      @buffer << indent
     end
 
     def output_indentation
diff --git a/lib/org-ruby/output_buffer.rb b/lib/org-ruby/output_buffer.rb
index c7de1e2..c67e0d3 100644
--- a/lib/org-ruby/output_buffer.rb
+++ b/lib/org-ruby/output_buffer.rb
@@ -74,15 +74,15 @@ module Orgmode
       # Adds the current line to the output buffer
       @buffered_lines.push(line)
       if preserve_whitespace? and not line.begin_block?
-        self << "\n" << line.output_text
+        @buffer << "\n" << line.output_text
       else
         case line.paragraph_type
         when :metadata, :table_separator, :blank, :comment, :property_drawer_item, :property_drawer_begin_block, :property_drawer_end_block, :blockquote, :center, :example, :src
           # Nothing
         else
-          self << "\n"
+          @buffer << "\n"
           buffer_indentation
-          self << line.output_text.strip
+          @buffer << line.output_text.strip
         end
       end
     end
@@ -112,11 +112,6 @@ module Orgmode
       @headline_number_stack.join(".")
     end
 
-    # Accumulate the string @str at .
-    def << (str)
-      @buffer << str
-    end
-
     # Gets the current list indent level.
     def list_indent_level
       @list_indent_stack.length

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list