gollum_rails 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -1
- data/HISTORY.md +16 -0
- data/gollum_rails.gemspec +10 -8
- data/lib/core_ext/string.rb +0 -7
- data/lib/gollum_rails.rb +31 -5
- data/lib/gollum_rails/adapters/activemodel.rb +1 -8
- data/lib/gollum_rails/adapters/gollum.rb +2 -22
- data/lib/gollum_rails/{modules → modulesDEPRECATED}/hash.rb +0 -0
- data/lib/gollum_rails/{modules → modulesDEPRECATED}/loader.rb +0 -0
- data/lib/gollum_rails/page.rb +11 -22
- data/spec/gollum_rails/adapters/gollum/connector_spec.rb +0 -3
- data/spec/gollum_rails/error_spec.rb +10 -0
- data/spec/gollum_rails/{modules/hash_spec.rb → modulesDEPRECATED/hash.rb} +0 -0
- data/spec/gollum_rails/setup_spec.rb +16 -0
- data/spec/gollum_rails_spec.rb +9 -0
- metadata +10 -10
- data/lib/gollum_rails/adapters/gollum/committer.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1b7d1d834268e00fc9b8c63f0aca04cc83bc85
|
4
|
+
data.tar.gz: b7c4a10005a3837d4bf8d9eee0afb2ac2e7867e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dab8d76e647ba708e1c9ee1ac8cb705633642682f6509b5d97e3fd40566333d4561d51c4bd699ca69cbd7ac774f6f34ae87d8ab1e8d8abfa87a3759729ee4609
|
7
|
+
data.tar.gz: fae83809b25633f5dcff576ac3ce3531d4b9f50d02eabd35865f41d50c6fd5a3ab8b849336c9af01e15db09bc0b56a4797cc321c4674cb5b3c9427e3435ed015
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gollum_rails (1.0.
|
4
|
+
gollum_rails (1.0.4)
|
5
5
|
activemodel (~> 3.2.13)
|
6
6
|
gollum-lib (~> 1.0.0)
|
7
7
|
|
@@ -72,6 +72,7 @@ GEM
|
|
72
72
|
mime-types (1.22)
|
73
73
|
multi_json (1.7.2)
|
74
74
|
nokogiri (1.5.9)
|
75
|
+
nokogiri (1.5.9-java)
|
75
76
|
polyglot (0.3.3)
|
76
77
|
posix-spawn (0.3.6)
|
77
78
|
pygments.rb (0.4.2)
|
data/HISTORY.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
|
2
|
+
# 1.0.4 1th May 2013
|
3
|
+
* removed mutex again
|
4
|
+
* added gemspec name to Gemfile
|
5
|
+
* removed odd modules
|
6
|
+
* updated description
|
7
|
+
* improved documentation
|
8
|
+
* removed unused activemodel adapters
|
9
|
+
* added fancy inspects
|
10
|
+
* concept to make gollum page adapter threadsave
|
11
|
+
* new documentation standard
|
12
|
+
* removed unused GollumRails::Adapters::Gollum::Committer (unused)
|
13
|
+
* removed .gitkeep from filled directories
|
14
|
+
* removed old and deprecated require style
|
15
|
+
|
16
|
+
|
1
17
|
# 1.0.3 25th April 2013
|
2
18
|
* fixed post install messsage
|
3
19
|
* removed unused require statements
|
data/gollum_rails.gemspec
CHANGED
@@ -4,10 +4,10 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'gollum_rails'
|
5
5
|
s.rubyforge_project = s.name
|
6
6
|
|
7
|
-
s.version = '1.0.
|
7
|
+
s.version = '1.0.4'
|
8
8
|
|
9
|
-
s.summary = 'Combines
|
10
|
-
s.description= '
|
9
|
+
s.summary = 'Combines Gollum and Rails'
|
10
|
+
s.description= 'include Gollum into Rails with ease'
|
11
11
|
|
12
12
|
s.add_dependency 'activemodel', '~> 3.2.13'
|
13
13
|
s.add_dependency 'gollum-lib', '~> 1.0.0'
|
@@ -18,11 +18,12 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.author = 'Florian Kasper'
|
20
20
|
s.email = 'mosny@zyg.li'
|
21
|
-
s.homepage = '
|
21
|
+
s.homepage = 'https://github.com/nirnanaaa/gollum_rails'
|
22
22
|
s.license = 'AGPL'
|
23
23
|
s.platform = Gem::Platform::RUBY
|
24
24
|
s.required_ruby_version = '>=1.9.3'
|
25
25
|
|
26
|
+
|
26
27
|
# = MANIFEST =
|
27
28
|
s.files = %w[
|
28
29
|
Gemfile
|
@@ -45,12 +46,11 @@ Gem::Specification.new do |s|
|
|
45
46
|
lib/gollum_rails/adapters/activemodel/naming.rb
|
46
47
|
lib/gollum_rails/adapters/gollum.rb
|
47
48
|
lib/gollum_rails/adapters/gollum/.gitkeep
|
48
|
-
lib/gollum_rails/adapters/gollum/committer.rb
|
49
49
|
lib/gollum_rails/adapters/gollum/error.rb
|
50
50
|
lib/gollum_rails/adapters/gollum/page.rb
|
51
51
|
lib/gollum_rails/adapters/gollum/wiki.rb
|
52
|
-
lib/gollum_rails/
|
53
|
-
lib/gollum_rails/
|
52
|
+
lib/gollum_rails/modulesDEPRECATED/hash.rb
|
53
|
+
lib/gollum_rails/modulesDEPRECATED/loader.rb
|
54
54
|
lib/gollum_rails/page.rb
|
55
55
|
lib/gollum_rails/setup.rb
|
56
56
|
lib/grit/git-ruby/internal/pack.rb
|
@@ -62,11 +62,13 @@ Gem::Specification.new do |s|
|
|
62
62
|
spec/gollum_rails/adapters/gollum/error_spec.rb
|
63
63
|
spec/gollum_rails/adapters/gollum/page_spec.rb
|
64
64
|
spec/gollum_rails/adapters/gollum/wiki_spec.rb
|
65
|
-
spec/gollum_rails/
|
65
|
+
spec/gollum_rails/error_spec.rb
|
66
|
+
spec/gollum_rails/modulesDEPRECATED/hash.rb
|
66
67
|
spec/gollum_rails/page_spec.rb
|
67
68
|
spec/gollum_rails/respository_spec.rb
|
68
69
|
spec/gollum_rails/setup_spec.rb
|
69
70
|
spec/gollum_rails/wiki_spec.rb
|
71
|
+
spec/gollum_rails_spec.rb
|
70
72
|
spec/spec.opts
|
71
73
|
spec/spec_helper.rb
|
72
74
|
]
|
data/lib/core_ext/string.rb
CHANGED
data/lib/gollum_rails.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
+
# ~*~ encoding: utf-8 ~*~
|
2
|
+
|
3
|
+
# stdlib
|
1
4
|
require 'rubygems'
|
5
|
+
|
6
|
+
# external
|
2
7
|
require 'gollum-lib'
|
8
|
+
|
9
|
+
# patches
|
3
10
|
require 'grit/git-ruby/internal/pack'
|
4
11
|
require 'core_ext/string'
|
5
12
|
|
@@ -16,20 +23,39 @@ module GollumRails
|
|
16
23
|
autoload :Setup, 'gollum_rails/setup'
|
17
24
|
|
18
25
|
# GollumRails version string
|
19
|
-
VERSION = '1.0.
|
26
|
+
VERSION = '1.0.4'
|
20
27
|
|
21
28
|
# Simplified error
|
22
29
|
class Error < StandardError; end
|
23
30
|
|
24
|
-
#
|
25
|
-
#
|
31
|
+
# All Gollum internal exceptions will be redirected to this
|
26
32
|
class GollumInternalError < Error
|
27
33
|
|
34
|
+
# The classes name, that raised the exception
|
35
|
+
attr_accessor :name
|
36
|
+
|
37
|
+
# The messsage, brought by the class
|
38
|
+
attr_accessor :message
|
39
|
+
|
40
|
+
# The target, the class wanted to interact with
|
41
|
+
attr_accessor :target
|
42
|
+
|
43
|
+
# modifies content for throwing an exception
|
44
|
+
def initialize(name, target = nil, message = nil)
|
45
|
+
@name = name
|
46
|
+
@target = target
|
47
|
+
@message = message
|
48
|
+
|
49
|
+
super(message || "An Error occured: #{name} on #{target}")
|
50
|
+
end
|
51
|
+
|
52
|
+
# Fancy inspects
|
53
|
+
def inspect
|
54
|
+
"#<GollumRails::GollumInternalError:#{object_id} {name: #{name.inspect}, message: #{message.inspect}, target: #{target.inspect}}>"
|
55
|
+
end
|
28
56
|
end
|
29
57
|
end
|
30
58
|
|
31
59
|
|
32
60
|
require File.expand_path '../gollum_rails/adapters/activemodel', __FILE__
|
33
61
|
require File.expand_path '../gollum_rails/adapters/gollum', __FILE__
|
34
|
-
# load extensions
|
35
|
-
require File.expand_path '../gollum_rails/modules/loader', __FILE__
|
@@ -13,27 +13,20 @@ module GollumRails
|
|
13
13
|
#
|
14
14
|
# The following files are involved:
|
15
15
|
# * boolean.rb -> Boolean features for validation
|
16
|
-
# * callback.rb -> Callback functionality
|
17
16
|
# * naming.rb -> Conversion and Naming
|
18
17
|
# * error.rb -> Active Model error handling
|
19
|
-
# * validation.rb -> Object validation
|
20
18
|
#
|
21
19
|
# Released under the AGPL License. For further information see the LICENSE file distributed
|
22
20
|
# with this package.
|
23
21
|
#
|
24
22
|
# TODO:
|
25
23
|
# * a lot of testing
|
26
|
-
# * implementing the rest of the error class
|
27
|
-
# * deleting the model template out
|
28
|
-
# * move into own gem
|
29
24
|
#
|
30
|
-
# FIXME:
|
31
|
-
# none a.t.m.
|
32
25
|
#
|
33
26
|
module ActiveModel
|
34
27
|
|
35
28
|
# connector version
|
36
|
-
VERSION="1.
|
29
|
+
VERSION="1.21.0"
|
37
30
|
end
|
38
31
|
end
|
39
32
|
end
|
@@ -3,19 +3,14 @@ module GollumRails
|
|
3
3
|
module Adapters
|
4
4
|
# Gollum Wiki connector classes
|
5
5
|
#
|
6
|
-
# TODO:
|
7
|
-
# * implement
|
8
|
-
#
|
9
|
-
# FIXME:
|
10
|
-
# currently nothing implemented
|
11
6
|
#
|
12
7
|
module Gollum
|
13
8
|
autoload :Wiki, 'gollum_rails/adapters/gollum/wiki'
|
14
9
|
autoload :Page, 'gollum_rails/adapters/gollum/page'
|
15
|
-
autoload :Committer, 'gollum_rails/adapters/gollum/committer'
|
16
10
|
autoload :Error, 'gollum_rails/adapters/gollum/error'
|
11
|
+
|
17
12
|
# connector version
|
18
|
-
VERSION="
|
13
|
+
VERSION="2.0.0"
|
19
14
|
|
20
15
|
# Gollum connector class, keeping defaults!
|
21
16
|
#
|
@@ -27,9 +22,6 @@ module GollumRails
|
|
27
22
|
# Sets the wiki class used by all instances
|
28
23
|
attr_writer :wiki_class
|
29
24
|
|
30
|
-
# Sets the committer
|
31
|
-
attr_writer :committer_class
|
32
|
-
|
33
25
|
# Sets the applications status
|
34
26
|
attr_writer :enabled
|
35
27
|
|
@@ -55,20 +47,8 @@ module GollumRails
|
|
55
47
|
@wiki_class || Wiki
|
56
48
|
end
|
57
49
|
|
58
|
-
# Gets the current committer or using anon
|
59
|
-
#
|
60
|
-
#
|
61
|
-
def committer_class
|
62
|
-
@committer_class || Committer
|
63
|
-
end
|
64
50
|
end
|
65
51
|
end
|
66
52
|
end
|
67
53
|
end
|
68
54
|
end
|
69
|
-
|
70
|
-
#require File.expand_path '../gollum/error', __FILE__
|
71
|
-
#require File.expand_path '../gollum/wiki', __FILE__
|
72
|
-
#require File.expand_path '../gollum/committer', __FILE__
|
73
|
-
#require File.expand_path '../gollum/page', __FILE__
|
74
|
-
|
File without changes
|
File without changes
|
data/lib/gollum_rails/page.rb
CHANGED
@@ -106,8 +106,6 @@ module GollumRails
|
|
106
106
|
|
107
107
|
end
|
108
108
|
|
109
|
-
# mutex lock for multithreading
|
110
|
-
attr_reader :mutex
|
111
109
|
|
112
110
|
# Initializes a new Page
|
113
111
|
#
|
@@ -115,7 +113,6 @@ module GollumRails
|
|
115
113
|
#
|
116
114
|
# commit must be given to perform any page action!
|
117
115
|
def initialize(attrs = {})
|
118
|
-
@mutex = Mutex.new
|
119
116
|
if Adapters::Gollum::Connector.enabled
|
120
117
|
attrs.each{|k,v| self.public_send("#{k}=",v)} if attrs
|
121
118
|
else
|
@@ -183,16 +180,14 @@ module GollumRails
|
|
183
180
|
#
|
184
181
|
# Returns an instance of Gollum::Page or false
|
185
182
|
def save
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
page.page = page.find_page(name)
|
193
|
-
end
|
194
|
-
return page.page
|
183
|
+
run_callbacks :save do
|
184
|
+
return false unless valid?
|
185
|
+
begin
|
186
|
+
page.new_page(name,content,format,commit)
|
187
|
+
rescue ::Gollum::DuplicatePageError => e
|
188
|
+
page.page = page.find_page(name)
|
195
189
|
end
|
190
|
+
return page.page
|
196
191
|
end
|
197
192
|
end
|
198
193
|
|
@@ -211,12 +206,9 @@ module GollumRails
|
|
211
206
|
#
|
212
207
|
# Returns an instance of Gollum::Page
|
213
208
|
def update_attributes(hash, commit=nil)
|
214
|
-
|
215
|
-
|
216
|
-
page.update_page hash, get_right_commit(commit)
|
217
|
-
end
|
209
|
+
run_callbacks :update do
|
210
|
+
page.update_page hash, get_right_commit(commit)
|
218
211
|
end
|
219
|
-
|
220
212
|
end
|
221
213
|
|
222
214
|
# Deletes current page (also available static. See below)
|
@@ -226,12 +218,9 @@ module GollumRails
|
|
226
218
|
#
|
227
219
|
# Returns the commit id of the current action as String
|
228
220
|
def delete(commit=nil)
|
229
|
-
|
230
|
-
|
231
|
-
page.delete_page get_right_commit(commit)
|
232
|
-
end
|
221
|
+
run_callbacks :delete do
|
222
|
+
page.delete_page get_right_commit(commit)
|
233
223
|
end
|
234
|
-
|
235
224
|
end
|
236
225
|
|
237
226
|
# checks if entry already has been saved
|
@@ -11,8 +11,5 @@ describe GollumRails::Adapters::Gollum::Connector do
|
|
11
11
|
it "should test the Page class connector" do
|
12
12
|
@class.page_class.should == GollumRails::Adapters::Gollum::Page
|
13
13
|
end
|
14
|
-
it "should test the Committer class connector" do
|
15
|
-
@class.committer_class.should == GollumRails::Adapters::Gollum::Committer
|
16
|
-
end
|
17
14
|
|
18
15
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe GollumRails::GollumInternalError do
|
3
|
+
|
4
|
+
it "should display a fancy inspect" do
|
5
|
+
GollumRails::GollumInternalError.new("hihi").inspect.should include("{name: \"hihi\"")
|
6
|
+
end
|
7
|
+
it "should raise an error with custom message" do
|
8
|
+
expect{raise GollumRails::GollumInternalError.new("myname", "is", "i am the message")}.to raise_error
|
9
|
+
end
|
10
|
+
end
|
File without changes
|
@@ -40,5 +40,21 @@ describe GollumRails::Setup do
|
|
40
40
|
expect{setup.startup=true}.to raise_error
|
41
41
|
end
|
42
42
|
end
|
43
|
+
it "should test the Rails configuration" do
|
44
|
+
GollumRails::Setup.build do |setup|
|
45
|
+
|
46
|
+
# => The repository path to the
|
47
|
+
#
|
48
|
+
#
|
49
|
+
setup.repository = :application
|
50
|
+
|
51
|
+
#setup.wiki.use = :default
|
52
|
+
expect{setup.startup=(true)}.to raise_error(NoMethodError, "undefined method `config' for nil:NilClass")
|
53
|
+
|
54
|
+
#setup.repository = nil
|
55
|
+
#expect{setup.startup=true}.to raise_error GollumRails::GollumInternalError
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
43
59
|
|
44
60
|
end
|
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.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Kasper
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -80,8 +80,7 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 3.2.13
|
83
|
-
description:
|
84
|
-
wiki
|
83
|
+
description: include Gollum into Rails with ease
|
85
84
|
email: mosny@zyg.li
|
86
85
|
executables: []
|
87
86
|
extensions: []
|
@@ -107,12 +106,11 @@ files:
|
|
107
106
|
- lib/gollum_rails/adapters/activemodel/naming.rb
|
108
107
|
- lib/gollum_rails/adapters/gollum.rb
|
109
108
|
- lib/gollum_rails/adapters/gollum/.gitkeep
|
110
|
-
- lib/gollum_rails/adapters/gollum/committer.rb
|
111
109
|
- lib/gollum_rails/adapters/gollum/error.rb
|
112
110
|
- lib/gollum_rails/adapters/gollum/page.rb
|
113
111
|
- lib/gollum_rails/adapters/gollum/wiki.rb
|
114
|
-
- lib/gollum_rails/
|
115
|
-
- lib/gollum_rails/
|
112
|
+
- lib/gollum_rails/modulesDEPRECATED/hash.rb
|
113
|
+
- lib/gollum_rails/modulesDEPRECATED/loader.rb
|
116
114
|
- lib/gollum_rails/page.rb
|
117
115
|
- lib/gollum_rails/setup.rb
|
118
116
|
- lib/grit/git-ruby/internal/pack.rb
|
@@ -124,14 +122,16 @@ files:
|
|
124
122
|
- spec/gollum_rails/adapters/gollum/error_spec.rb
|
125
123
|
- spec/gollum_rails/adapters/gollum/page_spec.rb
|
126
124
|
- spec/gollum_rails/adapters/gollum/wiki_spec.rb
|
127
|
-
- spec/gollum_rails/
|
125
|
+
- spec/gollum_rails/error_spec.rb
|
126
|
+
- spec/gollum_rails/modulesDEPRECATED/hash.rb
|
128
127
|
- spec/gollum_rails/page_spec.rb
|
129
128
|
- spec/gollum_rails/respository_spec.rb
|
130
129
|
- spec/gollum_rails/setup_spec.rb
|
131
130
|
- spec/gollum_rails/wiki_spec.rb
|
131
|
+
- spec/gollum_rails_spec.rb
|
132
132
|
- spec/spec.opts
|
133
133
|
- spec/spec_helper.rb
|
134
|
-
homepage:
|
134
|
+
homepage: https://github.com/nirnanaaa/gollum_rails
|
135
135
|
licenses:
|
136
136
|
- AGPL
|
137
137
|
metadata: {}
|
@@ -157,5 +157,5 @@ rubyforge_project: gollum_rails
|
|
157
157
|
rubygems_version: 2.0.3
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
|
-
summary: Combines
|
160
|
+
summary: Combines Gollum and Rails
|
161
161
|
test_files: []
|