gollum_rails 0.0.2 → 0.0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -36,7 +36,7 @@ If you want you can add an initializer into e.g. `config/initializers/gollum_rai
36
36
 
37
37
  Gollum::Rails::Wiki.new(<location>)
38
38
 
39
- Now your gollum is ready for use
39
+ Now your gollum wiki is ready for use
40
40
 
41
41
  If you want you can add a model the same way as normal `ActiveRecord` / `ActiveModel`
42
42
 
@@ -50,9 +50,34 @@ Works like `ActiveRecord` / `ActiveModel` validation
50
50
 
51
51
  some examples:
52
52
 
53
-
53
+ # validates the presence of the Name (already embedded into to gem)
54
+ validates_presence_of :name
55
+
56
+ # forces the name to have a given format e.g. only 0-9 a-z and A-Z
57
+ validates_format_of :name, :with => /^[a-zA-Z0-9_]+$/i
58
+
59
+ # checks if the lenght of the content fit
60
+ validates_length_of :content, :maximum => 500
61
+
54
62
  ## API
55
63
 
64
+ Accessible variables / methods are:
65
+
66
+ `Gollum::Rails::Page`
67
+
68
+ **Create a new Page:**
69
+
70
+ Example for existing model `Page`
71
+
72
+ page = Page.new {:name => 'Example page',
73
+ :content => 'some very very very very long content',
74
+ :format => :markdown,
75
+ :commit => commit_data
76
+ }
77
+ page.save
78
+
79
+ Thats it. Very easy. You can use also `page.save!` method.
80
+
56
81
 
57
82
  ## TODO
58
83
  * List all pages
data/gollum_rails.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'gollum_rails'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.2.1'
4
4
 
5
5
  s.summary = 'Combines the benefits from Gollum with Rails'
6
6
  s.description= 'use templating, authentication and so on'
@@ -108,6 +108,15 @@ module Gollum
108
108
  return true
109
109
  end
110
110
 
111
+ #rewrite for save() method with raising exceptions as well
112
+ def save!
113
+ if @error
114
+ raise RuntimeError, @error
115
+ else
116
+ return save
117
+ end
118
+
119
+ end
111
120
  # Updates an existing page
112
121
  # usage:
113
122
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: