a75b003c78
* Fix page list for files that have regexp special chars. The page list collection logic was using the filename without any scaping to create a regexp. This not only breaks for some names it might even be a security problem by introducing bad regular expression as filenames. * Add another video to README. * Test on Ruby 2.4 * Pass non-empty commit author details in transliteration test Empty name or email are not allowed by libgit2 and cause a test failure when the test suite is run against rugged_adapter. * Solve bug when folder contain non-ascii character When you create a file in a folder with non-ascii character, for exemple "Réseau", after creating the page, it throwed an "URI::InvalidURIError", given the fact that the url returned was "/Réseau/H%C3%A9y", only the part with the name of the file was correctly encoded. So I propose to encode every part of the url to solve this issue So I just * readme: Use --document in place of deprecated options * Release 4.1.0 * Skip tests for transliteration for adapters different than grit * Fix date. Closes #1211 * Set bar_side for versioned pages. Closes #1226 * Update gemijione dependency. Closes #1227 * Release 4.1.1 * Update Mousetrap and use new 'mod' helper Since version 1.4, a generic 'mod' helper can be used for cross platform shortcuts. I updated Mousetrap to latest v1.6.1 and used 'mod+s' instead of ['ctrl+s', 'command+s'] for the editor's keyboard shortcut. See https://craig.is/killing/mice#api.bind.combo
38 lines
802 B
Ruby
38 lines
802 B
Ruby
# ~*~ encoding: utf-8 ~*~
|
|
# stdlib
|
|
require 'digest/md5'
|
|
require 'digest/sha1'
|
|
require 'ostruct'
|
|
|
|
# external
|
|
require 'github/markup'
|
|
require 'sanitize'
|
|
|
|
# internal
|
|
require File.expand_path('../gollum/uri_encode_component', __FILE__)
|
|
|
|
module Gollum
|
|
VERSION = '4.1.1'
|
|
|
|
def self.assets_path
|
|
::File.expand_path('gollum/public', ::File.dirname(__FILE__))
|
|
end
|
|
|
|
class Error < StandardError;
|
|
end
|
|
|
|
class DuplicatePageError < Error
|
|
attr_accessor :dir
|
|
attr_accessor :existing_path
|
|
attr_accessor :attempted_path
|
|
|
|
def initialize(dir, existing, attempted, message = nil)
|
|
@dir = dir
|
|
@existing_path = existing
|
|
@attempted_path = attempted
|
|
super(message || "Cannot write #{@dir}/#{@attempted_path}, found #{@dir}/#{@existing_path}.")
|
|
end
|
|
end
|
|
end
|
|
|