gollum 2.3.8 → 2.3.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of gollum might be problematic. Click here for more details.

Files changed (4) hide show
  1. data/gollum.gemspec +1 -1
  2. data/lib/gollum.rb +1 -1
  3. data/lib/gollum/wiki.rb +25 -20
  4. metadata +1 -1
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.3.8'
8
+ s.version = '2.3.9'
9
9
  s.date = '2012-11-07'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
  require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
24
24
 
25
25
  module Gollum
26
- VERSION = '2.3.8'
26
+ VERSION = '2.3.9'
27
27
 
28
28
  def self.assets_path
29
29
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -166,26 +166,31 @@ module Gollum
166
166
  options[:access] = path
167
167
  path = path.path
168
168
  end
169
- @path = path
170
- @repo_is_bare = options[:repo_is_bare]
171
- @page_file_dir = options[:page_file_dir]
172
- @access = options[:access] || GitAccess.new(path, @page_file_dir, @repo_is_bare)
173
- @base_path = options[:base_path] || "/"
174
- @page_class = options[:page_class] || self.class.page_class
175
- @file_class = options[:file_class] || self.class.file_class
176
- @markup_classes = options[:markup_classes] || self.class.markup_classes
177
- @repo = @access.repo
178
- @ref = options[:ref] || self.class.default_ref
179
- @sanitization = options[:sanitization] || self.class.sanitization
180
- @ws_subs = options[:ws_subs] ||
181
- self.class.default_ws_subs
182
- @history_sanitization = options[:history_sanitization] ||
183
- self.class.history_sanitization
184
- @live_preview = options[:live_preview] || true
185
- @universal_toc = options[:universal_toc] || false
186
- @mathjax = options[:mathjax] || false
187
- @show_all = options[:show_all] || false
188
- @collapse_tree = options[:collapse_tree] || false
169
+
170
+ # Use .fetch instead of ||
171
+ #
172
+ # o = { :a => false }
173
+ # o[:a] || true # => true
174
+ # o.fetch :a, true # => false
175
+
176
+ @path = path
177
+ @repo_is_bare = options.fetch :repo_is_bare, nil
178
+ @page_file_dir = options.fetch :page_file_dir, nil
179
+ @access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare)
180
+ @base_path = options.fetch :base_path, "/"
181
+ @page_class = options.fetch :page_class, self.class.page_class
182
+ @file_class = options.fetch :file_class, self.class.file_class
183
+ @markup_classes = options.fetch :markup_classes, self.class.markup_classes
184
+ @repo = @access.repo
185
+ @ref = options.fetch :ref, self.class.default_ref
186
+ @sanitization = options.fetch :sanitization, self.class.sanitization
187
+ @ws_subs = options.fetch :ws_subs, self.class.default_ws_subs
188
+ @history_sanitization = options.fetch :history_sanitization, self.class.history_sanitization
189
+ @live_preview = options.fetch :live_preview, true
190
+ @universal_toc = options.fetch :universal_toc, false
191
+ @mathjax = options.fetch :mathjax, false
192
+ @show_all = options.fetch :show_all, false
193
+ @collapse_tree = options.fetch :collapse_tree, false
189
194
  end
190
195
 
191
196
  # Public: check whether the wiki's git repo exists on the filesystem.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.8
4
+ version: 2.3.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: