gollum 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of gollum might be problematic. Click here for more details.
- data/README.md +44 -7
- data/Rakefile +1 -1
- data/bin/gollum +20 -1
- data/gollum.gemspec +400 -5
- data/lib/gollum.rb +2 -1
- data/lib/gollum/blob_entry.rb +13 -1
- data/lib/gollum/committer.rb +10 -1
- data/lib/gollum/file.rb +15 -2
- data/lib/gollum/file_view.rb +145 -0
- data/lib/gollum/frontend/app.rb +217 -69
- data/lib/gollum/frontend/helpers.rb +21 -0
- data/lib/gollum/frontend/public/gollum/css/_styles.css +121 -0
- data/lib/gollum/frontend/public/gollum/css/editor.css +17 -8
- data/lib/gollum/frontend/public/gollum/css/gollum.css +440 -402
- data/lib/gollum/frontend/public/gollum/css/template.css +540 -289
- data/lib/gollum/frontend/public/gollum/images/dirty-shade.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/document.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/folder-horizontal.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small-expand.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/fileview/toggle-small.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/para.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-16.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-20.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-24.png +0 -0
- data/lib/gollum/frontend/public/gollum/images/pin-32.png +0 -0
- data/lib/gollum/frontend/public/gollum/javascript/editor/gollum.editor.js +31 -7
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/asciidoc.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/creole.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/markdown.js +18 -6
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/org.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/pod.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/editor/langs/textile.js +2 -1
- data/lib/gollum/frontend/public/gollum/javascript/gollum.dialog.js +3 -0
- data/lib/gollum/frontend/public/gollum/javascript/gollum.js +78 -16
- data/lib/gollum/frontend/public/gollum/javascript/jquery-1.7.2.min.js +4 -0
- data/lib/gollum/frontend/public/gollum/javascript/mousetrap.min.js +8 -0
- data/lib/gollum/frontend/public/gollum/livepreview/css/custom.css +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/cancel_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/save_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/images/savecomment_24.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/index.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ace.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor.js +254 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/anchor_test.js +184 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer.js +261 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/background_tokenizer_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/command_manager_test.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/default_commands.js +460 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/commands/multi_select_commands.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/config.js +124 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/codefolding-fold-button-states.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/editor.css +327 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/css/expand-marker.png +0 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document.js +617 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/document_test.js +314 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session.js +2419 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/bracket_match.js +252 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/fold_line.js +276 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session/folding.js +759 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/edit_session_test.js +981 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor.js +2163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_change_document_test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_highlight_selected_word_test.js +231 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_navigation_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/editor_text_edit_test.js +562 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static.css +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/static_highlight_test.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/ext/textarea.js +536 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/emacs.js +367 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/hash_handler.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/keybinding.js +143 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/state_handler.js +257 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/textinput.js +315 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/commands.js +556 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/aliases.js +101 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/motions.js +611 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/operators.js +193 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/maps/util.js +134 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/keyboard/vim/registers.js +49 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/cursor.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/gutter.js +187 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/marker.js +214 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text.js +595 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/layer/text_test.js +106 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/browser_focus.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/dom.js +292 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/es5-shim.js +1059 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event.js +317 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/event_emitter_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/fixoldbrowsers.js +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/keys.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/lang.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/net.js +62 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/oop.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/regexp.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/lib/useragent.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/cstyle.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/html.js +98 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xml.js +113 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/behaviour/xquery.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c9search_highlight_rules.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/c_cpp_highlight_rules.js +180 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/clojure_highlight_rules.js +235 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee.js +121 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/coffee-script.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/helpers.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/lexer.js +739 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/nodes.js +2756 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser.js +603 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/parser_test.js +68 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/rewriter.js +342 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee/scope.js +154 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules.js +227 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_highlight_rules_test.js +72 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coffee_worker.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_highlight_rules.js +135 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/coldfusion_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/csharp_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css.js +110 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css/csslint.js +9014 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules.js +242 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_highlight_rules_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_test.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker.js +66 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/css_worker_test.js +75 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/diff_highlight_rules.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/doc_comment_highlight_rules.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/c9search.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee.js +127 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/coffee_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle.js +95 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/cstyle_test.js +92 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/diff.js +76 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/fold_mode.js +115 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/html_test.js +169 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/mixed.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/pythonic_test.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml.js +262 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/folding/xml_test.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/golang_highlight_rules.js +129 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy.js +24 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/groovy_highlight_rules.js +183 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/haxe_highlight_rules.js +104 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html.js +83 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_highlight_rules_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/html_test.js +74 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/java_highlight_rules.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules.js +471 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_highlight_rules_test.js +225 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_test.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker.js +88 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/javascript_worker_test.js +99 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json/json_parse.js +346 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_highlight_rules.js +111 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/json_worker_test.js +108 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx.js +53 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/jsx_highlight_rules.js +122 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex.js +57 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/latex_highlight_rules.js +38 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/less_highlight_rules.js +279 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules.js +220 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/liquid_highlight_rules_test.js +91 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/lua_highlight_rules.js +436 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/luapage_highlight_rules.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/markdown_highlight_rules.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_brace_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/matching_parens_outdent.js +81 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ocaml_highlight_rules.js +355 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl.js +117 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/perl_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/pgsql_highlight_rules.js +583 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php.js +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/php_highlight_rules.js +1165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/powershell_highlight_rules.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python.js +147 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_highlight_rules.js +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/python_test.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules.js +194 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/ruby_highlight_rules_test.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad.js +132 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scad_highlight_rules.js +168 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala.js +25 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scala_highlight_rules.js +179 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/scss_highlight_rules.js +304 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh.js +144 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sh_highlight_rules.js +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/sql_highlight_rules.js +89 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg.js +78 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/svg_highlight_rules.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text.js +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/text_test.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/textile_highlight_rules.js +100 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules.js +109 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_highlight_rules_test.js +103 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_test.js +82 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xml_util.js +120 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery.js +202 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Position.js +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/Readme.md +6 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/StringLexer.js +1686 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XMLLexer.js +2993 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTLexer.js +69 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQDTParser.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryLexer.js +10363 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQueryParser.js +42525 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/XQuerySemanticHighlighter.js +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/antlr3-all.js +6177 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery/xquery.js +55 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_highlight_rules.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/xquery_worker.js +86 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml.js +64 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mode/yaml_highlight_rules.js +116 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/model/editor.js +70 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_gutter_handler.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/default_handlers.js +354 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/dragdrop.js +105 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/fold_handler.js +71 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_event.js +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/mouse_handler.js +158 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/mouse/multi_select_handler.js +163 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select.js +762 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/multi_select_test.js +171 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/definitions.js +696 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/lexer.js +598 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/options.js +61 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/narcissus/parser.js +2072 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder.js +278 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/placeholder_test.js +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range.js +581 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list.js +230 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_list_test.js +170 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/range_test.js +198 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/renderloop.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/requirejs/text.js +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/scrollbar.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search.js +398 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_highlight.js +87 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/search_test.js +451 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection.js +886 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/selection_test.js +472 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/split.js +411 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all.js +42 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/all_browser.js +136 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/assertions.js +63 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/assert.js +313 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/async.js +529 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/index.js +13 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/test.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/asyncjs/utils.js +65 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/benchmark.js +85 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockdom.js +10 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/mockrenderer.js +204 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/test/tests.html +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.css +159 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/chrome.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.css +118 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.css +119 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/clouds_midnight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/cobalt.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.css +151 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/crimson_editor.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.css +149 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dawn.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.css +182 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/dreamweaver.js +45 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.css +102 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/eclipse.js +48 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.css +133 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/github.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.css +137 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/idle_fingers.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/kr_theme.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.css +140 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.css +146 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/merbivore_soft.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.css +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/mono_industrial.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.css +145 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/monokai.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.css +150 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/pastel_on_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.css +131 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_dark.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.css +130 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/solarized_light.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.css +165 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/textmate.js +47 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_blue.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.css +164 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_bright.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.css +160 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/tomorrow_night_eighties.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.css +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/twilight.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.css +141 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/theme/vibrant_ink.js +46 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator.js +162 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/token_iterator_test.js +219 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/tokenizer.js +195 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/undomanager.js +142 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/unicode.js +107 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer.js +1402 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/virtual_renderer_test.js +93 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jshint.js +4469 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/jslint.js +6396 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/mirror.js +43 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker.js +138 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_client.js +176 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/ace/lib/ace/worker/worker_sourcemint.js +73 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/jquery.ba-throttle-debounce.min.js +2 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +456 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/md_sundown.js +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/requirejs.min.js +35 -0
- data/lib/gollum/frontend/public/gollum/livepreview/js/sundown.js +1 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/ace/LICENSE.txt +476 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/bootstraponline_gollum/LICENSE.txt +9 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/debounce/LICENSE-MIT.txt +22 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/gollum/LICENSE.txt +21 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/jquery/MIT-LICENSE.txt +20 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +59 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/notepages/LICENSE.txt +19 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/requirejs/LICENSE.txt +58 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt +359 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt +148 -0
- data/lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt +4 -0
- data/lib/gollum/frontend/public/gollum/livepreview/readme.md +44 -0
- data/lib/gollum/frontend/templates/compare.mustache +9 -9
- data/lib/gollum/frontend/templates/create.mustache +4 -1
- data/lib/gollum/frontend/templates/edit.mustache +6 -3
- data/lib/gollum/frontend/templates/editor.mustache +30 -14
- data/lib/gollum/frontend/templates/file_view.mustache +32 -0
- data/lib/gollum/frontend/templates/history.mustache +8 -8
- data/lib/gollum/frontend/templates/layout.mustache +21 -14
- data/lib/gollum/frontend/templates/page.mustache +37 -14
- data/lib/gollum/frontend/templates/pages.mustache +14 -10
- data/lib/gollum/frontend/templates/search.mustache +2 -2
- data/lib/gollum/frontend/templates/searchbar.mustache +1 -1
- data/lib/gollum/frontend/uri_encode_component.rb +172 -0
- data/lib/gollum/frontend/views/compare.rb +2 -4
- data/lib/gollum/frontend/views/create.rb +5 -0
- data/lib/gollum/frontend/views/edit.rb +12 -0
- data/lib/gollum/frontend/views/file_view.rb +19 -0
- data/lib/gollum/frontend/views/has_page.rb +15 -0
- data/lib/gollum/frontend/views/history.rb +8 -4
- data/lib/gollum/frontend/views/layout.rb +9 -1
- data/lib/gollum/frontend/views/page.rb +37 -10
- data/lib/gollum/frontend/views/pages.rb +48 -0
- data/lib/gollum/git_access.rb +2 -2
- data/lib/gollum/markup.rb +115 -19
- data/lib/gollum/page.rb +79 -9
- data/lib/gollum/tex.rb +319 -42
- data/lib/gollum/wiki.rb +92 -12
- data/licenses/css_tree_menu_thecssninja/license.txt +50 -0
- data/licenses/licenses.txt +23 -0
- data/licenses/unity_asset_pool/COPYRIGHT +286 -0
- data/test/examples/lotr.git/config +1 -1
- data/test/examples/lotr.git/logs/HEAD +4 -0
- data/test/examples/lotr.git/logs/refs/heads/master +4 -0
- data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
- data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
- data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
- data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
- data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
- data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
- data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +2 -0
- data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
- data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +1 -0
- data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
- data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
- data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
- data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
- data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
- data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
- data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
- data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
- data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
- data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +2 -0
- data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
- data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +1 -0
- data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
- data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
- data/test/examples/lotr.git/refs/heads/master +1 -1
- data/test/examples/revert.git/COMMIT_EDITMSG +1 -1
- data/test/examples/revert.git/index +0 -0
- data/test/examples/revert.git/logs/HEAD +1 -0
- data/test/examples/revert.git/logs/refs/heads/master +1 -0
- data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
- data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
- data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +3 -0
- data/test/examples/revert.git/refs/heads/master +1 -1
- data/test/file_view/1_file.txt +3 -0
- data/test/file_view/1_file_1_folder.txt +8 -0
- data/test/file_view/1_folder.txt +8 -0
- data/test/file_view/2_files_2_folders.txt +12 -0
- data/test/file_view/2_files_2_folders_1_root.txt +13 -0
- data/test/file_view/nested_folders.txt +28 -0
- data/test/test_app.rb +162 -12
- data/test/test_app_helpers.rb +13 -0
- data/test/test_committer.rb +1 -1
- data/test/test_file_view.rb +102 -0
- data/test/test_git_access.rb +3 -2
- data/test/test_markup.rb +45 -12
- data/test/test_page.rb +65 -1
- data/test/test_page_revert.rb +14 -2
- data/test/test_pages_view.rb +37 -0
- data/test/test_unicode.rb +110 -0
- data/test/test_wiki.rb +51 -4
- metadata +658 -239
- data/lib/gollum/frontend/public/gollum/javascript/jquery.js +0 -7179
data/lib/gollum/tex.rb
CHANGED
@@ -2,6 +2,7 @@ require 'fileutils'
|
|
2
2
|
require 'shellwords'
|
3
3
|
require 'tmpdir'
|
4
4
|
require 'posix/spawn'
|
5
|
+
require 'base64'
|
5
6
|
|
6
7
|
module Gollum
|
7
8
|
module Tex
|
@@ -10,80 +11,356 @@ module Gollum
|
|
10
11
|
extend POSIX::Spawn
|
11
12
|
|
12
13
|
Template = <<-EOS
|
13
|
-
\\documentclass[
|
14
|
-
\\usepackage{color}
|
15
|
-
\\usepackage[dvips]{graphicx}
|
14
|
+
\\documentclass[11pt]{article}
|
16
15
|
\\pagestyle{empty}
|
17
|
-
\\
|
18
|
-
\\
|
19
|
-
{\\
|
20
|
-
\\
|
21
|
-
|
22
|
-
\\
|
16
|
+
\\setlength{\\topskip}{0pt}
|
17
|
+
\\setlength{\\parindent}{0pt}
|
18
|
+
\\setlength{\\abovedisplayskip}{0pt}
|
19
|
+
\\setlength{\\belowdisplayskip}{0pt}
|
20
|
+
|
21
|
+
\\usepackage{geometry}
|
22
|
+
|
23
|
+
\\usepackage{amsfonts}
|
24
|
+
\\usepackage{amsmath}
|
25
|
+
|
26
|
+
\\newsavebox{\\snippetbox}
|
27
|
+
\\newlength{\\snippetwidth}
|
28
|
+
\\newlength{\\snippetheight}
|
29
|
+
\\newlength{\\snippetdepth}
|
30
|
+
\\newlength{\\pagewidth}
|
31
|
+
\\newlength{\\pageheight}
|
32
|
+
\\newlength{\\pagemargin}
|
33
|
+
|
34
|
+
\\begin{lrbox}{\\snippetbox}%
|
35
|
+
\$%s\$
|
36
|
+
\\end{lrbox}
|
37
|
+
|
38
|
+
\\settowidth{\\snippetwidth}{\\usebox{\\snippetbox}}
|
39
|
+
\\settoheight{\\snippetheight}{\\usebox{\\snippetbox}}
|
40
|
+
\\settodepth{\\snippetdepth}{\\usebox{\\snippetbox}}
|
41
|
+
|
42
|
+
\\setlength\\pagemargin{4pt}
|
43
|
+
|
44
|
+
\\setlength\\pagewidth\\snippetwidth
|
45
|
+
\\addtolength\\pagewidth\\pagemargin
|
46
|
+
\\addtolength\\pagewidth\\pagemargin
|
47
|
+
|
48
|
+
\\setlength\\pageheight\\snippetheight
|
49
|
+
\\addtolength{\\pageheight}{\\snippetdepth}
|
50
|
+
\\addtolength\\pageheight\\pagemargin
|
51
|
+
\\addtolength\\pageheight\\pagemargin
|
52
|
+
|
53
|
+
\\newwrite\\foo
|
54
|
+
\\immediate\\openout\\foo=\\jobname.dimensions
|
55
|
+
\\immediate\\write\\foo{snippetdepth = \\the\\snippetdepth}
|
56
|
+
\\immediate\\write\\foo{snippetheight = \\the\\snippetheight}
|
57
|
+
\\immediate\\write\\foo{snippetwidth = \\the\\snippetwidth}
|
58
|
+
\\immediate\\write\\foo{pagewidth = \\the\\pagewidth}
|
59
|
+
\\immediate\\write\\foo{pageheight = \\the\\pageheight}
|
60
|
+
\\immediate\\write\\foo{pagemargin = \\the\\pagemargin}
|
61
|
+
\\closeout\\foo
|
62
|
+
|
63
|
+
\\geometry{paperwidth=\\pagewidth,paperheight=\\pageheight,margin=\\pagemargin}
|
64
|
+
|
65
|
+
\\begin{document}%
|
66
|
+
\\usebox{\\snippetbox}%
|
23
67
|
\\end{document}
|
24
68
|
EOS
|
25
69
|
|
26
70
|
class << self
|
27
|
-
attr_accessor :latex_path
|
71
|
+
attr_accessor :latex_path
|
28
72
|
end
|
29
73
|
|
30
|
-
self.latex_path = '
|
31
|
-
self.dvips_path = 'dvips'
|
32
|
-
self.convert_path = 'convert'
|
74
|
+
self.latex_path = 'pdflatex'
|
33
75
|
|
34
76
|
def self.check_dependencies!
|
35
77
|
return if @dependencies_available
|
36
78
|
|
37
|
-
if `which
|
38
|
-
raise Error, "`
|
79
|
+
if `which pdflatex` == ""
|
80
|
+
raise Error, "`pdflatex` command not found"
|
39
81
|
end
|
40
82
|
|
41
|
-
if `which
|
42
|
-
raise Error, "`
|
83
|
+
if `which gs` == ""
|
84
|
+
raise Error, "`gs` command not found"
|
85
|
+
end
|
86
|
+
|
87
|
+
if `which pnmcrop` == ""
|
88
|
+
raise Error, "`pnmcrop` command not found"
|
43
89
|
end
|
44
90
|
|
45
|
-
if `which
|
46
|
-
raise Error, "`
|
91
|
+
if `which pnmpad` == ""
|
92
|
+
raise Error, "`pnmpad` command not found"
|
47
93
|
end
|
48
94
|
|
49
|
-
if `which
|
50
|
-
raise Error, "`
|
95
|
+
if `which pnmscale` == ""
|
96
|
+
raise Error, "`pnmscale` command not found"
|
97
|
+
end
|
98
|
+
|
99
|
+
if `which ppmtopgm` == ""
|
100
|
+
raise Error, "`ppmtopgm` command not found"
|
101
|
+
end
|
102
|
+
|
103
|
+
if `which pnmgamma` == ""
|
104
|
+
raise Error, "`pnmgamma` command not found"
|
105
|
+
end
|
106
|
+
|
107
|
+
if `which pnmtopng` == ""
|
108
|
+
raise Error, "`pnmtopng` command not found"
|
51
109
|
end
|
52
110
|
|
53
111
|
@dependencies_available = true
|
54
112
|
end
|
55
113
|
|
56
|
-
|
114
|
+
# Render the formula and calculate the correct alignment
|
115
|
+
# for the image in the html.
|
116
|
+
#
|
117
|
+
# This is a ruby implementation of the Perl version described
|
118
|
+
# at http://tex.stackexchange.com/questions/44486/pixel-perfect-vertical-alignment-of-image-rendered-tex-snippets
|
119
|
+
#
|
120
|
+
# The main caveat is that rendering takes quite a bit of processing power,
|
121
|
+
# which can make the page load slowly if it has to render each time.
|
122
|
+
# For this reason, the method caches the rendered formula in `/tmp` for reduced
|
123
|
+
# loading time in subsequent loads.
|
124
|
+
#
|
125
|
+
# @param formula the tex formula to render
|
126
|
+
# @param with_properties, if true it returns an array with a base64
|
127
|
+
# string with the image, and the alignment values for the image.
|
128
|
+
# Otherwise it returns the binary image.
|
129
|
+
def self.render_formula(formula, with_properties=false)
|
57
130
|
check_dependencies!
|
58
131
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
132
|
+
render_antialias_bits = 4
|
133
|
+
render_oversample = 4
|
134
|
+
display_oversample = 4
|
135
|
+
gamma = 0.3
|
136
|
+
if !with_properties
|
137
|
+
display_oversample = 1
|
138
|
+
gamma = 0.5
|
139
|
+
end
|
64
140
|
|
65
|
-
|
141
|
+
oversample = render_oversample * display_oversample
|
142
|
+
render_dpi = 96*1.2 * 72.27/72 * oversample # This is 1850.112 dpi.
|
66
143
|
|
67
|
-
result = sh latex_path, '-interaction=batchmode', 'formula.tex', :chdir => path
|
68
|
-
raise Error, "`latex` command failed: #{result}" unless ::File.exist?(dvi_path)
|
69
144
|
|
70
|
-
|
71
|
-
raise Error, "`dvips` command failed: #{result}" unless ::File.exist?(eps_path)
|
72
|
-
result = sh convert_path, '+adjoin',
|
73
|
-
'-antialias',
|
74
|
-
'-transparent', 'white',
|
75
|
-
'-density', '150x150',
|
76
|
-
eps_path, png_path
|
77
|
-
raise Error, "`convert` command failed: #{result}" unless ::File.exist?(png_path)
|
145
|
+
# Cache rendered formula and returned cached version if it exists
|
78
146
|
|
79
|
-
|
80
|
-
|
147
|
+
# First look for the .cache directory in the home folder
|
148
|
+
cache_dir = ::File.expand_path("~/.cache")
|
149
|
+
if not ::File.exists?(cache_dir) or not ::File.directory?(cache_dir)
|
150
|
+
::Dir.mkdir(cache_dir)
|
151
|
+
end
|
152
|
+
|
153
|
+
# Check that the gollum directory exists inside the cache dir
|
154
|
+
cache_dir = ::File.join(cache_dir, "gollum")
|
155
|
+
if not ::File.exists?(cache_dir) or not ::File.directory?(cache_dir)
|
156
|
+
::Dir.mkdir(cache_dir)
|
157
|
+
end
|
158
|
+
|
159
|
+
# Check for the formula in the cache dir
|
160
|
+
hash = Digest::SHA1.hexdigest(formula)
|
161
|
+
cache_file = ::File.join(cache_dir, "tex-#{hash}")
|
162
|
+
|
163
|
+
if ::File.exists?(cache_file)
|
164
|
+
width, height, align, base64 = ::File.open(cache_file, 'rb') { |io| io.read }.split(",")
|
165
|
+
|
166
|
+
if with_properties
|
167
|
+
return width, height, align, base64
|
168
|
+
else
|
169
|
+
return Base64.decode64(base64)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
Dir.mktmpdir('tex') do |path|
|
174
|
+
file = ::File.join(path, "formula")
|
175
|
+
|
176
|
+
# --- Write TeX source and compile to PDF.Write snippet into template
|
177
|
+
::File.open(file + ".tex", 'w') { |f| f.write(Template % formula) }
|
178
|
+
|
179
|
+
result = sh_chdir path, "pdflatex",
|
180
|
+
"-halt-on-error",
|
181
|
+
"-output-directory=#{path}",
|
182
|
+
"-output-format=pdf",
|
183
|
+
"#{file}.tex",
|
184
|
+
">#{file}.err 2>&1"
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
# --- Convert PDF to PNM using Ghostscript.
|
189
|
+
sh "gs",
|
190
|
+
"-q -dNOPAUSE -dBATCH",
|
191
|
+
"-dTextAlphaBits=#{render_antialias_bits}",
|
192
|
+
"-dGraphicsAlphaBits=#{render_antialias_bits}",
|
193
|
+
"-r#{render_dpi}",
|
194
|
+
"-sDEVICE=pnmraw",
|
195
|
+
"-sOutputFile=#{file}.pnm",
|
196
|
+
"#{file}.pdf"
|
197
|
+
|
198
|
+
|
199
|
+
img_width, img_height = pnm_width_height(file + ".pnm")
|
200
|
+
|
201
|
+
|
202
|
+
# --- Read dimensions file written by TeX during processing.
|
203
|
+
#
|
204
|
+
# Example of file contents:
|
205
|
+
# snippetdepth = 6.50009pt
|
206
|
+
# snippetheight = 13.53899pt
|
207
|
+
# snippetwidth = 145.4777pt
|
208
|
+
# pagewidth = 153.4777pt
|
209
|
+
# pageheight = 28.03908pt
|
210
|
+
# pagemargin = 4.0pt
|
211
|
+
dimensions = {}
|
212
|
+
::File.open(file + ".dimensions").readlines.each_with_index do |line, i|
|
213
|
+
if line =~ /^(\S+)\s+=\s+(-?[0-9\.]+)pt$/
|
214
|
+
dimensions[$1] = Float($2) / 72.27 * render_dpi
|
215
|
+
else
|
216
|
+
raise Error, "#{file}.dimensions: invalid line: #{i}"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
# --- Crop bottom, then measure how much was cropped.
|
221
|
+
sh "pnmcrop -white -bottom #{file}.pnm >#{file}.bottomcrop.pnm"
|
222
|
+
#raise Error, "`pnmcrop` command failed: #{result}" unless ::File.exist?(file + ".bottomcrop.pnm")
|
223
|
+
|
224
|
+
img_width_bottomcrop, img_height_bottomcrop = pnm_width_height("#{file}.bottomcrop.pnm")
|
225
|
+
bottomcrop = img_height - img_height_bottomcrop
|
226
|
+
|
227
|
+
# --- Crop top and sides, then measure how much was cropped from the top.
|
228
|
+
sh "pnmcrop -white #{file}.bottomcrop.pnm > #{file}.crop.pnm"
|
229
|
+
#raise Error, "`pnmcrop` command failed: #{result}" unless ::File.exist?(file + ".crop.pnm")
|
230
|
+
|
231
|
+
cropped_img_width, cropped_img_height = pnm_width_height("#{file}.crop.pnm")
|
232
|
+
topcrop = img_height_bottomcrop - cropped_img_height
|
233
|
+
|
234
|
+
# --- Pad image with specific values on all four sides, in preparation for
|
235
|
+
# downsampling.
|
236
|
+
|
237
|
+
# Calculate bottom padding.
|
238
|
+
snippet_depth = Integer(dimensions["snippetdepth"] + dimensions["pagemargin"] + 0.5) - bottomcrop
|
239
|
+
padded_snippet_depth = round_up(snippet_depth, oversample)
|
240
|
+
increase_snippet_depth = padded_snippet_depth - snippet_depth
|
241
|
+
bottom_padding = increase_snippet_depth
|
242
|
+
|
243
|
+
# --- Next calculate top padding, which depends on bottom padding.
|
244
|
+
|
245
|
+
padded_img_height = round_up(cropped_img_height + bottom_padding,
|
246
|
+
oversample)
|
247
|
+
top_padding = padded_img_height - (cropped_img_height + bottom_padding)
|
248
|
+
|
249
|
+
|
250
|
+
# --- Calculate left and right side padding. Distribute padding evenly.
|
251
|
+
|
252
|
+
padded_img_width = round_up(cropped_img_width, oversample)
|
253
|
+
left_padding = Integer((padded_img_width - cropped_img_width) / 2.0)
|
254
|
+
right_padding = (padded_img_width - cropped_img_width) - left_padding
|
255
|
+
|
256
|
+
|
257
|
+
# --- Pad the final image.
|
258
|
+
result = sh "pnmpad",
|
259
|
+
"-white",
|
260
|
+
"-bottom=#{bottom_padding}",
|
261
|
+
"-top=#{top_padding}",
|
262
|
+
"-left=#{left_padding}",
|
263
|
+
"-right=#{right_padding}",
|
264
|
+
"#{file}.crop.pnm",
|
265
|
+
">#{file}.pad.pnm"
|
266
|
+
|
267
|
+
# --- Sanity check of final size.
|
268
|
+
final_pnm_width, final_pnm_height = pnm_width_height(file + ".pad.pnm")
|
269
|
+
raise Error, "#{final_pnm_width} is not a multiple of #{oversample}" unless final_pnm_width % oversample == 0
|
270
|
+
|
271
|
+
raise "#{final_pnm_height} is not a multiple of #{oversample}" unless final_pnm_height % oversample == 0
|
272
|
+
|
273
|
+
# --- Convert PNM to PNG.
|
274
|
+
|
275
|
+
final_png_width = final_pnm_width / render_oversample
|
276
|
+
final_png_height = final_pnm_height / render_oversample
|
277
|
+
|
278
|
+
result = sh "cat #{file}.pad.pnm",
|
279
|
+
"| ppmtopgm",
|
280
|
+
"| pnmscale -reduce #{render_oversample}",
|
281
|
+
"| pnmgamma #{gamma}",
|
282
|
+
"| pnmtopng -compression 9",
|
283
|
+
"> #{file}.png"
|
284
|
+
|
285
|
+
raise Error, "Conversion to png failed: #{result}" unless ::File.exist?(file + ".png")
|
286
|
+
|
287
|
+
# Calculate html properties
|
288
|
+
html_img_width = final_png_width / display_oversample
|
289
|
+
html_img_height = final_png_height / display_oversample
|
290
|
+
html_img_vertical_align = sprintf("%.0f", -padded_snippet_depth / oversample)
|
291
|
+
png_data_base64 = Base64.encode64(::File.open("#{file}.png") { |io| io.read }).chomp
|
292
|
+
|
293
|
+
::File.open(cache_file, 'w') { |f| f.write(%{#{html_img_width},#{html_img_height},#{html_img_vertical_align},#{png_data_base64}}) }
|
294
|
+
if with_properties
|
295
|
+
return html_img_width, html_img_height, html_img_vertical_align, png_data_base64
|
296
|
+
else
|
297
|
+
::File.read(file + ".png")
|
298
|
+
end
|
299
|
+
end
|
81
300
|
end
|
82
301
|
|
83
302
|
private
|
303
|
+
def self.sh_chdir(path, *args)
|
304
|
+
origcommand = args * " "
|
305
|
+
return if origcommand == ""
|
306
|
+
|
307
|
+
command = origcommand
|
308
|
+
command.gsub! /(["\\])/, "\\$1"
|
309
|
+
command = %{/bin/sh -c "(#{command}) 2>&1"}
|
310
|
+
|
311
|
+
pid = spawn command, :chdir => path
|
312
|
+
|
313
|
+
result = Process::waitpid(pid)
|
314
|
+
exit_value = Integer($? >> 8), signal_num = Integer($? & 127), dumped_core = Integer($? & 128)
|
315
|
+
raise Error, "Failed #{result}: #{origcommand}. Exit value = #{exit_value}. Signal Num = #{signal_num}. Dumped core = #{dumped_core}" unless $?.success?
|
316
|
+
|
317
|
+
return result
|
318
|
+
end
|
319
|
+
|
84
320
|
def self.sh(*args)
|
85
|
-
|
86
|
-
|
321
|
+
origcommand = args * " "
|
322
|
+
return if origcommand == ""
|
323
|
+
|
324
|
+
command = origcommand
|
325
|
+
command.gsub! /(["\\])/, "\\$1"
|
326
|
+
command = %{/bin/sh -c "(#{command}) 2>&1"}
|
327
|
+
|
328
|
+
pid = spawn command
|
329
|
+
#pid = spawn *args
|
330
|
+
result = Process::waitpid(pid)
|
331
|
+
exit_value = $? >> 8, signal_num = $? & 127, dumped_core = $? & 128
|
332
|
+
raise Error, "Failed #{result}: #{origcommand}. Exit value = #{exit_value}. Signal Num = #{signal_num}. Dumped core = #{dumped_core}" unless $?.success?
|
333
|
+
|
334
|
+
return result
|
87
335
|
end
|
336
|
+
|
337
|
+
def self.round_up(num, mod)
|
338
|
+
num + (num % mod == 0 ? 0 : (mod - (num % mod)))
|
339
|
+
end
|
340
|
+
|
341
|
+
def self.pnm_width_height(filename)
|
342
|
+
raise Error, "#{filename} is not a .pnm file" if filename !~ /\.pnm$/
|
343
|
+
|
344
|
+
width = nil, height = nil
|
345
|
+
::File.open(filename) do |file|
|
346
|
+
# Read first line
|
347
|
+
line = file.gets
|
348
|
+
begin
|
349
|
+
line = file.gets # Read next line, skipping comments
|
350
|
+
end while line && line =~ /^#/
|
351
|
+
|
352
|
+
if line =~ /^(\d+)\s+(\d+)$/
|
353
|
+
width = Integer($1)
|
354
|
+
height = Integer($2)
|
355
|
+
else
|
356
|
+
raise Error, "#{filename}: couldn't read image size"
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
raise Error, "#{filename}: couldn't read image size" unless width && height
|
361
|
+
|
362
|
+
return width, height
|
363
|
+
end
|
364
|
+
|
88
365
|
end
|
89
366
|
end
|
data/lib/gollum/wiki.rb
CHANGED
@@ -32,6 +32,10 @@ module Gollum
|
|
32
32
|
# sanitization altogether.
|
33
33
|
attr_writer :history_sanitization
|
34
34
|
|
35
|
+
# Hash for setting different default wiki options
|
36
|
+
# These defaults can be overridden by options passed directly to initialize()
|
37
|
+
attr_accessor :default_options
|
38
|
+
|
35
39
|
# Gets the page class used by all instances of this Wiki.
|
36
40
|
# Default: Gollum::Page.
|
37
41
|
def page_class
|
@@ -107,6 +111,7 @@ module Gollum
|
|
107
111
|
self.default_committer_email = 'anon@anon.com'
|
108
112
|
|
109
113
|
self.default_ws_subs = ['_','-']
|
114
|
+
self.default_options = {}
|
110
115
|
|
111
116
|
# The String base path to prefix to internal links. For example, when set
|
112
117
|
# to "/wiki", the page "Hobbit" will be linked as "/wiki/Hobbit". Defaults
|
@@ -128,11 +133,16 @@ module Gollum
|
|
128
133
|
# Gets the Array of chars to sub for ws in filenames.
|
129
134
|
attr_reader :ws_subs
|
130
135
|
|
136
|
+
# Gets the boolean live preview value.
|
137
|
+
attr_reader :live_preview
|
138
|
+
|
131
139
|
# Public: Initialize a new Gollum Repo.
|
132
140
|
#
|
133
141
|
# path - The String path to the Git repository that holds the Gollum
|
134
142
|
# site.
|
135
143
|
# options - Optional Hash:
|
144
|
+
# :universal_toc - Table of contents on all pages. Default: false
|
145
|
+
# :live_preview - Livepreview editing for markdown files. Default: true
|
136
146
|
# :base_path - String base path for all Wiki links.
|
137
147
|
# Default: "/"
|
138
148
|
# :page_class - The page Class. Default: Gollum::Page
|
@@ -143,16 +153,19 @@ module Gollum
|
|
143
153
|
# :page_file_dir - String the directory in which all page files reside
|
144
154
|
# :ref - String the repository ref to retrieve pages from
|
145
155
|
# :ws_subs - Array of chars to sub for ws in filenames.
|
156
|
+
# :mathjax - Set to false to disable mathjax.
|
146
157
|
#
|
147
158
|
# Returns a fresh Gollum::Repo.
|
148
159
|
def initialize(path, options = {})
|
160
|
+
options = self.class.default_options.merge(options)
|
149
161
|
if path.is_a?(GitAccess)
|
150
162
|
options[:access] = path
|
151
163
|
path = path.path
|
152
164
|
end
|
153
165
|
@path = path
|
166
|
+
@repo_is_bare = options[:repo_is_bare]
|
154
167
|
@page_file_dir = options[:page_file_dir]
|
155
|
-
@access = options[:access] || GitAccess.new(path, @page_file_dir)
|
168
|
+
@access = options[:access] || GitAccess.new(path, @page_file_dir, @repo_is_bare)
|
156
169
|
@base_path = options[:base_path] || "/"
|
157
170
|
@page_class = options[:page_class] || self.class.page_class
|
158
171
|
@file_class = options[:file_class] || self.class.file_class
|
@@ -164,6 +177,9 @@ module Gollum
|
|
164
177
|
self.class.default_ws_subs
|
165
178
|
@history_sanitization = options[:history_sanitization] ||
|
166
179
|
self.class.history_sanitization
|
180
|
+
@live_preview = options.fetch(:live_preview, true)
|
181
|
+
@universal_toc = options.fetch(:universal_toc, false)
|
182
|
+
@mathjax = options[:mathjax] || true
|
167
183
|
end
|
168
184
|
|
169
185
|
# Public: check whether the wiki's git repo exists on the filesystem.
|
@@ -173,14 +189,27 @@ module Gollum
|
|
173
189
|
@access.exist?
|
174
190
|
end
|
175
191
|
|
176
|
-
# Public: Get the formatted page for a given page name.
|
192
|
+
# Public: Get the formatted page for a given page name, version, and dir.
|
193
|
+
#
|
194
|
+
# name - The human or canonical String page name of the wiki page.
|
195
|
+
# version - The String version ID to find (default: @ref).
|
196
|
+
# dir - The directory String relative to the repo.
|
197
|
+
#
|
198
|
+
# Returns a Gollum::Page or nil if no matching page was found.
|
199
|
+
def page(name, version = @ref, dir = nil)
|
200
|
+
version = @ref if version.nil?
|
201
|
+
@page_class.new(self).find(name, version, dir)
|
202
|
+
end
|
203
|
+
|
204
|
+
# Public: Convenience method instead of calling page(name, nil, dir).
|
177
205
|
#
|
178
206
|
# name - The human or canonical String page name of the wiki page.
|
179
207
|
# version - The String version ID to find (default: @ref).
|
208
|
+
# dir - The directory String relative to the repo.
|
180
209
|
#
|
181
210
|
# Returns a Gollum::Page or nil if no matching page was found.
|
182
|
-
def
|
183
|
-
|
211
|
+
def paged(name, dir = nil, version = @ref)
|
212
|
+
page(name, version, dir)
|
184
213
|
end
|
185
214
|
|
186
215
|
# Public: Get the static file for a given name.
|
@@ -430,6 +459,15 @@ module Gollum
|
|
430
459
|
tree_list(treeish || @ref)
|
431
460
|
end
|
432
461
|
|
462
|
+
# Public: Lists all non-page files for this wiki.
|
463
|
+
#
|
464
|
+
# treeish - The String commit ID or ref to find (default: @ref)
|
465
|
+
#
|
466
|
+
# Returns an Array of Gollum::File instances.
|
467
|
+
def files(treeish = nil)
|
468
|
+
file_list(treeish || @ref)
|
469
|
+
end
|
470
|
+
|
433
471
|
# Public: Returns the number of pages accessible from a commit
|
434
472
|
#
|
435
473
|
# ref - A String ref that is either a commit SHA or references one.
|
@@ -452,14 +490,26 @@ module Gollum
|
|
452
490
|
args = [{}, '-i', '-c', query, @ref, '--']
|
453
491
|
args << '--' << @page_file_dir if @page_file_dir
|
454
492
|
|
455
|
-
|
493
|
+
results = {}
|
494
|
+
|
495
|
+
@repo.git.grep(*args).split("\n").each do |line|
|
456
496
|
result = line.split(':')
|
457
|
-
|
497
|
+
result_1 = result[1]
|
498
|
+
file_name = result_1.chomp(::File.extname(result_1))
|
499
|
+
results[file_name] = result[2].to_i
|
500
|
+
end
|
501
|
+
|
502
|
+
# Use git ls-files '*query*' to search for file names. Grep only searches file content.
|
503
|
+
# Spaces are converted to dashes when saving pages to disk.
|
504
|
+
@repo.git.ls_files({}, "*#{ query.gsub(' ', '-') }*").split("\n").each do |line|
|
505
|
+
file_name = line.chomp(::File.extname(line))
|
506
|
+
# If there's not already a result for file_name then
|
507
|
+
# the value is nil and nil.to_i is 0.
|
508
|
+
results[file_name] = results[file_name].to_i + 1;
|
509
|
+
end
|
458
510
|
|
459
|
-
|
460
|
-
|
461
|
-
:name => file_name
|
462
|
-
}
|
511
|
+
results.map do |key,val|
|
512
|
+
{ :count => val, :name => key }
|
463
513
|
end
|
464
514
|
end
|
465
515
|
|
@@ -527,6 +577,12 @@ module Gollum
|
|
527
577
|
# Gets the markup class used by all instances of this Wiki.
|
528
578
|
attr_reader :markup_classes
|
529
579
|
|
580
|
+
# Toggles display of universal table of contents
|
581
|
+
attr_reader :universal_toc
|
582
|
+
|
583
|
+
# Toggles mathjax.
|
584
|
+
attr_reader :mathjax
|
585
|
+
|
530
586
|
# Normalize the data.
|
531
587
|
#
|
532
588
|
# data - The String data to be normalized.
|
@@ -563,6 +619,24 @@ module Gollum
|
|
563
619
|
end
|
564
620
|
end
|
565
621
|
|
622
|
+
# Fill an array with a list of files.
|
623
|
+
#
|
624
|
+
# ref - A String ref that is either a commit SHA or references one.
|
625
|
+
#
|
626
|
+
# Returns a flat Array of Gollum::File instances.
|
627
|
+
def file_list(ref)
|
628
|
+
if sha = @access.ref_to_sha(ref)
|
629
|
+
commit = @access.commit(sha)
|
630
|
+
tree_map_for(sha).inject([]) do |list, entry|
|
631
|
+
next list if entry.name.start_with?('_')
|
632
|
+
next list if @page_class.valid_page_name?(entry.name)
|
633
|
+
list << entry.file(self, commit)
|
634
|
+
end
|
635
|
+
else
|
636
|
+
[]
|
637
|
+
end
|
638
|
+
end
|
639
|
+
|
566
640
|
# Creates a reverse diff for the given SHAs on the given Gollum::Page.
|
567
641
|
#
|
568
642
|
# page - The Gollum::Page to scope the patch to, or a String Path.
|
@@ -621,10 +695,16 @@ module Gollum
|
|
621
695
|
# listing is cached based on its actual commit SHA.
|
622
696
|
#
|
623
697
|
# ref - A String ref that is either a commit SHA or references one.
|
698
|
+
# ignore_page_file_dir - Boolean, if true, searches all files within the git repo, regardless of dir/subdir
|
624
699
|
#
|
625
700
|
# Returns an Array of BlobEntry instances.
|
626
|
-
def tree_map_for(ref)
|
627
|
-
|
701
|
+
def tree_map_for(ref, ignore_page_file_dir=false)
|
702
|
+
if ignore_page_file_dir && !@page_file_dir.nil?
|
703
|
+
@root_access ||= GitAccess.new(path, nil, @repo_is_bare)
|
704
|
+
@root_access.tree(ref)
|
705
|
+
else
|
706
|
+
@access.tree(ref)
|
707
|
+
end
|
628
708
|
rescue Grit::GitRuby::Repository::NoSuchShaFound
|
629
709
|
[]
|
630
710
|
end
|