arboretum 0.0.5 → 0.0.6
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.
- checksums.yaml +4 -4
 - data/lib/arboretum/doctree.rb +8 -4
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 42a7d24be72182eafaad9b254b40ff5738423389
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5e0fc2574eb3bbc059c94dd9213dd7f7283c35d4
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 44b8504954777d1d5090fd11cbeba70dcd462d47a117d9b27a1b08de0b491fa74c41062cfa76cfb1e28f709a74779d0c9023ab48922392b61e1fac92ff92a95d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ee812ae2721613864054cd0d605f217bff0495e34021c0e77e2d597ca65b35763024b9f5a5d38c9b2a84fe404a523ec4e25540e3e685a25703949528fc3ef740
         
     | 
    
        data/lib/arboretum/doctree.rb
    CHANGED
    
    | 
         @@ -658,13 +658,17 @@ module Arboretum 
     | 
|
| 
       658 
658 
     | 
    
         | 
| 
       659 
659 
     | 
    
         
             
                    # Add an element to a category in this element's library
         
     | 
| 
       660 
660 
     | 
    
         
             
                    def lib_add(other, category)
         
     | 
| 
       661 
     | 
    
         
            -
                      raise TypeError.new("Cannot create a record for a non-element") if !other.is_a?(Element)
         
     | 
| 
      
 661 
     | 
    
         
            +
                      raise TypeError.new("Cannot create a record for a non-element") if !other.is_a?(Element) and !other.is_a?(ElementGroup)
         
     | 
| 
       662 
662 
     | 
    
         
             
                      if @library.has_key?(category)
         
     | 
| 
       663 
663 
     | 
    
         
             
                        record = @library[category]
         
     | 
| 
       664 
     | 
    
         
            -
                        if record.is_a?(Element)
         
     | 
| 
      
 664 
     | 
    
         
            +
                        if record.is_a?(Element) and other.is_a?(Element)
         
     | 
| 
       665 
665 
     | 
    
         
             
                          @library[category] = ElementGroup.new([record, other])
         
     | 
| 
       666 
     | 
    
         
            -
                         
     | 
| 
       667 
     | 
    
         
            -
                           
     | 
| 
      
 666 
     | 
    
         
            +
                        elsif record.is_a?(ElementGroup) and other.is_a?(Element)
         
     | 
| 
      
 667 
     | 
    
         
            +
                          @library[category] << other
         
     | 
| 
      
 668 
     | 
    
         
            +
                        elsif record.is_a?(Element) and other.is_a?(ElementGroup)
         
     | 
| 
      
 669 
     | 
    
         
            +
                          @library[category] = ElementGroup.new([record]) + other
         
     | 
| 
      
 670 
     | 
    
         
            +
                        elsif record.is_a?(ElementGroup) and other.is_a?(ElementGroup)
         
     | 
| 
      
 671 
     | 
    
         
            +
                          @library[category] = record + other
         
     | 
| 
       668 
672 
     | 
    
         
             
                        end
         
     | 
| 
       669 
673 
     | 
    
         
             
                      else
         
     | 
| 
       670 
674 
     | 
    
         
             
                        @library[category] = other
         
     |