gollum_rails 0.0.2.8 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +6 -4
  3. data/Gemfile.lock +151 -151
  4. data/HISTORY.md +43 -15
  5. data/LICENSE +661 -0
  6. data/README.md +75 -185
  7. data/Rakefile +170 -160
  8. data/examples/rails/initializer.rb +0 -0
  9. data/gollum_rails.gemspec +72 -57
  10. data/lib/gollum_rails.rb +35 -18
  11. data/lib/gollum_rails/adapters/activemodel.rb +46 -0
  12. data/lib/gollum_rails/adapters/activemodel/boolean.rb +15 -0
  13. data/lib/gollum_rails/adapters/activemodel/callback.rb +61 -0
  14. data/lib/gollum_rails/adapters/activemodel/error.rb +27 -0
  15. data/lib/gollum_rails/adapters/activemodel/naming.rb +42 -0
  16. data/lib/gollum_rails/adapters/activemodel/validation.rb +188 -0
  17. data/lib/gollum_rails/adapters/gollum.rb +61 -0
  18. data/lib/gollum_rails/adapters/gollum/.gitkeep +0 -0
  19. data/lib/gollum_rails/adapters/gollum/committer.rb +9 -0
  20. data/lib/gollum_rails/adapters/gollum/error.rb +19 -0
  21. data/lib/gollum_rails/adapters/gollum/page.rb +177 -0
  22. data/lib/gollum_rails/adapters/gollum/wiki.rb +43 -0
  23. data/lib/gollum_rails/initializer.rb +8 -0
  24. data/lib/gollum_rails/{hash.rb → modules/hash.rb} +33 -20
  25. data/lib/gollum_rails/modules/loader.rb +5 -0
  26. data/lib/gollum_rails/page.rb +283 -406
  27. data/lib/gollum_rails/setup.rb +68 -0
  28. metadata +56 -99
  29. data/LICENSE.md +0 -7
  30. data/lib/generators/gollum_rails/model/model_generator.rb +0 -10
  31. data/lib/gollum_rails/config.rb +0 -36
  32. data/lib/gollum_rails/dependency_injector.rb +0 -24
  33. data/lib/gollum_rails/engine.rb +0 -12
  34. data/lib/gollum_rails/file.rb +0 -9
  35. data/lib/gollum_rails/messages.yml +0 -8
  36. data/lib/gollum_rails/validations.rb +0 -10
  37. data/lib/gollum_rails/versions.rb +0 -79
  38. data/lib/gollum_rails/wiki.rb +0 -36
@@ -0,0 +1,68 @@
1
+ module GollumRails
2
+
3
+ # Setup functionality for Rails initializer
4
+ #
5
+ # will be generated by Rails generator: `rails g gollum_rails:install`
6
+ #
7
+ # manually:
8
+ #
9
+ # GollumRails::Setup.build do |config|
10
+ # config.repository = '<path_to_your_repository>'
11
+ # config.wiki = :default
12
+ # config.startup
13
+ # end
14
+ #
15
+ # TODO:
16
+ # * more options
17
+ #
18
+ # FIXME:
19
+ # currently nothing
20
+ #
21
+ class Setup
22
+
23
+ # static baby
24
+ class << self
25
+
26
+
27
+ # Gets / Sets the repository
28
+ attr_accessor :repository
29
+
30
+ # Startup action for building wiki components
31
+ #
32
+ # Returns true or throws an exception if the path is invalid
33
+ def startup
34
+ if path_valid? @repository
35
+ repository = Grit::Repo.new @repository.to_s
36
+ GollumRails::Adapters::Gollum::Wiki.new repository
37
+ true
38
+ else
39
+ raise GollumInternalError, 'no repository path specified'
40
+ end
41
+ end
42
+
43
+ # defines block builder for Rails initializer.
44
+ # executes public methods inside own class
45
+ #
46
+ def build(&block)
47
+ block.call self
48
+ end
49
+
50
+ #######
51
+ private
52
+ #######
53
+
54
+ # Checks if provided path is present and valid
55
+ #
56
+ # Example
57
+ # path_valid? '/'
58
+ # # =>true
59
+ #
60
+ # path_valid? nil
61
+ # # =>false
62
+ def path_valid?(path)
63
+ return !(path.nil? || path.empty? || ! path.is_a?(String))
64
+ end
65
+
66
+ end
67
+ end
68
+ end
metadata CHANGED
@@ -1,68 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.8
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Florian Kasper
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
11
+ date: 2013-03-30 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activemodel
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 3.2.11
19
+ version: 3.2.13
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 3.2.11
26
+ version: 3.2.13
30
27
  - !ruby/object:Gem::Dependency
31
- name: gollum
28
+ name: gollum-lib
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
37
- version: 2.4.11
33
+ version: 0.0.1
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
45
- version: 2.4.11
46
- - !ruby/object:Gem::Dependency
47
- name: grit
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 2.5.0
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 2.5.0
40
+ version: 0.0.1
62
41
  - !ruby/object:Gem::Dependency
63
42
  name: builder
64
43
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
44
  requirements:
67
45
  - - ~>
68
46
  - !ruby/object:Gem::Version
@@ -70,7 +48,6 @@ dependencies:
70
48
  type: :runtime
71
49
  prerelease: false
72
50
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
51
  requirements:
75
52
  - - ~>
76
53
  - !ruby/object:Gem::Version
@@ -78,101 +55,76 @@ dependencies:
78
55
  - !ruby/object:Gem::Dependency
79
56
  name: rack
80
57
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
58
  requirements:
83
59
  - - ~>
84
60
  - !ruby/object:Gem::Version
85
- version: 1.4.0
61
+ version: 1.4.5
86
62
  type: :runtime
87
63
  prerelease: false
88
64
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
65
  requirements:
91
66
  - - ~>
92
67
  - !ruby/object:Gem::Version
93
- version: 1.4.0
68
+ version: 1.4.5
94
69
  - !ruby/object:Gem::Dependency
95
- name: org-ruby
70
+ name: rspec
96
71
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
72
  requirements:
99
73
  - - ~>
100
74
  - !ruby/object:Gem::Version
101
- version: 0.7.2
75
+ version: 2.13.0
102
76
  type: :development
103
77
  prerelease: false
104
78
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
79
  requirements:
107
80
  - - ~>
108
81
  - !ruby/object:Gem::Version
109
- version: 0.7.2
82
+ version: 2.13.0
110
83
  - !ruby/object:Gem::Dependency
111
- name: shoulda
112
- requirement: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ~>
116
- - !ruby/object:Gem::Version
117
- version: 3.3.2
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ~>
124
- - !ruby/object:Gem::Version
125
- version: 3.3.2
126
- - !ruby/object:Gem::Dependency
127
- name: rack-test
84
+ name: rails
128
85
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
86
  requirements:
131
87
  - - ~>
132
88
  - !ruby/object:Gem::Version
133
- version: 0.6.2
89
+ version: 3.2.13
134
90
  type: :development
135
91
  prerelease: false
136
92
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
93
  requirements:
139
94
  - - ~>
140
95
  - !ruby/object:Gem::Version
141
- version: 0.6.2
96
+ version: 3.2.13
142
97
  - !ruby/object:Gem::Dependency
143
- name: rake
98
+ name: rr
144
99
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
100
  requirements:
147
101
  - - ~>
148
102
  - !ruby/object:Gem::Version
149
- version: 10.0.2
103
+ version: 1.0.4
150
104
  type: :development
151
105
  prerelease: false
152
106
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
107
  requirements:
155
108
  - - ~>
156
109
  - !ruby/object:Gem::Version
157
- version: 10.0.2
110
+ version: 1.0.4
158
111
  - !ruby/object:Gem::Dependency
159
112
  name: rails
160
113
  requirement: !ruby/object:Gem::Requirement
161
- none: false
162
114
  requirements:
163
115
  - - ~>
164
116
  - !ruby/object:Gem::Version
165
- version: 3.2.11
117
+ version: 3.2.13
166
118
  type: :development
167
119
  prerelease: false
168
120
  version_requirements: !ruby/object:Gem::Requirement
169
- none: false
170
121
  requirements:
171
122
  - - ~>
172
123
  - !ruby/object:Gem::Version
173
- version: 3.2.11
174
- description: use templating, authentication and so on
175
- email: nirnanaaa@khnetworks.com
124
+ version: 3.2.13
125
+ description: Use all the benefits from Rails and combine them with the awesome Gollum
126
+ wiki
127
+ email: mosny@zyg.li
176
128
  executables: []
177
129
  extensions: []
178
130
  extra_rdoc_files: []
@@ -180,48 +132,53 @@ files:
180
132
  - Gemfile
181
133
  - Gemfile.lock
182
134
  - HISTORY.md
183
- - LICENSE.md
135
+ - LICENSE
184
136
  - README.md
185
137
  - Rakefile
138
+ - examples/rails/initializer.rb
186
139
  - gollum_rails.gemspec
187
- - lib/generators/gollum_rails/model/model_generator.rb
188
140
  - lib/gollum_rails.rb
189
- - lib/gollum_rails/config.rb
190
- - lib/gollum_rails/dependency_injector.rb
191
- - lib/gollum_rails/engine.rb
192
- - lib/gollum_rails/file.rb
193
- - lib/gollum_rails/hash.rb
194
- - lib/gollum_rails/messages.yml
141
+ - lib/gollum_rails/adapters/activemodel.rb
142
+ - lib/gollum_rails/adapters/activemodel/boolean.rb
143
+ - lib/gollum_rails/adapters/activemodel/callback.rb
144
+ - lib/gollum_rails/adapters/activemodel/error.rb
145
+ - lib/gollum_rails/adapters/activemodel/naming.rb
146
+ - lib/gollum_rails/adapters/activemodel/validation.rb
147
+ - lib/gollum_rails/adapters/gollum.rb
148
+ - lib/gollum_rails/adapters/gollum/.gitkeep
149
+ - lib/gollum_rails/adapters/gollum/committer.rb
150
+ - lib/gollum_rails/adapters/gollum/error.rb
151
+ - lib/gollum_rails/adapters/gollum/page.rb
152
+ - lib/gollum_rails/adapters/gollum/wiki.rb
153
+ - lib/gollum_rails/initializer.rb
154
+ - lib/gollum_rails/modules/hash.rb
155
+ - lib/gollum_rails/modules/loader.rb
195
156
  - lib/gollum_rails/page.rb
196
- - lib/gollum_rails/validations.rb
197
- - lib/gollum_rails/versions.rb
198
- - lib/gollum_rails/wiki.rb
199
- homepage: https://github.com/nirnanaaa/gollum_rails
200
- licenses: []
201
- post_install_message:
202
- rdoc_options:
203
- - --charset=UTF-8
157
+ - lib/gollum_rails/setup.rb
158
+ homepage: http://gollum.zyg.li
159
+ licenses:
160
+ - AGPL
161
+ metadata: {}
162
+ post_install_message: "Important: \n\n**********************************************\n\nTo
163
+ use the 'autoinitializer' just run the following command:\n\n\t\trails g gollum_rails:install\n\nTo
164
+ generate a new Page model just run:\n\n\t\rails g gollum_rails:model MODEL_NAME**********************************************"
165
+ rdoc_options: []
204
166
  require_paths:
205
167
  - lib
206
168
  required_ruby_version: !ruby/object:Gem::Requirement
207
- none: false
208
169
  requirements:
209
- - - ! '>='
170
+ - - '>='
210
171
  - !ruby/object:Gem::Version
211
- version: 1.8.7
172
+ version: 1.9.3
212
173
  required_rubygems_version: !ruby/object:Gem::Requirement
213
- none: false
214
174
  requirements:
215
- - - ! '>='
175
+ - - '>='
216
176
  - !ruby/object:Gem::Version
217
177
  version: '0'
218
- segments:
219
- - 0
220
- hash: 833219695
221
178
  requirements: []
222
- rubyforge_project:
223
- rubygems_version: 1.8.23
179
+ rubyforge_project: gollum_rails
180
+ rubygems_version: 2.0.3
224
181
  signing_key:
225
- specification_version: 3
226
- summary: Combines the benefits from Gollum with Rails
182
+ specification_version: 4
183
+ summary: Combines the benefits from Gollum and Rails
227
184
  test_files: []
data/LICENSE.md DELETED
@@ -1,7 +0,0 @@
1
- ## LICENSE
2
- Copyright � 2013 Florian Kasper
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED �AS IS�, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,10 +0,0 @@
1
- require 'rails/generators'
2
-
3
- module GollumRails
4
- module Generators
5
- class ModelGenerator < ::Rails::Generators::Base
6
- desc "Install a new model into app/models"
7
- argument :model_name, :type => :string
8
- end
9
- end
10
- end
@@ -1,36 +0,0 @@
1
- require 'yaml'
2
-
3
- module GollumRails
4
- class Config
5
- attr_reader :config
6
- def self.read_config
7
- config = self.open_config
8
- DependencyInjector.set({:config => config})
9
- end
10
- def self.config_location
11
- end
12
-
13
- def self.lang_from_rails
14
- end
15
-
16
- def self.settings_from_rails
17
- Rails.settings
18
- end
19
-
20
- def self.rails_root
21
- Rails.root
22
- end
23
-
24
- def self.rails_config_dir
25
- end
26
-
27
- #######
28
- private
29
- #######
30
- #gives a hardcoded configuration file
31
- def self.open_config
32
- YAML.load_file(::File.join(::File.dirname(__FILE__), 'messages.yml'))
33
- end
34
-
35
- end
36
- end
@@ -1,24 +0,0 @@
1
- module GollumRails
2
- ## simple DI component
3
- class DependencyInjector
4
-
5
- @storage = {}
6
-
7
- #sets a storage Hash
8
- def self.register(&block)
9
- block.call(self)
10
- end
11
-
12
- def self.set(arguments = {})
13
- arguments.each{ |key, value| @storage[key] = value}
14
- end
15
-
16
- def self.method_missing(method, *arguments, &block)
17
- if @storage[method]
18
- return @storage[method]
19
- else
20
- return false
21
- end
22
- end
23
- end
24
- end
@@ -1,12 +0,0 @@
1
- require 'rails'
2
-
3
- module GollumRails
4
- class Engine < ::Rails::Engine
5
- initializer "gollum_rails.load_app" do |app|
6
- #super
7
- ## GollumRails::Config::rails = app
8
- end
9
- end
10
-
11
- end
12
-