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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f71884c345d954f3511cf8c6ea58bb840ae6a50
4
- data.tar.gz: fff2ffd81c27dcd66a362a834f6518ec8b0e0261
3
+ metadata.gz: 6867c0e8089af4224263a975f5186675d5966721
4
+ data.tar.gz: 78824ef63d8873305c0d4c84ed5048c48a25ea82
5
5
  SHA512:
6
- metadata.gz: e65f565da5445905b61693867eb482603a85eea98dd0157346631b89ca1c937bb734d057b8ace2af8009076116632f1ab75b9fbdeb66023adfdcd7a9b1946b9a
7
- data.tar.gz: cc49fccfab54ae62599b1800eb512966bd2f6074b4c38c58e436ba2e1217fca4083ee5a594f690f1dd5620a42f7c2df92fc7c83d9b22547ecba9a14e2912998a
6
+ metadata.gz: 2ca79b2d48c22b9e0001b8a81fd7d1c40ca18b6da822d9955a04dc88c49dc643e4a46deada730132e5afbc4f1ff50106666a4e891511593d95527456e0503737
7
+ data.tar.gz: 916fdd2d83c7e704fe94b4c9ce3921d7c70dd5140343afbbe0a222e638426c9c98c733f429ceed52f7ff55602e964394e2776c9b646f1e67d9bc8372a59069c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gollum_rails (1.5.0)
4
+ gollum_rails (1.5.1)
5
5
  activemodel (>= 3.2.11)
6
6
  activesupport (>= 3.2.11)
7
7
  gollum-lib (~> 1.0.9)
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.5.1 28th January 2014
2
+ * Updated `update_attributes` to work with hashes
3
+ * Bugfixing
4
+
1
5
  # 1.5.0 22th January 2014
2
6
  * Added parsing support for YAML header `page.meta`
3
7
  * Added html rendering without the YAML `page.html_without_yaml`
data/gollum_rails.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.name = 'gollum_rails'
5
5
  s.rubyforge_project = s.name
6
6
 
7
- s.version = '1.5.0'
7
+ s.version = '1.5.1'
8
8
 
9
9
  s.summary = 'Combines Gollum and Rails'
10
10
  s.description= 'include Gollum into Rails with ease'
data/lib/gollum_rails.rb CHANGED
@@ -45,7 +45,7 @@ module GollumRails
45
45
  autoload :Meta
46
46
 
47
47
  # GollumRails version string
48
- VERSION = '1.5.0'
48
+ VERSION = '1.5.1'
49
49
 
50
50
  end
51
51
 
@@ -49,11 +49,11 @@ module GollumRails
49
49
  end
50
50
  end
51
51
 
52
- def first(options)
52
+ def first(options={})
53
53
  all(options).first
54
54
  end
55
55
 
56
- def last(options)
56
+ def last(options={})
57
57
  all(options).last
58
58
  end
59
59
 
@@ -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 update_attributes(content=nil,name=nil,format=:markdown, commit=nil)
119
- run_callbacks :update do
120
- @gollum_page = page.update_page(gollum_page, wiki, content, get_right_commit(commit), name, format)
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 { @rr.update_attributes({:name => "google", :format => :wiki}).should be_a Gollum::Page }
86
-
87
- end
88
- describe "method missings" do
89
-
90
- it "should perform a normal find" do
91
- RailsModel.find_by_name('Goole').should be_a GollumRails::Page
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.0
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-22 00:00:00.000000000 Z
11
+ date: 2014-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel