confluencer 0.4.1 → 0.4.2
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/VERSION +1 -1
- data/confluencer.gemspec +1 -1
- data/lib/confluence/page.rb +7 -1
- data/spec/confluence/page_spec.rb +10 -0
- metadata +2 -2
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.4. | 
| 1 | 
            +
            0.4.2
         | 
    
        data/confluencer.gemspec
    CHANGED
    
    
    
        data/lib/confluence/page.rb
    CHANGED
    
    | @@ -35,7 +35,9 @@ module Confluence | |
| 35 35 | 
             
                  @details = []
         | 
| 36 36 | 
             
                end
         | 
| 37 37 |  | 
| 38 | 
            -
                def details(label)
         | 
| 38 | 
            +
                def details(label = :all)
         | 
| 39 | 
            +
                  return @details if label == :all
         | 
| 40 | 
            +
                  
         | 
| 39 41 | 
             
                  unless result = @details.find {|d| d.label == label}
         | 
| 40 42 | 
             
                    @details << (result = Details.new(label))
         | 
| 41 43 | 
             
                  end
         | 
| @@ -43,6 +45,10 @@ module Confluence | |
| 43 45 | 
             
                  result
         | 
| 44 46 | 
             
                end
         | 
| 45 47 |  | 
| 48 | 
            +
                def details=(value)
         | 
| 49 | 
            +
                  @details = value
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
                
         | 
| 46 52 | 
             
                def children(klass = self.class)
         | 
| 47 53 | 
             
                  children = client.getChildren(page_id)
         | 
| 48 54 | 
             
                  children.collect { |child| klass.find(:id => child["id"]) } if children
         | 
| @@ -107,4 +107,14 @@ describe Confluence::Page do | |
| 107 107 |  | 
| 108 108 | 
             
                page.to_hash['content'].should include("{details:label=confluencer}\ncreator=rgabo\n{details}")
         | 
| 109 109 | 
             
              end
         | 
| 110 | 
            +
              
         | 
| 111 | 
            +
              it "should copy metadata from one page to another" do
         | 
| 112 | 
            +
                page = create_test_page
         | 
| 113 | 
            +
                page.details(:confluencer)[:creator] = 'rgabo'
         | 
| 114 | 
            +
                
         | 
| 115 | 
            +
                new_page = create_test_page
         | 
| 116 | 
            +
                new_page.details = page.details
         | 
| 117 | 
            +
                
         | 
| 118 | 
            +
                new_page.details(:confluencer)[:creator].should == 'rgabo'
         | 
| 119 | 
            +
              end
         | 
| 110 120 | 
             
            end
         |