gollum_rails 1.5.0 → 1.5.1
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/Gemfile.lock +1 -1
 - data/HISTORY.md +4 -0
 - data/gollum_rails.gemspec +1 -1
 - data/lib/gollum_rails.rb +1 -1
 - data/lib/gollum_rails/finders.rb +2 -2
 - data/lib/gollum_rails/persistance.rb +21 -4
 - data/spec/gollum_rails/page_spec.rb +10 -9
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6867c0e8089af4224263a975f5186675d5966721
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 78824ef63d8873305c0d4c84ed5048c48a25ea82
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2ca79b2d48c22b9e0001b8a81fd7d1c40ca18b6da822d9955a04dc88c49dc643e4a46deada730132e5afbc4f1ff50106666a4e891511593d95527456e0503737
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 916fdd2d83c7e704fe94b4c9ce3921d7c70dd5140343afbbe0a222e638426c9c98c733f429ceed52f7ff55602e964394e2776c9b646f1e67d9bc8372a59069c4
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/HISTORY.md
    CHANGED
    
    
    
        data/gollum_rails.gemspec
    CHANGED
    
    
    
        data/lib/gollum_rails.rb
    CHANGED
    
    
    
        data/lib/gollum_rails/finders.rb
    CHANGED
    
    
| 
         @@ -107,6 +107,24 @@ module GollumRails 
     | 
|
| 
       107 
107 
     | 
    
         | 
| 
       108 
108 
     | 
    
         
             
                # == Updates an existing page (or created)
         
     | 
| 
       109 
109 
     | 
    
         
             
                #
         
     | 
| 
      
 110 
     | 
    
         
            +
                # args - Argument chain
         
     | 
| 
      
 111 
     | 
    
         
            +
                #
         
     | 
| 
      
 112 
     | 
    
         
            +
                # Returns an instance of GollumRails::Page
         
     | 
| 
      
 113 
     | 
    
         
            +
                def update_attributes(*args)
         
     | 
| 
      
 114 
     | 
    
         
            +
                  run_callbacks :update do
         
     | 
| 
      
 115 
     | 
    
         
            +
                    return update_deprecated(*args) if args.length > 1
         
     | 
| 
      
 116 
     | 
    
         
            +
                    #content=nil,name=nil,format=:markdown, commit=nil
         
     | 
| 
      
 117 
     | 
    
         
            +
                    args = args.first
         
     | 
| 
      
 118 
     | 
    
         
            +
                    @gollum_page = page.update_page(gollum_page, wiki, 
         
     | 
| 
      
 119 
     | 
    
         
            +
                      args[:content], 
         
     | 
| 
      
 120 
     | 
    
         
            +
                      get_right_commit(args[:commit]), 
         
     | 
| 
      
 121 
     | 
    
         
            +
                      args[:name], 
         
     | 
| 
      
 122 
     | 
    
         
            +
                      args[:format]||:markdown)
         
     | 
| 
      
 123 
     | 
    
         
            +
                  end
         
     | 
| 
      
 124 
     | 
    
         
            +
                end
         
     | 
| 
      
 125 
     | 
    
         
            +
                
         
     | 
| 
      
 126 
     | 
    
         
            +
                # == DEPRECATED: Updates an existing page (or created)
         
     | 
| 
      
 127 
     | 
    
         
            +
                #
         
     | 
| 
       110 
128 
     | 
    
         
             
                # content - optional. If given the content of the gollum_page will be updated
         
     | 
| 
       111 
129 
     | 
    
         
             
                # name - optional. If given the name of gollum_page will be updated
         
     | 
| 
       112 
130 
     | 
    
         
             
                # format - optional. Updates the format. Uses markdown as default
         
     | 
| 
         @@ -115,10 +133,9 @@ module GollumRails 
     | 
|
| 
       115 
133 
     | 
    
         
             
                #
         
     | 
| 
       116 
134 
     | 
    
         
             
                #
         
     | 
| 
       117 
135 
     | 
    
         
             
                # Returns an instance of GollumRails::Page
         
     | 
| 
       118 
     | 
    
         
            -
                def  
     | 
| 
       119 
     | 
    
         
            -
                   
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
                  end
         
     | 
| 
      
 136 
     | 
    
         
            +
                def update_deprecated(content=nil,name=nil,format=:markdown, commit=nil)
         
     | 
| 
      
 137 
     | 
    
         
            +
                  @gollum_page = page.update_page(gollum_page, wiki, content, get_right_commit(commit), name, format)
         
     | 
| 
      
 138 
     | 
    
         
            +
                  
         
     | 
| 
       122 
139 
     | 
    
         
             
                end
         
     | 
| 
       123 
140 
     | 
    
         | 
| 
       124 
141 
     | 
    
         
             
                # == Deletes current page
         
     | 
| 
         @@ -82,19 +82,20 @@ describe "Gollum Page" do 
     | 
|
| 
       82 
82 
     | 
    
         
             
                    @rr.save
         
     | 
| 
       83 
83 
     | 
    
         
             
                  end
         
     | 
| 
       84 
84 
     | 
    
         | 
| 
       85 
     | 
    
         
            -
                  it  
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
             
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
                  
         
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
                     
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
       93 
     | 
    
         
            -
                    
         
     | 
| 
      
 85 
     | 
    
         
            +
                  it "updates properly without all arguments, content+commit" do 
         
     | 
| 
      
 86 
     | 
    
         
            +
                    @rr.update_attributes({:name => "google", :format => :wiki}).should be_a Gollum::Page 
         
     | 
| 
      
 87 
     | 
    
         
            +
                    @rr.delete(@commit)
         
     | 
| 
      
 88 
     | 
    
         
            +
                  end
         
     | 
| 
      
 89 
     | 
    
         
            +
                  it "updates properly without all arguments, name, format" do
         
     | 
| 
      
 90 
     | 
    
         
            +
                    @rr.update_attributes({:content => "test"}).should be_a Gollum::Page 
         
     | 
| 
      
 91 
     | 
    
         
            +
                    expect(@rr.name).to match "Goole"
         
     | 
| 
      
 92 
     | 
    
         
            +
                    expect(@rr.format.to_s).to match "markdown"
         
     | 
| 
      
 93 
     | 
    
         
            +
                    @rr.delete(@commit)
         
     | 
| 
       94 
94 
     | 
    
         
             
                  end
         
     | 
| 
       95 
95 
     | 
    
         | 
| 
       96 
96 
     | 
    
         
             
                end
         
     | 
| 
       97 
97 
     | 
    
         | 
| 
      
 98 
     | 
    
         
            +
             
     | 
| 
       98 
99 
     | 
    
         
             
                describe "should test the deletion of a page" do
         
     | 
| 
       99 
100 
     | 
    
         
             
                  before :each do 
         
     | 
| 
       100 
101 
     | 
    
         
             
                    @rr = RailsModel.new @call
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: gollum_rails
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.5.1
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Florian Kasper
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-01- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-01-28 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: activemodel
         
     |