wunderbar 0.21.4 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -0
 - data/lib/wunderbar/builder.rb +11 -29
 - data/lib/wunderbar/html-methods.rb +16 -8
 - data/lib/wunderbar/node.rb +44 -19
 - data/lib/wunderbar/script.rb +1 -1
 - data/lib/wunderbar/version.rb +2 -2
 - data/wunderbar.gemspec +5 -5
 - metadata +56 -53
 - checksums.yaml +0 -7
 
    
        data/README.md
    CHANGED
    
    | 
         @@ -442,6 +442,8 @@ The following gems are required by extensions of the same name: 
     | 
|
| 
       442 
442 
     | 
    
         
             
            The following gems, if installed, will produce cleaner and prettier output:
         
     | 
| 
       443 
443 
     | 
    
         | 
| 
       444 
444 
     | 
    
         
             
            * `nokogiri` cleans up HTML fragments inserted via `<<`
         
     | 
| 
      
 445 
     | 
    
         
            +
            * `nokogumbo` also cleans up HTML fragments inserted via `<<`.  If this is
         
     | 
| 
      
 446 
     | 
    
         
            +
              available, it will be preferred over direct usage of `nokogiri`.
         
     | 
| 
       445 
447 
     | 
    
         
             
            * `escape` prettier quoting of `system` commands
         
     | 
| 
       446 
448 
     | 
    
         
             
            * `sanitize` will remove unsafe markup from tainted input
         
     | 
| 
       447 
449 
     | 
    
         | 
    
        data/lib/wunderbar/builder.rb
    CHANGED
    
    | 
         @@ -166,10 +166,10 @@ module Wunderbar 
     | 
|
| 
       166 
166 
     | 
    
         | 
| 
       167 
167 
     | 
    
         
             
                def compact!(&block)
         
     | 
| 
       168 
168 
     | 
    
         
             
                  begin
         
     | 
| 
       169 
     | 
    
         
            -
                    @indentation_enabled = false
         
     | 
| 
      
 169 
     | 
    
         
            +
                    indentation_enabled, @indentation_enabled = @indentation_enabled, false
         
     | 
| 
       170 
170 
     | 
    
         
             
                    block.call
         
     | 
| 
       171 
171 
     | 
    
         
             
                  ensure
         
     | 
| 
       172 
     | 
    
         
            -
                    @indentation_enabled =  
     | 
| 
      
 172 
     | 
    
         
            +
                    @indentation_enabled = indentation_enabled
         
     | 
| 
       173 
173 
     | 
    
         
             
                  end
         
     | 
| 
       174 
174 
     | 
    
         
             
                end
         
     | 
| 
       175 
175 
     | 
    
         | 
| 
         @@ -191,6 +191,7 @@ module Wunderbar 
     | 
|
| 
       191 
191 
     | 
    
         
             
                        [name, attr.value]
         
     | 
| 
       192 
192 
     | 
    
         
             
                      }]
         
     | 
| 
       193 
193 
     | 
    
         
             
                    end
         
     | 
| 
      
 194 
     | 
    
         
            +
             
     | 
| 
       194 
195 
     | 
    
         
             
                    attributes.merge!(node.namespaces) if node.namespaces
         
     | 
| 
       195 
196 
     | 
    
         
             
                    args.push attributes
         
     | 
| 
       196 
197 
     | 
    
         
             
                    if node.namespace and node.namespace.prefix
         
     | 
| 
         @@ -198,6 +199,12 @@ module Wunderbar 
     | 
|
| 
       198 
199 
     | 
    
         
             
                    else
         
     | 
| 
       199 
200 
     | 
    
         
             
                      sym = node.name
         
     | 
| 
       200 
201 
     | 
    
         
             
                    end
         
     | 
| 
      
 202 
     | 
    
         
            +
             
     | 
| 
      
 203 
     | 
    
         
            +
                    unless Class === args.first
         
     | 
| 
      
 204 
     | 
    
         
            +
                      args.unshift PreformattedNode if sym == 'pre'
         
     | 
| 
      
 205 
     | 
    
         
            +
                      args.unshift ScriptNode if sym == 'script'
         
     | 
| 
      
 206 
     | 
    
         
            +
                      args.unshift StyleNode if sym == 'style'
         
     | 
| 
      
 207 
     | 
    
         
            +
                    end
         
     | 
| 
       201 
208 
     | 
    
         
             
                  end
         
     | 
| 
       202 
209 
     | 
    
         | 
| 
       203 
210 
     | 
    
         
             
                  if Class === args.first and args.first < Node
         
     | 
| 
         @@ -308,33 +315,8 @@ module Wunderbar 
     | 
|
| 
       308 
315 
     | 
    
         
             
                    elsif child.comment?
         
     | 
| 
       309 
316 
     | 
    
         
             
                      comment! child.text.sub(/\A /,'').sub(/ \Z/, '')
         
     | 
| 
       310 
317 
     | 
    
         
             
                    elsif HtmlMarkup.flatten? child.children
         
     | 
| 
       311 
     | 
    
         
            -
                       
     | 
| 
       312 
     | 
    
         
            -
             
     | 
| 
       313 
     | 
    
         
            -
                      end
         
     | 
| 
       314 
     | 
    
         
            -
             
     | 
| 
       315 
     | 
    
         
            -
                      if child.children.any?(&block_element)
         
     | 
| 
       316 
     | 
    
         
            -
                        # indent children, but disable indentation on consecutive
         
     | 
| 
       317 
     | 
    
         
            -
                        # sequences of non-block-elements.  Put another way: break
         
     | 
| 
       318 
     | 
    
         
            -
                        # out block elements to a new line.
         
     | 
| 
       319 
     | 
    
         
            -
                        tag!(child) do
         
     | 
| 
       320 
     | 
    
         
            -
                          children = child.children.to_a
         
     | 
| 
       321 
     | 
    
         
            -
                          while not children.empty?
         
     | 
| 
       322 
     | 
    
         
            -
                            stop = children.index(&block_element)
         
     | 
| 
       323 
     | 
    
         
            -
                            if stop == 0
         
     | 
| 
       324 
     | 
    
         
            -
                              self[children.shift]
         
     | 
| 
       325 
     | 
    
         
            -
                            else
         
     | 
| 
       326 
     | 
    
         
            -
                              compact!(nil) do
         
     | 
| 
       327 
     | 
    
         
            -
                                self[*children.shift(stop || children.length)]
         
     | 
| 
       328 
     | 
    
         
            -
                              end
         
     | 
| 
       329 
     | 
    
         
            -
                            end
         
     | 
| 
       330 
     | 
    
         
            -
                          end
         
     | 
| 
       331 
     | 
    
         
            -
                        end
         
     | 
| 
       332 
     | 
    
         
            -
                      else
         
     | 
| 
       333 
     | 
    
         
            -
                        # disable indentation on the entire element
         
     | 
| 
       334 
     | 
    
         
            -
                        compact! do
         
     | 
| 
       335 
     | 
    
         
            -
                          tag!(child) {self[*child.children]}
         
     | 
| 
       336 
     | 
    
         
            -
                        end
         
     | 
| 
       337 
     | 
    
         
            -
                      end
         
     | 
| 
      
 318 
     | 
    
         
            +
                      # disable indentation on the entire element
         
     | 
| 
      
 319 
     | 
    
         
            +
                      compact! { tag!(child) {self[*child.children]} }
         
     | 
| 
       338 
320 
     | 
    
         
             
                    elsif child.children.empty? and HtmlMarkup::VOID.include? child.name
         
     | 
| 
       339 
321 
     | 
    
         
             
                      tag!(child)
         
     | 
| 
       340 
322 
     | 
    
         
             
                    elsif child.children.all?(&:text?)
         
     | 
| 
         @@ -5,8 +5,7 @@ module Wunderbar 
     | 
|
| 
       5 
5 
     | 
    
         
             
                def _script(*args, &block)
         
     | 
| 
       6 
6 
     | 
    
         
             
                  args << {} unless Hash === args.last
         
     | 
| 
       7 
7 
     | 
    
         
             
                  args.last[:lang] ||= 'text/javascript'
         
     | 
| 
       8 
     | 
    
         
            -
                  args 
     | 
| 
       9 
     | 
    
         
            -
                  proxiable_tag! 'script', *args, &block
         
     | 
| 
      
 8 
     | 
    
         
            +
                  proxiable_tag! 'script', ScriptNode, *args, &block
         
     | 
| 
       10 
9 
     | 
    
         
             
                end
         
     | 
| 
       11 
10 
     | 
    
         | 
| 
       12 
11 
     | 
    
         
             
                def _style(*args, &block)
         
     | 
| 
         @@ -19,8 +18,7 @@ module Wunderbar 
     | 
|
| 
       19 
18 
     | 
    
         
             
                  end
         
     | 
| 
       20 
19 
     | 
    
         
             
                  args << {} unless Hash === args.last
         
     | 
| 
       21 
20 
     | 
    
         
             
                  args.last[:type] ||= 'text/css'
         
     | 
| 
       22 
     | 
    
         
            -
                  args 
     | 
| 
       23 
     | 
    
         
            -
                  proxiable_tag! 'style', *args, &block
         
     | 
| 
      
 21 
     | 
    
         
            +
                  proxiable_tag! 'style', StyleNode, *args, &block
         
     | 
| 
       24 
22 
     | 
    
         
             
                end
         
     | 
| 
       25 
23 
     | 
    
         
             
              end
         
     | 
| 
       26 
24 
     | 
    
         | 
| 
         @@ -124,7 +122,7 @@ module Wunderbar 
     | 
|
| 
       124 
122 
     | 
    
         
             
                    require 'pathname'
         
     | 
| 
       125 
123 
     | 
    
         
             
                    base = @_scope.env['DOCUMENT_ROOT'] if @_scope.env.respond_to? :[]
         
     | 
| 
       126 
124 
     | 
    
         
             
                    base ||= Dir.pwd
         
     | 
| 
       127 
     | 
    
         
            -
                    base += head.children[1].attrs[:href]
         
     | 
| 
      
 125 
     | 
    
         
            +
                    base += (head.children[1].attrs[:href] || '')
         
     | 
| 
       128 
126 
     | 
    
         
             
                    base += 'index.html' if base.end_with? '/'
         
     | 
| 
       129 
127 
     | 
    
         
             
                    base = Pathname.new(base).parent
         
     | 
| 
       130 
128 
     | 
    
         
             
                    prefix = Pathname.new(Dir.pwd).relative_path_from(base).to_s + '/'
         
     | 
| 
         @@ -292,7 +290,9 @@ module Wunderbar 
     | 
|
| 
       292 
290 
     | 
    
         | 
| 
       293 
291 
     | 
    
         
             
                def _pre(*args, &block)
         
     | 
| 
       294 
292 
     | 
    
         
             
                  args.first.chomp! if String === args.first and args.first.end_with? "\n"
         
     | 
| 
       295 
     | 
    
         
            -
                  @_x.compact!  
     | 
| 
      
 293 
     | 
    
         
            +
                  @_x.compact! do
         
     | 
| 
      
 294 
     | 
    
         
            +
                    proxiable_tag! :pre, PreformattedNode, *args, &block
         
     | 
| 
      
 295 
     | 
    
         
            +
                  end
         
     | 
| 
       296 
296 
     | 
    
         
             
                end
         
     | 
| 
       297 
297 
     | 
    
         | 
| 
       298 
298 
     | 
    
         
             
                def _ul(*args, &block)
         
     | 
| 
         @@ -351,7 +351,12 @@ module Wunderbar 
     | 
|
| 
       351 
351 
     | 
    
         
             
                    safe = true
         
     | 
| 
       352 
352 
     | 
    
         | 
| 
       353 
353 
     | 
    
         
             
                    if ok and (children.include? '<' or children.include? '&')
         
     | 
| 
       354 
     | 
    
         
            -
                       
     | 
| 
      
 354 
     | 
    
         
            +
                      if defined? Nokogiri::HTML5.fragment
         
     | 
| 
      
 355 
     | 
    
         
            +
                        doc = Nokogiri::HTML5.fragment(children.to_s)
         
     | 
| 
      
 356 
     | 
    
         
            +
                      else
         
     | 
| 
      
 357 
     | 
    
         
            +
                        doc = Nokogiri::HTML.fragment(children.to_s)
         
     | 
| 
      
 358 
     | 
    
         
            +
                      end
         
     | 
| 
      
 359 
     | 
    
         
            +
             
     | 
| 
       355 
360 
     | 
    
         
             
                      Sanitize.new.clean_node! doc.dup.untaint if not safe
         
     | 
| 
       356 
361 
     | 
    
         
             
                      children = doc.children.to_a
         
     | 
| 
       357 
362 
     | 
    
         | 
| 
         @@ -382,10 +387,13 @@ module Wunderbar 
     | 
|
| 
       382 
387 
     | 
    
         
             
                  @_x[*children]
         
     | 
| 
       383 
388 
     | 
    
         
             
                end
         
     | 
| 
       384 
389 
     | 
    
         | 
| 
       385 
     | 
    
         
            -
                def __(text=nil)
         
     | 
| 
      
 390 
     | 
    
         
            +
                def __(text=nil, &block)
         
     | 
| 
       386 
391 
     | 
    
         
             
                  if text
         
     | 
| 
       387 
392 
     | 
    
         
             
                    @_x.spaced!
         
     | 
| 
       388 
393 
     | 
    
         
             
                    @_x.indented_text! text
         
     | 
| 
      
 394 
     | 
    
         
            +
                  elsif block
         
     | 
| 
      
 395 
     | 
    
         
            +
                    @_x.spaced!
         
     | 
| 
      
 396 
     | 
    
         
            +
                    _ &block
         
     | 
| 
       389 
397 
     | 
    
         
             
                  else
         
     | 
| 
       390 
398 
     | 
    
         
             
                    @_x.text! ""
         
     | 
| 
       391 
399 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/wunderbar/node.rb
    CHANGED
    
    | 
         @@ -46,10 +46,17 @@ module Wunderbar 
     | 
|
| 
       46 
46 
     | 
    
         
             
                  indent += options[:indent] if indent and parent
         
     | 
| 
       47 
47 
     | 
    
         
             
                  first = true
         
     | 
| 
       48 
48 
     | 
    
         
             
                  spaced = false
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
                  if preserve_spaces?
         
     | 
| 
      
 51 
     | 
    
         
            +
                    options = options.dup
         
     | 
| 
      
 52 
     | 
    
         
            +
                    options[:space] = :preserve
         
     | 
| 
      
 53 
     | 
    
         
            +
                  end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
       49 
55 
     | 
    
         
             
                  children.each do |child| 
         
     | 
| 
       50 
56 
     | 
    
         
             
                    next unless child
         
     | 
| 
       51 
57 
     | 
    
         
             
                    result << '' if (spaced or SpacedNode === child) and not first
         
     | 
| 
       52 
58 
     | 
    
         
             
                    if String === child
         
     | 
| 
      
 59 
     | 
    
         
            +
                      child = child.gsub(/\s+/, ' ') unless options[:space] == :preserve
         
     | 
| 
       53 
60 
     | 
    
         
             
                      result << child
         
     | 
| 
       54 
61 
     | 
    
         
             
                    else
         
     | 
| 
       55 
62 
     | 
    
         
             
                      child.serialize(options, result, indent)
         
     | 
| 
         @@ -70,22 +77,24 @@ module Wunderbar 
     | 
|
| 
       70 
77 
     | 
    
         
             
                  end
         
     | 
| 
       71 
78 
     | 
    
         | 
| 
       72 
79 
     | 
    
         
             
                  if children.empty? 
         
     | 
| 
       73 
     | 
    
         
            -
                    if  
     | 
| 
       74 
     | 
    
         
            -
                       
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
                       
     | 
| 
       77 
     | 
    
         
            -
             
     | 
| 
      
 80 
     | 
    
         
            +
                    if options[:pre]
         
     | 
| 
      
 81 
     | 
    
         
            +
                      line += ">#{options[:pre]}#{text}#{options[:post]}</#{name}>"
         
     | 
| 
      
 82 
     | 
    
         
            +
                    else
         
     | 
| 
      
 83 
     | 
    
         
            +
                      width = options[:width] unless preserve_spaces?
         
     | 
| 
      
 84 
     | 
    
         
            +
             
     | 
| 
      
 85 
     | 
    
         
            +
                      if text
         
     | 
| 
       78 
86 
     | 
    
         
             
                        line += ">#{text.to_s.gsub(/[&<>]/,ESCAPE)}</#{name}>"
         
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
       80 
     | 
    
         
            -
             
     | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
       82 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
      
 87 
     | 
    
         
            +
                      elsif VOID.include? name.to_s
         
     | 
| 
      
 88 
     | 
    
         
            +
                        line += "/>"
         
     | 
| 
      
 89 
     | 
    
         
            +
                      else
         
     | 
| 
      
 90 
     | 
    
         
            +
                        line += "></#{name}>"
         
     | 
| 
      
 91 
     | 
    
         
            +
                      end
         
     | 
| 
      
 92 
     | 
    
         
            +
             
     | 
| 
      
 93 
     | 
    
         
            +
                      if indent and width and line.length > width
         
     | 
| 
      
 94 
     | 
    
         
            +
                        reflowed = IndentedTextNode.reflow(indent, line, width)
         
     | 
| 
      
 95 
     | 
    
         
            +
                        line = reflowed.pop
         
     | 
| 
      
 96 
     | 
    
         
            +
                        result.push *reflowed
         
     | 
| 
       84 
97 
     | 
    
         
             
                      end
         
     | 
| 
       85 
     | 
    
         
            -
                    elsif VOID.include? name.to_s
         
     | 
| 
       86 
     | 
    
         
            -
                      line += "/>"
         
     | 
| 
       87 
     | 
    
         
            -
                    else
         
     | 
| 
       88 
     | 
    
         
            -
                      line += "></#{name}>"
         
     | 
| 
       89 
98 
     | 
    
         
             
                    end
         
     | 
| 
       90 
99 
     | 
    
         
             
                  elsif CompactNode === self and not CompactNode === parent
         
     | 
| 
       91 
100 
     | 
    
         
             
                    work = []
         
     | 
| 
         @@ -113,7 +122,7 @@ module Wunderbar 
     | 
|
| 
       113 
122 
     | 
    
         
             
                            line += ' ' + token
         
     | 
| 
       114 
123 
     | 
    
         
             
                          else
         
     | 
| 
       115 
124 
     | 
    
         
             
                            result << line
         
     | 
| 
       116 
     | 
    
         
            -
                            line = indent.to_s + token
         
     | 
| 
      
 125 
     | 
    
         
            +
                            line = indent.to_s + options[:indent] + token
         
     | 
| 
       117 
126 
     | 
    
         
             
                          end
         
     | 
| 
       118 
127 
     | 
    
         
             
                        end
         
     | 
| 
       119 
128 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -131,6 +140,10 @@ module Wunderbar 
     | 
|
| 
       131 
140 
     | 
    
         
             
                  result << line if parent
         
     | 
| 
       132 
141 
     | 
    
         
             
                  result
         
     | 
| 
       133 
142 
     | 
    
         
             
                end
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                def preserve_spaces?
         
     | 
| 
      
 145 
     | 
    
         
            +
                  false
         
     | 
| 
      
 146 
     | 
    
         
            +
                end
         
     | 
| 
       134 
147 
     | 
    
         
             
              end
         
     | 
| 
       135 
148 
     | 
    
         | 
| 
       136 
149 
     | 
    
         
             
              class CommentNode
         
     | 
| 
         @@ -156,7 +169,13 @@ module Wunderbar 
     | 
|
| 
       156 
169 
     | 
    
         
             
                end
         
     | 
| 
       157 
170 
     | 
    
         
             
              end
         
     | 
| 
       158 
171 
     | 
    
         | 
| 
       159 
     | 
    
         
            -
              class  
     | 
| 
      
 172 
     | 
    
         
            +
              class PreformattedNode < Node
         
     | 
| 
      
 173 
     | 
    
         
            +
                def preserve_spaces?
         
     | 
| 
      
 174 
     | 
    
         
            +
                  true
         
     | 
| 
      
 175 
     | 
    
         
            +
                end
         
     | 
| 
      
 176 
     | 
    
         
            +
              end
         
     | 
| 
      
 177 
     | 
    
         
            +
             
     | 
| 
      
 178 
     | 
    
         
            +
              class CDATANode < PreformattedNode
         
     | 
| 
       160 
179 
     | 
    
         
             
                def self.normalize(data, indent='')
         
     | 
| 
       161 
180 
     | 
    
         
             
                  data = data.sub(/\n\s*\Z/, '').sub(/\A\s*\n/, '')
         
     | 
| 
       162 
181 
     | 
    
         | 
| 
         @@ -177,7 +196,7 @@ module Wunderbar 
     | 
|
| 
       177 
196 
     | 
    
         
             
                  end
         
     | 
| 
       178 
197 
     | 
    
         | 
| 
       179 
198 
     | 
    
         
             
                  if @text and @text =~ /[<^>]/
         
     | 
| 
       180 
     | 
    
         
            -
                    indent +=  
     | 
| 
      
 199 
     | 
    
         
            +
                    indent += options[:indent] if indent
         
     | 
| 
       181 
200 
     | 
    
         
             
                    children.unshift @text.gsub(/^/, indent).gsub(/^ +$/,'').rstrip
         
     | 
| 
       182 
201 
     | 
    
         
             
                    @text = nil
         
     | 
| 
       183 
202 
     | 
    
         
             
                    super(options.merge(pre: pre, post: post), result, indent)
         
     | 
| 
         @@ -195,13 +214,19 @@ module Wunderbar 
     | 
|
| 
       195 
214 
     | 
    
         
             
                end
         
     | 
| 
       196 
215 
     | 
    
         | 
| 
       197 
216 
     | 
    
         
             
                def serialize(options, result, indent)
         
     | 
| 
       198 
     | 
    
         
            -
                   
     | 
| 
      
 217 
     | 
    
         
            +
                  if options[:space] == :preserve
         
     | 
| 
      
 218 
     | 
    
         
            +
                    result << @text.to_s.gsub(/[&<>]/,ESCAPE)
         
     | 
| 
      
 219 
     | 
    
         
            +
                  else
         
     | 
| 
      
 220 
     | 
    
         
            +
                    result << @text.to_s.gsub(/[&<>]/,ESCAPE).gsub(/\s+/, ' ')
         
     | 
| 
      
 221 
     | 
    
         
            +
                  end
         
     | 
| 
       199 
222 
     | 
    
         
             
                end
         
     | 
| 
       200 
223 
     | 
    
         
             
              end
         
     | 
| 
       201 
224 
     | 
    
         | 
| 
       202 
225 
     | 
    
         
             
              class IndentedTextNode < TextNode
         
     | 
| 
       203 
226 
     | 
    
         
             
                def self.reflow(indent, line, width)
         
     | 
| 
       204 
     | 
    
         
            -
                  return [line]  
     | 
| 
      
 227 
     | 
    
         
            +
                  return [line] unless width and indent
         
     | 
| 
      
 228 
     | 
    
         
            +
                  line = indent + line.gsub!(/\s+/, ' ').strip
         
     | 
| 
      
 229 
     | 
    
         
            +
                  indent += '  '
         
     | 
| 
       205 
230 
     | 
    
         | 
| 
       206 
231 
     | 
    
         
             
                  result = []
         
     | 
| 
       207 
232 
     | 
    
         
             
                  while line.length > width
         
     | 
    
        data/lib/wunderbar/script.rb
    CHANGED
    
    | 
         @@ -9,7 +9,7 @@ module Wunderbar 
     | 
|
| 
       9 
9 
     | 
    
         
             
              class ScriptNode
         
     | 
| 
       10 
10 
     | 
    
         
             
                attr_accessor :block, :binding
         
     | 
| 
       11 
11 
     | 
    
         
             
                def serialize(options, result, indent)
         
     | 
| 
       12 
     | 
    
         
            -
                  if @block
         
     | 
| 
      
 12 
     | 
    
         
            +
                  if @block and @children.empty? and not @text
         
     | 
| 
       13 
13 
     | 
    
         
             
                    width = options[:width]
         
     | 
| 
       14 
14 
     | 
    
         
             
                    width -= indent.to_s.length if width
         
     | 
| 
       15 
15 
     | 
    
         
             
                    @text = Ruby2JS.convert(@block, binding: @binding, width: width)
         
     | 
    
        data/lib/wunderbar/version.rb
    CHANGED
    
    
    
        data/wunderbar.gemspec
    CHANGED
    
    | 
         @@ -2,22 +2,22 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       4 
4 
     | 
    
         
             
              s.name = "wunderbar"
         
     | 
| 
       5 
     | 
    
         
            -
              s.version = "0. 
     | 
| 
      
 5 
     | 
    
         
            +
              s.version = "0.22.0"
         
     | 
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       8 
8 
     | 
    
         
             
              s.authors = ["Sam Ruby"]
         
     | 
| 
       9 
     | 
    
         
            -
              s.date = "2014- 
     | 
| 
      
 9 
     | 
    
         
            +
              s.date = "2014-12-23"
         
     | 
| 
       10 
10 
     | 
    
         
             
              s.description = "    Wunderbar makes it easy to produce valid HTML5, wellformed XHTML, Unicode\n    (utf-8), consistently indented, readable applications.  This includes\n    output that conforms to the Polyglot specification and the emerging\n    results from the XML Error Recovery Community Group.\n"
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.email = "rubys@intertwingly.net"
         
     | 
| 
       12 
     | 
    
         
            -
              s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar", "lib/wunderbar 
     | 
| 
      
 12 
     | 
    
         
            +
              s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/script.rb", "lib/wunderbar/jquery.rb", "lib/wunderbar/underscore.rb", "lib/wunderbar/polymer.rb", "lib/wunderbar/jquery", "lib/wunderbar/jquery/filter.rb", "lib/wunderbar/jquery/stupidtable.rb", "lib/wunderbar/vendor", "lib/wunderbar/vendor/polymer-v0.0.20131003.min.js", "lib/wunderbar/vendor/stupidtable.min.js", "lib/wunderbar/vendor/bootstrap.min.js", "lib/wunderbar/vendor/Markdown.Converter.js", "lib/wunderbar/vendor/angular.min.js", "lib/wunderbar/vendor/bootstrap-theme.min.css", "lib/wunderbar/vendor/jquery-1.11.0.min.js", "lib/wunderbar/vendor/angular-resource.min.js", "lib/wunderbar/vendor/bootstrap.min.css", "lib/wunderbar/vendor/underscore-min.js", "lib/wunderbar/vendor/angular-route.min.js", "lib/wunderbar/websocket.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/pagedown.rb", "lib/wunderbar/version.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/server.rb", "lib/wunderbar/angularjs.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/asset.rb", "lib/wunderbar/backtick.rb", "lib/wunderbar/opal", "lib/wunderbar/opal/browser.rb", "lib/wunderbar/opal/jquery.rb", "lib/wunderbar/coffeescript.rb", "lib/wunderbar/markdown.rb", "lib/wunderbar/opal.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/bootstrap.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/angularjs", "lib/wunderbar/angularjs/resource.rb", "lib/wunderbar/angularjs/route.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/coderay.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/bootstrap", "lib/wunderbar/bootstrap/theme.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/node.rb"]
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.homepage = "http://github.com/rubys/wunderbar"
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.licenses = ["MIT"]
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.require_paths = ["lib"]
         
     | 
| 
       16 
     | 
    
         
            -
              s.rubygems_version = " 
     | 
| 
      
 16 
     | 
    
         
            +
              s.rubygems_version = "1.8.23"
         
     | 
| 
       17 
17 
     | 
    
         
             
              s.summary = "HTML Generator and CGI application support"
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
              if s.respond_to? :specification_version then
         
     | 
| 
       20 
     | 
    
         
            -
                s.specification_version =  
     | 
| 
      
 20 
     | 
    
         
            +
                s.specification_version = 3
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         
     | 
| 
       23 
23 
     | 
    
         
             
                  s.add_runtime_dependency(%q<json>, [">= 0"])
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,34 +1,36 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: wunderbar
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.22.0
         
     | 
| 
      
 5 
     | 
    
         
            +
              prerelease: 
         
     | 
| 
       5 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
7 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
8 
     | 
    
         
             
            - Sam Ruby
         
     | 
| 
       8 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2014-12-23 00:00:00.000000000 Z
         
     | 
| 
       12 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
15 
     | 
    
         
             
              name: json
         
     | 
| 
       15 
16 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 17 
     | 
    
         
            +
                none: false
         
     | 
| 
       16 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       17 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 19 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       18 
20 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       19 
21 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       20 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       21 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       22 
24 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 25 
     | 
    
         
            +
                none: false
         
     | 
| 
       23 
26 
     | 
    
         
             
                requirements:
         
     | 
| 
       24 
     | 
    
         
            -
                - - '>='
         
     | 
| 
      
 27 
     | 
    
         
            +
                - - ! '>='
         
     | 
| 
       25 
28 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       26 
29 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       27 
     | 
    
         
            -
            description:  
     | 
| 
       28 
     | 
    
         
            -
             
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
       31 
     | 
    
         
            -
                  results from the XML Error Recovery Community Group.
         
     | 
| 
      
 30 
     | 
    
         
            +
            description: ! "    Wunderbar makes it easy to produce valid HTML5, wellformed XHTML,
         
     | 
| 
      
 31 
     | 
    
         
            +
              Unicode\n    (utf-8), consistently indented, readable applications.  This includes\n
         
     | 
| 
      
 32 
     | 
    
         
            +
              \   output that conforms to the Polyglot specification and the emerging\n    results
         
     | 
| 
      
 33 
     | 
    
         
            +
              from the XML Error Recovery Community Group.\n"
         
     | 
| 
       32 
34 
     | 
    
         
             
            email: rubys@intertwingly.net
         
     | 
| 
       33 
35 
     | 
    
         
             
            executables: []
         
     | 
| 
       34 
36 
     | 
    
         
             
            extensions: []
         
     | 
| 
         @@ -37,75 +39,76 @@ files: 
     | 
|
| 
       37 
39 
     | 
    
         
             
            - wunderbar.gemspec
         
     | 
| 
       38 
40 
     | 
    
         
             
            - README.md
         
     | 
| 
       39 
41 
     | 
    
         
             
            - COPYING
         
     | 
| 
       40 
     | 
    
         
            -
            - lib/wunderbar 
     | 
| 
       41 
     | 
    
         
            -
            - lib/wunderbar/ 
     | 
| 
      
 42 
     | 
    
         
            +
            - lib/wunderbar.rb
         
     | 
| 
      
 43 
     | 
    
         
            +
            - lib/wunderbar/script.rb
         
     | 
| 
      
 44 
     | 
    
         
            +
            - lib/wunderbar/jquery.rb
         
     | 
| 
      
 45 
     | 
    
         
            +
            - lib/wunderbar/underscore.rb
         
     | 
| 
      
 46 
     | 
    
         
            +
            - lib/wunderbar/polymer.rb
         
     | 
| 
      
 47 
     | 
    
         
            +
            - lib/wunderbar/jquery/filter.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - lib/wunderbar/jquery/stupidtable.rb
         
     | 
| 
      
 49 
     | 
    
         
            +
            - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
         
     | 
| 
      
 50 
     | 
    
         
            +
            - lib/wunderbar/vendor/stupidtable.min.js
         
     | 
| 
      
 51 
     | 
    
         
            +
            - lib/wunderbar/vendor/bootstrap.min.js
         
     | 
| 
      
 52 
     | 
    
         
            +
            - lib/wunderbar/vendor/Markdown.Converter.js
         
     | 
| 
      
 53 
     | 
    
         
            +
            - lib/wunderbar/vendor/angular.min.js
         
     | 
| 
      
 54 
     | 
    
         
            +
            - lib/wunderbar/vendor/bootstrap-theme.min.css
         
     | 
| 
      
 55 
     | 
    
         
            +
            - lib/wunderbar/vendor/jquery-1.11.0.min.js
         
     | 
| 
      
 56 
     | 
    
         
            +
            - lib/wunderbar/vendor/angular-resource.min.js
         
     | 
| 
      
 57 
     | 
    
         
            +
            - lib/wunderbar/vendor/bootstrap.min.css
         
     | 
| 
      
 58 
     | 
    
         
            +
            - lib/wunderbar/vendor/underscore-min.js
         
     | 
| 
      
 59 
     | 
    
         
            +
            - lib/wunderbar/vendor/angular-route.min.js
         
     | 
| 
      
 60 
     | 
    
         
            +
            - lib/wunderbar/websocket.rb
         
     | 
| 
      
 61 
     | 
    
         
            +
            - lib/wunderbar/environment.rb
         
     | 
| 
      
 62 
     | 
    
         
            +
            - lib/wunderbar/pagedown.rb
         
     | 
| 
      
 63 
     | 
    
         
            +
            - lib/wunderbar/version.rb
         
     | 
| 
      
 64 
     | 
    
         
            +
            - lib/wunderbar/cgi-methods.rb
         
     | 
| 
      
 65 
     | 
    
         
            +
            - lib/wunderbar/server.rb
         
     | 
| 
       42 
66 
     | 
    
         
             
            - lib/wunderbar/angularjs.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
            - lib/wunderbar/logger.rb
         
     | 
| 
       43 
68 
     | 
    
         
             
            - lib/wunderbar/asset.rb
         
     | 
| 
       44 
69 
     | 
    
         
             
            - lib/wunderbar/backtick.rb
         
     | 
| 
       45 
     | 
    
         
            -
            - lib/wunderbar/ 
     | 
| 
      
 70 
     | 
    
         
            +
            - lib/wunderbar/opal/browser.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - lib/wunderbar/opal/jquery.rb
         
     | 
| 
      
 72 
     | 
    
         
            +
            - lib/wunderbar/coffeescript.rb
         
     | 
| 
      
 73 
     | 
    
         
            +
            - lib/wunderbar/markdown.rb
         
     | 
| 
      
 74 
     | 
    
         
            +
            - lib/wunderbar/opal.rb
         
     | 
| 
      
 75 
     | 
    
         
            +
            - lib/wunderbar/installation.rb
         
     | 
| 
       46 
76 
     | 
    
         
             
            - lib/wunderbar/bootstrap.rb
         
     | 
| 
       47 
     | 
    
         
            -
            - lib/wunderbar/ 
     | 
| 
       48 
     | 
    
         
            -
            - lib/wunderbar/ 
     | 
| 
      
 77 
     | 
    
         
            +
            - lib/wunderbar/job-control.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
            - lib/wunderbar/sinatra.rb
         
     | 
| 
      
 79 
     | 
    
         
            +
            - lib/wunderbar/rails.rb
         
     | 
| 
      
 80 
     | 
    
         
            +
            - lib/wunderbar/angularjs/resource.rb
         
     | 
| 
      
 81 
     | 
    
         
            +
            - lib/wunderbar/angularjs/route.rb
         
     | 
| 
      
 82 
     | 
    
         
            +
            - lib/wunderbar/rack.rb
         
     | 
| 
       49 
83 
     | 
    
         
             
            - lib/wunderbar/coderay.rb
         
     | 
| 
       50 
     | 
    
         
            -
            - lib/wunderbar/ 
     | 
| 
      
 84 
     | 
    
         
            +
            - lib/wunderbar/builder.rb
         
     | 
| 
      
 85 
     | 
    
         
            +
            - lib/wunderbar/bootstrap/theme.rb
         
     | 
| 
       51 
86 
     | 
    
         
             
            - lib/wunderbar/cssproxy.rb
         
     | 
| 
       52 
     | 
    
         
            -
            - lib/wunderbar/environment.rb
         
     | 
| 
       53 
87 
     | 
    
         
             
            - lib/wunderbar/html-methods.rb
         
     | 
| 
       54 
     | 
    
         
            -
            - lib/wunderbar/installation.rb
         
     | 
| 
       55 
     | 
    
         
            -
            - lib/wunderbar/job-control.rb
         
     | 
| 
       56 
     | 
    
         
            -
            - lib/wunderbar/jquery/filter.rb
         
     | 
| 
       57 
     | 
    
         
            -
            - lib/wunderbar/jquery/stupidtable.rb
         
     | 
| 
       58 
     | 
    
         
            -
            - lib/wunderbar/jquery.rb
         
     | 
| 
       59 
     | 
    
         
            -
            - lib/wunderbar/logger.rb
         
     | 
| 
       60 
     | 
    
         
            -
            - lib/wunderbar/markdown.rb
         
     | 
| 
       61 
88 
     | 
    
         
             
            - lib/wunderbar/node.rb
         
     | 
| 
       62 
     | 
    
         
            -
            - lib/wunderbar/opal/browser.rb
         
     | 
| 
       63 
     | 
    
         
            -
            - lib/wunderbar/opal/jquery.rb
         
     | 
| 
       64 
     | 
    
         
            -
            - lib/wunderbar/opal.rb
         
     | 
| 
       65 
     | 
    
         
            -
            - lib/wunderbar/pagedown.rb
         
     | 
| 
       66 
     | 
    
         
            -
            - lib/wunderbar/polymer.rb
         
     | 
| 
       67 
     | 
    
         
            -
            - lib/wunderbar/rack.rb
         
     | 
| 
       68 
     | 
    
         
            -
            - lib/wunderbar/rails.rb
         
     | 
| 
       69 
     | 
    
         
            -
            - lib/wunderbar/script.rb
         
     | 
| 
       70 
     | 
    
         
            -
            - lib/wunderbar/server.rb
         
     | 
| 
       71 
     | 
    
         
            -
            - lib/wunderbar/sinatra.rb
         
     | 
| 
       72 
     | 
    
         
            -
            - lib/wunderbar/underscore.rb
         
     | 
| 
       73 
     | 
    
         
            -
            - lib/wunderbar/vendor/angular-resource.min.js
         
     | 
| 
       74 
     | 
    
         
            -
            - lib/wunderbar/vendor/angular-route.min.js
         
     | 
| 
       75 
     | 
    
         
            -
            - lib/wunderbar/vendor/angular.min.js
         
     | 
| 
       76 
     | 
    
         
            -
            - lib/wunderbar/vendor/bootstrap-theme.min.css
         
     | 
| 
       77 
     | 
    
         
            -
            - lib/wunderbar/vendor/bootstrap.min.css
         
     | 
| 
       78 
     | 
    
         
            -
            - lib/wunderbar/vendor/bootstrap.min.js
         
     | 
| 
       79 
     | 
    
         
            -
            - lib/wunderbar/vendor/jquery-1.11.0.min.js
         
     | 
| 
       80 
     | 
    
         
            -
            - lib/wunderbar/vendor/Markdown.Converter.js
         
     | 
| 
       81 
     | 
    
         
            -
            - lib/wunderbar/vendor/polymer-v0.0.20131003.min.js
         
     | 
| 
       82 
     | 
    
         
            -
            - lib/wunderbar/vendor/stupidtable.min.js
         
     | 
| 
       83 
     | 
    
         
            -
            - lib/wunderbar/vendor/underscore-min.js
         
     | 
| 
       84 
     | 
    
         
            -
            - lib/wunderbar/version.rb
         
     | 
| 
       85 
     | 
    
         
            -
            - lib/wunderbar/websocket.rb
         
     | 
| 
       86 
     | 
    
         
            -
            - lib/wunderbar.rb
         
     | 
| 
       87 
89 
     | 
    
         
             
            homepage: http://github.com/rubys/wunderbar
         
     | 
| 
       88 
90 
     | 
    
         
             
            licenses:
         
     | 
| 
       89 
91 
     | 
    
         
             
            - MIT
         
     | 
| 
       90 
     | 
    
         
            -
            metadata: {}
         
     | 
| 
       91 
92 
     | 
    
         
             
            post_install_message: 
         
     | 
| 
       92 
93 
     | 
    
         
             
            rdoc_options: []
         
     | 
| 
       93 
94 
     | 
    
         
             
            require_paths:
         
     | 
| 
       94 
95 
     | 
    
         
             
            - lib
         
     | 
| 
       95 
96 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 97 
     | 
    
         
            +
              none: false
         
     | 
| 
       96 
98 
     | 
    
         
             
              requirements:
         
     | 
| 
       97 
     | 
    
         
            -
              - - '>='
         
     | 
| 
      
 99 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
       98 
100 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       99 
101 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       100 
102 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 103 
     | 
    
         
            +
              none: false
         
     | 
| 
       101 
104 
     | 
    
         
             
              requirements:
         
     | 
| 
       102 
     | 
    
         
            -
              - - '>='
         
     | 
| 
      
 105 
     | 
    
         
            +
              - - ! '>='
         
     | 
| 
       103 
106 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       104 
107 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       105 
108 
     | 
    
         
             
            requirements: []
         
     | 
| 
       106 
109 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       107 
     | 
    
         
            -
            rubygems_version:  
     | 
| 
      
 110 
     | 
    
         
            +
            rubygems_version: 1.8.23
         
     | 
| 
       108 
111 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       109 
     | 
    
         
            -
            specification_version:  
     | 
| 
      
 112 
     | 
    
         
            +
            specification_version: 3
         
     | 
| 
       110 
113 
     | 
    
         
             
            summary: HTML Generator and CGI application support
         
     | 
| 
       111 
114 
     | 
    
         
             
            test_files: []
         
     | 
    
        checksums.yaml
    DELETED
    
    | 
         @@ -1,7 +0,0 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            ---
         
     | 
| 
       2 
     | 
    
         
            -
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz: 8badf15d87c160ff80047cf11daa11c075f52cd1
         
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz: 49055a8e408472bfa4b868ea45dfbf3133aa09d4
         
     | 
| 
       5 
     | 
    
         
            -
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz: b325a928ba13e21146b98ecaea45a1eb53e7cece7e37c076f07b278373d9674798420370e295c798be7b20739106a189bba9095373ad45d22d3b0a8e3655eaa2
         
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz: 76b378725828ff67d819119459e7aa480b9bd33d0284bd8dae28e37728e7fdcbdeb98f62933ee9f08b23d5993ea1024da7346d792f1e92a7fa3e0d6d2d2a8fd4
         
     |