gollum 2.1.3 → 2.1.4

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.

@@ -5,8 +5,8 @@ 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.1.3'
9
- s.date = '2012-08-13'
8
+ s.version = '2.1.4'
9
+ s.date = '2012-08-15'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
12
12
  s.summary = "A simple, Git-powered wiki."
@@ -22,7 +22,7 @@ require File.expand_path('../gollum/tex', __FILE__)
22
22
  require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
 
24
24
  module Gollum
25
- VERSION = '2.1.3'
25
+ VERSION = '2.1.4'
26
26
 
27
27
  def self.assets_path
28
28
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -5,6 +5,10 @@ module Precious
5
5
  class Pages < Layout
6
6
  attr_reader :results, :ref
7
7
 
8
+ def prefix
9
+ @base_url ? @base_url.chomp('/') + '/' : '/'
10
+ end
11
+
8
12
  def title
9
13
  "All pages in #{@ref}"
10
14
  end
@@ -12,14 +16,14 @@ module Precious
12
16
  def breadcrumb
13
17
  if @path
14
18
  path = Pathname.new(@path)
15
- breadcrumb = [%{<a href="#{@base_url}pages/">Home</a>}]
19
+ breadcrumb = [%{<a href="#{prefix}pages/">Home</a>}]
16
20
  path.descend do |crumb|
17
21
  title = crumb.basename
18
22
 
19
23
  if title == path.basename
20
24
  breadcrumb << title
21
25
  else
22
- breadcrumb << %{<a href="#{@base_url}pages/#{crumb}/">#{title}</a>}
26
+ breadcrumb << %{<a href="#{prefix}pages/#{crumb}/">#{title}</a>}
23
27
  end
24
28
  end
25
29
 
@@ -39,7 +43,7 @@ module Precious
39
43
  if page_path.include?('/')
40
44
  folder = page_path.split('/').first
41
45
  folder_path = @path ? "#{@path}/#{folder}" : folder
42
- folder_link = %{<li><a href="#{@base_url}pages/#{folder_path}/" class="folder">#{folder}</a></li>}
46
+ folder_link = %{<li><a href="#{prefix}pages/#{folder_path}/" class="folder">#{folder}</a></li>}
43
47
 
44
48
  unless folder_links.include?(folder_link)
45
49
  folder_links << folder_link
@@ -47,7 +51,7 @@ module Precious
47
51
  folder_link
48
52
  end
49
53
  elsif page_path != ".gitkeep"
50
- %{<li><a href="#{@base_url}#{page.escaped_url_path}" class="file">#{page.name}</a></li>}
54
+ %{<li><a href="#{prefix}#{page.escaped_url_path}" class="file">#{page.name}</a></li>}
51
55
  end
52
56
  }.compact.join("\n")
53
57
  else
@@ -34,4 +34,13 @@ context "Precious::Views::Pages" do
34
34
  @page.instance_variable_set("@results", results)
35
35
  assert_equal %{<li><a href="/Mordor/Eye-Of-Sauron" class="file">Eye Of Sauron</a></li>\n<li><a href="/pages/Mordor/Orc/" class="folder">Orc</a></li>}, @page.files_folders
36
36
  end
37
+
38
+ test "base url" do
39
+ # based on test "files_folders"
40
+ @page.instance_variable_set("@path", "Mordor")
41
+ @page.instance_variable_set("@base_url", "/wiki")
42
+ results = [FakeResult.new("Mordor/Eye-Of-Sauron.md"), FakeResult.new("Mordor/Orc/Saruman.md"), FakeResult.new("Mordor/.gitkeep")]
43
+ @page.instance_variable_set("@results", results)
44
+ assert_equal %{<li><a href="/wiki/Mordor/Eye-Of-Sauron" class="file">Eye Of Sauron</a></li>\n<li><a href="/wiki/pages/Mordor/Orc/" class="folder">Orc</a></li>}, @page.files_folders
45
+ end
37
46
  end
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.1.3
4
+ version: 2.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-13 00:00:00.000000000 Z
13
+ date: 2012-08-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: grit
@@ -909,7 +909,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
909
909
  version: '0'
910
910
  requirements: []
911
911
  rubyforge_project: gollum
912
- rubygems_version: 1.8.23
912
+ rubygems_version: 1.8.24
913
913
  signing_key:
914
914
  specification_version: 2
915
915
  summary: A simple, Git-powered wiki.