diff --git a/bin/gollum b/bin/gollum index 61e6ecc0..286bfcd6 100755 --- a/bin/gollum +++ b/bin/gollum @@ -149,7 +149,7 @@ if options['irb'] exit 0 end else - require 'gollum/frontend/app' + require 'gollum/app' Precious::App.set(:gollum_path, gollum_path) Precious::App.set(:wiki_options, wiki_options) diff --git a/gollum.gemspec b/gollum.gemspec index 7dd001b7..ff9f188f 100644 --- a/gollum.gemspec +++ b/gollum.gemspec @@ -23,14 +23,9 @@ Gem::Specification.new do |s| s.rdoc_options = ["--charset=UTF-8"] s.extra_rdoc_files = %w[README.md LICENSE] - s.add_dependency('grit', '~> 2.5.0') - s.add_dependency('github-markup', ['>= 0.7.5', '< 1.0.0']) - s.add_dependency('github-markdown', '~> 0.5.3') - s.add_dependency('pygments.rb', '~> 0.4.2') + s.add_dependency('gollum-lib', '~> 0.0.1') s.add_dependency('sinatra', '~> 1.3.5') s.add_dependency('mustache', ['>= 0.99.4', '< 1.0.0']) - s.add_dependency('sanitize', '~> 2.0.3') - s.add_dependency('nokogiri', '~> 1.5.6') s.add_dependency('useragent', '~> 0.4.16') s.add_dependency('stringex', '~> 1.5.1') @@ -44,6 +39,7 @@ Gem::Specification.new do |s| s.add_development_dependency('pry', '~> 0.9.12') # required by pry s.add_development_dependency('rb-readline', '~> 0.4.2') + s.add_development_dependency('minitest-reporters', '>= 0.5.0') # = MANIFEST = s.files = %w[ diff --git a/lib/gollum.rb b/lib/gollum.rb index b8c6e6d5..b02c98c9 100644 --- a/lib/gollum.rb +++ b/lib/gollum.rb @@ -6,24 +6,11 @@ require 'ostruct' # external require 'grit' -require File.expand_path('../gollum/grit_ext', __FILE__) require 'github/markup' require 'sanitize' # internal -require File.expand_path('../gollum/git_access', __FILE__) -require File.expand_path('../gollum/committer', __FILE__) -require File.expand_path('../gollum/pagination', __FILE__) -require File.expand_path('../gollum/blob_entry', __FILE__) -require File.expand_path('../gollum/wiki', __FILE__) -require File.expand_path('../gollum/page', __FILE__) -require File.expand_path('../gollum/file', __FILE__) -require File.expand_path('../gollum/file_view', __FILE__) -require File.expand_path('../gollum/markup', __FILE__) -require File.expand_path('../gollum/markups', __FILE__) -require File.expand_path('../gollum/sanitization', __FILE__) -require File.expand_path('../gollum/web_sequence_diagram', __FILE__) -require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__) +require File.expand_path('../gollum/uri_encode_component', __FILE__) # Set ruby to UTF-8 mode # This is required for Ruby 1.8.7 which gollum still supports. @@ -33,7 +20,7 @@ module Gollum VERSION = '2.4.11' def self.assets_path - ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__)) + ::File.expand_path('gollum/public', ::File.dirname(__FILE__)) end class Error < StandardError; end diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/app.rb similarity index 98% rename from lib/gollum/frontend/app.rb rename to lib/gollum/app.rb index 50893184..c59ae5a5 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/app.rb @@ -1,14 +1,14 @@ # ~*~ encoding: utf-8 ~*~ require 'cgi' require 'sinatra' -require 'gollum' +require 'gollum-lib' require 'mustache/sinatra' require 'useragent' require 'stringex' -require 'gollum/frontend/views/layout' -require 'gollum/frontend/views/editable' -require 'gollum/frontend/views/has_page' +require 'gollum/views/layout' +require 'gollum/views/editable' +require 'gollum/views/has_page' require File.expand_path '../helpers', __FILE__ @@ -27,7 +27,7 @@ end # There are a number of wiki options that can be set for the frontend # # Example -# require 'gollum/frontend/app' +# require 'gollum/app' # Precious::App.set(:wiki_options, { # :universal_toc => false, # } diff --git a/lib/gollum/blob_entry.rb b/lib/gollum/blob_entry.rb deleted file mode 100644 index d1f4fd56..00000000 --- a/lib/gollum/blob_entry.rb +++ /dev/null @@ -1,95 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - class BlobEntry - # Gets the String SHA for this blob. - attr_reader :sha - - # Gets the full path String for this blob. - attr_reader :path - - # Gets the Fixnum size of this blob. - attr_reader :size - - # Gets the Fixnum mode of this blob. - attr_reader :mode - - def initialize(sha, path, size = nil, mode = nil) - @sha = sha - @path = path - @size = size - @mode = mode - @dir = @name = @blob = nil - end - - # Gets the normalized directory path String for this blob. - def dir - @dir ||= self.class.normalize_dir(::File.dirname(@path)) - end - - # Gets the file base name String for this blob. - def name - @name ||= ::File.basename(@path) - end - - # Gets a Grit::Blob instance for this blob. - # - # repo - Grit::Repo instance for the Grit::Blob. - # - # Returns an unbaked Grit::Blob instance. - def blob(repo) - @blob ||= Grit::Blob.create(repo, - :id => @sha, :name => name, :size => @size, :mode => @mode) - end - - # Gets a Page instance for this blob. - # - # wiki - Gollum::Wiki instance for the Gollum::Page - # - # Returns a Gollum::Page instance. - def page(wiki, commit) - blob = self.blob(wiki.repo) - page = wiki.page_class.new(wiki).populate(blob, self.dir) - page.version = commit - page - end - - # Gets a File instance for this blob. - # - # wiki - Gollum::Wiki instance for the Gollum::File - # - # Returns a Gollum::File instance. - def file(wiki, commit) - blob = self.blob(wiki.repo) - file = wiki.file_class.new(wiki).populate(blob, self.dir) - file.version = commit - file - end - - def inspect - %(#) - end - - # Normalizes a given directory name for searching through tree paths. - # Ensures that a directory begins with a slash, or - # - # normalize_dir("") # => "" - # normalize_dir(".") # => "" - # normalize_dir("foo") # => "/foo" - # normalize_dir("/foo/") # => "/foo" - # normalize_dir("/") # => "" - # normalize_dir("c:/") # => "" - # - # dir - String directory name. - # - # Returns a normalized String directory name, or nil if no directory - # is given. - def self.normalize_dir(dir) - return '' if dir =~ /^.:\/$/ - if dir - dir = ::File.expand_path(dir, '/') - dir = '' if dir == '/' - end - dir - end - end -end diff --git a/lib/gollum/committer.rb b/lib/gollum/committer.rb deleted file mode 100644 index 719c1a95..00000000 --- a/lib/gollum/committer.rb +++ /dev/null @@ -1,236 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - # Responsible for handling the commit process for a Wiki. It sets up the - # Git index, provides methods for modifying the tree, and stores callbacks - # to be fired after the commit has been made. This is specifically - # designed to handle multiple updated pages in a single commit. - class Committer - # Gets the instance of the Gollum::Wiki that is being updated. - attr_reader :wiki - - # Gets a Hash of commit options. - attr_reader :options - - # Initializes the Committer. - # - # wiki - The Gollum::Wiki instance that is being updated. - # options - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # :tree - Optional String SHA of the tree to create the - # index from. - # :committer - Optional Gollum::Committer instance. If provided, - # assume that this operation is part of batch of - # updates and the commit happens later. - # - # Returns the Committer instance. - def initialize(wiki, options = {}) - @wiki = wiki - @options = options - @callbacks = [] - end - - # Public: References the Git index for this commit. - # - # Returns a Grit::Index. - def index - @index ||= begin - idx = @wiki.repo.index - if tree = options[:tree] - idx.read_tree(tree) - elsif parent = parents.first - idx.read_tree(parent.tree.id) - end - idx - end - end - - # Public: The committer for this commit. - # - # Returns a Grit::Actor. - def actor - @actor ||= begin - @options[:name] = @wiki.default_committer_name if @options[:name].to_s.empty? - @options[:email] = @wiki.default_committer_email if @options[:email].to_s.empty? - Grit::Actor.new(@options[:name], @options[:email]) - end - end - - # Public: The parent commits to this pending commit. - # - # Returns an array of Grit::Commit instances. - def parents - @parents ||= begin - arr = [@options[:parent] || @wiki.repo.commit(@wiki.ref)] - arr.flatten! - arr.compact! - arr - end - end - - # Adds a page to the given Index. - # - # dir - The String subdirectory of the Gollum::Page without any - # prefix or suffix slashes (e.g. "foo/bar"). - # name - The String Gollum::Page filename_stripped. - # format - The Symbol Gollum::Page format. - # data - The String wiki data to store in the tree map. - # allow_same_ext - A Boolean determining if the tree map allows the same - # filename with the same extension. - # - # Raises Gollum::DuplicatePageError if a matching filename already exists. - # This way, pages are not inadvertently overwritten. - # - # Returns nothing (modifies the Index in place). - def add_to_index(dir, name, format, data, allow_same_ext = false) - # spaces must be dashes - dir.gsub!(' ', '-') - name.gsub!(' ', '-') - - path = @wiki.page_file_name(name, format) - - dir = '/' if dir.strip.empty? - - fullpath = ::File.join(*[@wiki.page_file_dir, dir, path].compact) - fullpath = fullpath[1..-1] if fullpath =~ /^\// - - if index.current_tree && tree = index.current_tree / (@wiki.page_file_dir || '/') - tree = tree / dir unless tree.nil? - end - - if tree - downpath = path.downcase.sub(/\.\w+$/, '') - - tree.blobs.each do |blob| - next if page_path_scheduled_for_deletion?(index.tree, fullpath) - - existing_file = blob.name.downcase.sub(/\.\w+$/, '') - existing_file_ext = ::File.extname(blob.name).sub(/^\./, '') - - new_file_ext = ::File.extname(path).sub(/^\./, '') - - if downpath == existing_file && !(allow_same_ext && new_file_ext == existing_file_ext) - raise DuplicatePageError.new(dir, blob.name, path) - end - end - end - - fullpath = fullpath.force_encoding('ascii-8bit') if fullpath.respond_to?(:force_encoding) - - index.add(fullpath, @wiki.normalize(data)) - end - - # Update the given file in the repository's working directory if there - # is a working directory present. - # - # dir - The String directory in which the file lives. - # name - The String name of the page or the stripped filename - # (should be pre-canonicalized if required). - # format - The Symbol format of the page. - # - # Returns nothing. - def update_working_dir(dir, name, format) - unless @wiki.repo.bare - if @wiki.page_file_dir - dir = dir.size.zero? ? @wiki.page_file_dir : ::File.join(dir, @wiki.page_file_dir) - end - - path = - if dir == '' - @wiki.page_file_name(name, format) - else - ::File.join(dir, @wiki.page_file_name(name, format)) - end - - path = path.force_encoding('ascii-8bit') if path.respond_to?(:force_encoding) - - Dir.chdir(::File.join(@wiki.repo.path, '..')) do - if file_path_scheduled_for_deletion?(index.tree, path) - @wiki.repo.git.rm({'f' => true}, '--', path) - else - @wiki.repo.git.checkout({}, 'HEAD', '--', path) - end - end - end - end - - # Writes the commit to Git and runs the after_commit callbacks. - # - # Returns the String SHA1 of the new commit. - def commit - sha1 = index.commit(@options[:message], parents, actor, nil, @wiki.ref) - @callbacks.each do |cb| - cb.call(self, sha1) - end - sha1 - end - - # Adds a callback to be fired after a commit. - # - # block - A block that expects this Committer instance and the created - # commit's SHA1 as the arguments. - # - # Returns nothing. - def after_commit(&block) - @callbacks << block - end - - # Determine if a given page (regardless of format) is scheduled to be - # deleted in the next commit for the given Index. - # - # map - The Hash map: - # key - The String directory or filename. - # val - The Hash submap or the String contents of the file. - # path - The String path of the page file. This may include the format - # extension in which case it will be ignored. - # - # Returns the Boolean response. - def page_path_scheduled_for_deletion?(map, path) - parts = path.split('/') - if parts.size == 1 - deletions = map.keys.select { |k| !map[k] } - downfile = parts.first.downcase.sub(/\.\w+$/, '') - deletions.any? { |d| d.downcase.sub(/\.\w+$/, '') == downfile } - else - part = parts.shift - if rest = map[part] - page_path_scheduled_for_deletion?(rest, parts.join('/')) - else - false - end - end - end - - # Determine if a given file is scheduled to be deleted in the next commit - # for the given Index. - # - # map - The Hash map: - # key - The String directory or filename. - # val - The Hash submap or the String contents of the file. - # path - The String path of the file including extension. - # - # Returns the Boolean response. - def file_path_scheduled_for_deletion?(map, path) - parts = path.split('/') - if parts.size == 1 - deletions = map.keys.select { |k| !map[k] } - deletions.any? { |d| d == parts.first } - else - part = parts.shift - if rest = map[part] - file_path_scheduled_for_deletion?(rest, parts.join('/')) - else - false - end - end - end - - # Proxies methods t - def method_missing(name, *args) - args.map! { |item| item.respond_to?(:force_encoding) ? item.force_encoding('ascii-8bit') : item } - index.send(name, *args) - end - end -end diff --git a/lib/gollum/file.rb b/lib/gollum/file.rb deleted file mode 100644 index c0150c34..00000000 --- a/lib/gollum/file.rb +++ /dev/null @@ -1,101 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - class File - Wiki.file_class = self - - # Public: Initialize a file. - # - # wiki - The Gollum::Wiki in question. - # - # Returns a newly initialized Gollum::File. - def initialize(wiki) - @wiki = wiki - @blob = nil - @path = nil - end - - # Public: The url path required to reach this page within the repo. - # - # Returns the String url_path - def url_path - path = self.path - path = path.sub(/\/[^\/]+$/, '/') if path.include?('/') - path - end - - # Public: The url_path, but CGI escaped. - # - # Returns the String url_path - def escaped_url_path - CGI.escape(self.url_path).gsub('%2F','/') - end - - # Public: The on-disk filename of the file. - # - # Returns the String name. - def name - @blob && @blob.name - end - alias filename name - - # Public: The raw contents of the page. - # - # Returns the String data. - def raw_data - return nil unless @blob - - if !@wiki.repo.bare && @blob.is_symlink - new_path = @blob.symlink_target(::File.join(@wiki.repo.path, '..', self.path)) - return IO.read(new_path) if new_path - end - - @blob.data - end - - # Public: The Grit::Commit version of the file. - attr_accessor :version - - # Public: The String path of the file. - attr_reader :path - - # Public: The String mime type of the file. - def mime_type - @blob.mime_type - end - - # Populate the File with information from the Blob. - # - # blob - The Grit::Blob that contains the info. - # path - The String directory path of the file. - # - # Returns the populated Gollum::File. - def populate(blob, path=nil) - @blob = blob - @path = "#{path}/#{blob.name}"[1..-1] - self - end - - ######################################################################### - # - # Internal Methods - # - ######################################################################### - - # Find a file in the given Gollum repo. - # - # name - The full String path. - # version - The String version ID to find. - # - # Returns a Gollum::File or nil if the file could not be found. - def find(name, version) - checked = name.downcase - map = @wiki.tree_map_for(version) - if entry = map.detect { |entry| entry.path.downcase == checked } - @path = name - @blob = entry.blob(@wiki.repo) - @version = version.is_a?(Grit::Commit) ? version : @wiki.commit_for(version) - self - end - end - end -end diff --git a/lib/gollum/file_view.rb b/lib/gollum/file_view.rb deleted file mode 100644 index 79ab67b6..00000000 --- a/lib/gollum/file_view.rb +++ /dev/null @@ -1,155 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum -=begin - FileView requires that: - - All files in root dir are processed first - - Then all the folders are sorted and processed -=end - class FileView - # common use cases: - # set pages to wiki.pages and show_all to false - # set pages to wiki.pages + wiki.files and show_all to true - def initialize pages, options = {} - @pages = pages - @show_all = options[:show_all] || false - @checked = options[:collapse_tree] ? '' : "checked" - end - - def enclose_tree string - %Q(
    \n) + string + %Q(
) - end - - def new_page page - name = page.name - url = url_for_page page - %Q(
  • #{name}
  • ) - end - - def new_folder folder_path - new_sub_folder folder_path - end - - def new_sub_folder path - <<-HTML -
  • - -
      - HTML - end - - def end_folder - "
  • \n" - end - - def url_for_page page - url = '' - if @show_all - # Remove ext for valid pages. - filename = page.filename - filename = Page::valid_page_name?(filename) ? filename.chomp(::File.extname(filename)) : filename - - url = ::File.join(::File.dirname(page.path), filename) - else - url = ::File.join(::File.dirname(page.path), page.filename_stripped) - end - url = url[2..-1] if url[0,2] == './' - url - end - - def render_files - html = '' - count = @pages.size - folder_start = -1 - - # Process all pages until folders start - count.times do | index | - page = @pages[ index ] - path = page.path - - unless path.include? '/' - # Page processed (not contained in a folder) - html += new_page page - else - # Folders start at the next index - folder_start = index - break # Pages finished, move on to folders - end - end - - # If there are no folders, then we're done. - return enclose_tree(html) if folder_start <= -1 - - # Handle special case of only one folder. - if (count - folder_start == 1) - page = @pages[ folder_start ] - html += <<-HTML -
  • - -
      - #{new_page page} -
    -
  • - HTML - - return enclose_tree html - end - - sorted_folders = [] - (folder_start).upto count - 1 do | index | - sorted_folders += [[ @pages[ index ].path, index ]] - end - - # http://stackoverflow.com/questions/3482814/sorting-list-of-string-paths-in-vb-net - sorted_folders.sort! do |first,second| - a = first[0] - b = second[0] - - # use :: operator because gollum defines its own conflicting File class - dir_compare = ::File.dirname(a) <=> ::File.dirname(b) - - # Sort based on directory name unless they're equal (0) in - # which case sort based on file name. - if dir_compare == 0 - ::File.basename(a) <=> ::File.basename(b) - else - dir_compare - end - end - - # keep track of folder depth, 0 = at root. - cwd_array = [] - changed = false - - # process rest of folders - (0...sorted_folders.size).each do | index | - page = @pages[ sorted_folders[ index ][ 1 ] ] - path = page.path - folder = ::File.dirname path - - tmp_array = folder.split '/' - - (0...tmp_array.size).each do | index | - if cwd_array[ index ].nil? || changed - html += new_sub_folder tmp_array[ index ] - next - end - - if cwd_array[ index ] != tmp_array[ index ] - changed = true - (cwd_array.size - index).times do - html += end_folder - end - html += new_sub_folder tmp_array[ index ] - end - end - - html += new_page page - cwd_array = tmp_array - changed = false - end - - # return the completed html - enclose_tree html - end # end render_files - end # end FileView class -end # end Gollum module diff --git a/lib/gollum/git_access.rb b/lib/gollum/git_access.rb deleted file mode 100644 index 0157f9b2..00000000 --- a/lib/gollum/git_access.rb +++ /dev/null @@ -1,249 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - # Controls all access to the Git objects from Gollum. Extend this class to - # add custom caching for special cases. - class GitAccess - # Initializes the GitAccess instance. - # - # path - The String path to the Git repository that holds the - # Gollum site. - # page_file_dir - String the directory in which all page files reside - # - # Returns this instance. - def initialize(path, page_file_dir = nil, bare = false) - @page_file_dir = page_file_dir - @path = path - @repo = Grit::Repo.new(path, { :is_bare => bare }) - clear - end - - # Public: Determines whether the Git repository exists on disk. - # - # Returns true if it exists, or false. - def exist? - @repo.git.exist? - end - - # Public: Converts a given Git reference to a SHA, using the cache if - # available. - # - # ref - a String Git reference (ex: "master") - # - # Returns a String, or nil if the ref isn't found. - def ref_to_sha(ref) - ref = ref.to_s - return if ref.empty? - sha = - if sha?(ref) - ref - else - get_cache(:ref, ref) { ref_to_sha!(ref) } - end.to_s - sha.empty? ? nil : sha - end - - # Public: Gets a recursive list of Git blobs for the whole tree at the - # given commit. - # - # ref - A String Git reference or Git SHA to a commit. - # - # Returns an Array of BlobEntry instances. - def tree(ref) - if sha = ref_to_sha(ref) - get_cache(:tree, sha) { tree!(sha) } - else - [] - end - end - - # Public: Fetches the contents of the Git blob at the given SHA. - # - # sha - A String Git SHA. - # - # Returns the String content of the blob. - def blob(sha) - cat_file!(sha) - end - - # Public: Looks up the Git commit using the given Git SHA or ref. - # - # ref - A String Git SHA or ref. - # - # Returns a Grit::Commit. - def commit(ref) - if sha?(ref) - get_cache(:commit, ref) { commit!(ref) } - else - if sha = get_cache(:ref, ref) - commit(sha) - else - if cm = commit!(ref) - set_cache(:ref, ref, cm.id) - set_cache(:commit, cm.id, cm) - end - end - end - end - - # Public: Clears all of the cached data that this GitAccess is tracking. - # - # Returns nothing. - def clear - @ref_map = {} - @tree_map = {} - @commit_map = {} - end - - # Public: Refreshes just the cached Git reference data. This should - # be called after every Gollum update. - # - # Returns nothing. - def refresh - @ref_map.clear - end - - ######################################################################### - # - # Internal Methods - # - ######################################################################### - - # Gets the String path to the Git repository. - attr_reader :path - - # Gets the Grit::Repo instance for the Git repository. - attr_reader :repo - - # Gets a Hash cache of refs to commit SHAs. - # - # {"master" => "abc123", ...} - # - attr_reader :ref_map - - # Gets a Hash cache of commit SHAs to a recursive tree of blobs. - # - # {"abc123" => [, ]} - # - attr_reader :tree_map - - # Gets a Hash cache of commit SHAs to the Grit::Commit instance. - # - # {"abcd123" => } - # - attr_reader :commit_map - - # Checks to see if the given String is a 40 character hex SHA. - # - # str - Possible String SHA. - # - # Returns true if the String is a SHA, or false. - def sha?(str) - !!(str =~ /^[0-9a-f]{40}$/) - end - - # Looks up the Git SHA for the given Git ref. - # - # ref - String Git ref. - # - # Returns a String SHA. - def ref_to_sha!(ref) - @repo.git.rev_list({:max_count=>1}, ref) - rescue Grit::GitRuby::Repository::NoSuchShaFound - end - - # Looks up the Git blobs for a given commit. - # - # sha - String commit SHA. - # - # Returns an Array of BlobEntry instances. - def tree!(sha) - tree = @repo.git.native(:ls_tree, - {:r => true, :l => true, :z => true}, sha) - if tree.respond_to?(:force_encoding) - tree.force_encoding("UTF-8") - end - items = tree.split("\0").inject([]) do |memo, line| - memo << parse_tree_line(line) - end - - if dir = @page_file_dir - regex = /^#{dir}\// - items.select { |i| i.path =~ regex } - else - items - end - end - - # Reads the content from the Git db at the given SHA. - # - # sha - The String SHA. - # - # Returns the String content of the Git object. - def cat_file!(sha) - @repo.git.cat_file({:p => true}, sha) - end - - # Reads a Git commit. - # - # sha - The string SHA of the Git commit. - # - # Returns a Grit::Commit. - def commit!(sha) - @repo.commit(sha) - end - - # Attempts to get the given data from a cache. If it doesn't exist, it'll - # pass the results of the yielded block to the cache for future accesses. - # - # name - The cache prefix used in building the full cache key. - # key - The unique cache key suffix, usually a String Git SHA. - # - # Yields a block to pass to the cache. - # Returns the cached result. - def get_cache(name, key) - cache = instance_variable_get("@#{name}_map") - value = cache[key] - if value.nil? && block_given? - set_cache(name, key, value = yield) - end - value == :_nil ? nil : value - end - - # Writes some data to the internal cache. - # - # name - The cache prefix used in building the full cache key. - # key - The unique cache key suffix, usually a String Git SHA. - # value - The value to write to the cache. - # - # Returns nothing. - def set_cache(name, key, value) - cache = instance_variable_get("@#{name}_map") - cache[key] = value || :_nil - end - - # Parses a line of output from the `ls-tree` command. - # - # line - A String line of output: - # "100644 blob 839c2291b30495b9a882c17d08254d3c90d8fb53 Home.md" - # - # Returns an Array of BlobEntry instances. - def parse_tree_line(line) - mode, type, sha, size, *name = line.split(/\s+/) - BlobEntry.new(sha, name.join(' '), size.to_i, mode.to_i(8)) - end - - # Decode octal sequences (\NNN) in tree path names. - # - # path - String path name. - # - # Returns a decoded String. - def decode_git_path(path) - if path[0] == ?" && path[-1] == ?" - path = path[1...-1] - path.gsub!(/\\\d{3}/) { |m| m[1..-1].to_i(8).chr } - end - path.gsub!(/\\[rn"\\]/) { |m| eval(%("#{m.to_s}")) } - path - end - end -end diff --git a/lib/gollum/gitcode.rb b/lib/gollum/gitcode.rb deleted file mode 100644 index 226b345a..00000000 --- a/lib/gollum/gitcode.rb +++ /dev/null @@ -1,48 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require 'net/http' -require 'net/https' # ruby 1.8.7 fix, remove at upgrade -require 'uri' -require 'open-uri' - -module Gollum - class Gitcode - def initialize path - raise(ArgumentError, 'path is nil or empty') if path.nil? or path.empty? - - @uri = URI::HTTP.build({ - :path => self.unchomp(path), - :host => 'raw.github.com', - :scheme => 'https', - :port => 443 }) - end - - def contents - @contents ||= self.req @uri - end - - def unchomp p - return p if p.nil? - p[0] == '/' ? p : ('/' + p) - end - - def req uri, cut = 1 - return "Too many redirects or retries" if cut >= 10 - http = Net::HTTP.new uri.host, uri.port - http.use_ssl = true - resp = http.get uri.path, { - 'Accept' => 'text/plain', - 'Cache-Control' => 'no-cache', - 'Connection' => 'keep-alive', - 'Host' => uri.host, - 'User-Agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0' - } - code = resp.code.to_i - return resp.body if code == 200 - return "Not Found" if code == 404 - return "Unhandled Response Code #{code}" unless code == 304 or not resp.header['location'].nil? - loc = URI.parse resp.header['location'] - uri2 = loc.relative?() ? (uri + loc) : loc # overloads (+) - return req uri2, (cut + 1) - end - end -end diff --git a/lib/gollum/grit_ext.rb b/lib/gollum/grit_ext.rb deleted file mode 100644 index be77d059..00000000 --- a/lib/gollum/grit_ext.rb +++ /dev/null @@ -1,20 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ - -module Grit - class Blob - def is_symlink - self.mode == 0120000 - end - - def symlink_target(base_path = nil) - target = self.data - new_path = File.expand_path(File.join('..', target), base_path) - - if File.file? new_path - return new_path - end - end - - nil - end -end diff --git a/lib/gollum/frontend/helpers.rb b/lib/gollum/helpers.rb similarity index 85% rename from lib/gollum/frontend/helpers.rb rename to lib/gollum/helpers.rb index 51e2c008..e9145a0a 100644 --- a/lib/gollum/frontend/helpers.rb +++ b/lib/gollum/helpers.rb @@ -32,11 +32,5 @@ module Precious url.gsub('%2F','/').gsub(/^\/+/,'').gsub('//','/') end - def trim_leading_slash url - return url if url.nil? - url.gsub!('%2F','/') - return '/' + url.gsub(/^\/+/,'') if url[0,1] == '/' - url - end end end diff --git a/lib/gollum/markup.rb b/lib/gollum/markup.rb deleted file mode 100644 index 405fc08f..00000000 --- a/lib/gollum/markup.rb +++ /dev/null @@ -1,686 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require 'digest/sha1' -require 'cgi' -require 'pygments' -require 'base64' - -require File.expand_path '../frontend/helpers', __FILE__ -require File.expand_path '../gitcode', __FILE__ - -# initialize Pygments -Pygments.start - -module Gollum - - class Markup - include Precious::Helpers - - @formats = {} - - class << self - attr_reader :formats - - # Register a file extension and associated markup type - # - # ext - The file extension - # name - The name of the markup type - # options - Hash of options: - # regexp - Regexp to match against. - # Defaults to exact match of ext. - # - # If given a block, that block will be registered with GitHub::Markup to - # render any matching pages - def register(ext, name, options = {}, &block) - regexp = options[:regexp] || Regexp.new(ext.to_s) - @formats[ext] = { :name => name, :regexp => regexp } - GitHub::Markup.add_markup(regexp, &block) if block_given? - end - end - - attr_accessor :toc - attr_reader :metadata - - # Initialize a new Markup object. - # - # page - The Gollum::Page. - # - # Returns a new Gollum::Markup object, ready for rendering. - def initialize(page) - @wiki = page.wiki - @name = page.filename - @data = page.text_data - @version = page.version.id if page.version - @format = page.format - @sub_page = page.sub_page - @parent_page = page.parent_page - @dir = ::File.dirname(page.path) - @tagmap = {} - @codemap = {} - @wsdmap = {} - @premap = {} - @toc = nil - @metadata = nil - @to_xml = { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML ^ 1, :indent => 0, :encoding => 'UTF-8' } - end - - # Render the content with Gollum wiki syntax on top of the file's own - # markup language. - # - # no_follow - Boolean that determines if rel="nofollow" is added to all - # tags. - # encoding - Encoding Constant or String. - # - # Returns the formatted String content. - def render(no_follow = false, encoding = nil) - sanitize = no_follow ? - @wiki.history_sanitizer : - @wiki.sanitizer - - data = @data.dup - data = extract_metadata(data) - data = extract_gitcode(data) - data = extract_code(data) - data = extract_wsd(data) - data = extract_tags(data) - begin - data = GitHub::Markup.render(@name, data) - if data.nil? - raise "There was an error converting #{@name} to HTML." - end - rescue Object => e - data = %{

    #{e.message}

    } - end - data = process_tags(data) - data = process_code(data, encoding) - - doc = Nokogiri::HTML::DocumentFragment.parse(data) - doc = sanitize.clean_node!(doc) if sanitize - doc,toc = process_headers(doc) - @toc = @sub_page ? ( @parent_page ? @parent_page.toc_data : "[[_TOC_]]" ) : toc - yield doc if block_given? - # nokogiri's save options are ored together. FORMAT has a value of 1 so ^ 1 removes it. - # formatting will create extra spaces in pre tags. - # https://github.com/sparklemotion/nokogiri/issues/782 - # DEFAULT_HTML encodes unicode so XHTML is used for proper unicode support in href. - data = doc.to_xml( @to_xml ) - - data = process_toc_tags(data) - data = process_wsd(data) - data.gsub!(/

    <\/p>/) do - '' - end - - data - end - - # Inserts header anchors and creates TOC - # - # doc - Nokogiri parsed document - # - # Returns doc Document and toc String - def process_headers(doc) - toc = nil - doc.css('h1,h2,h3,h4,h5,h6').each do |h| - # must escape " - h_name = h.content.gsub(' ','-').gsub('"','%22') - - level = h.name.gsub(/[hH]/,'').to_i - - # Add anchors - h.add_child(%Q{}) - - # Build TOC - toc ||= Nokogiri::XML::DocumentFragment.parse('

    Table of Contents
    ') - tail ||= toc.child - tail_level ||= 0 - - while tail_level < level - node = Nokogiri::XML::Node.new('ul', doc) - tail = tail.add_child(node) - tail_level += 1 - end - while tail_level > level - tail = tail.parent - tail_level -= 1 - end - node = Nokogiri::XML::Node.new('li', doc) - # % -> %25 so anchors work on Firefox. See issue #475 - node.add_child(%Q{#{h.content}}) - tail.add_child(node) - end - toc = toc.to_xml(@to_xml) if toc != nil - [doc, toc] - end - - ######################################################################### - # - # Tags - # - ######################################################################### - - # Extract all tags into the tagmap and replace with placeholders. - # - # data - The raw String data. - # - # Returns the placeholder'd String data. - def extract_tags(data) - if @format == :asciidoc - return data - end - data.gsub!(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do - if $1 == "'" && $3 != "'" - "[[#{$2}]]#{$3}" - elsif $2.include?('][') - if $2[0..4] == 'file:' - pre = $1 - post = $3 - parts = $2.split('][') - parts[0][0..4] = "" - link = "#{parts[1]}|#{parts[0].sub(/\.org/,'')}" - id = Digest::SHA1.hexdigest(link) - @tagmap[id] = link - "#{pre}#{id}#{post}" - else - $& - end - else - id = Digest::SHA1.hexdigest($2) - @tagmap[id] = $2 - "#{$1}#{id}#{$3}" - end - end - data - end - - # Process all tags from the tagmap and replace the placeholders with the - # final markup. - # - # data - The String data (with placeholders). - # - # Returns the marked up String data. - def process_tags(data) - @tagmap.each do |id, tag| - # If it's preformatted, just put the tag back - if is_preformatted?(data, id) - data.gsub!(id) do - "[[#{tag}]]" - end - else - data.gsub!(id) do - process_tag(tag).gsub('%2F', '/') - end - end - end - data - end - - # Find `id` within `data` and determine if it's within - # preformatted tags. - # - # data - The String data (with placeholders). - # id - The String SHA1 hash. - PREFORMATTED_TAGS = %w(code tt) - def is_preformatted?(data, id) - doc = Nokogiri::HTML::DocumentFragment.parse(data) - node = doc.search("[text()*='#{id}']").first - node && (PREFORMATTED_TAGS.include?(node.name) || - node.ancestors.any? { |a| PREFORMATTED_TAGS.include?(a.name) }) - end - - # Process a single tag into its final HTML form. - # - # tag - The String tag contents (the stuff inside the double - # brackets). - # - # Returns the String HTML version of the tag. - def process_tag(tag) - if tag =~ /^_TOC_$/ - %{[[#{tag}]]} - elsif html = process_image_tag(tag) - html - elsif html = process_file_link_tag(tag) - html - else - process_page_link_tag(tag) - end - end - - # Attempt to process the tag as an image tag. - # - # tag - The String tag contents (the stuff inside the double brackets). - # - # Returns the String HTML if the tag is a valid image tag or nil - # if it is not. - def process_image_tag(tag) - parts = tag.split('|') - return if parts.size.zero? - - name = parts[0].strip - path = if file = find_file(name) - ::File.join @wiki.base_path, file.path - elsif name =~ /^https?:\/\/.+(jpg|png|gif|svg|bmp)$/i - name - end - - if path - opts = parse_image_tag_options(tag) - - containered = false - - classes = [] # applied to whatever the outermost container is - attrs = [] # applied to the image - - align = opts['align'] - if opts['float'] - containered = true - align ||= 'left' - if %w{left right}.include?(align) - classes << "float-#{align}" - end - elsif %w{top texttop middle absmiddle bottom absbottom baseline}.include?(align) - attrs << %{align="#{align}"} - elsif align - if %w{left center right}.include?(align) - containered = true - classes << "align-#{align}" - end - end - - if width = opts['width'] - if width =~ /^\d+(\.\d+)?(em|px)$/ - attrs << %{width="#{width}"} - end - end - - if height = opts['height'] - if height =~ /^\d+(\.\d+)?(em|px)$/ - attrs << %{height="#{height}"} - end - end - - if alt = opts['alt'] - attrs << %{alt="#{alt}"} - end - - attr_string = attrs.size > 0 ? attrs.join(' ') + ' ' : '' - - if opts['frame'] || containered - classes << 'frame' if opts['frame'] - %{} + - %{} + - %{} + - (alt ? %{#{alt}} : '') + - %{} + - %{} - else - %{} - end - end - end - - # Parse any options present on the image tag and extract them into a - # Hash of option names and values. - # - # tag - The String tag contents (the stuff inside the double brackets). - # - # Returns the options Hash: - # key - The String option name. - # val - The String option value or true if it is a binary option. - def parse_image_tag_options(tag) - tag.split('|')[1..-1].inject({}) do |memo, attr| - parts = attr.split('=').map { |x| x.strip } - memo[parts[0]] = (parts.size == 1 ? true : parts[1]) - memo - end - end - - # Attempt to process the tag as a file link tag. - # - # tag - The String tag contents (the stuff inside the double - # brackets). - # - # Returns the String HTML if the tag is a valid file link tag or nil - # if it is not. - def process_file_link_tag(tag) - parts = tag.split('|') - return if parts.size.zero? - - name = parts[0].strip - path = parts[1] && parts[1].strip - path = if path && file = find_file(path) - ::File.join @wiki.base_path, file.path - elsif path =~ %r{^https?://} - path - else - nil - end - - if name && path && file - %{#{name}} - elsif name && path - %{#{name}} - else - nil - end - end - - # Attempt to process the tag as a page link tag. - # - # tag - The String tag contents (the stuff inside the double - # brackets). - # - # Returns the String HTML if the tag is a valid page link tag or nil - # if it is not. - def process_page_link_tag(tag) - parts = tag.split('|') - parts.reverse! if @format == :mediawiki - - name, page_name = *parts.compact.map(&:strip) - cname = @wiki.page_class.cname(page_name || name) - - if name =~ %r{^https?://} && page_name.nil? - %{#{name}} - else - presence = "absent" - link_name = cname - page, extra = find_page_from_name(cname) - if page - link_name = @wiki.page_class.cname(page.name) - presence = "present" - end - link = ::File.join(@wiki.base_path, page ? page.escaped_url_path : CGI.escape(link_name)) - - # //page is invalid - # strip all duplicate forward slashes using helpers.rb trim_leading_slash - # //page => /page - link = trim_leading_slash link - - %{#{name}} - end - end - - - # Process the special table of contents tag [[_TOC_]] - # - # data - The String data (with placeholders). - # - # Returns the marked up String data. - def process_toc_tags(data) - data.gsub!("[[_TOC_]]") do - @toc.nil? ? '' : @toc - end - data - end - - # Find the given file in the repo. - # - # name - The String absolute or relative path of the file. - # - # Returns the Gollum::File or nil if none was found. - def find_file(name, version=@version) - if name =~ /^\// - @wiki.file(name[1..-1], version) - else - path = @dir == '.' ? name : ::File.join(@dir, name) - @wiki.file(path, version) - end - end - - # Find a page from a given cname. If the page has an anchor (#) and has - # no match, strip the anchor and try again. - # - # cname - The String canonical page name including path. - # - # Returns a Gollum::Page instance if a page is found, or an Array of - # [Gollum::Page, String extra] if a page without the extra anchor data - # is found. - def find_page_from_name(cname) - slash = cname.rindex('/') - - unless slash.nil? - name = cname[slash+1..-1] - path = cname[0..slash] - page = @wiki.paged(name, path) - else - page = @wiki.paged(cname, '/') || @wiki.page(cname) - end - - if page - return page - end - if pos = cname.index('#') - [@wiki.page(cname[0...pos]), cname[pos..-1]] - end - end - - ######################################################################### - # - # Gitcode - fetch code from github search path and replace the contents - # to a code-block that gets run the next parse. - # Acceptable formats: - # ```language:local-file.ext``` - # ```language:/abs/other-file.ext``` - # ```language:gollum/gollum/master/somefile.txt``` - # - ######################################################################### - - def extract_gitcode data - data.gsub /^[ \t]*``` ?([^:\n\r]+):([^`\n\r]+)```/ do - contents = '' - # Use empty string if $2 is nil. - uri = $2 || '' - # Detect local file. - if uri[0..6] != 'gollum/' - if file = self.find_file(uri, @wiki.ref) - contents = file.raw_data - else - # How do we communicate a render error? - next "File not found: #{Rack::Utils::escape_html(uri)}" - end - else - contents = Gollum::Gitcode.new(uri).contents - end - - "```#{$1}\n#{contents}\n```\n" - end - end - - ######################################################################### - # - # Code - # - ######################################################################### - - # Extract all code blocks into the codemap and replace with placeholders. - # - # data - The raw String data. - # - # Returns the placeholder'd String data. - def extract_code(data) - data.gsub!(/^([ \t]*)(~~~+) ?([^\r\n]+)?\r?\n(.+?)\r?\n\1(~~~+)[ \t\r]*$/m) do - m_indent = $1 - m_start = $2 # ~~~ - m_lang = $3 - m_code = $4 - m_end = $5 # ~~~ - - # start and finish tilde fence must be the same length - return '' if m_start.length != m_end.length - - lang = m_lang ? m_lang.strip : nil - id = Digest::SHA1.hexdigest("#{lang}.#{m_code}") - cached = check_cache(:code, id) - - # extract lang from { .ruby } or { #stuff .ruby .indent } - # see http://johnmacfarlane.net/pandoc/README.html#delimited-code-blocks - - if lang - lang = lang.match(/\.([^}\s]+)/) - lang = lang[1] unless lang.nil? - end - - @codemap[id] = cached ? - { :output => cached } : - { :lang => lang, :code => m_code, :indent => m_indent } - - "#{m_indent}#{id}" # print the SHA1 ID with the proper indentation - end - - data.gsub!(/^([ \t]*)``` ?([^\r\n]+)?\r?\n(.+?)\r?\n\1```[ \t]*\r?$/m) do - lang = $2 ? $2.strip : nil - id = Digest::SHA1.hexdigest("#{lang}.#{$3}") - cached = check_cache(:code, id) - @codemap[id] = cached ? - { :output => cached } : - { :lang => lang, :code => $3, :indent => $1 } - "#{$1}#{id}" # print the SHA1 ID with the proper indentation - end - data - end - - # Remove the leading space from a code block. Leading space - # is only removed if every single line in the block has leading - # whitespace. - # - # code - The code block to remove spaces from - # regex - A regex to match whitespace - def remove_leading_space(code, regex) - if code.lines.all? { |line| line =~ /\A\r?\n\Z/ || line =~ regex } - code.gsub!(regex) do - '' - end - end - end - - # Process all code from the codemap and replace the placeholders with the - # final HTML. - # - # data - The String data (with placeholders). - # encoding - Encoding Constant or String. - # - # Returns the marked up String data. - def process_code(data, encoding = nil) - return data if data.nil? || data.size.zero? || @codemap.size.zero? - - blocks = [] - @codemap.each do |id, spec| - next if spec[:output] # cached - - code = spec[:code] - - remove_leading_space(code, /^#{spec[:indent]}/m) - remove_leading_space(code, /^( |\t)/m) - - blocks << [spec[:lang], code] - end - - highlighted = [] - blocks.each do |lang, code| - encoding ||= 'utf-8' - begin - # must set startinline to true for php to be highlighted without lang, :options => {:encoding => encoding.to_s, :startinline => true}) - rescue - hl_code = code - end - highlighted << hl_code - end - - @codemap.each do |id, spec| - body = spec[:output] || begin - if (body = highlighted.shift.to_s).size > 0 - update_cache(:code, id, body) - body - else - "
    #{CGI.escapeHTML(spec[:code])}
    " - end - end - data.gsub!(id) do - body - end - end - - data - end - - ######################################################################### - # - # Sequence Diagrams - # - ######################################################################### - - # Extract all sequence diagram blocks into the wsdmap and replace with - # placeholders. - # - # data - The raw String data. - # - # Returns the placeholder'd String data. - def extract_wsd(data) - data.gsub(/^\{\{\{\{\{\{ ?(.+?)\r?\n(.+?)\r?\n\}\}\}\}\}\}\r?$/m) do - id = Digest::SHA1.hexdigest($2) - @wsdmap[id] = { :style => $1, :code => $2 } - id - end - end - - # Process all diagrams from the wsdmap and replace the placeholders with - # the final HTML. - # - # data - The String data (with placeholders). - # - # Returns the marked up String data. - def process_wsd(data) - @wsdmap.each do |id, spec| - style = spec[:style] - code = spec[:code] - data.gsub!(id) do - Gollum::WebSequenceDiagram.new(code, style).to_tag - end - end - data - end - - ######################################################################### - # - # Metadata - # - ######################################################################### - - # Extract metadata for data and build metadata table. Metadata - # is content found between markers, and must - # be a valid YAML mapping. - # - # Because ri and ruby 1.8.7 are awesome, the markers can't - # be included in this documentation without triggering - # `Unhandled special: Special: type=17` - # Please read the source code for the exact markers - # - # Returns the String of formatted data with metadata removed. - def extract_metadata(data) - @metadata = {} - data - end - - # Hook for getting the formatted value of extracted tag data. - # - # type - Symbol value identifying what type of data is being extracted. - # id - String SHA1 hash of original extracted tag data. - # - # Returns the String cached formatted data, or nil. - def check_cache(type, id) - end - - # Hook for caching the formatted value of extracted tag data. - # - # type - Symbol value identifying what type of data is being extracted. - # id - String SHA1 hash of original extracted tag data. - # data - The String formatted value to be cached. - # - # Returns nothing. - def update_cache(type, id, data) - end - end - - MarkupGFM = Markup -end diff --git a/lib/gollum/markups.rb b/lib/gollum/markups.rb deleted file mode 100644 index 53f45ed3..00000000 --- a/lib/gollum/markups.rb +++ /dev/null @@ -1,13 +0,0 @@ -module Gollum - class Markup - register(:markdown, "Markdown", :regexp => /md|mkdn?|mdown|markdown/) - register(:textile, "Textile") - register(:rdoc, "RDoc") - register(:org, "Org-mode") - register(:creole, "Creole") - register(:rest, "reStructuredText", :regexp => /re?st(\.txt)?/) - register(:asciidoc, "AsciiDoc") - register(:mediawiki, "MediaWiki", :regexp => /(media)?wiki/) - register(:pod, "Pod") - end -end \ No newline at end of file diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb deleted file mode 100644 index 2abea5aa..00000000 --- a/lib/gollum/page.rb +++ /dev/null @@ -1,485 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - class Page - include Pagination - - Wiki.page_class = self - - # Sets a Boolean determing whether this page is a historical version. - # - # Returns nothing. - attr_writer :historical - - # Parent page if this is a sub page - # - # Returns a Page - attr_accessor :parent_page - - - # Checks a filename against the registered markup extensions - # - # filename - String filename, like "Home.md" - # - # Returns e.g. ["Home", :markdown], or [] if the extension is unregistered - def self.parse_filename(filename) - return [] unless filename =~ /^(.+)\.([a-zA-Z]\w*)$/i - pref, ext = $1, $2 - - Gollum::Markup.formats.each_pair do |name, format| - return [pref, name] if ext =~ format[:regexp] - end - [] - end - - # Checks if a filename has a valid, registered extension - # - # filename - String filename, like "Home.md". - # - # Returns the matching String basename of the file without the extension. - def self.valid_filename?(filename) - self.parse_filename(filename).first - end - - # Checks if a filename has a valid extension understood by GitHub::Markup. - # Also, checks if the filename has no "_" in the front (such as - # _Footer.md). - # - # filename - String filename, like "Home.md". - # - # Returns the matching String basename of the file without the extension. - def self.valid_page_name?(filename) - match = valid_filename?(filename) - filename =~ /^_/ ? false : match - end - - # Public: The format of a given filename. - # - # filename - The String filename. - # - # Returns the Symbol format of the page; one of the registered format types - def self.format_for(filename) - self.parse_filename(filename).last - end - - # Reusable filter to turn a filename (without path) into a canonical name. - # Strips extension, converts dashes to spaces. - # - # Returns the filtered String. - def self.canonicalize_filename(filename) - strip_filename(filename).gsub('-', ' ') - end - - # Reusable filter to strip extension and path from filename - # - # filename - The string path or filename to strip - # - # Returns the stripped String. - def self.strip_filename(filename) - ::File.basename(filename, ::File.extname(filename)) - end - - # Public: Initialize a page. - # - # wiki - The Gollum::Wiki in question. - # - # Returns a newly initialized Gollum::Page. - def initialize(wiki) - @wiki = wiki - @blob = @header = @footer = @sidebar = nil - @doc = nil - @parent_page = nil - end - - # Public: The on-disk filename of the page including extension. - # - # Returns the String name. - def filename - @blob && @blob.name - end - - # Public: The on-disk filename of the page with extension stripped. - # - # Returns the String name. - def filename_stripped - self.class.strip_filename(filename) - end - - # Public: The canonical page name without extension, and dashes converted - # to spaces. - # - # Returns the String name. - def name - self.class.canonicalize_filename(filename) - end - - # Public: The title will be constructed from the - # filename by stripping the extension and replacing any dashes with - # spaces. - # - # Returns the fully sanitized String title. - def title - Sanitize.clean(name).strip - end - - # Public: Determines if this is a sub-page - # Sub-pages have filenames beginning with an underscore - # - # Returns true or false. - def sub_page - filename =~ /^_/ - end - - # Public: The path of the page within the repo. - # - # Returns the String path. - attr_reader :path - - # Public: The url path required to reach this page within the repo. - # - # Returns the String url_path - def url_path - path = if self.path.include?('/') - self.path.sub(/\/[^\/]+$/, '/') - else - '' - end - - path << Page.cname(self.name, '-', '-') - path - end - - # Public: Defines title for page.rb - # - # Returns the String title - def url_path_title - metadata_title || url_path.gsub("-", " ") - end - - # Public: Metadata title - # - # Set with in page content - # - # Returns the String title or nil if not defined - def metadata_title - if metadata - title = metadata['title'] - return title unless title.nil? - end - - nil - end - - # Public: The url_path, but CGI escaped. - # - # Returns the String url_path - def escaped_url_path - CGI.escape(self.url_path).gsub('%2F','/') - end - - # Public: The raw contents of the page. - # - # Returns the String data. - def raw_data - return nil unless @blob - - if !@wiki.repo.bare && @blob.is_symlink - new_path = @blob.symlink_target(::File.join(@wiki.repo.path, '..', self.path)) - return IO.read(new_path) if new_path - end - - @blob.data - end - - # Public: A text data encoded in specified encoding. - # - # encoding - An Encoding or nil - # - # Returns a character encoding aware String. - def text_data(encoding=nil) - if raw_data.respond_to?(:encoding) - raw_data.force_encoding(encoding || Encoding::UTF_8) - else - raw_data - end - end - - # Public: The formatted contents of the page. - # - # encoding - Encoding Constant or String. - # - # Returns the String data. - def formatted_data(encoding = nil, &block) - @blob && markup_class.render(historical?, encoding) do |doc| - @doc = doc - yield doc if block_given? - end - end - - # Public: The table of contents of the page. - # - # formatted_data - page already marked up in html. - # - # Returns the String data. - def toc_data() - return @parent_page.toc_data if @parent_page and @sub_page - formatted_data if markup_class.toc == nil - markup_class.toc - end - - # Public: Embedded metadata. - # - # Returns Hash of metadata. - def metadata() - formatted_data if markup_class.metadata == nil - markup_class.metadata - end - - # Public: The format of the page. - # - # Returns the Symbol format of the page; one of the registered format types - def format - self.class.format_for(@blob.name) - end - - # Gets the Gollum::Markup instance that will render this page's content. - # - # Returns a Gollum::Markup instance. - def markup_class - @markup_class ||= @wiki.markup_classes[format].new(self) - end - - # Public: The current version of the page. - # - # Returns the Grit::Commit. - attr_reader :version - - # Public: All of the versions that have touched the Page. - # - # options - The options Hash: - # :page - The Integer page number (default: 1). - # :per_page - The Integer max count of items to return. - # :follow - Follow's a file across renames, but falls back - # to a slower Grit native call. (default: false) - # - # Returns an Array of Grit::Commit. - def versions(options = {}) - if options[:follow] - options[:pretty] = 'raw' - options.delete :max_count - options.delete :skip - log = @wiki.repo.git.native "log", options, @wiki.ref, "--", @path - Grit::Commit.list_from_string(@wiki.repo, log) - else - @wiki.repo.log(@wiki.ref, @path, log_pagination_options(options)) - end - end - - # Public: The first 7 characters of the current version. - # - # Returns the first 7 characters of the current version. - def version_short - version.to_s[0,7] - end - - # Public: The header Page. - # - # Returns the header Page or nil if none exists. - def header - @header ||= find_sub_page(:header) - end - - # Public: The footer Page. - # - # Returns the footer Page or nil if none exists. - def footer - @footer ||= find_sub_page(:footer) - end - - # Public: The sidebar Page. - # - # Returns the sidebar Page or nil if none exists. - def sidebar - @sidebar ||= find_sub_page(:sidebar) - end - - # Gets a Boolean determining whether this page is a historical version. - # Historical pages are pulled using exact SHA hashes and format all links - # with rel="nofollow" - # - # Returns true if the page is pulled from a named branch or tag, or false. - def historical? - !!@historical - end - - ######################################################################### - # - # Class Methods - # - ######################################################################### - - # Convert a human page name into a canonical page name. - # - # name - The String human page name. - # char_white_sub - Substitution for whitespace - # char_other_sub - Substitution for other special chars - # - # Examples - # - # Page.cname("Bilbo Baggins") - # # => 'Bilbo-Baggins' - # - # Page.cname("Bilbo Baggins",'_') - # # => 'Bilbo_Baggins' - # - # Returns the String canonical name. - def self.cname(name, char_white_sub = '-', char_other_sub = '-') - name.respond_to?(:gsub) ? - name.gsub(%r{\s},char_white_sub).gsub(%r{[<>+]}, char_other_sub) : - '' - end - - # Convert a format Symbol into an extension String. - # - # format - The format Symbol. - # - # Returns the String extension (no leading period). - def self.format_to_ext(format) - format == :markdown ? "md" : format.to_s - end - - ######################################################################### - # - # Internal Methods - # - ######################################################################### - - # The underlying wiki repo. - # - # Returns the Gollum::Wiki containing the page. - attr_reader :wiki - - # Set the Grit::Commit version of the page. - # - # Returns nothing. - attr_writer :version - - # Find a page in the given Gollum repo. - # - # name - The human or canonical String page name to find. - # version - The String version ID to find. - # - # Returns a Gollum::Page or nil if the page could not be found. - def find(name, version, dir = nil, exact = false) - map = @wiki.tree_map_for(version.to_s) - if page = find_page_in_tree(map, name, dir, exact) - page.version = version.is_a?(Grit::Commit) ? - version : @wiki.commit_for(version) - page.historical = page.version.to_s == version.to_s - page - end - rescue Grit::GitRuby::Repository::NoSuchShaFound - end - - # Find a page in a given tree. - # - # map - The Array tree map from Wiki#tree_map. - # name - The canonical String page name. - # checked_dir - Optional String of the directory a matching page needs - # to be in. The string should - # - # Returns a Gollum::Page or nil if the page could not be found. - def find_page_in_tree(map, name, checked_dir = nil, exact = false) - return nil if !map || name.to_s.empty? - if checked_dir = BlobEntry.normalize_dir(checked_dir) - checked_dir.downcase! - end - - checked_dir = '' if exact && checked_dir.nil? - - map.each do |entry| - next if entry.name.to_s.empty? - next unless checked_dir.nil? || entry.dir.downcase == checked_dir - next unless page_match(name, entry.name) - return entry.page(@wiki, @version) - end - - return nil # nothing was found - end - - # Populate the Page with information from the Blob. - # - # blob - The Grit::Blob that contains the info. - # path - The String directory path of the page file. - # - # Returns the populated Gollum::Page. - def populate(blob, path=nil) - @blob = blob - @path = "#{path}/#{blob.name}"[1..-1] - self - end - - # The full directory path for the given tree. - # - # treemap - The Hash treemap containing parentage information. - # tree - The Grit::Tree for which to compute the path. - # - # Returns the String path. - def tree_path(treemap, tree) - if ptree = treemap[tree] - tree_path(treemap, ptree) + '/' + tree.name - else - '' - end - end - - # Compare the canonicalized versions of the two names. - # - # name - The human or canonical String page name. - # filename - the String filename on disk (including extension). - # - # Returns a Boolean. - def page_match(name, filename) - if match = self.class.valid_filename?(filename) - @wiki.ws_subs.each do |sub| - return true if Page.cname(name).downcase == Page.cname(match, sub).downcase - end - end - false - end - - # Loads a sub page. Sub page names (footers, headers, sidebars) are prefixed with - # an underscore to distinguish them from other Pages. If there is not one within - # the current directory, starts walking up the directory tree to try and find one - # within parent directories. - # - # name - String page name. - # - # Returns the Page or nil if none exists. - def find_sub_page(name) - return nil unless self.version - return nil if self.filename =~ /^_/ - name = "_#{name.to_s.capitalize}" - return nil if page_match(name, self.filename) - - dirs = self.path.split('/') - dirs.pop - map = @wiki.tree_map_for(@wiki.ref, true) - while !dirs.empty? - if page = find_page_in_tree(map, name, dirs.join('/')) - page.parent_page = self - return page - end - dirs.pop - end - - if page = find_page_in_tree(map, name, '') - page.parent_page = self - end - page - end - - def inspect - %(#<#{self.class.name}:#{object_id} #{name} (#{format}) @wiki=#{@wiki.repo.path.inspect}>) - end - end -end diff --git a/lib/gollum/pagination.rb b/lib/gollum/pagination.rb deleted file mode 100644 index c1f7621d..00000000 --- a/lib/gollum/pagination.rb +++ /dev/null @@ -1,62 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - module Pagination - def self.included(klass) - klass.extend ClassMethods - class << klass - # Default Integer max count of items to return in git commands. - attr_accessor :per_page - end - klass.per_page = 30 - end - - module ClassMethods - # Turns a page number into an offset number for the git skip option. - # - # page - Integer page number. - # - # Returns an Integer. - def page_to_skip(page) - ([1, page.to_i].max - 1) * per_page - end - - # Fills in git-specific options for the log command using simple - # pagination options. - # - # options - Hash of options: - # page - Optional Integer page number (default: 1) - # per_page - Optional Integer max count of items to return. - # Defaults to #per_class class method. - # - # Returns Hash with :max_count and :skip keys. - def log_pagination_options(options = {}) - skip = page_to_skip(options.delete(:page)) - options[:max_count] = [options.delete(:per_page).to_i, per_page].max - options[:skip] = skip if skip > 0 - options - end - end - - # Turns a page number into an offset number for the git skip option. - # - # page - Integer page number. - # - # Returns an Integer. - def page_to_skip(page) - self.class.page_to_skip(page) - end - - # Fills in git-specific options for the log command using simple - # pagination options. - # - # options - Hash of options: - # page - Optional Integer page number (default: 1) - # per_page - Optional Integer max count of items to return. - # Defaults to #per_class class method. - # - # Returns Hash with :max_count and :skip keys. - def log_pagination_options(options = {}) - self.class.log_pagination_options(options) - end - end -end diff --git a/lib/gollum/frontend/public/gollum/css/_styles.css b/lib/gollum/public/gollum/css/_styles.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/_styles.css rename to lib/gollum/public/gollum/css/_styles.css diff --git a/lib/gollum/frontend/public/gollum/css/dialog.css b/lib/gollum/public/gollum/css/dialog.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/dialog.css rename to lib/gollum/public/gollum/css/dialog.css diff --git a/lib/gollum/frontend/public/gollum/css/editor.css b/lib/gollum/public/gollum/css/editor.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/editor.css rename to lib/gollum/public/gollum/css/editor.css diff --git a/lib/gollum/frontend/public/gollum/css/gollum.css b/lib/gollum/public/gollum/css/gollum.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/gollum.css rename to lib/gollum/public/gollum/css/gollum.css diff --git a/lib/gollum/frontend/public/gollum/css/ie7.css b/lib/gollum/public/gollum/css/ie7.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/ie7.css rename to lib/gollum/public/gollum/css/ie7.css diff --git a/lib/gollum/frontend/public/gollum/css/template.css b/lib/gollum/public/gollum/css/template.css similarity index 100% rename from lib/gollum/frontend/public/gollum/css/template.css rename to lib/gollum/public/gollum/css/template.css diff --git a/lib/gollum/frontend/public/gollum/images/dirty-shade.png b/lib/gollum/public/gollum/images/dirty-shade.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/dirty-shade.png rename to lib/gollum/public/gollum/images/dirty-shade.png diff --git a/lib/gollum/frontend/public/gollum/images/fileview/document.png b/lib/gollum/public/gollum/images/fileview/document.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/fileview/document.png rename to lib/gollum/public/gollum/images/fileview/document.png diff --git a/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png b/lib/gollum/public/gollum/images/fileview/folder-horizontal.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png rename to lib/gollum/public/gollum/images/fileview/folder-horizontal.png diff --git a/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png b/lib/gollum/public/gollum/images/fileview/toggle-small-expand.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png rename to lib/gollum/public/gollum/images/fileview/toggle-small-expand.png diff --git a/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png b/lib/gollum/public/gollum/images/fileview/toggle-small.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png rename to lib/gollum/public/gollum/images/fileview/toggle-small.png diff --git a/lib/gollum/frontend/public/gollum/images/icon-sprite.png b/lib/gollum/public/gollum/images/icon-sprite.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/icon-sprite.png rename to lib/gollum/public/gollum/images/icon-sprite.png diff --git a/lib/gollum/frontend/public/gollum/images/man_24.png b/lib/gollum/public/gollum/images/man_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/man_24.png rename to lib/gollum/public/gollum/images/man_24.png diff --git a/lib/gollum/frontend/public/gollum/images/para.png b/lib/gollum/public/gollum/images/para.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/para.png rename to lib/gollum/public/gollum/images/para.png diff --git a/lib/gollum/frontend/public/gollum/images/pin-16.png b/lib/gollum/public/gollum/images/pin-16.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/pin-16.png rename to lib/gollum/public/gollum/images/pin-16.png diff --git a/lib/gollum/frontend/public/gollum/images/pin-20.png b/lib/gollum/public/gollum/images/pin-20.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/pin-20.png rename to lib/gollum/public/gollum/images/pin-20.png diff --git a/lib/gollum/frontend/public/gollum/images/pin-24.png b/lib/gollum/public/gollum/images/pin-24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/pin-24.png rename to lib/gollum/public/gollum/images/pin-24.png diff --git a/lib/gollum/frontend/public/gollum/images/pin-32.png b/lib/gollum/public/gollum/images/pin-32.png similarity index 100% rename from lib/gollum/frontend/public/gollum/images/pin-32.png rename to lib/gollum/public/gollum/images/pin-32.png diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js b/lib/gollum/public/gollum/javascript/editor/gollum.editor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js rename to lib/gollum/public/gollum/javascript/editor/gollum.editor.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js b/lib/gollum/public/gollum/javascript/editor/langs/asciidoc.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js rename to lib/gollum/public/gollum/javascript/editor/langs/asciidoc.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js b/lib/gollum/public/gollum/javascript/editor/langs/creole.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js rename to lib/gollum/public/gollum/javascript/editor/langs/creole.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js b/lib/gollum/public/gollum/javascript/editor/langs/markdown.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js rename to lib/gollum/public/gollum/javascript/editor/langs/markdown.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js b/lib/gollum/public/gollum/javascript/editor/langs/org.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js rename to lib/gollum/public/gollum/javascript/editor/langs/org.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js b/lib/gollum/public/gollum/javascript/editor/langs/pod.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js rename to lib/gollum/public/gollum/javascript/editor/langs/pod.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/rdoc.js b/lib/gollum/public/gollum/javascript/editor/langs/rdoc.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/rdoc.js rename to lib/gollum/public/gollum/javascript/editor/langs/rdoc.js diff --git a/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js b/lib/gollum/public/gollum/javascript/editor/langs/textile.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js rename to lib/gollum/public/gollum/javascript/editor/langs/textile.js diff --git a/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js b/lib/gollum/public/gollum/javascript/gollum.dialog.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js rename to lib/gollum/public/gollum/javascript/gollum.dialog.js diff --git a/lib/gollum/frontend/public/gollum/javascript/gollum.js b/lib/gollum/public/gollum/javascript/gollum.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/gollum.js rename to lib/gollum/public/gollum/javascript/gollum.js diff --git a/lib/gollum/frontend/public/gollum/javascript/gollum.placeholder.js b/lib/gollum/public/gollum/javascript/gollum.placeholder.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/gollum.placeholder.js rename to lib/gollum/public/gollum/javascript/gollum.placeholder.js diff --git a/lib/gollum/frontend/public/gollum/javascript/identicon_canvas.js b/lib/gollum/public/gollum/javascript/identicon_canvas.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/identicon_canvas.js rename to lib/gollum/public/gollum/javascript/identicon_canvas.js diff --git a/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js b/lib/gollum/public/gollum/javascript/jquery-1.7.2.min.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js rename to lib/gollum/public/gollum/javascript/jquery-1.7.2.min.js diff --git a/lib/gollum/frontend/public/gollum/javascript/jquery.color.js b/lib/gollum/public/gollum/javascript/jquery.color.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/jquery.color.js rename to lib/gollum/public/gollum/javascript/jquery.color.js diff --git a/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js b/lib/gollum/public/gollum/javascript/mousetrap.min.js similarity index 100% rename from lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js rename to lib/gollum/public/gollum/javascript/mousetrap.min.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/css/custom.css b/lib/gollum/public/gollum/livepreview/css/custom.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/css/custom.css rename to lib/gollum/public/gollum/livepreview/css/custom.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png b/lib/gollum/public/gollum/livepreview/images/cancel_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png rename to lib/gollum/public/gollum/livepreview/images/cancel_24.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/images/globe_24.png b/lib/gollum/public/gollum/livepreview/images/globe_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/images/globe_24.png rename to lib/gollum/public/gollum/livepreview/images/globe_24.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png b/lib/gollum/public/gollum/livepreview/images/lr_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png rename to lib/gollum/public/gollum/livepreview/images/lr_24.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png b/lib/gollum/public/gollum/livepreview/images/save_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/images/save_24.png rename to lib/gollum/public/gollum/livepreview/images/save_24.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png b/lib/gollum/public/gollum/livepreview/images/savecomment_24.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png rename to lib/gollum/public/gollum/livepreview/images/savecomment_24.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/index.html b/lib/gollum/public/gollum/livepreview/index.html similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/index.html rename to lib/gollum/public/gollum/livepreview/index.html diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ace.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/config_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/editor.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/editor.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/document_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/net.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/net.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/package.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/test_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/text_javascript.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c9search.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_c_cpp.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_clojure.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coffee.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_coldfusion.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_csharp.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_css.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_diff.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_glsl.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_golang.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_groovy.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_haxe.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_html.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_java.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_javascript.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_json.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_jsx.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_latex.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_less.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_liquid.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_lua.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_luapage.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_markdown.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ocaml.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_perl.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_pgsql.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_php.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_powershell.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_python.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_ruby.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scad.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scala.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_scss.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sh.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_sql.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_svg.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_tcl.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_text.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_textile.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xml.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_xquery.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/_test/tokens_yaml.json diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/abap_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/asciidoc_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/dart_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/asciidoc.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/latex.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/lua.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/markdown.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/glsl_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haml_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jade_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript/jshint.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsp_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lisp_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/lucene_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/makefile_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/objectivec_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/r_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rdoc_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/rhtml_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/stylus_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tcl_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/tex_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/typescript_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/JSONParseTreeHandler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/visitors/SyntaxHighlighter.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/model/editor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/model/editor.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/range_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/renderloop.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/renderloop.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/search_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/selection_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/split.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/test/tests.html diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/ambiance.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/github.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.css diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/theme/xcode.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/tokenizer_dev.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/undomanager.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/unicode.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js b/lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js rename to lib/gollum/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js b/lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js rename to lib/gollum/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js b/lib/gollum/public/gollum/livepreview/js/livepreview.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js rename to lib/gollum/public/gollum/livepreview/js/livepreview.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js b/lib/gollum/public/gollum/livepreview/js/md_sundown.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js rename to lib/gollum/public/gollum/livepreview/js/md_sundown.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js b/lib/gollum/public/gollum/livepreview/js/requirejs.min.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js rename to lib/gollum/public/gollum/livepreview/js/requirejs.min.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js b/lib/gollum/public/gollum/livepreview/js/sundown.js similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/js/sundown.js rename to lib/gollum/public/gollum/livepreview/js/sundown.js diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/ace/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/ace/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt b/lib/gollum/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt rename to lib/gollum/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/gollum/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/gollum/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt b/lib/gollum/public/gollum/livepreview/licenses/licenses.txt similarity index 69% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt rename to lib/gollum/public/gollum/livepreview/licenses/licenses.txt index f0097112..d4d98ee2 100644 --- a/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +++ b/lib/gollum/public/gollum/livepreview/licenses/licenses.txt @@ -2,7 +2,7 @@ Ajaxorg Ace is used under the New BSD License https://github.com/ajaxorg/ace/blob/master/LICENSE https://github.com/ajaxorg/ace (build folder in master) - lib/gollum/frontend/public/gollum/livepreview/js/ace/* + lib/gollum/public/gollum/livepreview/js/ace/* --- Fivesixty Notepages (MIT license) @@ -10,15 +10,15 @@ https://github.com/fivesixty/notepages/blob/master/LICENSE --- -Save icon from notepag.es repo originally from blog.twg.ca (lib/gollum/frontend/public/images/save_24.png) +Save icon from notepag.es repo originally from blog.twg.ca (lib/gollum/public/images/save_24.png) CC BY-SA 3.0 Unported http://blog.twg.ca/2010/11/retina-display-icon-set/ http://creativecommons.org/licenses/by-sa/3.0/legalcode.txt - lib/gollum/frontend/public/images/savecomment_24.png - lib/gollum/frontend/public/images/cancel_24.png - lib/gollum/frontend/public/images/save_24.png - lib/gollum/frontend/public/images/globe_24.png + lib/gollum/public/images/savecomment_24.png + lib/gollum/public/images/cancel_24.png + lib/gollum/public/images/save_24.png + lib/gollum/public/images/globe_24.png --- @@ -32,7 +32,7 @@ jQuery is used under the MIT License http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt jQuery.com - lib/gollum/frontend/public/jquery-1.7.js + lib/gollum/public/jquery-1.7.js --- @@ -47,10 +47,10 @@ The following PNGs are based on Ubuntu 11.10 SVG files located in /usr/share/ico - group-files.svg - group-downloads.svg - lib/gollum/frontend/public/css/document.png - lib/gollum/frontend/public/css/folder-horizontal.png - lib/gollum/frontend/public/css/toggle-small-expand.png - lib/gollum/frontend/public/css/toggle-small.png + lib/gollum/public/css/document.png + lib/gollum/public/css/folder-horizontal.png + lib/gollum/public/css/toggle-small-expand.png + lib/gollum/public/css/toggle-small.png --- @@ -59,7 +59,7 @@ The css-tree-menu code is used under the MIT license. http://www.thecssninja.com/css/css-tree-menu http://www.thecssninja.com/demo/license.txt - lib/gollum/frontend/public/css/_styles.css + lib/gollum/public/css/_styles.css --- diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/notepages/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/notepages/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/requirejs/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/requirejs/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt b/lib/gollum/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt rename to lib/gollum/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt b/lib/gollum/public/gollum/livepreview/licenses/sizzle/LICENSE.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt rename to lib/gollum/public/gollum/livepreview/licenses/sizzle/LICENSE.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt b/lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt rename to lib/gollum/public/gollum/livepreview/licenses/sundown/sundown.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt b/lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt rename to lib/gollum/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt diff --git a/lib/gollum/frontend/public/gollum/livepreview/readme.md b/lib/gollum/public/gollum/livepreview/readme.md similarity index 100% rename from lib/gollum/frontend/public/gollum/livepreview/readme.md rename to lib/gollum/public/gollum/livepreview/readme.md diff --git a/lib/gollum/sanitization.rb b/lib/gollum/sanitization.rb deleted file mode 100644 index 11049761..00000000 --- a/lib/gollum/sanitization.rb +++ /dev/null @@ -1,176 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - # Encapsulate sanitization options. - # - # This class does not yet support all options of Sanitize library. - # See http://github.com/rgrove/sanitize/. - class Sanitization - # Default whitelisted elements. - ELEMENTS = [ - 'a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', - 'blockquote', 'br', 'button', 'caption', 'center', 'cite', - 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', - 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'form', 'h1', - 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', - 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', - 'ol', 'optgroup', 'option', 'p', 'pre', 'q', 's', 'samp', - 'select', 'small', 'span', 'strike', 'strong', 'sub', - 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', - 'thead', 'tr', 'tt', 'u', 'ul', 'var' - ].freeze - - # Default whitelisted attributes. - ATTRIBUTES = { - 'a' => ['href'], - 'img' => ['src'], - :all => ['abbr', 'accept', 'accept-charset', - 'accesskey', 'action', 'align', 'alt', 'axis', - 'border', 'cellpadding', 'cellspacing', 'char', - 'charoff', 'class', 'charset', 'checked', 'cite', - 'clear', 'cols', 'colspan', 'color', - 'compact', 'coords', 'datetime', 'dir', - 'disabled', 'enctype', 'for', 'frame', - 'headers', 'height', 'hreflang', - 'hspace', 'id', 'ismap', 'label', 'lang', - 'longdesc', 'maxlength', 'media', 'method', - 'multiple', 'name', 'nohref', 'noshade', - 'nowrap', 'prompt', 'readonly', 'rel', 'rev', - 'rows', 'rowspan', 'rules', 'scope', - 'selected', 'shape', 'size', 'span', - 'start', 'summary', 'tabindex', 'target', - 'title', 'type', 'usemap', 'valign', 'value', - 'vspace', 'width'] - }.freeze - - # Default whitelisted protocols for URLs. - PROTOCOLS = { - 'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', 'apt', :relative]}, - 'img' => {'src' => ['http', 'https', :relative]}, - 'form' => {'action' => ['http', 'https', :relative]} - }.freeze - - ADD_ATTRIBUTES = lambda do |env, node| - if add = env[:config][:add_attributes][node.name] - add.each do |key, value| - node[key] = value - end - end - end - - # Default elements whose contents will be removed in addition - # to the elements themselve - REMOVE_CONTENTS = [ - 'script', - 'style' - ].freeze - - # Default transformers to force @id attributes with 'wiki-' prefix - TRANSFORMERS = [ - lambda do |env| - node = env[:node] - return if env[:is_whitelisted] || !node.element? - prefix = env[:config][:id_prefix] - found_attrs = %w(id name).select do |key| - if value = node[key] - node[key] = value.gsub(/\A(#{prefix})?/, prefix) - end - end - if found_attrs.size > 0 - ADD_ATTRIBUTES.call(env, node) - {} - end - end, - lambda do |env| - node = env[:node] - return unless value = node['href'] - prefix = env[:config][:id_prefix] - node['href'] = value.gsub(/\A\#(#{prefix})?/, '#'+prefix) - ADD_ATTRIBUTES.call(env, node) - {} - end - ].freeze - - # Gets an Array of whitelisted HTML elements. Default: ELEMENTS. - attr_reader :elements - - # Gets a Hash describing which attributes are allowed in which HTML - # elements. Default: ATTRIBUTES. - attr_reader :attributes - - # Gets a Hash describing which URI protocols are allowed in HTML - # attributes. Default: PROTOCOLS - attr_reader :protocols - - # Gets a Hash describing which URI protocols are allowed in HTML - # attributes. Default: TRANSFORMERS - attr_reader :transformers - - # Gets or sets a String prefix which is added to ID attributes. - # Default: '' - attr_accessor :id_prefix - - # Gets a Hash describing HTML attributes that Sanitize should add. - # Default: {} - attr_reader :add_attributes - - # Gets an Array of element names whose contents will be removed in addition - # to the elements themselves. Default: REMOVE_CONTENTS - attr_reader :remove_contents - - # Sets a boolean determining whether Sanitize allows HTML comments in the - # output. Default: false. - attr_writer :allow_comments - - def initialize - @elements = ELEMENTS.dup - @attributes = ATTRIBUTES.dup - @protocols = PROTOCOLS.dup - @transformers = TRANSFORMERS.dup - @add_attributes = {} - @remove_contents = REMOVE_CONTENTS.dup - @allow_comments = false - @id_prefix = '' - yield self if block_given? - end - - # Determines if Sanitize should allow HTML comments. - # - # Returns True if comments are allowed, or False. - def allow_comments? - !!@allow_comments - end - - # Modifies the current Sanitization instance to sanitize older revisions - # of pages. - # - # Returns a Sanitization instance. - def history_sanitization - self.class.new do |sanitize| - sanitize.add_attributes['a'] = {'rel' => 'nofollow'} - end - end - - # Builds a Hash of options suitable for Sanitize.clean. - # - # Returns a Hash. - def to_hash - { :elements => elements, - :attributes => attributes, - :protocols => protocols, - :add_attributes => add_attributes, - :remove_contents => remove_contents, - :allow_comments => allow_comments?, - :transformers => transformers, - :id_prefix => id_prefix - } - end - - # Builds a Sanitize instance from the current options. - # - # Returns a Sanitize instance. - def to_sanitize - Sanitize.new(to_hash) - end - end -end - diff --git a/lib/gollum/frontend/templates/compare.mustache b/lib/gollum/templates/compare.mustache similarity index 100% rename from lib/gollum/frontend/templates/compare.mustache rename to lib/gollum/templates/compare.mustache diff --git a/lib/gollum/frontend/templates/create.mustache b/lib/gollum/templates/create.mustache similarity index 100% rename from lib/gollum/frontend/templates/create.mustache rename to lib/gollum/templates/create.mustache diff --git a/lib/gollum/frontend/templates/edit.mustache b/lib/gollum/templates/edit.mustache similarity index 100% rename from lib/gollum/frontend/templates/edit.mustache rename to lib/gollum/templates/edit.mustache diff --git a/lib/gollum/frontend/templates/editor.mustache b/lib/gollum/templates/editor.mustache similarity index 100% rename from lib/gollum/frontend/templates/editor.mustache rename to lib/gollum/templates/editor.mustache diff --git a/lib/gollum/frontend/templates/error.mustache b/lib/gollum/templates/error.mustache similarity index 100% rename from lib/gollum/frontend/templates/error.mustache rename to lib/gollum/templates/error.mustache diff --git a/lib/gollum/frontend/templates/file_view.mustache b/lib/gollum/templates/file_view.mustache similarity index 100% rename from lib/gollum/frontend/templates/file_view.mustache rename to lib/gollum/templates/file_view.mustache diff --git a/lib/gollum/frontend/templates/history.mustache b/lib/gollum/templates/history.mustache similarity index 100% rename from lib/gollum/frontend/templates/history.mustache rename to lib/gollum/templates/history.mustache diff --git a/lib/gollum/frontend/templates/history_authors/gravatar.mustache b/lib/gollum/templates/history_authors/gravatar.mustache similarity index 100% rename from lib/gollum/frontend/templates/history_authors/gravatar.mustache rename to lib/gollum/templates/history_authors/gravatar.mustache diff --git a/lib/gollum/frontend/templates/history_authors/identicon.mustache b/lib/gollum/templates/history_authors/identicon.mustache similarity index 100% rename from lib/gollum/frontend/templates/history_authors/identicon.mustache rename to lib/gollum/templates/history_authors/identicon.mustache diff --git a/lib/gollum/frontend/templates/history_authors/none.mustache b/lib/gollum/templates/history_authors/none.mustache similarity index 100% rename from lib/gollum/frontend/templates/history_authors/none.mustache rename to lib/gollum/templates/history_authors/none.mustache diff --git a/lib/gollum/frontend/templates/layout.mustache b/lib/gollum/templates/layout.mustache similarity index 100% rename from lib/gollum/frontend/templates/layout.mustache rename to lib/gollum/templates/layout.mustache diff --git a/lib/gollum/frontend/templates/page.mustache b/lib/gollum/templates/page.mustache similarity index 100% rename from lib/gollum/frontend/templates/page.mustache rename to lib/gollum/templates/page.mustache diff --git a/lib/gollum/frontend/templates/pages.mustache b/lib/gollum/templates/pages.mustache similarity index 100% rename from lib/gollum/frontend/templates/pages.mustache rename to lib/gollum/templates/pages.mustache diff --git a/lib/gollum/frontend/templates/search.mustache b/lib/gollum/templates/search.mustache similarity index 100% rename from lib/gollum/frontend/templates/search.mustache rename to lib/gollum/templates/search.mustache diff --git a/lib/gollum/frontend/templates/searchbar.mustache b/lib/gollum/templates/searchbar.mustache similarity index 100% rename from lib/gollum/frontend/templates/searchbar.mustache rename to lib/gollum/templates/searchbar.mustache diff --git a/lib/gollum/frontend/uri_encode_component.rb b/lib/gollum/uri_encode_component.rb similarity index 100% rename from lib/gollum/frontend/uri_encode_component.rb rename to lib/gollum/uri_encode_component.rb diff --git a/lib/gollum/frontend/views/compare.rb b/lib/gollum/views/compare.rb similarity index 100% rename from lib/gollum/frontend/views/compare.rb rename to lib/gollum/views/compare.rb diff --git a/lib/gollum/frontend/views/create.rb b/lib/gollum/views/create.rb similarity index 100% rename from lib/gollum/frontend/views/create.rb rename to lib/gollum/views/create.rb diff --git a/lib/gollum/frontend/views/edit.rb b/lib/gollum/views/edit.rb similarity index 100% rename from lib/gollum/frontend/views/edit.rb rename to lib/gollum/views/edit.rb diff --git a/lib/gollum/frontend/views/editable.rb b/lib/gollum/views/editable.rb similarity index 100% rename from lib/gollum/frontend/views/editable.rb rename to lib/gollum/views/editable.rb diff --git a/lib/gollum/frontend/views/error.rb b/lib/gollum/views/error.rb similarity index 100% rename from lib/gollum/frontend/views/error.rb rename to lib/gollum/views/error.rb diff --git a/lib/gollum/frontend/views/file_view.rb b/lib/gollum/views/file_view.rb similarity index 100% rename from lib/gollum/frontend/views/file_view.rb rename to lib/gollum/views/file_view.rb diff --git a/lib/gollum/frontend/views/has_page.rb b/lib/gollum/views/has_page.rb similarity index 100% rename from lib/gollum/frontend/views/has_page.rb rename to lib/gollum/views/has_page.rb diff --git a/lib/gollum/frontend/views/history.rb b/lib/gollum/views/history.rb similarity index 100% rename from lib/gollum/frontend/views/history.rb rename to lib/gollum/views/history.rb diff --git a/lib/gollum/frontend/views/layout.rb b/lib/gollum/views/layout.rb similarity index 100% rename from lib/gollum/frontend/views/layout.rb rename to lib/gollum/views/layout.rb diff --git a/lib/gollum/frontend/views/page.rb b/lib/gollum/views/page.rb similarity index 100% rename from lib/gollum/frontend/views/page.rb rename to lib/gollum/views/page.rb diff --git a/lib/gollum/frontend/views/pages.rb b/lib/gollum/views/pages.rb similarity index 100% rename from lib/gollum/frontend/views/pages.rb rename to lib/gollum/views/pages.rb diff --git a/lib/gollum/frontend/views/search.rb b/lib/gollum/views/search.rb similarity index 100% rename from lib/gollum/frontend/views/search.rb rename to lib/gollum/views/search.rb diff --git a/lib/gollum/web_sequence_diagram.rb b/lib/gollum/web_sequence_diagram.rb deleted file mode 100644 index 0125ef2c..00000000 --- a/lib/gollum/web_sequence_diagram.rb +++ /dev/null @@ -1,44 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require 'net/http' -require 'uri' -require 'open-uri' - -class Gollum::WebSequenceDiagram - WSD_URL = "http://www.websequencediagrams.com/index.php" - - # Initialize a new WebSequenceDiagram object. - # - # code - The String containing the sequence diagram markup. - # style - The String containing the rendering style. - # - # Returns a new Gollum::WebSequenceDiagram object - def initialize(code, style) - @code = code - @style = style - @tag = "" - - render - end - - # Render the sequence diagram on the remote server and store the url to - # the rendered image. - # - # Returns nil. - def render - response = Net::HTTP.post_form(URI.parse(WSD_URL), 'style' => @style, 'message' => @code) - if response.body =~ /img: "(.+)"/ - url = "http://www.websequencediagrams.com/#{$1}" - @tag = "" - else - puts response.body - @tag ="Sorry, unable to render sequence diagram at this time." - end - end - - # Gets the HTML IMG tag for the sequence diagram. - # - # Returns a String containing the IMG tag. - def to_tag - @tag - end -end diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb deleted file mode 100644 index 967eccf9..00000000 --- a/lib/gollum/wiki.rb +++ /dev/null @@ -1,833 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -module Gollum - class Wiki - include Pagination - - class << self - # Sets the page class used by all instances of this Wiki. - attr_writer :page_class - - # Sets the file class used by all instances of this Wiki. - attr_writer :file_class - - # Sets the markup class used by all instances of this Wiki. - attr_writer :markup_classes - - # Sets the default ref for the wiki. - attr_accessor :default_ref - - # Sets the default name for commits. - attr_accessor :default_committer_name - - # Sets the default email for commits. - attr_accessor :default_committer_email - - # Array of chars to substitute whitespace for when trying to locate file in git repo. - attr_accessor :default_ws_subs - - # Sets sanitization options. Set to false to deactivate - # sanitization altogether. - attr_writer :sanitization - - # Sets sanitization options. Set to false to deactivate - # sanitization altogether. - attr_writer :history_sanitization - - # Hash for setting different default wiki options - # These defaults can be overridden by options passed directly to initialize() - attr_accessor :default_options - - # Gets the page class used by all instances of this Wiki. - # Default: Gollum::Page. - def page_class - @page_class || - if superclass.respond_to?(:page_class) - superclass.page_class - else - ::Gollum::Page - end - end - - # Gets the file class used by all instances of this Wiki. - # Default: Gollum::File. - def file_class - @file_class || - if superclass.respond_to?(:file_class) - superclass.file_class - else - ::Gollum::File - end - end - - # Gets the markup class used by all instances of this Wiki. - # Default: Gollum::Markup - def markup_classes - @markup_classes ||= - if superclass.respond_to?(:markup_classes) - superclass.markup_classes - else - Hash.new(::Gollum::Markup) - end - end - - # Gets the default markup class used by all instances of this Wiki. - # Kept for backwards compatibility until Gollum v2.x - def markup_class(language=:default) - markup_classes[language] - end - - # Sets the default markup class used by all instances of this Wiki. - # Kept for backwards compatibility until Gollum v2.x - def markup_class=(default) - @markup_classes = Hash.new(default).update(markup_classes) - default - end - - alias_method :default_markup_class, :markup_class - alias_method :default_markup_class=, :markup_class= - - # Gets the default sanitization options for current pages used by - # instances of this Wiki. - def sanitization - if @sanitization.nil? - @sanitization = Sanitization.new - end - @sanitization - end - - # Gets the default sanitization options for older page revisions used by - # instances of this Wiki. - def history_sanitization - if @history_sanitization.nil? - @history_sanitization = sanitization ? - sanitization.history_sanitization : - false - end - @history_sanitization - end - end - - self.default_ref = 'master' - self.default_committer_name = 'Anonymous' - self.default_committer_email = 'anon@anon.com' - - self.default_ws_subs = ['_','-'] - self.default_options = {} - - # The String base path to prefix to internal links. For example, when set - # to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults - # to "/". - attr_reader :base_path - - # Gets the sanitization options for current pages used by this Wiki. - attr_reader :sanitization - - # Gets the sanitization options for older page revisions used by this Wiki. - attr_reader :history_sanitization - - # Gets the String ref in which all page files reside. - attr_reader :ref - - # Gets the String directory in which all page files reside. - attr_reader :page_file_dir - - # Gets the Array of chars to sub for ws in filenames. - attr_reader :ws_subs - - # Gets the boolean live preview value. - attr_reader :live_preview - - # Injects custom css from custom.css in root repo. - # Defaults to false - attr_reader :css - - # Sets page title to value of first h1 - # Defaults to false - attr_reader :h1_title - - # Gets the custom index page for / and subdirs (e.g. foo/) - attr_reader :index_page - - # Gets side on which the sidebar should be shown - attr_reader :bar_side - - # Public: Initialize a new Gollum Repo. - # - # path - The String path to the Git repository that holds the Gollum - # site. - # options - Optional Hash: - # :universal_toc - Table of contents on all pages. Default: false - # :live_preview - Livepreview editing for markdown files. Default: true - # :base_path - String base path for all Wiki links. - # Default: "/" - # :page_class - The page Class. Default: Gollum::Page - # :file_class - The file Class. Default: Gollum::File - # :markup_classes - A hash containing the markup Classes for each - # document type. Default: { Gollum::Markup } - # :sanitization - An instance of Sanitization. - # :page_file_dir - String the directory in which all page files reside - # :ref - String the repository ref to retrieve pages from - # :ws_subs - Array of chars to sub for ws in filenames. - # :mathjax - Set to false to disable mathjax. - # :user_icons - Enable user icons on the history page. [gravatar, identicon, none]. - # Default: none - # :show_all - Show all files in file view, not just valid pages. - # Default: false - # :collapse_tree - Start with collapsed file view. Default: false - # :css - Include the custom.css file from the repo. - # :h1_title - Concatenate all h1's on a page to form the - # page title. - # :index_page - The default page to retrieve or create if the - # a directory is accessed. - # :bar_side - Where the sidebar should be displayed, may be: - # - :left - # - :right - # - # Returns a fresh Gollum::Repo. - def initialize(path, options = {}) - options = self.class.default_options.merge(options) - if path.is_a?(GitAccess) - options[:access] = path - path = path.path - end - - # Use .fetch instead of || - # - # o = { :a => false } - # o[:a] || true # => true - # o.fetch :a, true # => false - - @path = path - @repo_is_bare = options.fetch :repo_is_bare, nil - @page_file_dir = options.fetch :page_file_dir, nil - @access = options.fetch :access, GitAccess.new(path, @page_file_dir, @repo_is_bare) - @base_path = options.fetch :base_path, "/" - @page_class = options.fetch :page_class, self.class.page_class - @file_class = options.fetch :file_class, self.class.file_class - @markup_classes = options.fetch :markup_classes, self.class.markup_classes - @repo = @access.repo - @ref = options.fetch :ref, self.class.default_ref - @sanitization = options.fetch :sanitization, self.class.sanitization - @ws_subs = options.fetch :ws_subs, self.class.default_ws_subs - @history_sanitization = options.fetch :history_sanitization, self.class.history_sanitization - @live_preview = options.fetch :live_preview, true - @universal_toc = options.fetch :universal_toc, false - @mathjax = options.fetch :mathjax, false - @show_all = options.fetch :show_all, false - @collapse_tree = options.fetch :collapse_tree, false - @css = options.fetch :css, false - @h1_title = options.fetch :h1_title, false - @index_page = options.fetch :index_page, 'Home' - @bar_side = options.fetch :sidebar, :right - @user_icons = ['gravatar', 'identicon'].include?( options[:user_icons] ) ? - options[:user_icons] : 'none' - end - - # Public: check whether the wiki's git repo exists on the filesystem. - # - # Returns true if the repo exists, and false if it does not. - def exist? - @access.exist? - end - - # Public: Get the formatted page for a given page name, version, and dir. - # - # name - The human or canonical String page name of the wiki page. - # version - The String version ID to find (default: @ref). - # dir - The directory String relative to the repo. - # - # Returns a Gollum::Page or nil if no matching page was found. - def page(name, version = @ref, dir = nil, exact = false) - version = @ref if version.nil? - @page_class.new(self).find(name, version, dir, exact) - end - - # Public: Convenience method instead of calling page(name, nil, dir). - # - # name - The human or canonical String page name of the wiki page. - # version - The String version ID to find (default: @ref). - # dir - The directory String relative to the repo. - # - # Returns a Gollum::Page or nil if no matching page was found. - def paged(name, dir = nil, exact = false, version = @ref) - page(name, version, dir, exact) - end - - # Public: Get the static file for a given name. - # - # name - The full String pathname to the file. - # version - The String version ID to find (default: @ref). - # - # Returns a Gollum::File or nil if no matching file was found. - def file(name, version = @ref) - @file_class.new(self).find(name, version) - end - - # Public: Create an in-memory Page with the given data and format. This - # is useful for previewing what content will look like before committing - # it to the repository. - # - # name - The String name of the page. - # format - The Symbol format of the page. - # data - The new String contents of the page. - # - # Returns the in-memory Gollum::Page. - def preview_page(name, data, format) - page = @page_class.new(self) - ext = @page_class.format_to_ext(format.to_sym) - name = @page_class.cname(name) + '.' + ext - blob = OpenStruct.new(:name => name, :data => data, :is_symlink => false) - page.populate(blob) - page.version = @access.commit('master') - page - end - - # Public: Write a new version of a page to the Gollum repo root. - # - # name - The String name of the page. - # format - The Symbol format of the page. - # data - The new String contents of the page. - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # :tree - Optional String SHA of the tree to create the - # index from. - # :committer - Optional Gollum::Committer instance. If provided, - # assume that this operation is part of batch of - # updates and the commit happens later. - # dir - The String subdirectory of the Gollum::Page without any - # prefix or suffix slashes (e.g. "foo/bar"). - # Returns the String SHA1 of the newly written version, or the - # Gollum::Committer instance if this is part of a batch update. - def write_page(name, format, data, commit = {}, dir = '') - # spaces must be dashes - name.gsub!(' ', '-') - dir.gsub!(' ', '-') - - multi_commit = false - - committer = if obj = commit[:committer] - multi_commit = true - obj - else - Committer.new(self, commit) - end - - filename = Gollum::Page.cname(name) - - committer.add_to_index(dir, filename, format, data) - - committer.after_commit do |index, sha| - @access.refresh - index.update_working_dir(dir, filename, format) - end - - multi_commit ? committer : committer.commit - end - - # Public: Rename an existing page without altering content. - # - # page - The Gollum::Page to update. - # rename - The String extension-less full path of the page (leading '/' is ignored). - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # :tree - Optional String SHA of the tree to create the - # index from. - # :committer - Optional Gollum::Committer instance. If provided, - # assume that this operation is part of batch of - # updates and the commit happens later. - # - # Returns the String SHA1 of the newly written version, or the - # Gollum::Committer instance if this is part of a batch update. - # Returns false if the operation is a NOOP. - def rename_page(page, rename, commit = {}) - return false if page.nil? - return false if rename.nil? or rename.empty? - - (target_dir, target_name) = ::File.split(rename) - (source_dir, source_name) = ::File.split(page.path) - source_name = page.filename_stripped - - # File.split gives us relative paths with ".", commiter.add_to_index doesn't like that. - target_dir = '' if target_dir == '.' - source_dir = '' if source_dir == '.' - target_dir = target_dir.gsub(/^\//, '') - - # if the rename is a NOOP, abort - if source_dir == target_dir and source_name == target_name - return false - end - - multi_commit = false - committer = if obj = commit[:committer] - multi_commit = true - obj - else - Committer.new(self, commit) - end - - committer.delete(page.path) - committer.add_to_index(target_dir, target_name, page.format, page.raw_data, :allow_same_ext) - - committer.after_commit do |index, sha| - @access.refresh - index.update_working_dir(source_dir, source_name, page.format) - index.update_working_dir(target_dir, target_name, page.format) - end - - multi_commit ? committer : committer.commit - end - - # Public: Update an existing page with new content. The location of the - # page inside the repository will not change. If the given format is - # different than the current format of the page, the filename will be - # changed to reflect the new format. - # - # page - The Gollum::Page to update. - # name - The String extension-less name of the page. - # format - The Symbol format of the page. - # data - The new String contents of the page. - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # :tree - Optional String SHA of the tree to create the - # index from. - # :committer - Optional Gollum::Committer instance. If provided, - # assume that this operation is part of batch of - # updates and the commit happens later. - # - # Returns the String SHA1 of the newly written version, or the - # Gollum::Committer instance if this is part of a batch update. - def update_page(page, name, format, data, commit = {}) - name ||= page.name - format ||= page.format - dir = ::File.dirname(page.path) - dir = '' if dir == '.' - filename = (rename = page.name != name) ? - Gollum::Page.cname(name) : page.filename_stripped - - multi_commit = false - - committer = if obj = commit[:committer] - multi_commit = true - obj - else - Committer.new(self, commit) - end - - if !rename && page.format == format - committer.add(page.path, normalize(data)) - else - committer.delete(page.path) - committer.add_to_index(dir, filename, format, data, :allow_same_ext) - end - - committer.after_commit do |index, sha| - @access.refresh - index.update_working_dir(dir, page.filename_stripped, page.format) - index.update_working_dir(dir, filename, format) - end - - multi_commit ? committer : committer.commit - end - - # Public: Delete a page. - # - # page - The Gollum::Page to delete. - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # :tree - Optional String SHA of the tree to create the - # index from. - # :committer - Optional Gollum::Committer instance. If provided, - # assume that this operation is part of batch of - # updates and the commit happens later. - # - # Returns the String SHA1 of the newly written version, or the - # Gollum::Committer instance if this is part of a batch update. - def delete_page(page, commit) - multi_commit = false - - committer = if obj = commit[:committer] - multi_commit = true - obj - else - Committer.new(self, commit) - end - - committer.delete(page.path) - - committer.after_commit do |index, sha| - dir = ::File.dirname(page.path) - dir = '' if dir == '.' - - @access.refresh - index.update_working_dir(dir, page.filename_stripped, page.format) - end - - multi_commit ? committer : committer.commit - end - - # Public: Applies a reverse diff for a given page. If only 1 SHA is given, - # the reverse diff will be taken from its parent (^SHA...SHA). If two SHAs - # are given, the reverse diff is taken from SHA1...SHA2. - # - # page - The Gollum::Page to delete. - # sha1 - String SHA1 of the earlier parent if two SHAs are given, - # or the child. - # sha2 - Optional String SHA1 of the child. - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # :parent - Optional Grit::Commit parent to this update. - # - # Returns a String SHA1 of the new commit, or nil if the reverse diff does - # not apply. - def revert_page(page, sha1, sha2 = nil, commit = {}) - if sha2.is_a?(Hash) - commit = sha2 - sha2 = nil - end - - patch = full_reverse_diff_for(page, sha1, sha2) - committer = Committer.new(self, commit) - parent = committer.parents[0] - committer.options[:tree] = @repo.git.apply_patch(parent.sha, patch) - return false unless committer.options[:tree] - committer.after_commit do |index, sha| - @access.refresh - - files = [] - if page - files << [page.path, page.filename_stripped, page.format] - else - # Grit::Diff can't parse reverse diffs.... yet - patch.each_line do |line| - if line =~ %r{^diff --git b/.+? a/(.+)$} - path = $1 - ext = ::File.extname(path) - name = ::File.basename(path, ext) - if format = ::Gollum::Page.format_for(ext) - files << [path, name, format] - end - end - end - end - - files.each do |(path, name, format)| - dir = ::File.dirname(path) - dir = '' if dir == '.' - index.update_working_dir(dir, name, format) - end - end - - committer.commit - end - - # Public: Applies a reverse diff to the repo. If only 1 SHA is given, - # the reverse diff will be taken from its parent (^SHA...SHA). If two SHAs - # are given, the reverse diff is taken from SHA1...SHA2. - # - # sha1 - String SHA1 of the earlier parent if two SHAs are given, - # or the child. - # sha2 - Optional String SHA1 of the child. - # commit - The commit Hash details: - # :message - The String commit message. - # :name - The String author full name. - # :email - The String email address. - # - # Returns a String SHA1 of the new commit, or nil if the reverse diff does - # not apply. - def revert_commit(sha1, sha2 = nil, commit = {}) - revert_page(nil, sha1, sha2, commit) - end - - # Public: Lists all pages for this wiki. - # - # treeish - The String commit ID or ref to find (default: @ref) - # - # Returns an Array of Gollum::Page instances. - def pages(treeish = nil) - tree_list(treeish || @ref) - end - - # Public: Lists all non-page files for this wiki. - # - # treeish - The String commit ID or ref to find (default: @ref) - # - # Returns an Array of Gollum::File instances. - def files(treeish = nil) - file_list(treeish || @ref) - end - - # Public: Returns the number of pages accessible from a commit - # - # ref - A String ref that is either a commit SHA or references one. - # - # Returns a Fixnum - def size(ref = nil) - tree_map_for(ref || @ref).inject(0) do |num, entry| - num + (@page_class.valid_page_name?(entry.name) ? 1 : 0) - end - rescue Grit::GitRuby::Repository::NoSuchShaFound - 0 - end - - # Public: Search all pages for this wiki. - # - # query - The string to search for - # - # Returns an Array with Objects of page name and count of matches - def search(query) - args = [{}, '-i', '-c', query, @ref, '--'] - args << '--' << @page_file_dir if @page_file_dir - - results = {} - - @repo.git.grep(*args).split("\n").each do |line| - result = line.split(':') - result_1 = result[1] - # Remove ext only from known extensions. - # test.pdf => test.pdf, test.md => test - file_name = Page::valid_page_name?(result_1) ? result_1.chomp(::File.extname(result_1)) : - result_1 - results[file_name] = result[2].to_i - end - - # Use git ls-files '*query*' to search for file names. Grep only searches file content. - # Spaces are converted to dashes when saving pages to disk. - @repo.git.ls_files({}, "*#{ query.gsub(' ', '-') }*").split("\n").each do |line| - # Remove ext only from known extensions. - file_name = Page::valid_page_name?(line) ? line.chomp(::File.extname(line)) : - line - # If there's not already a result for file_name then - # the value is nil and nil.to_i is 0. - results[file_name] = results[file_name].to_i + 1; - end - - results.map do |key,val| - { :count => val, :name => key } - end - end - - # Public: All of the versions that have touched the Page. - # - # options - The options Hash: - # :page - The Integer page number (default: 1). - # :per_page - The Integer max count of items to return. - # - # Returns an Array of Grit::Commit. - def log(options = {}) - @repo.log(@ref, nil, log_pagination_options(options)) - end - - # Public: Refreshes just the cached Git reference data. This should - # be called after every Gollum update. - # - # Returns nothing. - def clear_cache - @access.refresh - end - - # Public: Creates a Sanitize instance using the Wiki's sanitization - # options. - # - # Returns a Sanitize instance. - def sanitizer - if options = sanitization - @sanitizer ||= options.to_sanitize - end - end - - # Public: Creates a Sanitize instance using the Wiki's history sanitization - # options. - # - # Returns a Sanitize instance. - def history_sanitizer - if options = history_sanitization - @history_sanitizer ||= options.to_sanitize - end - end - - ######################################################################### - # - # Internal Methods - # - ######################################################################### - - # The Grit::Repo associated with the wiki. - # - # Returns the Grit::Repo. - attr_reader :repo - - # The String path to the Git repository that holds the Gollum site. - # - # Returns the String path. - attr_reader :path - - # Gets the page class used by all instances of this Wiki. - attr_reader :page_class - - # Gets the file class used by all instances of this Wiki. - attr_reader :file_class - - # Gets the markup class used by all instances of this Wiki. - attr_reader :markup_classes - - # Toggles display of universal table of contents - attr_reader :universal_toc - - # Toggles mathjax. - attr_reader :mathjax - - # Toggles user icons. Default: 'none' - attr_reader :user_icons - - # Toggles showing all files in files view. Default is false. - # When false, only valid pages in the git repo are displayed. - attr_reader :show_all - - # Start with collapsed file view. Default: false - attr_reader :collapse_tree - - # Normalize the data. - # - # data - The String data to be normalized. - # - # Returns the normalized data String. - def normalize(data) - data.gsub(/\r/, '') - end - - # Assemble a Page's filename from its name and format. - # - # name - The String name of the page (should be pre-canonicalized). - # format - The Symbol format of the page. - # - # Returns the String filename. - def page_file_name(name, format) - name + '.' + @page_class.format_to_ext(format) - end - - # Fill an array with a list of pages. - # - # ref - A String ref that is either a commit SHA or references one. - # - # Returns a flat Array of Gollum::Page instances. - def tree_list(ref) - if sha = @access.ref_to_sha(ref) - commit = @access.commit(sha) - tree_map_for(sha).inject([]) do |list, entry| - next list unless @page_class.valid_page_name?(entry.name) - list << entry.page(self, commit) - end - else - [] - end - end - - # Fill an array with a list of files. - # - # ref - A String ref that is either a commit SHA or references one. - # - # Returns a flat Array of Gollum::File instances. - def file_list(ref) - if sha = @access.ref_to_sha(ref) - commit = @access.commit(sha) - tree_map_for(sha).inject([]) do |list, entry| - next list if entry.name.start_with?('_') - next list if @page_class.valid_page_name?(entry.name) - list << entry.file(self, commit) - end - else - [] - end - end - - # Creates a reverse diff for the given SHAs on the given Gollum::Page. - # - # page - The Gollum::Page to scope the patch to, or a String Path. - # sha1 - String SHA1 of the earlier parent if two SHAs are given, - # or the child. - # sha2 - Optional String SHA1 of the child. - # - # Returns a String of the reverse Diff to apply. - def full_reverse_diff_for(page, sha1, sha2 = nil) - sha1, sha2 = "#{sha1}^", sha1 if sha2.nil? - args = [{:R => true}, sha1, sha2] - if page - args << '--' << (page.respond_to?(:path) ? page.path : page.to_s) - end - repo.git.native(:diff, *args) - end - - # Creates a reverse diff for the given SHAs. - # - # sha1 - String SHA1 of the earlier parent if two SHAs are given, - # or the child. - # sha2 - Optional String SHA1 of the child. - # - # Returns a String of the reverse Diff to apply. - def full_reverse_diff(sha1, sha2 = nil) - full_reverse_diff_for(nil, sha1, sha2) - end - - # Gets the default name for commits. - # - # Returns the String name. - def default_committer_name - @default_committer_name ||= \ - @repo.config['user.name'] || self.class.default_committer_name - end - - # Gets the default email for commits. - # - # Returns the String email address. - def default_committer_email - @default_committer_email ||= \ - @repo.config['user.email'] || self.class.default_committer_email - end - - # Gets the commit object for the given ref or sha. - # - # ref - A string ref or SHA pointing to a valid commit. - # - # Returns a Grit::Commit instance. - def commit_for(ref) - @access.commit(ref) - rescue Grit::GitRuby::Repository::NoSuchShaFound - end - - # Finds a full listing of files and their blob SHA for a given ref. Each - # listing is cached based on its actual commit SHA. - # - # ref - A String ref that is either a commit SHA or references one. - # ignore_page_file_dir - Boolean, if true, searches all files within the git repo, regardless of dir/subdir - # - # Returns an Array of BlobEntry instances. - def tree_map_for(ref, ignore_page_file_dir=false) - if ignore_page_file_dir && !@page_file_dir.nil? - @root_access ||= GitAccess.new(path, nil, @repo_is_bare) - @root_access.tree(ref) - else - @access.tree(ref) - end - rescue Grit::GitRuby::Repository::NoSuchShaFound - [] - end - - def inspect - %(#<#{self.class.name}:#{object_id} #{@repo.path}>) - end - end -end diff --git a/licenses/licenses.txt b/licenses/licenses.txt index d92cf99f..c60bdafc 100644 --- a/licenses/licenses.txt +++ b/licenses/licenses.txt @@ -12,10 +12,10 @@ The following PNGs are based on Ubuntu 11.10 SVG files located in /usr/share/ico - group-files.svg - group-downloads.svg - lib/gollum/frontend/public/css/document.png - lib/gollum/frontend/public/css/folder-horizontal.png - lib/gollum/frontend/public/css/toggle-small-expand.png - lib/gollum/frontend/public/css/toggle-small.png + lib/gollum/public/css/document.png + lib/gollum/public/css/folder-horizontal.png + lib/gollum/public/css/toggle-small-expand.png + lib/gollum/public/css/toggle-small.png Creative Commons - Attribution Share Alike https://launchpad.net/unity-asset-pool @@ -29,7 +29,7 @@ The css-tree-menu code is used under the MIT license. http://www.thecssninja.com/css/css-tree-menu http://www.thecssninja.com/demo/license.txt - lib/gollum/frontend/public/css/_styles.css + lib/gollum/public/css/_styles.css --- @@ -39,7 +39,7 @@ CC BY-SA 3.0 Unported http://blog.twg.ca/2010/11/retina-display-icon-set/ http://creativecommons.org/licenses/by-sa/3.0/legalcode.txt - lib/gollum/frontend/public/images/man_24.png + lib/gollum/public/images/man_24.png --- @@ -48,5 +48,5 @@ The canvas_identicon code is used under the MIT license. https://github.com/donpark/identicon/blob/master/identicon-canvas/identicon_canvas.js https://github.com/donpark/identicon/blob/master/README - lib/gollum/frontend/public/gollum/javascript/identicon_canvas.js + lib/gollum/public/gollum/javascript/identicon_canvas.js diff --git a/test/file_view/1_file.txt b/test/file_view/1_file.txt deleted file mode 100644 index d74f47ce..00000000 --- a/test/file_view/1_file.txt +++ /dev/null @@ -1,5 +0,0 @@ -
      -
    1. - 0 -
    2. -
    diff --git a/test/file_view/1_file_1_folder.txt b/test/file_view/1_file_1_folder.txt deleted file mode 100644 index 54a50980..00000000 --- a/test/file_view/1_file_1_folder.txt +++ /dev/null @@ -1,11 +0,0 @@ -
      -
    1. - - -
        -
      1. - 0 -
      2. -
      -
    2. -
    diff --git a/test/file_view/1_folder.txt b/test/file_view/1_folder.txt deleted file mode 100644 index 04066def..00000000 --- a/test/file_view/1_folder.txt +++ /dev/null @@ -1,11 +0,0 @@ -
      -
    1. - - -
        -
      1. - folder0 -
      2. -
      -
    2. -
    diff --git a/test/file_view/2_files_2_folders.txt b/test/file_view/2_files_2_folders.txt deleted file mode 100644 index 49cb39ee..00000000 --- a/test/file_view/2_files_2_folders.txt +++ /dev/null @@ -1,20 +0,0 @@ -
      -
    1. - - -
        -
      1. - 0 -
      2. -
      -
    2. -
    3. - - -
        -
      1. - 1 -
      2. -
      -
    4. -
    diff --git a/test/file_view/2_files_2_folders_1_root.txt b/test/file_view/2_files_2_folders_1_root.txt deleted file mode 100644 index 1ee732b2..00000000 --- a/test/file_view/2_files_2_folders_1_root.txt +++ /dev/null @@ -1,23 +0,0 @@ -
      -
    1. - root -
    2. -
    3. - - -
        -
      1. - 0 -
      2. -
      -
    4. -
    5. - - -
        -
      1. - 1 -
      2. -
      -
    6. -
    diff --git a/test/file_view/nested_folders.txt b/test/file_view/nested_folders.txt deleted file mode 100644 index 5cb0703f..00000000 --- a/test/file_view/nested_folders.txt +++ /dev/null @@ -1,41 +0,0 @@ -
      -
    1. - - -
        -
      1. - - -
          -
        1. - - -
            -
          1. - 0 -
          2. -
          -
        2. -
        3. - - -
            -
          1. - 1 -
          2. -
          -
        4. -
        -
      2. -
      -
    2. -
    3. - - -
        -
      1. - 2 -
      2. -
      -
    4. -
    diff --git a/test/helper.rb b/test/helper.rb index 8e4a8887..2cf30787 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -4,6 +4,9 @@ require 'test/unit' require 'shoulda' require 'mocha/setup' require 'fileutils' +require 'minitest/reporters' + +MiniTest::Reporters.use! dir = File.dirname(File.expand_path(__FILE__)) $LOAD_PATH.unshift(File.join(dir, '..', 'lib')) @@ -11,7 +14,7 @@ $LOAD_PATH.unshift(dir) ENV['RACK_ENV'] = 'test' require 'gollum' -require 'gollum/frontend/app' +require 'gollum/app' # Disable the metadata feature $METADATA = false diff --git a/test/test_committer.rb b/test/test_committer.rb deleted file mode 100644 index 519eb8ac..00000000 --- a/test/test_committer.rb +++ /dev/null @@ -1,64 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), "helper")) - -context "Wiki" do - setup do - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) - end - - test "normalizes commit hash" do - commit = {:message => 'abc'} - name = @wiki.repo.config['user.name'] || @wiki.default_committer_name - email = @wiki.repo.config['user.email'] || @wiki.default_committer_email - committer = Gollum::Committer.new(@wiki, commit) - assert_equal name, committer.actor.name - assert_equal email, committer.actor.email - - commit[:name] = 'bob' - commit[:email] = '' - committer = Gollum::Committer.new(@wiki, commit) - assert_equal 'bob', committer.actor.name - assert_equal email, committer.actor.email - - commit[:email] = 'foo@bar.com' - committer = Gollum::Committer.new(@wiki, commit) - assert_equal 'bob', committer.actor.name - assert_equal 'foo@bar.com', committer.actor.email - end - - test "yield after_commit callback" do - @path = cloned_testpath('examples/lotr.git') - yielded = nil - begin - wiki = Gollum::Wiki.new(@path) - committer = Gollum::Committer.new(wiki) - committer.after_commit do |index, sha1| - yielded = sha1 - assert_equal committer, index - end - - res = wiki.write_page("Gollum", :markdown, "# Gollum", - :committer => committer) - - assert_equal committer, res - - sha1 = committer.commit - assert_equal sha1, yielded - ensure - FileUtils.rm_rf(@path) - end - end - - test "parents with default master ref" do - ref = '874f597a5659b4c3b153674ea04e406ff393975e' - committer = Gollum::Committer.new(@wiki) - assert_equal ref, committer.parents.first.sha - end - - test "parents with custom ref" do - ref = '60f12f4254f58801b9ee7db7bca5fa8aeefaa56b' - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git"), :ref => ref) - committer = Gollum::Committer.new(@wiki) - assert_equal ref, committer.parents.first.sha - end -end diff --git a/test/test_file.rb b/test/test_file.rb deleted file mode 100644 index b9e22194..00000000 --- a/test/test_file.rb +++ /dev/null @@ -1,45 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -path = File.join(File.dirname(__FILE__), "helper") -require File.expand_path(path) - -context "File" do - setup do - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) - end - - test "new file" do - file = Gollum::File.new(@wiki) - assert_nil file.raw_data - end - - test "existing file" do - commit = @wiki.repo.commits.first - file = @wiki.file("Mordor/todo.txt") - assert_equal "[ ] Write section on Ents\n", file.raw_data - assert_equal 'todo.txt', file.name - assert_equal commit.id, file.version.id - assert_equal commit.author.name, file.version.author.name - end - - test "accessing tree" do - assert_nil @wiki.file("Mordor") - end -end - -context "File with checkout" do - setup do - @path = cloned_testpath("examples/lotr.git") - @wiki = Gollum::Wiki.new(@path) - end - - teardown do - FileUtils.rm_rf(@path) - end - - test "symbolic link" do - commit = @wiki.repo.commits.first - file = @wiki.file("Data-Two.csv") - - assert_match /^FirstName,LastName\n/, file.raw_data - end -end diff --git a/test/test_file_view.rb b/test/test_file_view.rb deleted file mode 100644 index f8ae05c3..00000000 --- a/test/test_file_view.rb +++ /dev/null @@ -1,120 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) -require File.expand_path '../../lib/gollum/file_view', __FILE__ - -class FakePage - def initialize filepath - @filepath = filepath - end - - # From page.rb - def filename_stripped - ::File.basename(@filepath, ::File.extname(@filepath)) - end - - def filename - ::File.basename(@filepath) - end - - def path - return @filepath - end - - # From page.rb - def name - self.class.canonicalize_filename @filepath - end - - # From page.rb - def self.strip_filename filename - ::File.basename( filename, ::File.extname( filename )) - end - - # From page.rb - def self.canonicalize_filename filename - strip_filename(filename).gsub('-', ' ') - end -end - -class FakePages - def initialize filepath_array - @array = filepath_array.map { | filepath | FakePage.new filepath } - end - - def size - @array.size - end - - def [] index - @array[ index ] - end -end - -def view pages - Gollum::FileView.new( pages ).render_files -end - -@@test_path = File.expand_path( '../file_view/' , __FILE__ ) + '/' - -def read file - File.read @@test_path + file + '.txt' -end - -# For creating expected files. -# write name, actual -def write file, content - File.open(@@test_path + file + '.txt', 'w') do | f | - f.write content - end -end - -def to_html html - # Remove blank nodes for proper formatting - doc = Nokogiri.XML(html) do |cfg| - cfg.default_xml.noblanks - end - - # Save as XHTML - doc.to_xml( { :save_with => Nokogiri::XML::Node::SaveOptions::DEFAULT_XHTML, :indent => 2, :encoding => 'UTF-8' } ) -end - -def check name, pages_array - pages = FakePages.new pages_array - expected = read name - actual = to_html view pages - - # Uncomment when updating tests - # write name, actual - - assert_equal expected, actual -end - -# Test Notes -# root files must be before any folders. -# Home.md => file at root folder -# docs/sanitization.md => file within folder -context 'file_view' do - test 'one file' do - check '1_file', [ '0.md' ] - end - - test 'one folder' do - check '1_folder', [ 'folder0/' ] - end - - test 'one file with one folder' do - check '1_file_1_folder', [ 'folder0/0.md' ] - end - - test 'two files with two folders' do - check '2_files_2_folders', [ 'folder0/0.md', 'folder1/1.md' ] - end - - test 'two files with two folders and one root file' do - check '2_files_2_folders_1_root', [ 'root.md', 'folder0/0.md', 'folder1/1.md' ] - end - - test 'nested folders' do - check 'nested_folders', [ 'folder0/folder1/folder2/0.md', 'folder0/folder1/folder3/1.md', 'folder4/2.md' ] - end -end # context diff --git a/test/test_git_access.rb b/test/test_git_access.rb deleted file mode 100644 index f058745a..00000000 --- a/test/test_git_access.rb +++ /dev/null @@ -1,64 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), "helper")) - -context "GitAccess" do - setup do - @access = Gollum::GitAccess.new(testpath("examples/lotr.git")) - end - - test "#commit fills commit_map cache" do - assert @access.commit_map.empty? - actual = @access.repo.commits.first - expected = @access.commit(actual.id) - assert_equal actual.message, expected.message - assert_equal actual.message, @access.commit_map[actual.id].message - end - - test "#tree_map_for caches ref and tree" do - assert @access.ref_map.empty? - assert @access.tree_map.empty? - @access.tree 'master' - assert_equal({"master"=>"874f597a5659b4c3b153674ea04e406ff393975e"}, @access.ref_map) - - @access.tree '1db89ebba7e2c14d93b94ff98cfa3708a4f0d4e3' - map = @access.tree_map['1db89ebba7e2c14d93b94ff98cfa3708a4f0d4e3'] - assert_equal 'Bilbo-Baggins.md', map[0].path - assert_equal '', map[0].dir - assert_equal map[0].path, map[0].name - assert_equal 'Mordor/Eye-Of-Sauron.md', map[3].path - assert_equal '/Mordor', map[3].dir - assert_equal 'Eye-Of-Sauron.md', map[3].name - end - - test "#tree_map_for only caches tree for commit" do - assert @access.tree_map.empty? - @access.tree '60f12f4254f58801b9ee7db7bca5fa8aeefaa56b' - assert @access.ref_map.empty? - - entry = @access.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0] - assert_equal 'Bilbo-Baggins.md', entry.path - end - - test "cannot access commit from invalid ref" do - assert_nil @access.commit('foo') - end - - test "cannot access sha from invalid ref" do - assert_nil @access.ref_to_sha('foo') - end - - test "cannot access tree from invalid ref" do - assert_equal [], @access.tree('foo') - end - - test "sets #mode for blob entries" do - @access.tree '60f12f4254f58801b9ee7db7bca5fa8aeefaa56b' - file = @access.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'][0] - assert_equal 0100644, file.mode - - @access.tree '874f597a5659b4c3b153674ea04e406ff393975e' - symlink = @access.tree_map['874f597a5659b4c3b153674ea04e406ff393975e'].find { |entry| entry.name == 'Data-Two.csv' } - assert_not_nil symlink - assert_equal 0120000, symlink.mode - end -end diff --git a/test/test_gitcode.rb b/test/test_gitcode.rb deleted file mode 100644 index 9d72769b..00000000 --- a/test/test_gitcode.rb +++ /dev/null @@ -1,100 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path( '../helper', __FILE__ ) -require File.expand_path( '../wiki_factory', __FILE__ ) - -context "gitcode" do - - def page_with_content c - index = @wiki.repo.index - index.add 'Sample-Html.md', c - index.commit 'adding file html sample' - - page = @wiki.page 'Sample Html' - page - end - - setup do - # context - @wiki, @path, @cleanup = WikiFactory.create 'examples/test.git' - - # given - p = page_with_content "a\n\n```html:gollum/gollum/master/test/file_view/1_file.txt```\n\nb" - - # when rendering the page - @rendered = Gollum::Markup.new(p).render - end - - test 'that the rendered output is correctly fetched and rendered as html code' do - assert_equal %Q{

    a

    \n\n
    <ol class=\"tree\">\n  <li class=\"file\">\n    <a href=\"0\"><span class=\"icon\"></span>0</a>\n  </li>\n</ol>\n
    \n\n

    b

    }, @rendered - end - - test 'contents' do - g = Gollum::Gitcode.new 'gollum/gollum/master/test/file_view/1_file.txt' - - assert_equal g.contents, %{
      \n
    1. \n 0\n
    2. \n
    \n} - end - - test "gitcode relative local file" do - @wiki.write_page("Bilbo Baggins", :markdown, "a\n```python:file-exists.py```\nb", commit_details) - page = @wiki.page('Bilbo Baggins') - - index = @wiki.repo.index - index.add("file-exists.py", "import sys\n\nprint sys.maxint\n") - index.commit("Add file-exists.py") - - @wiki.clear_cache - - output = page.formatted_data - assert_equal %Q{

    a\n

    import sys\n\nprint sys.maxint\n
    \n\n

    b

    }, output - end - - test "gitcode relative local file in subdir" do - index = @wiki.repo.index - index.add("foo/file-exists.py", "import sys\n\nprint sys.maxint\n") - index.commit("Add file-exists.py") - - @wiki.write_page("Pippin", :markdown, "a\n```python:file-exists.py```\nb", commit_details, 'foo') - - page = @wiki.paged('Pippin', 'foo') - output = page.formatted_data - assert_equal %Q{

    a\n

    import sys\n\nprint sys.maxint\n
    \n\n

    b

    }, output - end - - test "gitcode relative no file" do - @wiki.write_page("Bilbo Baggins", :markdown, "a\n```python:no-file-exists.py```\nb", commit_details) - page = @wiki.page('Bilbo Baggins') - output = page.formatted_data - assert_equal %Q{

    a\nFile not found: no-file-exists.py\nb

    }, output - end - - test "gitcode absolute local file" do - @wiki.write_page("Bilbo Baggins", :markdown, "a\n```python:/monkey/file-exists.py```\nb", commit_details) - page = @wiki.page('Bilbo Baggins') - - index = @wiki.repo.index - index.add("monkey/file-exists.py", "import sys\n\nprint sys.platform\n") - index.commit("Add monkey/file-exists.py") - @wiki.clear_cache - - output = page.formatted_data - assert_equal %Q{

    a\n

    import sys\n\nprint sys.platform\n
    \n\n

    b

    }, output - end - - test "gitcode absolute no file" do - @wiki.write_page("Bilbo Baggins", :markdown, "a\n```python:/monkey/no-file-exists.py```\nb", commit_details) - page = @wiki.page('Bilbo Baggins') - output = page.formatted_data - assert_equal %Q{

    a\nFile not found: /monkey/no-file-exists.py\nb

    }, output - end - - test "gitcode error generates santized html" do - @wiki.write_page("Bilbo Baggins", :markdown, "a\n```python:```\nb", commit_details) - page = @wiki.page('Bilbo Baggins') - output = page.formatted_data - assert_equal %Q{

    a\nFile not found: <script>foo</script>\nb

    }, output - end - - teardown do - @cleanup.call - end -end diff --git a/test/test_history_view.rb b/test/test_history_view.rb index 94ad87e7..33f160f8 100644 --- a/test/test_history_view.rb +++ b/test/test_history_view.rb @@ -1,6 +1,6 @@ # ~*~ encoding: utf-8 ~*~ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) -require File.expand_path '../../lib/gollum/frontend/views/history', __FILE__ +require File.expand_path '../../lib/gollum/views/history', __FILE__ context "Precious::Views::History" do setup do diff --git a/test/test_markup.rb b/test/test_markup.rb deleted file mode 100644 index 87d291e7..00000000 --- a/test/test_markup.rb +++ /dev/null @@ -1,824 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path( "../helper", __FILE__ ) -require File.expand_path( "../wiki_factory", __FILE__ ) - -context "Markup" do - setup do - @wiki, @path, @teardown = WikiFactory.create 'examples/test.git' - end - - teardown do - @teardown.call - end - - test "formats page from Wiki#pages" do - @wiki.write_page("Bilbo Baggins", :markdown, "a [[Foo]][[Bar]] b", commit_details) - assert @wiki.pages[0].formatted_data - end - - # This test is to assume that Sanitize.clean doesn't raise Encoding::CompatibilityError on ruby 1.9 - test "formats non ASCII-7 character page from Wiki#pages" do - wiki = Gollum::Wiki.new(testpath("examples/yubiwa.git")) - assert_nothing_raised(defined?(Encoding) && Encoding::CompatibilityError) do - assert wiki.page("strider").formatted_data - end - end - - test "Gollum::Markup#render yields a DocumentFragment" do - yielded = false - @wiki.write_page("Yielded", :markdown, "abc", commit_details) - - page = @wiki.page("Yielded") - markup = Gollum::Markup.new(page) - markup.render do |doc| - assert_kind_of Nokogiri::HTML::DocumentFragment, doc - yielded = true - end - assert yielded - end - - test "Gollum::Page#formatted_data yields a DocumentFragment" do - yielded = false - @wiki.write_page("Yielded", :markdown, "abc", commit_details) - - page = @wiki.page("Yielded") - page.formatted_data do |doc| - assert_kind_of Nokogiri::HTML::DocumentFragment, doc - yielded = true - end - assert yielded - end - - ######################################################################### - # - # Links - # - ######################################################################### - - test "absolute link to non-existent page" do - @wiki.write_page("linktest", :markdown, "[[/Page]]", commit_details) - - page = @wiki.page("linktest") - doc = Nokogiri::HTML page.formatted_data - paras = doc / :p - para = paras.first - anchors = para / :a - assert_equal 1, paras.size - assert_equal 1, anchors.size - assert_equal 'internal absent', anchors[0]['class'] - assert_equal '/Page', anchors[0]['href'] - assert_equal '/Page', anchors[0].text - end - - test "double page links no space" do - @wiki.write_page("Bilbo Baggins", :markdown, "a [[Foo]][[Bar]] b", commit_details) - - # "

    a FooBar b

    " - page = @wiki.page("Bilbo Baggins") - doc = Nokogiri::HTML page.formatted_data - paras = doc / :p - para = paras.first - anchors = para / :a - assert_equal 1, paras.size - assert_equal 2, anchors.size - assert_equal 'internal absent', anchors[0]['class'] - assert_equal 'internal absent', anchors[1]['class'] - assert_equal '/Foo', anchors[0]['href'] - assert_equal '/Bar', anchors[1]['href'] - assert_equal 'Foo', anchors[0].text - assert_equal 'Bar', anchors[1].text - end - - test "double page links with space" do - @wiki.write_page("Bilbo Baggins", :markdown, "a [[Foo]] [[Bar]] b", commit_details) - - # "

    a Foo Bar b

    " - page = @wiki.page("Bilbo Baggins") - doc = Nokogiri::HTML page.formatted_data - paras = doc / :p - para = paras.first - anchors = para / :a - assert_equal 1, paras.size - assert_equal 2, anchors.size - assert_equal 'internal absent', anchors[0]['class'] - assert_equal 'internal absent', anchors[1]['class'] - assert_equal '/Foo', anchors[0]['href'] - assert_equal '/Bar', anchors[1]['href'] - assert_equal 'Foo', anchors[0].text - assert_equal 'Bar', anchors[1].text - end - - test "page link" do - @wiki.write_page("Bilbo Baggins", :markdown, "a [[Bilbo Baggins]] b", commit_details) - - page = @wiki.page("Bilbo Baggins") - output = page.formatted_data - assert_match /class="internal present"/, output - assert_match /href="\/Bilbo-Baggins"/, output - assert_match /\>Bilbo Baggins\J\. R\. R\. Tolkien\ path) - @wiki.write_page(name, :markdown, "a [[#{name}]] b", commit_details) - - page = @wiki.page(name) - output = page.formatted_data - assert_match /class="internal present"/, output - assert_match /href="\/wiki\/Bilbo-Baggins-\d"/, output - assert_match /\>Bilbo Baggins \d\a http://example.com b

    ", page.formatted_data - end - - test "page link with different text" do - @wiki.write_page("Potato", :markdown, "a [[Potato Heaad|Potato]] ", commit_details) - page = @wiki.page("Potato") - output = page.formatted_data - assert_equal "

    aPotatoHeaad

    ", normal(output) - end - - test "page link with different text on mediawiki" do - @wiki.write_page("Potato", :mediawiki, "a [[Potato|Potato Heaad]] ", commit_details) - page = @wiki.page("Potato") - output = page.formatted_data - assert_equal normal("

    \na Potato Heaad

    -"), normal(output) - end - - test "wiki link within inline code block" do - @wiki.write_page("Potato", :markdown, "`sed -i '' 's/[[:space:]]*$//'`", commit_details) - page = @wiki.page("Potato") - assert_equal "

    sed -i '' 's/[[:space:]]*$//'

    ", page.formatted_data - end - - test "regexp gsub! backref (#383)" do - # bug only triggers on "```" syntax - # not `code` - page = 'test_rgx' - @wiki.write_page(page, :markdown, - (<<-'DATA' - ``` - rot13='tr '\''A-Za-z'\'' '\''N-ZA-Mn-za-m'\' - ``` - DATA - ), commit_details) - output = @wiki.page(page).formatted_data - expected = %Q{
          
    rot13='tr '\\''A-Za-z'\\'' '\\''N-ZA-Mn-za-m'\\'\n
    \n
    } - assert_equal expected, output - end - - # Issue #568 - test "tilde code blocks without a language" do - page = 'test_rgx' - @wiki.write_page(page, :markdown, - %Q(~~~ -'hi' -~~~ - ), commit_details) - output = @wiki.page(page).formatted_data - expected = %Q{
    'hi'\n
    } - assert_equal expected, output - end - - test "tilde code blocks #537" do - page = 'test_rgx' - @wiki.write_page(page, :markdown, - %Q(~~~ {.ruby} -'hi' -~~~ - ), commit_details) - output = @wiki.page(page).formatted_data - expected = %Q{
    'hi'\n
    } - assert_equal expected, output - end - - # Issue #537 - test "tilde code blocks with more than one class" do - page = 'test_rgx' - @wiki.write_page(page, :markdown, - %Q(~~~ {#hi .ruby .sauce} -'hi' -~~~ - ), commit_details) - output = @wiki.page(page).formatted_data - expected = %Q{
    'hi'\n
    } - assert_equal expected, output - end - - # Issue #537 - test "tilde code blocks with lots of tildes" do - page = 'test_rgx' - @wiki.write_page(page, :markdown, - %Q(~~~~~~ {#hi .ruby .sauce} -~~ -'hi'~ -~~~~~~ - ), commit_details) - output = @wiki.page(page).formatted_data - expected = %Q{
    ~~\n'hi'~\n
    } - assert_equal expected, output - end - - test "four space indented code block" do - page = 'test_four' - @wiki.write_page(page, :markdown, - %( test - test), commit_details) - output = @wiki.page(page).formatted_data - expected = %(
    test\ntest\n
    ) - assert_equal expected, output - end - - test "wiki link within code block" do - @wiki.write_page("Potato", :markdown, " sed -i '' 's/[[:space:]]*$//'", commit_details) - page = @wiki.page("Potato") - assert_equal "
    sed -i '' 's/[[:space:]]*$//'\n
    ", page.formatted_data - end - - test "piped wiki link within code block" do - @wiki.write_page("Potato", :markdown, "`make a link [[home|sweet home]]`", commit_details) - page = @wiki.page("Potato") - assert_equal "

    make a link [[home|sweet home]]

    ", page.formatted_data - end - - ######################################################################### - # - # Images - # - ######################################################################### - - test "image with http url" do - ['http', 'https'].each do |scheme| - name = "Bilbo Baggins #{scheme}" - @wiki.write_page(name, :markdown, "a [[#{scheme}://example.com/bilbo.jpg]] b", commit_details) - - page = @wiki.page(name) - output = page.formatted_data - assert_equal %{

    a b

    }, output - end - end - - test "image with extension in caps with http url" do - ['http', 'https'].each do |scheme| - name = "Bilbo Baggins #{scheme}" - @wiki.write_page(name, :markdown, "a [[#{scheme}://example.com/bilbo.JPG]] b", commit_details) - - page = @wiki.page(name) - output = page.formatted_data - assert_equal %{

    a b

    }, output - end - end - - test "image with absolute path" do - @wiki = Gollum::Wiki.new(@path, :base_path => '/wiki') - index = @wiki.repo.index - index.add("alpha.jpg", "hi") - index.commit("Add alpha.jpg") - @wiki.write_page("Bilbo Baggins", :markdown, "a [[/alpha.jpg]] [[a | /alpha.jpg]] b", commit_details) - - page = @wiki.page("Bilbo Baggins") - assert_equal %{

    a a b

    }, page.formatted_data - end - - test "image with relative path on root" do - @wiki = Gollum::Wiki.new(@path, :base_path => '/wiki') - index = @wiki.repo.index - index.add("alpha.jpg", "hi") - index.add("Bilbo-Baggins.md", "a [[alpha.jpg]] [[a | alpha.jpg]] b") - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - assert_equal %Q{

    a a b

    }, page.formatted_data - end - - test "image with relative path" do - @wiki = Gollum::Wiki.new(@path, :base_path => '/wiki') - index = @wiki.repo.index - index.add("greek/alpha.jpg", "hi") - index.add("greek/Bilbo-Baggins.md", "a [[alpha.jpg]] [[a | alpha.jpg]] b") - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - output = page.formatted_data - assert_equal %{

    a a b

    }, output - end - - test "image with absolute path on a preview" do - @wiki = Gollum::Wiki.new(@path, :base_path => '/wiki') - index = @wiki.repo.index - index.add("alpha.jpg", "hi") - index.commit("Add alpha.jpg") - - page = @wiki.preview_page("Test", "a [[/alpha.jpg]] b", :markdown) - assert_equal %{

    a b

    }, page.formatted_data - end - - test "image with relative path on a preview" do - @wiki = Gollum::Wiki.new(@path, :base_path => '/wiki') - index = @wiki.repo.index - index.add("alpha.jpg", "hi") - index.add("greek/alpha.jpg", "hi") - index.commit("Add alpha.jpg") - - page = @wiki.preview_page("Test", "a [[alpha.jpg]] [[greek/alpha.jpg]] b", :markdown) - assert_equal %{

    a b

    }, page.formatted_data - end - - test "image with alt" do - content = "a [[alpha.jpg|alt=Alpha Dog]] b" - output = %{

    ab

    } - relative_image(content, output) - end - - test "image with em or px dimension" do - %w{em px}.each do |unit| - %w{width height}.each do |dim| - content = "a [[alpha.jpg|#{dim}=100#{unit}]] b" - output = "

    ab

    " - relative_image(content, output) - end - end - end - - test "image with bogus dimension" do - %w{width height}.each do |dim| - content = "a [[alpha.jpg|#{dim}=100]] b" - output = "

    ab

    " - relative_image(content, output) - end - end - - test "image with vertical align" do - %w{top texttop middle absmiddle bottom absbottom baseline}.each do |align| - content = "a [[alpha.jpg|align=#{align}]] b" - output = %Q{

    ab

    } - relative_image(content, output) - end - end - - test "image with horizontal align" do - %w{left center right}.each do |align| - content = "a [[alpha.jpg|align=#{align}]] b" - output = "

    ab

    " - relative_image(content, output) - end - end - - test "image with float" do - content = "a\n\n[[alpha.jpg|float]]\n\nb" - output = "

    a

    b

    " - relative_image(content, output) - end - - test "image with float and align" do - %w{left right}.each do |align| - content = "a\n\n[[alpha.jpg|float|align=#{align}]]\n\nb" - output = "

    a

    b

    " - relative_image(content, output) - end - end - - test "image with frame" do - content = "a\n\n[[alpha.jpg|frame]]\n\nb" - output = "

    a

    b

    " - relative_image(content, output) - end - - test "absolute image with frame" do - content = "a\n\n[[http://example.com/bilbo.jpg|frame]]\n\nb" - output = "

    a

    b

    " - relative_image(content, output) - end - - test "image with frame and alt" do - content = "a\n\n[[alpha.jpg|frame|alt=Alpha]]\n\nb" - output = "

    a

    Alpha

    b

    " - relative_image(content, output) - end - - ######################################################################### - # - # File links - # - ######################################################################### - - test "file link with absolute path" do - index = @wiki.repo.index - index.add("alpha.jpg", "hi") - index.commit("Add alpha.jpg") - @wiki.write_page("Bilbo Baggins", :markdown, "a [[Alpha|/alpha.jpg]] b", commit_details) - - page = @wiki.page("Bilbo Baggins") - output = Gollum::Markup.new(page).render - assert_equal %{

    a Alpha b

    }, output - end - - test "file link with relative path" do - index = @wiki.repo.index - index.add("greek/alpha.jpg", "hi") - index.add("greek/Bilbo-Baggins.md", "a [[Alpha|alpha.jpg]] b") - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - output = Gollum::Markup.new(page).render - assert_equal %{

    a Alpha b

    }, output - end - - test "file link with external path" do - index = @wiki.repo.index - index.add("greek/Bilbo-Baggins.md", "a [[Alpha|http://example.com/alpha.jpg]] b") - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - assert_equal %{

    a Alpha b

    }, page.formatted_data - end - - ######################################################################### - # - # Code - # - ######################################################################### - - test "regular code blocks" do - content = "a\n\n```ruby\nx = 1\n```\n\nb" - output = %Q{

    a

    \n\n
    x = 1\n
    \n\n

    b

    } - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal output, rendered - end - - test "code blocks with carriage returns" do - content = "a\r\n\r\n```ruby\r\nx = 1\r\n```\r\n\r\nb" - output = %Q{

    a

    \n\n
    x = 1\n
    \n\n

    b

    } - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal output, rendered - end - - test "code blocks with two-space indent" do - content = "a\n\n```ruby\n x = 1\n\n y = 2\n```\n\nb" - output = "

    a

    \n\n
    " +
    -             "x = 1" +
    -             "\n\ny =" +
    -             " 2\n
    \n
    \n\n\n

    b

    " - compare(content, output) - end - - test "code blocks with one-tab indent" do - content = "a\n\n```ruby\n\tx = 1\n\n\ty = 2\n```\n\nb" - output = "

    a

    \n\n
    " +
    -             "x = 1" +
    -             "\n\ny =" +
    -             " 2\n
    \n
    \n\n\n

    b

    " - compare(content, output) - end - - test "code blocks with multibyte caracters indent" do - content = "a\n\n```ruby\ns = 'やくしまるえつこ'\n```\n\nb" - output = %Q{

    a

    \n\n
    s = 'やくしまるえつこ'\n
    \n\n

    b

    } - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render(false, 'utf-8') - assert_equal output, rendered - end - - test "code blocks with ascii characters" do - content = "a\n\n```\n├─foo\n```\n\nb" - output = %(

    a

    ├─foo

    b

    ) - compare(content, output) - end - - test "code with wiki links" do - content = <<-END -booya - -``` python -np.array([[2,2],[1,3]],np.float) -``` - END - - # rendered with Gollum::Markup - page, rendered = render_page(content) - assert_markup_highlights_code Gollum::Markup, rendered - end - - test "code with trailing whitespace" do - content = <<-END -shoop da woop - -``` python -np.array([[2,2],[1,3]],np.float) -``` - END - - # rendered with Gollum::Markup - page, rendered = render_page(content) - assert_markup_highlights_code Gollum::Markup, rendered - end - - def assert_markup_highlights_code(markup_class, rendered) - assert_match /div class="highlight"/, rendered, "#{markup_class} doesn't highlight code\n #{rendered}" - assert_match /span class="n"/, rendered, "#{markup_class} doesn't highlight code\n #{rendered}" - assert_match /\(\[\[/, rendered, "#{markup_class} parses out wiki links\n#{rendered}" - end - - test "embed code page absolute link" do - @wiki.write_page("base", :markdown, "a\n!base\b", commit_details) - @wiki.write_page("a", :markdown, "a\n```html:/base```\b", commit_details) - - page = @wiki.page("a") - output = page.formatted_data - assert_equal %Q{

    a\nFile not found: /base

    }, output - end - - test "embed code page relative link" do - @wiki.write_page("base", :markdown, "a\n!rel\b", commit_details) - @wiki.write_page("a", :markdown, "a\n```html:base```\b", commit_details) - - page = @wiki.page("a") - output = page.formatted_data - assert_equal %Q{

    a\nFile not found: base

    }, output - end - - test "code block in unsupported language" do - @wiki.write_page("a", :markdown, "a\n```nonexistent\ncode\n```\nb", commit_details) - - page = @wiki.page("a") - output = page.formatted_data - assert_equal %Q{

    a\ncode\nb

    }, output - end - - ######################################################################### - # - # Web Sequence Diagrams - # - ######################################################################### - - test "sequence diagram blocks" do - content = "a\n\n{{{{{{default\nalice->bob: Test\n}}}}}}\n\nb" - output = /.*.*/ - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add sequence diagram") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_not_nil rendered.match(output) - end - -if $METADATA ######################################################################### - # - # Metadata Blocks - # - ######################################################################### - - test "metadata blocks" do - content = "a\n\n\n\nb" - output = "

    a

    \n\n

    b

    " - result = {'tags'=>['foo','bar']} - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add metadata") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal output, rendered - assert_equal result, page.metadata - end - - test "metadata blocks with newline" do - content = "a\n\n\n\nb" - output = "

    a

    \n\n

    b

    " - result = {'tags'=>['foo','bar']} - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add metadata") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal output, rendered - assert_equal result, page.metadata - end - - test "metadata sanitation" do - content = "a\n\n\n\nb" - output = "

    a

    \n\n

    b

    " - result = {'foo'=>nil} - - index = @wiki.repo.index - index.add("Bilbo-Baggins.md", content) - index.commit("Add metadata") - - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal output, rendered - assert_equal result, page.metadata - end -end # if $METADATA - ######################################################################### - # - # Various - # - ######################################################################### - - test "strips javscript protocol urls" do - content = "[Hack me](javascript:hacked=true)" - output = "

    Hackme

    " - compare(content, output) - end - - test "allows apt uri schemes" do - content = "[Hack me](apt:gettext)" - output = "

    Hackme

    " - compare(content, output) - end - - test "removes style blocks completely" do - content = "foobar" - output = "

    foobar

    " - compare(content, output) - end - - test "removes script blocks completely" do - content = "foobar" - output = "

    foobar

    " - compare(content, output) - end - - test "escaped wiki link" do - content = "a '[[Foo]], b" - output = "

    a [[Foo]], b

    " - compare(content, output) - end - - test "quoted wiki link" do - content = "a '[[Foo]]', b" - output = "

    a 'Foo', b

    " - compare(content, output, 'md', [ - /class="internal absent"/, - /href="\/Foo"/, - /\>Foo\a Google b

    " - compare(content, output, 'org') - end - - test "org mode style double file links" do - content = "a [[file:f.org][Google]] b" - output = "

    a Google b

    " - compare(content, output, 'org') - end - - test "short double links" do - content = "a [[b]] c" - output = %(

    a b c

    ) - compare(content, output, 'org') - end - - test "double linked pipe" do - content = "a [[|]] b" - output = %(

    a b

    ) - compare(content, output, 'org') - end - - test "id with prefix ok" do - content = "h2(example#wiki-foo). xxxx" -output = %(

    xxxx

    ) -compare(content, output, :textile) -end - - test "id prefix added" do - content = "h2(#foo). xxxx[1]\n\nfn1.footnote" - output = "

    xxxx" + - "1" + - "

    " + - "\n

    1 footnote

    " - compare(content, output, :textile) - end - - test "name prefix added" do - content = "abc\n\n__TOC__\n\n==Header==\n\nblah" - compare content, '', :mediawiki, [ - /id="wiki-toc"/, - /href="#wiki-Header"/, - /id="wiki-Header"/, - /name="wiki-Header"/ - ] - end - -if ENV['ASCIIDOC'] - ######################################################################### - # Asciidoc - ######################################################################### - - test "asciidoc header" do - compare("= Book Title\n\n== Heading", '

    Heading

    ', 'asciidoc') - end - - test "internal links with asciidoc" do - compare("= Book Title\n\n[[anid]]\n== Heading", '

    Heading

    ', 'asciidoc') - end -end - - ######################################################################### - # - # Helpers - # - ######################################################################### - - def render_page(content, ext = "md") - index = @wiki.repo.index - index.add("Bilbo-Baggins.#{ext}", content) - index.commit("Add baggins") - - page = @wiki.page("Bilbo Baggins") - [page, Gollum::Markup.new(page).render] - end - - def compare(content, output, ext = "md", regexes = []) - page, rendered = render_page(content, ext) - - if regexes.empty? - assert_equal normal(output), normal(rendered) - else - output = page.formatted_data - regexes.each { |r| assert_match r, output } - end - end - - def relative_image(content, output) - index = @wiki.repo.index - index.add("greek/alpha.jpg", "hi") - index.add("greek/Bilbo-Baggins.md", content) - index.commit("Add alpha.jpg") - - @wiki.clear_cache - page = @wiki.page("Bilbo Baggins") - rendered = Gollum::Markup.new(page).render - assert_equal normal(output), normal(rendered) - end -end diff --git a/test/test_page.rb b/test/test_page.rb deleted file mode 100644 index 95ef0e05..00000000 --- a/test/test_page.rb +++ /dev/null @@ -1,273 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), "helper")) - -context "Page" do - setup do - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) - end - - test "new page" do - page = Gollum::Page.new(@wiki) - assert_nil page.raw_data - assert_nil page.formatted_data - end - - test "get existing page" do - page = @wiki.page('Bilbo Baggins') - assert_equal Gollum::Page, page.class - assert page.raw_data =~ /^# Bilbo Baggins\n\nBilbo Baggins/ - assert page.formatted_data =~ %r{

    Bilbo Baggins

    \n\n

    Bilbo Baggins} - assert_equal 'Bilbo-Baggins.md', page.path - assert_equal :markdown, page.format - assert_equal @wiki.repo.commits.first.id, page.version.id - end - - test "get existing page case insensitive" do - assert_equal @wiki.page('Bilbo Baggins').path, @wiki.page('bilbo baggins').path - end - - test "get existing page with hyphen" do - assert_equal @wiki.page('Bilbo Baggins').path, @wiki.page('Bilbo-Baggins').path - end - - test "get existing page with underscore" do - assert_nil @wiki.page('Bilbo_Baggins') - end - - test "get existing page where filename contains whitespace, with hypen" do - assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise-Gamgee').path - end - - test "get existing page where filename contains whitespace, with underscore" do - assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise_Gamgee').path - end - - test "get existing page where filename contains whitespace, with whitespace" do - assert_equal @wiki.page('Samwise Gamgee').path, @wiki.page('Samwise Gamgee').path - end - - test "get nested page" do - page = @wiki.page('Eye Of Sauron') - assert_equal 'Mordor/Eye-Of-Sauron.md', page.path - end - - test "url_path" do - page = @wiki.page('Bilbo Baggins') - assert_equal 'Bilbo-Baggins', page.url_path - end - - test "nested url_path" do - page = @wiki.page('Eye Of Sauron') - assert_equal 'Mordor/Eye-Of-Sauron', page.url_path - end - - test "page versions" do - page = @wiki.page('Bilbo Baggins') - assert_equal ["f25eccd98e9b667f9e22946f3e2f945378b8a72d", "5bc1aaec6149e854078f1d0f8b71933bbc6c2e43"], - page.versions.map { |v| v.id } - end - - test "page versions across renames" do - page = @wiki.page 'My-Precious' - assert_equal ['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b', '94523d7ae48aeba575099dd12926420d8fd0425d'], - page.versions(:follow => true).map { |v| v.id } - end - - test "page versions without renames" do - page = @wiki.page 'My-Precious' - assert_equal ['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'], - page.versions(:follow => false).map { |v| v.id } - end - - test "specific page version" do - page = @wiki.page('Bilbo Baggins', 'fbabba862dfa7ac35b39042dd4ad780c9f67b8cb') - assert_equal 'fbabba862dfa7ac35b39042dd4ad780c9f67b8cb', page.version.id - end - - test "no page match" do - assert_nil @wiki.page('I do not exist') - end - - test "no version match" do - assert_nil @wiki.page('Bilbo Baggins', 'I do not exist') - end - - test "no ext match" do - assert_nil @wiki.page('Data') - end - - test "cname" do - assert_equal "Foo", Gollum::Page.cname("Foo") - assert_equal "Foo-Bar", Gollum::Page.cname("Foo Bar") - # / is now a directory delimiter so it must be preserved - assert_equal "Foo-/-Bar", Gollum::Page.cname("Foo / Bar") - assert_equal "José", Gollum::Page.cname("José") - assert_equal "モルドール", Gollum::Page.cname("モルドール") - end - - test "title from filename with normal contents" do - page = @wiki.page('Bilbo Baggins') - assert_equal 'Bilbo Baggins', page.title - end - - test "title from filename with html contents" do - page = @wiki.page('My Precious', '0ed8cbe0a25235bd867e65193c7d837c66b328ef') - assert_equal 'My Precious', page.title - end - - test "title from filename with normal contents" do - page = @wiki.page('Home') - assert_equal "Home", page.title - end - - test "title from filename with html contents" do - page = @wiki.page('Eye Of Sauron') - assert_equal "Eye Of Sauron", page.title - end - - test "top level header" do - header = @wiki.page('Home').header - assert_equal "Hobbits\n", header.raw_data - assert_equal "_Header.md", header.path - end - - test "nested header" do - header = @wiki.page('Eye Of Sauron').header - assert_equal "Sauron\n", header.raw_data - assert_equal "Mordor/_Header.md", header.path - end - - test "header itself" do - header = @wiki.page("_Header") - assert_nil header.header - assert_nil header.footer - assert_nil header.sidebar - end - - test "top level footer" do - footer = @wiki.page('Home').footer - assert_equal 'Lord of the Rings wiki', footer.raw_data - assert_equal '_Footer.md', footer.path - end - - test "nested footer" do - footer = @wiki.page('Eye Of Sauron').footer - assert_equal "Ones does not simply **walk** into Mordor!\n", footer.raw_data - assert_equal "Mordor/_Footer.md", footer.path - end - - test "footer itself" do - footer = @wiki.page("_Footer") - assert_nil footer.header - assert_nil footer.footer - assert_nil footer.sidebar - end - - test "top level sidebar" do - sidebar = @wiki.page('Home').sidebar - assert_equal 'Lord of the Rings wiki', sidebar.raw_data - assert_equal '_Sidebar.md', sidebar.path - end - - test "nested sidebar" do - sidebar = @wiki.page('Eye Of Sauron').sidebar - assert_equal "Ones does not simply **walk** into Mordor!\n", sidebar.raw_data - assert_equal "Mordor/_Sidebar.md", sidebar.path - end - - test "sidebar itself" do - sidebar = @wiki.page("_Sidebar") - assert_nil sidebar.header - assert_nil sidebar.footer - assert_nil sidebar.sidebar - end - - test "cannot convert non string to human readable page title" do - assert_equal '', Gollum::Page.cname(nil) - assert_equal '', Gollum::Page.cname(3) - end - - test "normalize_dir" do - assert_equal "", Gollum::BlobEntry.normalize_dir("") - assert_equal "", Gollum::BlobEntry.normalize_dir(".") - assert_equal "", Gollum::BlobEntry.normalize_dir("/") - assert_equal "", Gollum::BlobEntry.normalize_dir("c:/") - assert_equal "/foo", Gollum::BlobEntry.normalize_dir("foo") - assert_equal "/foo", Gollum::BlobEntry.normalize_dir("/foo") - end -end - -context "with a checkout" do - setup do - @path = cloned_testpath("examples/lotr.git") - @wiki = Gollum::Wiki.new(@path) - end - - teardown do - FileUtils.rm_rf(@path) - end - - test "get existing page with symbolic link" do - page = @wiki.page("Hobbit") - assert_equal Gollum::Page, page.class - assert page.raw_data =~ /^# Bilbo Baggins\n\nBilbo Baggins/ - assert page.formatted_data =~ %r{

    Bilbo Baggins

    \n\n

    Bilbo Baggins} - assert_equal 'Hobbit.md', page.path - assert_equal :markdown, page.format - end -end - -context "within a sub-directory" do - setup do - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git"), { :page_file_dir => 'Rivendell' }) - end - - test "get existing page" do - page = @wiki.page('Elrond') - assert_equal Gollum::Page, page.class - assert page.raw_data =~ /^# Elrond\n\nElrond/ - assert_equal 'Rivendell/Elrond.md', page.path - assert_equal :markdown, page.format - assert_equal @wiki.repo.commits.first.id, page.version.id - end - - test "should not get page from parent dir" do - page = @wiki.page('Bilbo Baggins') - assert_equal nil, page - end - - test "should inherit header/footer/sidebar pages from parent directories" do - page = @wiki.page('Elrond') - - assert_equal Gollum::Page, page.sidebar.class - assert_equal Gollum::Page, page.header.class - assert_equal Gollum::Page, page.footer.class - - assert page.sidebar.raw_data =~ /^Lord of the Rings/ - assert page.header.raw_data =~ /^Hobbits/ - assert page.footer.raw_data =~ /^Lord of the Rings/ - end - -if $METADATA - test "get metadata on page" do - page = @wiki.page('Elrond') - assert_equal Gollum::Page, page.class - assert_equal 'elf', page.metadata['race'] - end -end - -end - -context "with custom markup engines" do - setup do - Gollum::Markup.register(:redacted, "Redacted", :regexp => /rd/) { |content| content.gsub /\S/, '-' } - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) - end - - test "should use the specified engine" do - page = @wiki.page('Riddles') - assert_equal :redacted, page.format - assert page.raw_data.include? 'Time' - assert page.raw_data =~ /^[\s\-]*$/ - end -end \ No newline at end of file diff --git a/test/test_page_revert.rb b/test/test_page_revert.rb deleted file mode 100644 index 2854273f..00000000 --- a/test/test_page_revert.rb +++ /dev/null @@ -1,57 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), "helper")) - -context "Page Reverting" do - setup do - @path = cloned_testpath("examples/revert.git") - @wiki = Gollum::Wiki.new(@path) - end - - teardown do - FileUtils.rm_rf(@path) - end - -=begin - # Grit is broken and this test fails often. See #363. - test "reverts single commit" do - page1 = @wiki.page("B") - sha = @wiki.revert_commit('7c45b5f16ff3bae2a0063191ef832701214d4df5') - page2 = @wiki.page("B") - assert_equal sha, page2.version.sha - assert_equal "INITIAL", body=page2.raw_data.strip - assert_equal body, File.read(File.join(@path, "B.md")).strip - end - - test "reverts single commit for a page" do - page1 = nil - while (page1 == nil) - page1 = @wiki.page('B') - end - - sha = @wiki.revert_page(page1, '7c45b5f16ff3bae2a0063191ef832701214d4df5') - - page2 = nil - while (page2 == nil) - page2 = @wiki.page('B') - end - - assert_equal sha, page2.version.sha - assert_equal "INITIAL", body=page2.raw_data.strip - assert_equal body, File.read(File.join(@path, "B.md")).strip - end - - test "reverts multiple commits for a page" do - page1 = @wiki.page('A') - sha = @wiki.revert_page(page1, '302a5491a9a5ba12c7652ac831a44961afa312d2^', 'b26b791cb7917c4f37dd9cb4d1e0efb24ac4d26f') - page2 = @wiki.page('A') - assert_equal sha, page2.version.sha - assert_equal "INITIAL", body=page2.raw_data.strip - assert_equal body, File.read(File.join(@path, "A.md")).strip - end -=end - - test "cannot revert conflicting commit" do - page1 = @wiki.page('A') - assert_equal false, @wiki.revert_page(page1, '302a5491a9a5ba12c7652ac831a44961afa312d2') - end -end diff --git a/test/test_page_view.rb b/test/test_page_view.rb index 1e3f575b..8b1c266a 100644 --- a/test/test_page_view.rb +++ b/test/test_page_view.rb @@ -1,6 +1,6 @@ # ~*~ encoding: utf-8 ~*~ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) -require File.expand_path '../../lib/gollum/frontend/views/page', __FILE__ +require File.expand_path '../../lib/gollum/views/page', __FILE__ context "Precious::Views::Page" do setup do diff --git a/test/test_pages_view.rb b/test/test_pages_view.rb index 07093ed5..85a0bbde 100644 --- a/test/test_pages_view.rb +++ b/test/test_pages_view.rb @@ -1,6 +1,6 @@ # ~*~ encoding: utf-8 ~*~ require File.expand_path(File.join(File.dirname(__FILE__), 'helper')) -require File.expand_path '../../lib/gollum/frontend/views/pages', __FILE__ +require File.expand_path '../../lib/gollum/views/pages', __FILE__ FakeResult = Struct.new(:path) do def name diff --git a/test/test_unicode.rb b/test/test_unicode.rb index 0313a224..7df8e019 100644 --- a/test/test_unicode.rb +++ b/test/test_unicode.rb @@ -20,73 +20,6 @@ context "Unicode Support" do assert_equal '%ED%95%9C%EA%B8%80', encodeURIComponent(c) assert_equal '%ED%95%9C%EA%B8%80', CGI::escape(c) end - - test "create and read non-latin page with anchor" do - @wiki.write_page("test", :markdown, "# 한글") - - page = @wiki.page("test") - assert_equal Gollum::Page, page.class - assert_equal "# 한글", utf8(page.raw_data) - - # markup.rb - doc = Nokogiri::HTML page.formatted_data - h1s = doc / :h1 - h1 = h1s.first - anchors = h1 / :a - assert_equal 1, h1s.size - assert_equal 1, anchors.size - assert_equal '#한글', anchors[0]['href'] - assert_equal '한글', anchors[0]['id'] - assert_equal 'anchor', anchors[0]['class'] - assert_equal '', anchors[0].text - end - - def check_h1 text, page - @wiki.write_page(page, :markdown, "# " + text) - - page = @wiki.page(page) - assert_equal Gollum::Page, page.class - assert_equal '# ' + text, utf8(page.raw_data) - - output = page.formatted_data - - # UTF-8 headers should not be encoded. - assert_match /

    #{text}<\/a><\/h1>/, output - end - - test "create and read non-latin page with anchor" do - # href="#한글" - # href="#%ED%95%9C%EA%B8%80" - check_h1 '한글', '1' - # href="#Synhtèse" - # href="#Synht%C3%A8se" - check_h1 'Synhtèse', '2' - end - - test "create and read non-latin page with anchor 2" do - @wiki.write_page("test", :markdown, "# \"La\" faune d'Édiacara") - - page = @wiki.page("test") - assert_equal Gollum::Page, page.class - assert_equal "# \"La\" faune d'Édiacara", utf8(page.raw_data) - - # markup.rb test: ', ", É - doc = Nokogiri::HTML page.formatted_data - h1s = doc / :h1 - h1 = h1s.first - anchors = h1 / :a - assert_equal 1, h1s.size - assert_equal 1, anchors.size - assert_equal %q(#%22La%22-faune-d'Édiacara), anchors[0]['href'] - assert_equal %q(%22La%22-faune-d'Édiacara), anchors[0]['id'] - assert_equal 'anchor', anchors[0]['class'] - assert_equal '', anchors[0].text - end - - test "unicode with existing format rules" do - @wiki.write_page("test", :markdown, "# 한글") - assert_equal @wiki.page("test").path, @wiki.page("test").path - end end context "Frontend Unicode support" do diff --git a/test/test_wiki.rb b/test/test_wiki.rb deleted file mode 100644 index ab85d819..00000000 --- a/test/test_wiki.rb +++ /dev/null @@ -1,667 +0,0 @@ -# ~*~ encoding: utf-8 ~*~ -require File.expand_path(File.join(File.dirname(__FILE__), "helper")) - -context "Wiki" do - setup do - @wiki = Gollum::Wiki.new(testpath("examples/lotr.git")) - Gollum::Wiki.markup_classes = nil - end - - test "#markup_class gets default markup" do - assert_equal Gollum::Markup, Gollum::Wiki.markup_class - end - - test "#default_markup_class= doesn't clobber alternate markups" do - custom = Class.new(Gollum::Markup) - custom_md = Class.new(Gollum::Markup) - - Gollum::Wiki.markup_classes = Hash.new Gollum::Markup - Gollum::Wiki.markup_classes[:markdown] = custom_md - Gollum::Wiki.default_markup_class = custom - - assert_equal custom, Gollum::Wiki.default_markup_class - assert_equal custom, Gollum::Wiki.markup_classes[:orgmode] - assert_equal custom_md, Gollum::Wiki.markup_classes[:markdown] - end - - test "repo path" do - assert_equal testpath("examples/lotr.git"), @wiki.path - end - - test "git repo" do - assert_equal Grit::Repo, @wiki.repo.class - assert @wiki.exist? - end - - test "shows paginated log with no page" do - Gollum::Wiki.per_page = 3 - commits = @wiki.repo.commits[0..2].map { |x| x.id } - assert_equal commits, @wiki.log.map { |c| c.id } - end - - test "shows paginated log with 1st page" do - Gollum::Wiki.per_page = 3 - commits = @wiki.repo.commits[0..2].map { |x| x.id } - assert_equal commits, @wiki.log(:page => 1).map { |c| c.id } - end - - test "shows paginated log with next page" do - Gollum::Wiki.per_page = 3 - commits = @wiki.repo.commits[3..5].map { |x| x.id } - assert_equal commits, @wiki.log(:page => 2).map { |c| c.id } - end - - test "list pages" do - pages = @wiki.pages - assert_equal \ - ['Bilbo-Baggins.md', 'Boromir.md', 'Elrond.md', 'Eye-Of-Sauron.md', 'Hobbit.md', 'Home.textile', 'My-Precious.md', 'Samwise Gamgee.mediawiki'], - pages.map { |p| p.filename }.sort - end - - test "list files" do - files = @wiki.files - assert_equal \ - ['Data-Two.csv', 'Data.csv', 'Riddles.rd', 'eye.jpg', 'todo.txt'], - files.map { |p| p.filename }.sort - end - - test "counts pages" do - assert_equal 8, @wiki.size - end - - test "text_data" do - wiki = Gollum::Wiki.new(testpath("examples/yubiwa.git")) - if String.instance_methods.include?(:encoding) - utf8 = wiki.page("strider").text_data - assert_equal Encoding::UTF_8, utf8.encoding - sjis = wiki.page("sjis").text_data(Encoding::SHIFT_JIS) - assert_equal Encoding::SHIFT_JIS, sjis.encoding - else - page = wiki.page("strider") - assert_equal page.raw_data, page.text_data - end - end - - test "gets reverse diff" do - diff = @wiki.full_reverse_diff('a8ad3c09dd842a3517085bfadd37718856dee813') - assert_match "b/Mordor/_Sidebar.md", diff - assert_match "b/_Sidebar.md", diff - end - - test "gets reverse diff for a page" do - diff = @wiki.full_reverse_diff_for('_Sidebar.md', 'a8ad3c09dd842a3517085bfadd37718856dee813') - regex = /b\/Mordor\/\_Sidebar\.md/ - assert_match "b/_Sidebar.md", diff - assert_no_match regex, diff - end - - test "gets scoped page from specified directory" do - @path = cloned_testpath('examples/lotr.git') - begin - wiki = Gollum::Wiki.new(@path) - index = wiki.repo.index - index.read_tree 'master' - index.add('Foobar/Elrond.md', 'Baz') - index.commit 'Add Foobar/Elrond.', [wiki.repo.commits.last], Grit::Actor.new('Tom Preston-Werner', 'tom@github.com') - - assert_equal 'Rivendell/Elrond.md', wiki.page('Elrond', nil, 'Rivendell').path - # test paged as well. - assert_equal 'Foobar/Elrond.md', wiki.paged('Elrond', 'Foobar').path - ensure - FileUtils.rm_rf(@path) - end - end -end - -context "Wiki page previewing" do - setup do - @path = testpath("examples/lotr.git") - Gollum::Wiki.default_options = {:universal_toc => false} - @wiki = Gollum::Wiki.new(@path) - end - - test "preview_page" do - page = @wiki.preview_page("Test", "# Bilbo", :markdown) - assert_equal "# Bilbo", page.raw_data - assert_equal %Q{

    Bilbo

    }, page.formatted_data - assert_equal "Test.md", page.filename - assert_equal "Test", page.name - end -end - -context "Wiki TOC" do - setup do - @path = testpath("examples/lotr.git") - options = {:universal_toc => true} - @wiki = Gollum::Wiki.new(@path, options) - end - - test "toc_generation" do - page = @wiki.preview_page("Test", "# Bilbo", :markdown) - assert_equal "# Bilbo", page.raw_data - assert_equal '

    Bilbo

    ', page.formatted_data.gsub(/\n/,"") - assert_equal %{
    Table of Contents
    }, page.toc_data.gsub(/\n */,"") - end - - # Ensure ' creates valid links in TOC - # Incorrect: - # Correct: - test "' in link" do - page = @wiki.preview_page("Test", "# a'b", :markdown) - assert_equal "# a'b", page.raw_data - assert_equal %q{

    a'b

    }, page.formatted_data.gsub(/\n/,"") - assert_equal %{
    Table of Contents
    }, page.toc_data.gsub(/\n */,"") - end -end - -context "Wiki page writing" do - setup do - @path = testpath("examples/test.git") - FileUtils.rm_rf(@path) - Grit::Repo.init_bare(@path) - @wiki = Gollum::Wiki.new(@path) - end - - test "write_page" do - cd = commit_details - @wiki.write_page("Gollum", :markdown, "# Gollum", cd) - assert_equal 1, @wiki.repo.commits.size - assert_equal cd[:message], @wiki.repo.commits.first.message - assert_equal cd[:name], @wiki.repo.commits.first.author.name - assert_equal cd[:email], @wiki.repo.commits.first.author.email - assert @wiki.page("Gollum") - - @wiki.write_page("Bilbo", :markdown, "# Bilbo", commit_details) - assert_equal 2, @wiki.repo.commits.size - assert @wiki.page("Bilbo") - assert @wiki.page("Gollum") - end - - test "is not allowed to overwrite file" do - @wiki.write_page("Abc-Def", :markdown, "# Gollum", commit_details) - assert_raises Gollum::DuplicatePageError do - @wiki.write_page("ABC DEF", :textile, "# Gollum", commit_details) - end - end - - test "update_page" do - @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) - - page = @wiki.page("Gollum") - cd = commit_details - @wiki.update_page(page, page.name, :markdown, "# Gollum2", cd) - - assert_equal 2, @wiki.repo.commits.size - assert_equal "# Gollum2", @wiki.page("Gollum").raw_data - assert_equal cd[:message], @wiki.repo.commits.first.message - assert_equal cd[:name], @wiki.repo.commits.first.author.name - assert_equal cd[:email], @wiki.repo.commits.first.author.email - end - -if $METADATA - test "page title override with metadata" do - @wiki.write_page("Gollum", :markdown, "", commit_details) - - page = @wiki.page("Gollum") - - assert_equal 'Over', page.url_path_title - end -end - - test "update page with format change" do - @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) - - assert_equal :markdown, @wiki.page("Gollum").format - - page = @wiki.page("Gollum") - @wiki.update_page(page, page.name, :textile, "h1. Gollum", commit_details) - - assert_equal 2, @wiki.repo.commits.size - assert_equal :textile, @wiki.page("Gollum").format - assert_equal "h1. Gollum", @wiki.page("Gollum").raw_data - end - - test "update page with name change" do - @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) - - assert_equal :markdown, @wiki.page("Gollum").format - - page = @wiki.page("Gollum") - @wiki.update_page(page, 'Smeagol', :markdown, "h1. Gollum", commit_details) - - assert_equal 2, @wiki.repo.commits.size - assert_equal "h1. Gollum", @wiki.page("Smeagol").raw_data - end - - test "update page with name and format change" do - @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) - - assert_equal :markdown, @wiki.page("Gollum").format - - page = @wiki.page("Gollum") - @wiki.update_page(page, 'Smeagol', :textile, "h1. Gollum", commit_details) - - assert_equal 2, @wiki.repo.commits.size - assert_equal :textile, @wiki.page("Smeagol").format - assert_equal "h1. Gollum", @wiki.page("Smeagol").raw_data - end - - test "update nested page with format change" do - index = @wiki.repo.index - index.add("lotr/Gollum.md", "# Gollum") - index.commit("Add nested page") - - page = @wiki.page("Gollum") - assert_equal :markdown, @wiki.page("Gollum").format - @wiki.update_page(page, page.name, :textile, "h1. Gollum", commit_details) - - page = @wiki.page("Gollum") - assert_equal "lotr/Gollum.textile", page.path - assert_equal :textile, page.format - assert_equal "h1. Gollum", page.raw_data - end - - test "delete root page" do - @wiki.write_page("Gollum", :markdown, "# Gollum", commit_details) - - page = @wiki.page("Gollum") - @wiki.delete_page(page, commit_details) - - assert_equal 2, @wiki.repo.commits.size - assert_nil @wiki.page("Gollum") - end - - test "delete nested page" do - index = @wiki.repo.index - index.add("greek/Bilbo-Baggins.md", "hi") - index.add("Gollum.md", "hi") - index.commit("Add alpha.jpg") - - page = @wiki.page("Bilbo-Baggins") - assert page - @wiki.delete_page(page, commit_details) - - assert_equal 2, @wiki.repo.commits.size - assert_nil @wiki.page("Bilbo-Baggins") - - assert @wiki.page("Gollum") - end - - teardown do - FileUtils.rm_r(File.join(File.dirname(__FILE__), *%w[examples test.git])) - end -end - -context "Wiki page writing with whitespace (filename contains whitespace)" do - setup do - @path = cloned_testpath("examples/lotr.git") - @wiki = Gollum::Wiki.new(@path) - end - - test "update_page" do - assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format - assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename - - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, page.name, :textile, "h1. Samwise Gamgee2", commit_details) - - assert_equal :textile, @wiki.page("Samwise Gamgee").format - assert_equal "h1. Samwise Gamgee2", @wiki.page("Samwise Gamgee").raw_data - assert_equal "Samwise-Gamgee.textile", @wiki.page("Samwise Gamgee").filename - end - - test "update page with format change, verify non-canonicalization of filename, where filename contains Whitespace" do - assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format - assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename - - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, page.name, :textile, "h1. Samwise Gamgee", commit_details) - - assert_equal :textile, @wiki.page("Samwise Gamgee").format - assert_equal "h1. Samwise Gamgee", @wiki.page("Samwise Gamgee").raw_data - assert_equal "Samwise-Gamgee.textile", @wiki.page("Samwise Gamgee").filename - end - - test "update page with name change, verify canonicalization of filename, where filename contains Whitespace" do - assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format - assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename - - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, 'Sam Gamgee', :textile, "h1. Samwise Gamgee", commit_details) - - assert_equal "h1. Samwise Gamgee", @wiki.page("Sam Gamgee").raw_data - assert_equal "Sam-Gamgee.textile", @wiki.page("Sam Gamgee").filename - end - - test "update page with name and format change, verify canonicalization of filename, where filename contains Whitespace" do - assert_equal :mediawiki, @wiki.page("Samwise Gamgee").format - assert_equal "Samwise Gamgee.mediawiki", @wiki.page("Samwise Gamgee").filename - - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, 'Sam Gamgee', :textile, "h1. Samwise Gamgee", commit_details) - - assert_equal :textile, @wiki.page("Sam Gamgee").format - assert_equal "h1. Samwise Gamgee", @wiki.page("Sam Gamgee").raw_data - assert_equal "Sam-Gamgee.textile", @wiki.page("Sam Gamgee").filename - end - - teardown do - FileUtils.rm_rf(@path) - end -end - -context "Wiki sync with working directory" do - setup do - @path = testpath('examples/wdtest') - Grit::Repo.init(@path) - @wiki = Gollum::Wiki.new(@path) - end - - test "write a page" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - assert_equal "Hi", File.read(File.join(@path, "New-Page.md")) - end - - test "write a page in subdirectory" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details, "Subdirectory") - assert_equal "Hi", File.read(File.join(@path, "Subdirectory", "New-Page.md")) - end - - test "update a page with same name and format" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - page = @wiki.page("New Page") - @wiki.update_page(page, page.name, page.format, "Bye", commit_details) - assert_equal "Bye", File.read(File.join(@path, "New-Page.md")) - end - - test "update a page with different name and same format" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - page = @wiki.page("New Page") - @wiki.update_page(page, "New Page 2", page.format, "Bye", commit_details) - assert_equal "Bye", File.read(File.join(@path, "New-Page-2.md")) - assert !File.exist?(File.join(@path, "New-Page.md")) - end - - test "update a page with same name and different format" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - page = @wiki.page("New Page") - @wiki.update_page(page, page.name, :textile, "Bye", commit_details) - assert_equal "Bye", File.read(File.join(@path, "New-Page.textile")) - assert !File.exist?(File.join(@path, "New-Page.md")) - end - - test "update a page with different name and different format" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - page = @wiki.page("New Page") - @wiki.update_page(page, "New Page 2", :textile, "Bye", commit_details) - assert_equal "Bye", File.read(File.join(@path, "New-Page-2.textile")) - assert !File.exist?(File.join(@path, "New-Page.md")) - end - - test "delete a page" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - page = @wiki.page("New Page") - @wiki.delete_page(page, commit_details) - assert !File.exist?(File.join(@path, "New-Page.md")) - end - - teardown do - FileUtils.rm_r(@path) - end -end - -context "Wiki sync with working directory (filename contains whitespace)" do - setup do - @path = cloned_testpath("examples/lotr.git") - @wiki = Gollum::Wiki.new(@path) - end - test "update a page with same name and format" do - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, page.name, page.format, "What we need is a few good taters.", commit_details) - assert_equal "What we need is a few good taters.", File.read(File.join(@path, "Samwise Gamgee.mediawiki")) - end - - test "update a page with different name and same format" do - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, "Sam Gamgee", page.format, "What we need is a few good taters.", commit_details) - assert_equal "What we need is a few good taters.", File.read(File.join(@path, "Sam-Gamgee.mediawiki")) - assert !File.exist?(File.join(@path, "Samwise Gamgee")) - end - - test "update a page with same name and different format" do - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, page.name, :textile, "What we need is a few good taters.", commit_details) - assert_equal "What we need is a few good taters.", File.read(File.join(@path, "Samwise-Gamgee.textile")) - assert !File.exist?(File.join(@path, "Samwise-Gamgee.mediawiki")) - end - - test "update a page with different name and different format" do - page = @wiki.page("Samwise Gamgee") - @wiki.update_page(page, "Sam Gamgee", :textile, "What we need is a few good taters.", commit_details) - assert_equal "What we need is a few good taters.", File.read(File.join(@path, "Sam-Gamgee.textile")) - assert !File.exist?(File.join(@path, "Samwise Gamgee.mediawiki")) - end - - test "delete a page" do - page = @wiki.page("Samwise Gamgee") - @wiki.delete_page(page, commit_details) - assert !File.exist?(File.join(@path, "Samwise Gamgee.mediawiki")) - end - - teardown do - FileUtils.rm_r(@path) - end -end - -context "page_file_dir option" do - setup do - @path = cloned_testpath('examples/page_file_dir') - @repo = Grit::Repo.init(@path) - @page_file_dir = 'docs' - @wiki = Gollum::Wiki.new(@path, :page_file_dir => @page_file_dir) - end - - test "write a page in sub directory" do - @wiki.write_page("New Page", :markdown, "Hi", commit_details) - assert_equal "Hi", File.read(File.join(@path, @page_file_dir, "New-Page.md")) - assert !File.exist?(File.join(@path, "New-Page.md")) - end - - test "edit a page in a sub directory" do - page = @wiki.page('foo') - @wiki.update_page(page, page.name, page.format, 'new contents', commit_details) - end - - test "a file in page file dir should be found" do - assert @wiki.page("foo") - end - - test "a file out of page file dir should not be found" do - assert !@wiki.page("bar") - end - - test "search results should be restricted in page filer dir" do - results = @wiki.search("foo") - assert_equal 1, results.size - assert_equal "docs/foo", results[0][:name] - end - - test "search results should make the content/filename search additive" do - # This file contains the word 'foo' and is called 'foo', so it should - # have a count of 2, not 1... - results = @wiki.search("foo") - assert_equal 2, results[0][:count] - end - - teardown do - FileUtils.rm_r(@path) - end -end - -context "Wiki page writing with different branch" do - setup do - @path = testpath("examples/test.git") - FileUtils.rm_rf(@path) - @repo = Grit::Repo.init_bare(@path) - @wiki = Gollum::Wiki.new(@path) - - # We need an initial commit to create the master branch - # before we can create new branches - cd = commit_details - @wiki.write_page("Gollum", :markdown, "# Gollum", cd) - - # Create our test branch and check it out - @repo.update_ref("test", @repo.commits.first.id) - @branch = Gollum::Wiki.new(@path, :ref => "test") - end - - teardown do - FileUtils.rm_rf(@path) - end - - test "write_page" do - cd = commit_details - - @branch.write_page("Bilbo", :markdown, "# Bilbo", commit_details) - assert @branch.page("Bilbo") - assert @wiki.page("Gollum") - - assert_equal 1, @wiki.repo.commits.size - assert_equal 1, @branch.repo.commits.size - - assert_equal nil, @wiki.page("Bilbo") - end -end - -context "Renames directory traversal" do - setup do - @path = cloned_testpath("examples/revert.git") - @wiki = Gollum::Wiki.new(@path) - Precious::App.set(:gollum_path, @path) - Precious::App.set(:wiki_options, {}) - end - - teardown do - FileUtils.rm_rf(@path) - end - - test "rename aborts on nil" do - cd = {:message => "def"} - res = @wiki.rename_page(@wiki.page("some-super-fake-page"), "B", cd) - assert !res, "rename did not abort with non-existant page" - res = @wiki.rename_page(@wiki.page("B"), "", cd) - assert !res, "rename did not abort with empty rename" - res = @wiki.rename_page(@wiki.page("B"), nil, cd) - assert !res, "rename did not abort with nil rename" - end - - test "rename page no-act" do - # Make sure renames don't do anything if the name is the same. - cd = {:message => "def"} - - # B.md => B.md - res = @wiki.rename_page(@wiki.page("B"), "B", cd) - assert !res, "NOOP rename did not abort" - end - - test "rename page without directories" do - # Make sure renames work with relative paths. - cd = {:message => "def"} - source = @wiki.page("B") - - # B.md => C.md - res = @wiki.rename_page(source, "C", cd) - assert res - - renamed_ok(source, @wiki.page("C")) - end - - test "rename page with subdirs" do - # Make sure renames in subdirectories happen ok - cd = {:message => "def"} - source = @wiki.paged("H", "G") - - # G/H.md => G/F.md - @wiki.rename_page(source, "G/F", cd) - - renamed_ok(source, @wiki.paged("F", "G")) - end - - test "rename page absolute path is still no-act" do - # Make sure renames don't do anything if the name is the same. - cd = {:message => "def"} - - # B.md => B.md - res = @wiki.rename_page(@wiki.page("B"), "/B", cd) - assert !res, "NOOP rename did not abort" - end - - test "rename page absolute path NOOPs ok" do - # Make sure renames don't do anything if the name is the same and we are in a subdirectory. - cd = {:message => "def"} - source = @wiki.paged("H", "G") - - # G/H.md => G/H.md - res = @wiki.rename_page(source, "/G/H", cd) - assert !res, "NOOP rename did not abort" - end - - test "rename page absolute directory" do - # Make sure renames work with absolute paths. - cd = {:message => "def"} - source = @wiki.page("B") - - # B.md => C.md - res = @wiki.rename_page(source, "/C", cd) - assert res - - renamed_ok(source, @wiki.page("C")) - end - - test "rename page absolute directory with subdirs" do - # Make sure renames in subdirectories happen ok - cd = {:message => "def"} - source = @wiki.paged("H", "G") - - # G/H.md => G/F.md - @wiki.rename_page(source, "/G/F", cd) - - renamed_ok(source, @wiki.paged("F", "G")) - end - - test "rename page relative directory with new dir creation" do - # Make sure renames in subdirectories create more subdirectories ok - cd = {:message => "def"} - source = @wiki.paged("H", "G") - - # G/H.md => G/K/F.md - assert_not_equal k = @wiki.rename_page(source, "K/F", cd), false - - new_page = @wiki.paged("F", "K") - assert_not_equal new_page, nil - renamed_ok(source, new_page) - end - - test "rename page absolute directory with subdir creation" do - # Make sure renames in subdirectories create more subdirectories ok - cd = {:message => "def"} - source = @wiki.paged("H", "G") - - # G/H.md => G/K/F.md - assert_not_equal @wiki.rename_page(source, "/G/K/F", cd), false - - new_page = @wiki.paged("F", "G/K") - assert_not_equal new_page, nil - renamed_ok(source, new_page) - end - - def renamed_ok(page_source, page_target) - @wiki.clear_cache - page1 = @wiki.paged(page_source.name, page_source.path) - assert_nil page1 - assert_equal "INITIAL\n\nSPAM2\n", page_target.raw_data - assert_equal 'def', page_target.version.message - assert_not_equal page_source.version.sha, page_target.version.sha - end -end - diff --git a/test/wiki_factory.rb b/test/wiki_factory.rb deleted file mode 100644 index a6c81174..00000000 --- a/test/wiki_factory.rb +++ /dev/null @@ -1,12 +0,0 @@ -class WikiFactory - def self.create p, opt={} - path = testpath "examples/test.git" - Grit::Repo.init_bare(path) - Gollum::Wiki.default_options = {:universal_toc => false}.merge(opt) - cleanup = Proc.new { FileUtils.rm_r File.join(File.dirname(__FILE__), *%w[examples test.git]) } - wiki = Gollum::Wiki.new(path) - # set 'wiki-' prefix on ids for tests - wiki.sanitization.id_prefix = 'wiki-' - return wiki, path, cleanup - end -end