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.
- checksums.yaml +7 -0
- data/Gemfile +6 -4
- data/Gemfile.lock +151 -151
- data/HISTORY.md +43 -15
- data/LICENSE +661 -0
- data/README.md +75 -185
- data/Rakefile +170 -160
- data/examples/rails/initializer.rb +0 -0
- data/gollum_rails.gemspec +72 -57
- data/lib/gollum_rails.rb +35 -18
- data/lib/gollum_rails/adapters/activemodel.rb +46 -0
- data/lib/gollum_rails/adapters/activemodel/boolean.rb +15 -0
- data/lib/gollum_rails/adapters/activemodel/callback.rb +61 -0
- data/lib/gollum_rails/adapters/activemodel/error.rb +27 -0
- data/lib/gollum_rails/adapters/activemodel/naming.rb +42 -0
- data/lib/gollum_rails/adapters/activemodel/validation.rb +188 -0
- data/lib/gollum_rails/adapters/gollum.rb +61 -0
- data/lib/gollum_rails/adapters/gollum/.gitkeep +0 -0
- data/lib/gollum_rails/adapters/gollum/committer.rb +9 -0
- data/lib/gollum_rails/adapters/gollum/error.rb +19 -0
- data/lib/gollum_rails/adapters/gollum/page.rb +177 -0
- data/lib/gollum_rails/adapters/gollum/wiki.rb +43 -0
- data/lib/gollum_rails/initializer.rb +8 -0
- data/lib/gollum_rails/{hash.rb → modules/hash.rb} +33 -20
- data/lib/gollum_rails/modules/loader.rb +5 -0
- data/lib/gollum_rails/page.rb +283 -406
- data/lib/gollum_rails/setup.rb +68 -0
- metadata +56 -99
- data/LICENSE.md +0 -7
- data/lib/generators/gollum_rails/model/model_generator.rb +0 -10
- data/lib/gollum_rails/config.rb +0 -36
- data/lib/gollum_rails/dependency_injector.rb +0 -24
- data/lib/gollum_rails/engine.rb +0 -12
- data/lib/gollum_rails/file.rb +0 -9
- data/lib/gollum_rails/messages.yml +0 -8
- data/lib/gollum_rails/validations.rb +0 -10
- data/lib/gollum_rails/versions.rb +0 -79
- data/lib/gollum_rails/wiki.rb +0 -36
data/lib/gollum_rails/file.rb
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
messages:
|
2
|
-
name_not_set_or_nil: The name is not set or is NIL
|
3
|
-
commit_not_empty_and_content_not_empty: The commit must be set and also the content
|
4
|
-
commit_must_be_given: Commit must not be empty or nil
|
5
|
-
no_page_fetched: No page was fetched
|
6
|
-
no_page_found: The page was not found
|
7
|
-
format_not_set: The format was not set
|
8
|
-
wiki_could_not_be_loaded: The wiki instance in ::Page is not an Instance of GollumRails::Wiki or is empty
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# ~*~ encoding: utf-8 ~*~
|
2
|
-
module GollumRails
|
3
|
-
class Versions
|
4
|
-
|
5
|
-
# Public: Gets the versions
|
6
|
-
attr_reader :versions
|
7
|
-
|
8
|
-
def initialize(page)
|
9
|
-
@versions = page.versions
|
10
|
-
end
|
11
|
-
|
12
|
-
# Public: .first
|
13
|
-
#
|
14
|
-
# Examples
|
15
|
-
# oldest
|
16
|
-
# # => #<Grit::Commit "6d71571d379cfe863933123ea93dea4aac1d6eb64">
|
17
|
-
#
|
18
|
-
#
|
19
|
-
# Returns the latest instance of Grit::Commit
|
20
|
-
def latest
|
21
|
-
return @versions.first
|
22
|
-
end
|
23
|
-
|
24
|
-
# Public: Last position in the @versions Array
|
25
|
-
#
|
26
|
-
# Examples
|
27
|
-
# oldest
|
28
|
-
# # => #<Grit::Commit "6d71571d379cfe863933123ea93dea4aac1d6eb64">
|
29
|
-
#
|
30
|
-
#
|
31
|
-
# Returns the oldest version of Grit::Commit
|
32
|
-
def oldest
|
33
|
-
return @versions.last
|
34
|
-
end
|
35
|
-
|
36
|
-
# Public: An Array of Grit::Commit
|
37
|
-
#
|
38
|
-
#
|
39
|
-
# Examples
|
40
|
-
# all
|
41
|
-
# # => <Grit::Commit "b3cc54c974700391d3f1c3c108032b6a5f27ecd8">,
|
42
|
-
# <Grit::Commit "13cda30e2a292852a32fad1e9c547c523387f17e">,
|
43
|
-
# <Grit::Commit "83a5e82a58eb4afda2662b7ca665b64554baf431">,
|
44
|
-
# <Grit::Commit "3a12080810acaf5cff3c2fb9bf67821943033548">,
|
45
|
-
# <Grit::Commit "3b9ee74806b5cd59ec7d01fe4d974aa9974c816e">,
|
46
|
-
# <Grit::Commit "c1507f5c47ae5bee16dea3ebed2f177dbcf48a68">,
|
47
|
-
# <Grit::Commit "1979f67c509c2802234dc12f242999953ffd9bc7">,
|
48
|
-
# <Grit::Commit "01fb119db9cb59b339011c7c9e5e59b89bf9a7a2">,
|
49
|
-
# <Grit::Commit "650cfd42814cf2d9fd0e2e9b7262f77bad06d0e0">,
|
50
|
-
# <Grit::Commit "07dfb9a86e7045369fc57c8d43e8cf68d3dfe7d1">,
|
51
|
-
# ...
|
52
|
-
#
|
53
|
-
# Returns many instances of Grit::Commit
|
54
|
-
def all
|
55
|
-
return @versions
|
56
|
-
end
|
57
|
-
|
58
|
-
# Public: Find a specific version
|
59
|
-
#
|
60
|
-
# version - String, containing the GIT version number
|
61
|
-
#
|
62
|
-
# Examples
|
63
|
-
# find '6d71571d379cfe86393135ea93dea4aac1d6eb64'
|
64
|
-
# # => #<Grit::Commit "6d71571d379cfe86393135ea93dea4aac1d6eb64">
|
65
|
-
#
|
66
|
-
#
|
67
|
-
# Returns an instance of Gollum::Page
|
68
|
-
def find(version = String.new)
|
69
|
-
result = nil
|
70
|
-
@versions.each do |commit|
|
71
|
-
if commit.id == version
|
72
|
-
result = commit
|
73
|
-
end
|
74
|
-
end
|
75
|
-
return result
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
end
|
data/lib/gollum_rails/wiki.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require File.expand_path('../validations', __FILE__)
|
2
|
-
require File.expand_path('../file', __FILE__)
|
3
|
-
require File.expand_path('../page', __FILE__)
|
4
|
-
|
5
|
-
module GollumRails
|
6
|
-
class Wiki
|
7
|
-
attr_accessor :wiki
|
8
|
-
def initialize(path)
|
9
|
-
main = getMainGollum(path)
|
10
|
-
send("wiki=", main)
|
11
|
-
DependencyInjector.set({:wiki => self})
|
12
|
-
end
|
13
|
-
|
14
|
-
def getMainGollum(path)
|
15
|
-
wiki = Gollum::Wiki.new(path)
|
16
|
-
end
|
17
|
-
|
18
|
-
def getPath
|
19
|
-
@wiki.path
|
20
|
-
end
|
21
|
-
|
22
|
-
def getRepo
|
23
|
-
@wiki.repo
|
24
|
-
end
|
25
|
-
|
26
|
-
def search(string = '')
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
## static setters / getters
|
31
|
-
|
32
|
-
def self.getWiki
|
33
|
-
@wiki
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|