Compare commits

...

7 Commits

Author SHA1 Message Date
Dawa Ometto 9c2f8dfeba Release 5.3.0 2022-05-25 11:24:19 +02:00
Dawa Ometto 8e35688b17 Release preparation: update readme, rakefile and changelog (#1788)
* Update README.md
* Add LATEST_CHANGES.md and release helpers
2022-05-24 16:27:39 +02:00
Paul Westcott 860e8b2ebd Restore the normalize check that appears to be inadvertantly removed (#1802)
* Add test for normalize on upload

Co-authored-by: Dawa Ometto <d.ometto@gmail.com>
2022-05-24 16:13:35 +02:00
benjamin wil 0d2ab11604 Include rdoc as a dependency (#1823)
We've had some reports (#1342, #1809) of `rdoc` not being installed
in some environments, causing Gollum to error in unpleasant ways.

This isn't an issue that's unique to Gollum, and I don't think `rdoc`
should actually be a hard dependency of this project.  But since we can
side-step the issue by requiring `rdoc`, something that most users who
install Gollum via RubyGems would already have installed, I don't think
this is a horrible solution.
2022-05-04 18:25:48 -07:00
Andreas Wachter ddc7dba0a2 Remove arm/v6 and v7 from the Docker builds (#1822)
* added platforms to actions, install libc6-compat for pi

* fix build problem for now. https://github.com/gollum/gollum/runs/6248371141
2022-05-03 08:15:09 -07:00
Andreas Wachter bc3503f374 added platforms to actions, install libc6-compat for pi (#1806) 2022-04-30 23:04:45 -07:00
benjamin wil 2dfe103687 Ensure example git repos are valid (#1821)
* Ensure example git repos are valid

It was reported in #1817 that the `lotr_migration.git` repository we use
in `test/test_migrate.rb` is not a valid git repository on when clone,
causing the test suite to fail when run locally.

The reason is because there is no `.git/refs` directory, meaning it's
not really a valid git repository at all. I noticed that the `empty.git`
example repository has the same problem.

This commit simply ensures that the directory structure of these example
repositories are persisted in git.

* Run `test_migrate` tests on CI

Now that we've resolved the issue with the invalid git repository in the
parent commit, we can run all of the tests in our CI environment.
2022-04-30 23:03:56 -07:00
14 changed files with 201 additions and 92 deletions
+1
View File
@@ -45,5 +45,6 @@ jobs:
tags: ${{ env.DEPLOY_NAME }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
platforms: linux/amd64, linux/arm64
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
+4 -3
View File
@@ -19,7 +19,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
draft: true
prerelease: false
body_path: "LATEST_CHANGES.md"
+2 -1
View File
@@ -32,7 +32,8 @@ COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
RUN apk add \
bash \
git
git \
libc6-compat
VOLUME /wiki
WORKDIR /wiki
+16 -3
View File
@@ -1,12 +1,25 @@
# 5.2.3 2021-04-18
# 5.3.0 / 2022-05-25
* Feature: allow for overriding only specific Mustache templates/partials (@beporter)
* Feature: Add option to show browser's local time (@NikitaIvanovV)
* Improvement: presentation on mobile devises (@benjaminwil)
* Improvement: Add page context to template filter. #1603 (@tevino)
* Fix: restore normalize check on file upload (@manofstick)
* Fix mathjax on edit and create pages. #1772 (@fhchl)
* Fix utf-8 issues: #1721 #1758 #1801 (@basking2, @dometto)
* Fix an IME rendering issue. #1735 (@yy0931)
* Fix broken history button when viewing historical deleted file. (@NikitaIvanovV)
* Fix: non-ascii characters in page names are not rendered correctly in the preview tab of the "Edit" page. #1739 (@yy0931)
* Fix: anchors and header display on JRuby. #1779
# 5.2.3 / 2021-04-18
* Fix bug preventing page titles from being displayed
# 5.2.1 2021-02-25
# 5.2.1 / 2021-02-25
* Fix include call to a missing asset (@benjaminwil). This caused slow first page loads on JRuby.
# 5.2 2021-02-24
# 5.2 / 2021-02-24
* Improved styling and Primer upgrade (@benjaminwil)
* Add redirect to rename commit (@ViChyavIn)
+13
View File
@@ -0,0 +1,13 @@
# 5.3.0 / 2022-05-24
* Feature: allow for overriding only specific Mustache templates/partials (@beporter)
* Feature: Add option to show browser's local time (@NikitaIvanovV)
* Improvement: presentation on mobile devises (@benjaminwil)
* Improvement: Add page context to template filter. #1603 (@tevino)
* Fix: restore normalize check on file upload (@manofstick)
* Fix mathjax on edit and create pages. #1772 (@fhchl)
* Fix utf-8 issues: #1721 #1758 #1801 (@basking2, @dometto)
* Fix an IME rendering issue. #1735 (@yy0931)
* Fix broken history button when viewing historical deleted file. (@NikitaIvanovV)
* Fix: non-ascii characters in page names are not rendered correctly in the preview tab of the "Edit" page. #1739 (@yy0931)
* Fix: anchors and header display on JRuby. #1779
+29 -23
View File
@@ -5,21 +5,24 @@ gollum -- A git-based Wiki
![Build Status](https://github.com/gollum/gollum/actions/workflows/test.yaml/badge.svg)
[![Open Source Helpers](https://www.codetriage.com/gollum/gollum/badges/users.svg)](https://www.codetriage.com/gollum/gollum)
[![Cutting Edge Dependency Status](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/svg 'Cutting Edge Dependency Status')](https://dometto-cuttingedge.herokuapp.com/github/gollum/gollum/info)
[![Docker Pulls](https://img.shields.io/docker/pulls/gollumwiki/gollum)](https://hub.docker.com/r/gollumwiki/gollum)
**Gollum version 5.0 is out!** See [here](https://github.com/gollum/gollum/wiki/5.0-release-notes) for a list of changes and new features compared to Gollum version 4.x, and see some [Screenshots](https://github.com/gollum/gollum/wiki/Screenshots) of Gollum's features.
See the [wiki](https://github.com/gollum/gollum/wiki) for extensive documentation, along with [screenshots](https://github.com/gollum/gollum/wiki/Screenshots) of Gollum's features.
## DESCRIPTION
Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a git repository of a specific nature:
* A Gollum repository's contents are human-editable text or markup files.
* Pages may be organized into directories any way you choose.
* Other content can also be included, for example images, PDFs and headers/footers for your pages.
* Gollum pages:
* May be written in a variety of [markups](#markups).
* Can be edited with your favourite system editor or IDE (changes will be visible after committing) or with the built-in web interface.
* Can be edited with your favourite editor (changes will be visible after committing) or with the built-in web interface.
* Can be displayed in all versions, reverted, etc.
* Gollum strives to be compatible with GitHub wikis (see `--lenient-tag-lookup`)
* Gollum strives to be [compatible](https://github.com/gollum/gollum/wiki/5.0-release-notes#compatibility-option) with [GitHub](https://docs.github.com/en/communities/documenting-your-project-with-wikis/about-wikis) and [GitLab](https://docs.gitlab.com/ee/user/project/wiki/#create-or-edit-wiki-pages-locally) wikis.
* Just clone your GitHub/GitLab wiki and view and edit it locally!
* Gollum supports advanced functionality like:
* [UML diagrams](https://github.com/gollum/gollum/wiki#plantuml-diagrams)
* [BibTeX and Citation support](https://github.com/gollum/gollum/wiki/BibTeX-and-Citations)
@@ -32,16 +35,17 @@ Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a gi
### SYSTEM REQUIREMENTS
Gollum runs on Unix-like systems using its [adapter](https://github.com/gollum/rugged_adapter) for [rugged](https://github.com/libgit2/rugged) by default. You can also run Gollum on [JRuby](https://github.com/jruby/jruby) via its [adapter](https://github.com/repotag/gollum-lib_rjgit_adapter) for [RJGit](https://github.com/repotag/rjgit/). On Windows, Gollum runs only on JRuby.
Gollum runs on Unix-like systems using its default [adapter](https://github.com/gollum/rugged_adapter) for [rugged](https://github.com/libgit2/rugged). You can also run Gollum on [JRuby](https://github.com/jruby/jruby) via its [adapter](https://github.com/repotag/gollum-lib_rjgit_adapter) for [RJGit](https://github.com/repotag/rjgit/). On Windows, Gollum runs only on JRuby.
## INSTALLATION
1. Ruby is best installed either via [RVM](https://rvm.io/) or a package manager of choice.
2. Gollum is best installed via RubyGems:
```
[sudo] gem install gollum
```
### As a Ruby Gem
Ruby is best installed either via [RVM](https://rvm.io/) or a package manager of choice. Then simply:
```
gem install gollum
```
Installation examples for individual systems can be seen [here](https://github.com/gollum/gollum/wiki/Installation).
To run, simply:
@@ -49,24 +53,30 @@ To run, simply:
1. Run: `gollum /path/to/wiki` where `/path/to/wiki` is an initialized Git repository.
2. Open `http://localhost:4567` in your browser.
### Via Docker
See [here](https://github.com/gollum/gollum/wiki/Gollum-via-Docker) for instructions on how to run Gollum via Docker.
### Misc
See [below](#running-from-source) for information on running Gollum from source, as a Rack app, and more.
### Markups
## MARKUPS
Gollum allows using different markup languages on different wiki pages. It presently ships with support for the following markups:
* [Markdown](http://daringfireball.net/projects/markdown/syntax) (see [below](#Markdown-flavors) for more information on Markdown flavors)
* [RDoc](http://rdoc.sourceforge.net/)
You can easily activate support for other markups by installing additional renderers (any that are supported by [github-markup](https://github.com/github/markup)):
* [AsciiDoc](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/) -- `[sudo] gem install asciidoctor`
* [Creole](http://www.wikicreole.org/wiki/CheatSheet) -- `[sudo] gem install creole`
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `[sudo] gem install wikicloth`
* [Org](http://orgmode.org/worg/dev/org-syntax.html) -- `[sudo] gem install org-ruby`
* [AsciiDoc](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/) -- `gem install asciidoctor`
* [Creole](http://www.wikicreole.org/wiki/CheatSheet) -- `gem install creole`
* [MediaWiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth`
* [Org](http://orgmode.org/worg/dev/org-syntax.html) -- `gem install org-ruby`
* [Pod](http://perldoc.perl.org/perlpod.html) -- requires Perl >= 5.10 (the `perl` command must be available on your command line)
* Lower versions should install `Pod::Simple` from CPAN.
* [ReStructuredText](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html) -- requires python >= 2 (the `python2` command must be available on your command line)
* Note that Gollum will also need you to install `docutils` for your Python 2.
* [Textile](http://redcloth.org/hobix.com/textile/quick.html) -- `[sudo] gem install RedCloth`
* [ReStructuredText](http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html) -- requires python >= 3
* Note that Gollum will also need you to install `docutils` for python
* [Textile](http://redcloth.org/hobix.com/textile/quick.html) -- `gem install RedCloth`
### Markdown flavors
@@ -90,10 +100,6 @@ Gollum can also be run with any [rack-compatible web server](https://github.com/
Gollum can also be run alongside a CAS (Central Authentication Service) SSO (single sign-on) server. With a bit of tweaking, this adds basic user-support to Gollum. To see an example and an explanation, navigate [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Rack-and-CAS-SSO).
### Docker
Gollum can also be run via [Docker](https://www.docker.com/). More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-via-Docker).
### Service
Gollum can also be run as a service. More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-as-a-service).
@@ -106,7 +112,7 @@ Gollum comes with the following command line options:
| ----------------- | --------- | ----------- |
| --host | [HOST] | Specify the hostname or IP address to listen on. Default: '0.0.0.0'.<sup>1</sup> |
| --port | [PORT] | Specify the port to bind Gollum with. Default: `4567`. |
| --config | [FILE] | Specify path to Gollum's configuration file. |
| --config | [FILE] | Specify path to Gollum's [configuration file](#Config-file). |
| --ref | [REF] | Specify the git branch to serve. Default: `master`. |
| --bare | none | Tell Gollum that the git repository should be treated as bare. |
| --adapter | [ADAPTER] | Launch Gollum using a specific git adapter. Default: `rugged`.<sup>2</sup> |
+55
View File
@@ -1,5 +1,7 @@
require 'rubygems'
require 'rake'
require 'date'
require 'tempfile'
#############################################################################
#
@@ -7,6 +9,10 @@ require 'rake'
#
#############################################################################
def date
Time.now.strftime("%Y-%m-%d")
end
def name
@name ||= Dir['*.gemspec'].first.split('.').first
end
@@ -16,6 +22,14 @@ def version
line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
end
def latest_changes_file
'LATEST_CHANGES.md'
end
def history_file
'HISTORY.md'
end
# assumes x.y.z all digit version
def next_version
# x.y.z
@@ -105,6 +119,7 @@ task :release => :build do
puts "You must be on the master branch to release!"
exit!
end
Rake::Task[:changelog].execute
sh "git commit --allow-empty -a -m 'Release #{version}'"
sh "git pull --rebase origin master"
sh "git tag v#{version}"
@@ -167,6 +182,46 @@ task :validate do
end
end
desc 'Build changlog'
task :changelog do
[latest_changes_file, history_file].each do |f|
unless File.exists?(f)
puts "#{f} does not exist but is required to build a new release."
exit!
end
end
latest_changes = File.open(latest_changes_file)
version_pattern = "# #{version}"
if !`grep "#{version_pattern}" #{history_file}`.empty?
puts "#{version} is already described in #{history_file}"
exit!
end
begin
unless latest_changes.readline.chomp! =~ %r{#{version_pattern}}
puts "#{latest_changes_file} should begin with '#{version_pattern}'"
exit!
end
rescue EOFError
puts "#{latest_changes_file} is empty!"
exit!
end
body = latest_changes.read
body.scan(/\s*#\s+\d\.\d.*/) do |match|
puts "#{latest_changes_file} may not contain multiple markdown headers!"
exit!
end
temp = Tempfile.new
temp.puts("#{version_pattern} / #{date}\n#{body}\n")
temp.close
`cat #{history_file} >> #{temp.path}`
`cat #{temp.path} > #{history_file}`
end
desc 'Precompile assets'
task :precompile do
require './lib/gollum/app.rb'
+15 -8
View File
@@ -3,7 +3,7 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.6'
s.name = 'gollum'
s.version = '5.2.3'
s.version = '5.3.0'
s.license = 'MIT'
s.summary = 'A simple, Git-powered wiki.'
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ['--charset=UTF-8']
s.extra_rdoc_files = %w[README.md LICENSE]
s.add_dependency 'rdoc', '~> 6'
s.add_dependency 'gollum-lib', '~> 5.1'
s.add_dependency 'kramdown', '~> 2.3'
s.add_dependency 'kramdown-parser-gfm', '~> 1.1.0'
@@ -47,8 +48,10 @@ Gem::Specification.new do |s|
# = MANIFEST =
s.files = %w[
CONTRIBUTING.md
Dockerfile
Gemfile
HISTORY.md
LATEST_CHANGES.md
LICENSE
README.md
Rakefile
@@ -61,20 +64,21 @@ Gem::Specification.new do |s|
contrib/openrc/init.d/gollum
contrib/systemd/gollum@.service
contrib/sysv-debian/init.d/gollum
docker-run.sh
gollum.gemspec
lib/gollum.rb
lib/gollum/app.rb
lib/gollum/assets.rb
lib/gollum/helpers.rb
lib/gollum/public/assets/.sprockets-manifest-de7bb79aec424e55af1acdcc4237b301.json
lib/gollum/public/assets/app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js
lib/gollum/public/assets/app-0fd228e26bfbe6fe31a2da268eb0e98e780c1191c1a918adf383377946e9c838.js.gz
lib/gollum/public/assets/app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css
lib/gollum/public/assets/app-ad43ca64b295d8444b10f22ee868f18429268af498f1bc515434878b690e37a2.css.gz
lib/gollum/public/assets/.sprockets-manifest-160337b312f8e438181baac4aaa37319.json
lib/gollum/public/assets/app-309be032396e783b13a47df58f389b7c8e11c2b2d42640560b874f677c25f6e5.css
lib/gollum/public/assets/app-309be032396e783b13a47df58f389b7c8e11c2b2d42640560b874f677c25f6e5.css.gz
lib/gollum/public/assets/app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js
lib/gollum/public/assets/app-f05401ee374f0c7f48fc2bc08e30b4f4db705861fd5895ed70998683b383bfb5.js.gz
lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css
lib/gollum/public/assets/criticmarkup-31ae5d3282bbb8e7b7c3c9917e9fb68e3315a6b4a75da6cec48d21b8846905c4.css.gz
lib/gollum/public/assets/editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js
lib/gollum/public/assets/editor-db10c8351306e92f1926ba225d0cd9c8e886482b3b9820a85825ec3abab5f1cf.js.gz
lib/gollum/public/assets/editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js
lib/gollum/public/assets/editor-9881d0c7ae663293f0e3a7e72729eec7e940fa613185c076709b76d292f5703a.js.gz
lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css
lib/gollum/public/assets/print-512498c368be0d3fb1ba105dfa84289ae48380ec9fcbef948bd4e23b0b095bfb.css.gz
lib/gollum/public/gollum/javascript/HOWTO_UPDATE_ACE.md
@@ -1216,9 +1220,11 @@ Gem::Specification.new do |s|
lib/gollum/views/edit.rb
lib/gollum/views/editable.rb
lib/gollum/views/error.rb
lib/gollum/views/has_math.rb
lib/gollum/views/has_page.rb
lib/gollum/views/has_user_icons.rb
lib/gollum/views/helpers.rb
lib/gollum/views/helpers/locale_helpers.rb
lib/gollum/views/history.rb
lib/gollum/views/latest_changes.rb
lib/gollum/views/layout.rb
@@ -1227,6 +1233,7 @@ Gem::Specification.new do |s|
lib/gollum/views/pagination.rb
lib/gollum/views/rss.rb
lib/gollum/views/search.rb
lib/gollum/views/template_cascade.rb
licenses/licenses.txt
]
# = MANIFEST =
+1 -1
View File
@@ -13,7 +13,7 @@ require 'rhino' if RUBY_PLATFORM == 'java'
require ::File.expand_path('../gollum/uri_encode_component', __FILE__)
module Gollum
VERSION = '5.2.3'
VERSION = '5.3.0'
::I18n.available_locales = [:en]
::I18n.load_path = Dir[::File.expand_path("lib/gollum/locales") + "/*.yml"]
+1 -1
View File
@@ -273,7 +273,7 @@ module Precious
options.merge! author
end
normalize = Gollum::Page.valid_extension?(fullname)
options[:normalize] = Gollum::Page.valid_extension?(fullname)
begin
wiki.write_file(reponame, contents, options)
+17 -3
View File
@@ -477,9 +477,9 @@ EOF
assert_equal 'abc', file.raw_data
Precious::App.set(:wiki_options, {allow_uploads: false})
end
test "upload a file with mode page" do
temp_upload_file = Tempfile.new(['upload', '.file']) << 'abc'
temp_upload_file = Tempfile.new(['upload', '.file']) << "abc\r"
temp_upload_file.close
Precious::App.set(:wiki_options, {allow_uploads: true, per_page_uploads: true})
post "/gollum/upload_file", {:file => Rack::Test::UploadedFile.new(::File.open(temp_upload_file))}, {'HTTP_REFERER' => 'http://localhost:4567/Home.md', 'HTTP_HOST' => 'localhost:4567'}
@@ -488,7 +488,21 @@ EOF
@wiki.clear_cache
# Find the file in a page-specific subdir (here: Home), based on referer
file = @wiki.file("uploads/Home/#{::File.basename(temp_upload_file.path)}")
assert_equal 'abc', file.raw_data
assert_equal "abc\r", file.raw_data
Precious::App.set(:wiki_options, {allow_uploads: false, per_page_uploads: false})
end
test "upload a file with valid extension" do
temp_upload_file = Tempfile.new(['upload', '.txt']) << "abc\r"
temp_upload_file.close
Precious::App.set(:wiki_options, {allow_uploads: true, per_page_uploads: true})
post "/gollum/upload_file", {:file => Rack::Test::UploadedFile.new(::File.open(temp_upload_file))}, {'HTTP_REFERER' => 'http://localhost:4567/Home.md', 'HTTP_HOST' => 'localhost:4567'}
assert_equal 302, last_response.status # redirect is expected
@wiki.clear_cache
# Find the file in a page-specific subdir (here: Home), based on referer
file = @wiki.file("uploads/Home/#{::File.basename(temp_upload_file.path)}")
assert_equal "abc", file.raw_data
Precious::App.set(:wiki_options, {allow_uploads: false, per_page_uploads: false})
end
+47 -49
View File
@@ -25,62 +25,60 @@ def load_script(**args)
end
end
unless ENV['CI']
context '4.x -> 5.x tag migrator' do
include Rack::Test::Methods
context '4.x -> 5.x tag migrator' do
include Rack::Test::Methods
setup do
@path = cloned_testpath("examples/lotr_migration.git")
end
setup do
@path = cloned_testpath("examples/lotr_migration.git")
end
test 'repair broken links' do
# The original contents of Subdir/Foo.md:
#
# waa
# [[Samwi]]
# [[samwise gamgee.mediaWiki]]
# [[Samwise Gamgee.mediawiki]]
# [[Samwise Gamgee]]
# [[Test|Samwise Gamgee#Anchor]]
# [[Waaa|Test]]
# [[Zaa]]
#
# The contents will be updated after running the migration script.
load_script
test 'repair broken links' do
# The original contents of Subdir/Foo.md:
#
# waa
# [[Samwi]]
# [[samwise gamgee.mediaWiki]]
# [[Samwise Gamgee.mediawiki]]
# [[Samwise Gamgee]]
# [[Test|Samwise Gamgee#Anchor]]
# [[Waaa|Test]]
# [[Zaa]]
#
# The contents will be updated after running the migration script.
load_script
file = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
assert_equal <<~FILE_CONTENTS, file.read
waa
[[Samwi]]
[[/Samwise Gamgee.mediawiki]]
[[/Samwise Gamgee.mediawiki]]
[[/Samwise Gamgee.md]]
[[Test|/Samwise Gamgee.md#Anchor]]
[[Waaa|/Bar/Test.md]]
[[Subsub/Zaa.md]]
FILE_CONTENTS
end
file = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
assert_equal <<~FILE_CONTENTS, file.read
waa
[[Samwi]]
[[/Samwise Gamgee.mediawiki]]
[[/Samwise Gamgee.mediawiki]]
[[/Samwise Gamgee.md]]
[[Test|/Samwise Gamgee.md#Anchor]]
[[Waaa|/Bar/Test.md]]
[[Subsub/Zaa.md]]
FILE_CONTENTS
end
test 'change spaced filenames to hyphenated filenames' do
load_script(hyphenate: true)
test 'change spaced filenames to hyphenated filenames' do
load_script(hyphenate: true)
f = ::File.new(::File.join(@path, 'Home.textile'), 'r')
output = f.read
assert_equal true, output.include?('[[Bilbo-Baggins.md]]')
assert_equal true, output.include?('[[evil|Mordor/Eye-Of-Sauron.md]]')
end
f = ::File.new(::File.join(@path, 'Home.textile'), 'r')
output = f.read
assert_equal true, output.include?('[[Bilbo-Baggins.md]]')
assert_equal true, output.include?('[[evil|Mordor/Eye-Of-Sauron.md]]')
end
test 'migration with page file dir' do
load_script(page_file_dir: 'Subdir')
test 'migration with page file dir' do
load_script(page_file_dir: 'Subdir')
f = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
output = f.read
assert_equal true, output.include?('[[Subsub/Zaa.md]]')
assert_equal true, output.include?('[[Samwi]]')
end
f = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
output = f.read
assert_equal true, output.include?('[[Subsub/Zaa.md]]')
assert_equal true, output.include?('[[Samwi]]')
end
teardown do
FileUtils.rm_rf(@path)
end
teardown do
FileUtils.rm_rf(@path)
end
end