gollum-lib 5.0 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9da40c6b458fcb087bcffc9d258cc0fc16d5ff751e64650f5ec9372a71addea4
4
- data.tar.gz: 2e85e4321dafc1d5a51a3aa90cddfea17a7f3b675a08ccdd96f7859a39657942
3
+ metadata.gz: 4a2bc81f80db1d1d27d7bbf98ee2c7de3b78da25a4e068b506914889a59b78a9
4
+ data.tar.gz: 59b0439f772973507254aaa566e134984c5c1761f7242b4c09c9ef3fe9e34aab
5
5
  SHA512:
6
- metadata.gz: 2dd5df4f3a3ce1b8247ca8e8c67e746d67f9dd794ab28e06a2f9c72ec003afb996e58b5374b024d2c060cf6e23481e50c5e46b31962cb47bfb437c95a1d9980a
7
- data.tar.gz: b09e3211137d7ad250dbbbd8f9168c328f70b018146a982869844ebcbfa4a32a859ed5bb79e1e0388db2b236c362d1f967aa231e58a08b3d7c0e75762731e150
6
+ metadata.gz: 88d75e9d5f4cfa16dda0a8cd67dd6988a0894d19ad97a1d354cd3a7d96cf5bec6a0e350b48db91c796a2d2d5f43db79e6d021ae89f6af4442c1c5c36217dd8c5
7
+ data.tar.gz: 9ab4e40babd84d9baa3041e7212431fb05a95855dd428964e4d5467ebebd75b2405a1a7fbbb038a5ab8ca0ae14401f172eaf2f6f0e6fd8f510358e7b0f5cbb3c
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ # v5.0.1
2
+
3
+ Bugfix release: fix emoji when using base path. Thanks to @heavywatal.
4
+
1
5
  # v5.0
2
6
 
3
7
  For a detailed overview of changes in 5.0 and a guide to migrating your wiki, see https://github.com/gollum/gollum/wiki/5.0-release-notes
data/Rakefile CHANGED
@@ -51,11 +51,11 @@ def gemspec_file
51
51
  end
52
52
 
53
53
  def gemspecs
54
- ["#{name}.gemspec", "#{name}_java.gemspec"]
54
+ ["#{name}.gemspec", "#{name}_java.gemspec"]
55
55
  end
56
56
 
57
57
  def gem_files
58
- ["#{name}-#{version}.gem", "#{name}-#{version}-java.gem"]
58
+ ["#{name}-#{version}.gem", "#{name}-#{version}-java.gem"]
59
59
  end
60
60
 
61
61
  def replace_header(head, header_name)
@@ -75,6 +75,7 @@ Rake::TestTask.new(:test) do |test|
75
75
  test.libs << 'lib' << 'test' << '.'
76
76
  test.pattern = 'test/**/test_*.rb'
77
77
  test.verbose = true
78
+ test.warning = false
78
79
  end
79
80
 
80
81
  desc "Generate RCov test coverage and open in your browser"
data/gemspec.rb CHANGED
@@ -8,7 +8,7 @@ def specification(version, default_adapter, platform = nil)
8
8
  s.name = 'gollum-lib'
9
9
  s.version = version
10
10
  s.platform = platform if platform
11
- s.date = '2020-03-29'
11
+ s.date = '2020-08-03'
12
12
  s.date = '2017-04-13'
13
13
  s.rubyforge_project = 'gollum-lib'
14
14
  s.license = 'MIT'
@@ -66,7 +66,6 @@ def specification(version, default_adapter, platform = nil)
66
66
  LICENSE
67
67
  README.md
68
68
  Rakefile
69
- adapter_dependencies.rb
70
69
  docs/sanitization.md
71
70
  gemspec.rb
72
71
  gollum-lib.gemspec
@@ -1,4 +1,10 @@
1
1
  require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
- require File.join(File.dirname(__FILE__), 'adapter_dependencies.rb')
3
2
  require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
4
- Gem::Specification.new &specification(Gollum::Lib::VERSION, DEFAULT_ADAPTER_REQ)
3
+ # This file needs to conditionally define the default adapter for MRI and Java, because this is the file that is included from the Gemfile.
4
+ # In addition, the default Java adapter needs to be defined in gollum-lib_java.gemspec beause that file is used to *build* the Java gem.
5
+ if RUBY_PLATFORM == 'java' then
6
+ default_adapter = ['gollum-rjgit_adapter', '~> 0.6']
7
+ else
8
+ default_adapter = ['gollum-rugged_adapter', '~> 1.0']
9
+ end
10
+ Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter)
@@ -1,4 +1,4 @@
1
1
  require File.join(File.dirname(__FILE__), 'gemspec.rb')
2
- require File.join(File.dirname(__FILE__), 'adapter_dependencies.rb')
3
2
  require File.join(File.dirname(__FILE__), 'lib', 'gollum-lib', 'version.rb')
4
- Gem::Specification.new &specification(Gollum::Lib::VERSION, DEFAULT_ADAPTER_REQ, "java")
3
+ default_adapter = ['gollum-rjgit_adapter', '~> 0.6']
4
+ Gem::Specification.new &specification(Gollum::Lib::VERSION, default_adapter, "java")
@@ -54,7 +54,7 @@ module Gollum
54
54
  @actor ||= begin
55
55
  @options[:name] = @wiki.default_committer_name if @options[:name].nil?
56
56
  @options[:email] = @wiki.default_committer_email if @options[:email].nil?
57
- Gollum::Git::Actor.new(@options[:name], @options[:email])
57
+ Gollum::Git::Actor.new(@options[:name], @options[:email], @options[:time])
58
58
  end
59
59
  end
60
60
 
@@ -26,7 +26,8 @@ class Gollum::Filter::Emoji < Gollum::Filter
26
26
  end
27
27
 
28
28
  def process(data)
29
- data.gsub! process_pattern, %q(<img src="/gollum/emoji/\k<name>" alt="\k<name>" class="emoji">)
29
+ src = ::File.join(@markup.wiki.base_path, '/gollum/emoji/\\k<name>')
30
+ data.gsub! process_pattern, %Q(<img src="#{src}" alt="\\k<name>" class="emoji">)
30
31
  data
31
32
  end
32
33
 
@@ -230,6 +230,7 @@ class Gollum::Filter::Tags < Gollum::Filter
230
230
  else
231
231
  name = page ? path_to_link_text(link) : link
232
232
  end
233
+
233
234
  link = page ? page.escaped_url_path : ERB::Util.url_encode(link).force_encoding('utf-8')
234
235
  generate_link(link, name, extra, presence)
235
236
  end
@@ -16,7 +16,7 @@ module Gollum
16
16
  # '/opt/local/bin/ruby.ext' -> 'ruby'
17
17
  def path_to_link_text(str)
18
18
  return nil unless str
19
- ::File.basename(str, ::File.extname(str))
19
+ ::File.basename(str, Page.valid_extension?(str) ? ::File.extname(str) : '')
20
20
  end
21
21
 
22
22
  end
@@ -25,6 +25,10 @@ module Gollum
25
25
  "<p class=\"gollum-error\">#{s}</p>"
26
26
  end
27
27
 
28
+ def active_page
29
+ return @page.parent_page || @page
30
+ end
31
+
28
32
  # The special class we reserve for only the finest of screwups. The
29
33
  # underscore is to make sure nobody can define a real, callable macro
30
34
  # with the same name, because that would be... exciting.
@@ -3,7 +3,7 @@ module Gollum
3
3
 
4
4
  class Series < Gollum::Macro
5
5
  def render(series_prefix = "")
6
- raise "This page's name does not match the prefix '#{series_prefix}'" unless @page.name =~ /^#{series_prefix}/
6
+ raise "This page's name does not match the prefix '#{series_prefix}'" unless active_page.name =~ /^#{series_prefix}/
7
7
  render_links(*find_series(series_prefix))
8
8
  end
9
9
 
@@ -21,7 +21,7 @@ module Gollum
21
21
  dir = @wiki.pages.select {|page| ::File.dirname(page.path) == ::File.dirname(@page.path)}
22
22
  dir.select! {|page| page.name =~ /\A#{series_prefix}/ } unless series_prefix.empty?
23
23
  dir.sort_by! {|page| page.name}
24
- self_index = dir.find_index {|page| page.name == @page.name}
24
+ self_index = dir.find_index {|page| page.name == active_page.name}
25
25
  if self_index > 0
26
26
  return dir[self_index-1], dir[self_index+1]
27
27
  else
@@ -58,7 +58,7 @@ module Gollum
58
58
  if gem_exists?('pandoc-ruby')
59
59
  GitHub::Markup::Markdown::MARKDOWN_GEMS.delete('kramdown')
60
60
  GitHub::Markup::Markdown::MARKDOWN_GEMS['pandoc-ruby'] = proc { |content|
61
- PandocRuby.convert(content, :from => :markdown, :to => :html, :filter => 'pandoc-citeproc')
61
+ PandocRuby.convert(content, :from => 'markdown-tex_math_dollars-raw_tex', :to => :html, :filter => 'pandoc-citeproc')
62
62
  }
63
63
  else
64
64
  GitHub::Markup::Markdown::MARKDOWN_GEMS['kramdown'] = proc { |content|
@@ -85,7 +85,8 @@ module Gollum
85
85
  :extensions => ['rest', 'rst'])
86
86
  register(:asciidoc, "AsciiDoc",
87
87
  :skip_filters => [:Tags],
88
- :enabled => MarkupRegisterUtils::gem_exists?("asciidoctor"))
88
+ :enabled => MarkupRegisterUtils::gem_exists?("asciidoctor"),
89
+ :extensions => ['adoc','asciidoc'])
89
90
  register(:mediawiki, "MediaWiki",
90
91
  :enabled => MarkupRegisterUtils::gem_exists?("wikicloth"),
91
92
  :extensions => ['mediawiki','wiki'], :reverse_links => true)
@@ -277,7 +277,7 @@ module Gollum
277
277
  #
278
278
  # Returns the String extension (no leading period).
279
279
  def self.format_to_ext(format)
280
- format == :markdown ? "md" : format.to_s
280
+ Gollum::Markup.formats[format] ? Gollum::Markup.formats[format][:extensions].first : nil
281
281
  end
282
282
 
283
283
  # The underlying wiki repo.
@@ -7,12 +7,12 @@ module Gollum
7
7
  module Redirects
8
8
 
9
9
  def stale?
10
- @current_head != @wiki.repo.head.commit.sha
10
+ @current_head != get_head_sha
11
11
  end
12
12
 
13
13
  def init(wiki)
14
14
  @wiki = wiki
15
- @current_head = @wiki.repo.head.commit.sha
15
+ @current_head = get_head_sha
16
16
  end
17
17
 
18
18
  def load
@@ -33,6 +33,10 @@ module Gollum
33
33
  @wiki.overwrite_file(REDIRECTS_FILE, self.to_yaml, {})
34
34
  end
35
35
 
36
+ def get_head_sha
37
+ @wiki.repo.head ? @wiki.repo.head.commit.sha : nil
38
+ end
39
+
36
40
  end # Redirects Module
37
41
 
38
42
  end # Gollum Module
@@ -1,5 +1,5 @@
1
1
  module Gollum
2
2
  module Lib
3
- VERSION = '5.0'
3
+ VERSION = '5.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gollum-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: '5.0'
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -15,22 +15,16 @@ dependencies:
15
15
  name: gollum-rugged_adapter
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 0.99.4
21
18
  - - "~>"
22
19
  - !ruby/object:Gem::Version
23
- version: 0.99.4
20
+ version: '1.0'
24
21
  type: :runtime
25
22
  prerelease: false
26
23
  version_requirements: !ruby/object:Gem::Requirement
27
24
  requirements:
28
- - - ">="
29
- - !ruby/object:Gem::Version
30
- version: 0.99.4
31
25
  - - "~>"
32
26
  - !ruby/object:Gem::Version
33
- version: 0.99.4
27
+ version: '1.0'
34
28
  - !ruby/object:Gem::Dependency
35
29
  name: rouge
36
30
  requirement: !ruby/object:Gem::Requirement
@@ -456,7 +450,6 @@ files:
456
450
  - LICENSE
457
451
  - README.md
458
452
  - Rakefile
459
- - adapter_dependencies.rb
460
453
  - docs/sanitization.md
461
454
  - gemspec.rb
462
455
  - gollum-lib.gemspec
@@ -1,7 +0,0 @@
1
- # Set the default git adapter for use in gollum-lib.gemspec and gollum-lib_java.gemspec
2
-
3
- if RUBY_PLATFORM == 'java' then
4
- DEFAULT_ADAPTER_REQ = ['gollum-rjgit_adapter', '>= 0.5.1', '~> 0.5.1']
5
- else
6
- DEFAULT_ADAPTER_REQ = ['gollum-rugged_adapter', '>= 0.99.4', '~> 0.99.4']
7
- end