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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a2c2e98a8c012221cdd7df298985e2a78e484a7
4
- data.tar.gz: 0541fe5604df89959e2f164cec74cfe3cac97546
3
+ metadata.gz: 7c1b7d1d834268e00fc9b8c63f0aca04cc83bc85
4
+ data.tar.gz: b7c4a10005a3837d4bf8d9eee0afb2ac2e7867e0
5
5
  SHA512:
6
- metadata.gz: ecde48f9e07329566993ad8372bd6ea6ac859be2801a37cbab1c564944c9fb15546956cb5232f66927b98bc6fdb97f3a10dcb6b05492ba80fdeea072161ff42a
7
- data.tar.gz: 3aec45e7526934f729262afb84c9f563d70ff25213e41bdbd61b73c542cb881683f83cb4b7297439c1c00dacd614fe3ba6712f9a243e9753aa0d076f555ade4a
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.3)
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.3'
7
+ s.version = '1.0.4'
8
8
 
9
- s.summary = 'Combines the benefits from Gollum and Rails'
10
- s.description= 'Use all the benefits from Rails and combine them with the awesome Gollum wiki'
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 = 'http://gollum.zyg.li'
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/modules/hash.rb
53
- lib/gollum_rails/modules/loader.rb
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/modules/hash_spec.rb
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
  ]
@@ -1,10 +1,3 @@
1
1
  class String
2
- if ((defined? RUBY_VERSION) && (['1.9', '2.0'].include? RUBY_VERSION[0..2]))
3
2
  def getord(offset); self[offset].ord; end
4
- else
5
- alias :getord :[]
6
- end
7
-
8
-
9
-
10
3
  end
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.3'
26
+ VERSION = '1.0.4'
20
27
 
21
28
  # Simplified error
22
29
  class Error < StandardError; end
23
30
 
24
- # For use with internal gollumGem exceptions
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.20.0"
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="1.0.3"
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
-
@@ -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
- mutex.synchronize do
187
- run_callbacks :save do
188
- return false unless valid?
189
- begin
190
- page.new_page(name,content,format,commit)
191
- rescue ::Gollum::DuplicatePageError => e
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
- mutex.synchronize do
215
- run_callbacks :update do
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
- mutex.synchronize do
230
- run_callbacks :delete do
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
@@ -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
@@ -0,0 +1,9 @@
1
+ # Setup testing
2
+ require 'spec_helper'
3
+ describe GollumRails do
4
+
5
+ it "should equal the current version" do
6
+ GollumRails::VERSION.should == "1.0.4"
7
+ end
8
+
9
+ 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.3
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-04-25 00:00:00.000000000 Z
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: Use all the benefits from Rails and combine them with the awesome Gollum
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/modules/hash.rb
115
- - lib/gollum_rails/modules/loader.rb
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/modules/hash_spec.rb
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: http://gollum.zyg.li
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 the benefits from Gollum and Rails
160
+ summary: Combines Gollum and Rails
161
161
  test_files: []
@@ -1,9 +0,0 @@
1
- module GollumRails
2
- module Adapters
3
- module Gollum
4
- # TODO: doc
5
- class Committer < ::Gollum::Committer
6
- end
7
- end
8
- end
9
- end