gollum 2.2.1 → 2.2.2

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.

Files changed (166) hide show
  1. data/Gemfile +1 -1
  2. data/README.md +24 -1
  3. data/Rakefile +2 -2
  4. data/bin/gollum +1 -1
  5. data/gollum.gemspec +24 -169
  6. data/lib/gollum.rb +1 -1
  7. data/lib/gollum/frontend/app.rb +12 -7
  8. data/lib/gollum/frontend/helpers.rb +6 -0
  9. data/lib/gollum/frontend/public/gollum/livepreview/images/lr_24.png +0 -0
  10. data/lib/gollum/frontend/public/gollum/livepreview/index.html +0 -6
  11. data/lib/gollum/frontend/public/gollum/livepreview/js/livepreview.js +0 -2
  12. data/lib/gollum/frontend/public/gollum/livepreview/licenses/licenses.txt +7 -0
  13. data/lib/gollum/frontend/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt +40 -0
  14. data/lib/gollum/gitcode.rb +47 -0
  15. data/lib/gollum/markup.rb +58 -8
  16. data/lib/gollum/wiki.rb +7 -2
  17. data/templates/helper_wiki.rb +9 -0
  18. metadata +261 -429
  19. data/test/examples/empty.git/HEAD +0 -1
  20. data/test/examples/empty.git/config +0 -5
  21. data/test/examples/empty.git/description +0 -1
  22. data/test/examples/empty.git/hooks/applypatch-msg.sample +0 -15
  23. data/test/examples/empty.git/hooks/commit-msg.sample +0 -24
  24. data/test/examples/empty.git/hooks/post-commit.sample +0 -8
  25. data/test/examples/empty.git/hooks/post-receive.sample +0 -15
  26. data/test/examples/empty.git/hooks/post-update.sample +0 -8
  27. data/test/examples/empty.git/hooks/pre-applypatch.sample +0 -14
  28. data/test/examples/empty.git/hooks/pre-commit.sample +0 -46
  29. data/test/examples/empty.git/hooks/pre-rebase.sample +0 -169
  30. data/test/examples/empty.git/hooks/prepare-commit-msg.sample +0 -36
  31. data/test/examples/empty.git/hooks/update.sample +0 -128
  32. data/test/examples/empty.git/info/exclude +0 -6
  33. data/test/examples/empty.git/objects/info/.gitkeep +0 -0
  34. data/test/examples/empty.git/objects/pack/.gitkeep +0 -0
  35. data/test/examples/empty.git/refs/heads/.gitkeep +0 -0
  36. data/test/examples/lotr.git/COMMIT_EDITMSG +0 -1
  37. data/test/examples/lotr.git/HEAD +0 -1
  38. data/test/examples/lotr.git/ORIG_HEAD +0 -1
  39. data/test/examples/lotr.git/config +0 -12
  40. data/test/examples/lotr.git/description +0 -1
  41. data/test/examples/lotr.git/index +0 -0
  42. data/test/examples/lotr.git/info/exclude +0 -6
  43. data/test/examples/lotr.git/logs/HEAD +0 -7
  44. data/test/examples/lotr.git/logs/refs/heads/master +0 -7
  45. data/test/examples/lotr.git/objects/06/131480411710c92a82fe2d1e76932c70feb2e5 +0 -0
  46. data/test/examples/lotr.git/objects/0a/de1e2916346d4c1f2fb63b863fd3c16808fe44 +0 -0
  47. data/test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e +0 -0
  48. data/test/examples/lotr.git/objects/0e/d8cbe0a25235bd867e65193c7d837c66b328ef +0 -3
  49. data/test/examples/lotr.git/objects/12/629d666c5e3178f82f533f543d61b53dc78c0b +0 -0
  50. data/test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0 +0 -0
  51. data/test/examples/lotr.git/objects/1d/b89ebba7e2c14d93b94ff98cfa3708a4f0d4e3 +0 -2
  52. data/test/examples/lotr.git/objects/24/49c2681badfd3c189e8ed658dacffe8ba48fe5 +0 -0
  53. data/test/examples/lotr.git/objects/25/4bdc1ba27d8b8a794538a8522d9a2b56ec2dd9 +0 -0
  54. data/test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6 +0 -0
  55. data/test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad +0 -4
  56. data/test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee +0 -0
  57. data/test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1 +0 -0
  58. data/test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087 +0 -0
  59. data/test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5 +0 -2
  60. data/test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15 +0 -0
  61. data/test/examples/lotr.git/objects/5d/cac289a8603188d2c5caf481dcba2985126aaa +0 -0
  62. data/test/examples/lotr.git/objects/60/f12f4254f58801b9ee7db7bca5fa8aeefaa56b +0 -0
  63. data/test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2 +0 -1
  64. data/test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71 +0 -0
  65. data/test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f +0 -0
  66. data/test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b +0 -0
  67. data/test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979 +0 -0
  68. data/test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10 +0 -0
  69. data/test/examples/lotr.git/objects/93/6b83ee0dd8837adb82511e40d5e4ebe59bb675 +0 -0
  70. data/test/examples/lotr.git/objects/94/523d7ae48aeba575099dd12926420d8fd0425d +0 -2
  71. data/test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809 +0 -0
  72. data/test/examples/lotr.git/objects/96/97dc65e095658bbd1b8e8678e08881e86d32f1 +0 -0
  73. data/test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6 +0 -0
  74. data/test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814 +0 -0
  75. data/test/examples/lotr.git/objects/a6/59b3763b822dd97544621fd0beef162ea37b14 +0 -4
  76. data/test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813 +0 -0
  77. data/test/examples/lotr.git/objects/aa/b61fe89d56f8614c0a8151da34f939dcedfa68 +0 -0
  78. data/test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c +0 -0
  79. data/test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd +0 -0
  80. data/test/examples/lotr.git/objects/bc/4b5fc0ce2c2ba3acef6647e4f67256ee45ab60 +0 -0
  81. data/test/examples/lotr.git/objects/c3/b43e9f08966b088e7a0192e436b7a884542e05 +0 -0
  82. data/test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c +0 -0
  83. data/test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614 +0 -0
  84. data/test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd +0 -2
  85. data/test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966 +0 -0
  86. data/test/examples/lotr.git/objects/dc/596d6b2dd89ab05c66f4abd7d5eb706bc17f19 +0 -0
  87. data/test/examples/lotr.git/objects/ec/da3205bee14520aab5a7bb307392064b938e83 +0 -0
  88. data/test/examples/lotr.git/objects/f4/84ebb1f40f8eb20d1bcd8d1d71934d2b8ae961 +0 -0
  89. data/test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465 +0 -3
  90. data/test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df +0 -1
  91. data/test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634 +0 -0
  92. data/test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66 +0 -0
  93. data/test/examples/lotr.git/objects/info/packs +0 -2
  94. data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.idx +0 -0
  95. data/test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.pack +0 -0
  96. data/test/examples/lotr.git/packed-refs +0 -2
  97. data/test/examples/lotr.git/refs/heads/master +0 -1
  98. data/test/examples/lotr.git/refs/remotes/origin/HEAD +0 -1
  99. data/test/examples/page_file_dir.git/COMMIT_EDITMSG +0 -1
  100. data/test/examples/page_file_dir.git/HEAD +0 -1
  101. data/test/examples/page_file_dir.git/config +0 -6
  102. data/test/examples/page_file_dir.git/description +0 -1
  103. data/test/examples/page_file_dir.git/index +0 -0
  104. data/test/examples/page_file_dir.git/info/exclude +0 -6
  105. data/test/examples/page_file_dir.git/logs/HEAD +0 -1
  106. data/test/examples/page_file_dir.git/logs/refs/heads/master +0 -1
  107. data/test/examples/page_file_dir.git/objects/0c/7d27db1f575263efdcab3dc650f4502a2dbcbf +0 -0
  108. data/test/examples/page_file_dir.git/objects/22/b404803c966dd92865614d86ff22ca12e50c1e +0 -0
  109. data/test/examples/page_file_dir.git/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 +0 -0
  110. data/test/examples/page_file_dir.git/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6 +0 -0
  111. data/test/examples/page_file_dir.git/objects/5b/43e14e0a15fb6f08feab1773d1c0991e9f71e2 +0 -0
  112. data/test/examples/page_file_dir.git/refs/heads/master +0 -1
  113. data/test/examples/revert.git/COMMIT_EDITMSG +0 -1
  114. data/test/examples/revert.git/HEAD +0 -1
  115. data/test/examples/revert.git/config +0 -12
  116. data/test/examples/revert.git/description +0 -1
  117. data/test/examples/revert.git/index +0 -0
  118. data/test/examples/revert.git/info/exclude +0 -6
  119. data/test/examples/revert.git/logs/HEAD +0 -3
  120. data/test/examples/revert.git/logs/refs/heads/master +0 -3
  121. data/test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab +0 -0
  122. data/test/examples/revert.git/objects/20/2ced67cea93c7b6bd2928aa1daef8d1d55a20d +0 -0
  123. data/test/examples/revert.git/objects/41/76394bfa11222363c66ce7e84b5f154095b6d9 +0 -0
  124. data/test/examples/revert.git/objects/6a/69f92020f5df77af6e8813ff1232493383b708 +0 -0
  125. data/test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa +0 -0
  126. data/test/examples/revert.git/objects/b4/785957bc986dc39c629de9fac9df46972c00fc +0 -0
  127. data/test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023 +0 -3
  128. data/test/examples/revert.git/objects/f4/03b791119f8232b7cb0ba455c624ac6435f433 +0 -0
  129. data/test/examples/revert.git/objects/info/packs +0 -2
  130. data/test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.idx +0 -0
  131. data/test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.pack +0 -0
  132. data/test/examples/revert.git/packed-refs +0 -2
  133. data/test/examples/revert.git/refs/heads/master +0 -1
  134. data/test/examples/revert.git/refs/remotes/origin/HEAD +0 -1
  135. data/test/examples/yubiwa.git/HEAD +0 -1
  136. data/test/examples/yubiwa.git/config +0 -5
  137. data/test/examples/yubiwa.git/description +0 -1
  138. data/test/examples/yubiwa.git/info/exclude +0 -6
  139. data/test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00 +0 -0
  140. data/test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de +0 -0
  141. data/test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835 +0 -0
  142. data/test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8 +0 -1
  143. data/test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70 +0 -0
  144. data/test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b +0 -0
  145. data/test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309 +0 -0
  146. data/test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34 +0 -0
  147. data/test/examples/yubiwa.git/refs/heads/master +0 -1
  148. data/test/file_view/1_file.txt +0 -3
  149. data/test/file_view/1_file_1_folder.txt +0 -8
  150. data/test/file_view/1_folder.txt +0 -8
  151. data/test/file_view/2_files_2_folders.txt +0 -12
  152. data/test/file_view/2_files_2_folders_1_root.txt +0 -13
  153. data/test/file_view/nested_folders.txt +0 -28
  154. data/test/helper.rb +0 -66
  155. data/test/test_app.rb +0 -375
  156. data/test/test_app_helpers.rb +0 -13
  157. data/test/test_committer.rb +0 -64
  158. data/test/test_file.rb +0 -27
  159. data/test/test_file_view.rb +0 -102
  160. data/test/test_git_access.rb +0 -53
  161. data/test/test_markup.rb +0 -732
  162. data/test/test_page.rb +0 -231
  163. data/test/test_page_revert.rb +0 -57
  164. data/test/test_pages_view.rb +0 -46
  165. data/test/test_unicode.rb +0 -131
  166. data/test/test_wiki.rb +0 -509
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
- gem "rake", "~> 0.9.2"
4
+ gem "rake", "~> 0.9.2.2"
data/README.md CHANGED
@@ -334,6 +334,27 @@ then that whitespace will be ignored (this makes the blocks easier to read in pl
334
334
  The block must end with three backticks indented at the same level than the opening
335
335
  backticks.
336
336
 
337
+ ### GITHUB SYNTAX HIGHLIGHTING
338
+
339
+ As an extra feature, you can syntax highlight a file from your repository, allowing
340
+ you keep some of your sample code in the main repository. The code-snippet is
341
+ updated when the wiki is rebuilt. You include github code like this:
342
+
343
+ ```html:github/gollum/master/test/file_view/1_file.txt```
344
+
345
+ This will make the builder look at the **github user**, in the **gollum project**,
346
+ in the **master branch**, at path **test/file_view/1_file.txt**. It will be
347
+ rewritten to:
348
+
349
+ ```html
350
+ <ol class="tree">
351
+ <li class="file"><a href="0">0</a></li>
352
+ </ol>
353
+ ```
354
+
355
+ Which will be parsed as HTML code during the Pygments run, and thereby coloured
356
+ appropriately.
357
+
337
358
  ## MATHEMATICAL EQUATIONS
338
359
 
339
360
 
@@ -497,12 +518,14 @@ like Rack::Auth, OmniAuth, etc.
497
518
  Precious::App.set(:wiki_options, {:universal_toc => false})
498
519
  run Precious::App
499
520
 
521
+ Your Rack middleware can pass author details to Gollum in a Hash in the session under the 'gollum.author' key.
522
+
500
523
  ## WINDOWS FILENAME VALIDATION
501
524
  Note that filenames on windows must not contain any of the following characters `\ / : * ? " < > |`. See [this support article](http://support.microsoft.com/kb/177506) for details.
502
525
 
503
526
  ## LIB.SO ERROR
504
527
 
505
- `Could not open library 'lib.so'` may be solved by installing `python-devel` on Fedora or `python-dev` on Ubuntu.
528
+ `Could not open library 'lib.so'` may be solved by installing `python-devel` on Fedora or `python-dev` on Ubuntu. Gentoo requires a rubypython [patch](https://gist.github.com/2802480) to use python2.7.
506
529
 
507
530
  ## CONTRIBUTE
508
531
 
data/Rakefile CHANGED
@@ -117,7 +117,7 @@ task :gemspec => :validate do
117
117
  split("\n").
118
118
  sort.
119
119
  reject { |file| file =~ /^\./ }.
120
- reject { |file| file =~ /^(rdoc|pkg)/ }.
120
+ reject { |file| file =~ /^(rdoc|pkg|test)/ }.
121
121
  map { |file| " #{file}" }.
122
122
  join("\n")
123
123
 
@@ -139,4 +139,4 @@ task :validate do
139
139
  puts "A `VERSION` file at root level violates Gem best practices."
140
140
  exit!
141
141
  end
142
- end
142
+ end
data/bin/gollum CHANGED
@@ -66,7 +66,7 @@ opts = OptionParser.new do |opts|
66
66
  end
67
67
 
68
68
  opts.on("--mathjax", "Enables mathjax.") do
69
- options['mathjax'] = true
69
+ wiki_options[:mathjax] = true
70
70
  end
71
71
  end
72
72
 
data/gollum.gemspec CHANGED
@@ -5,8 +5,8 @@ Gem::Specification.new do |s|
5
5
  s.required_ruby_version = ">= 1.8.7"
6
6
 
7
7
  s.name = 'gollum'
8
- s.version = '2.2.1'
9
- s.date = '2012-09-02'
8
+ s.version = '2.2.2'
9
+ s.date = '2012-10-04'
10
10
  s.rubyforge_project = 'gollum'
11
11
 
12
12
  s.summary = "A simple, Git-powered wiki."
@@ -23,25 +23,25 @@ Gem::Specification.new do |s|
23
23
  s.rdoc_options = ["--charset=UTF-8"]
24
24
  s.extra_rdoc_files = %w[README.md LICENSE]
25
25
 
26
- s.add_dependency('grit', "~> 2.5.0")
27
- s.add_dependency('github-markup', [">= 0.7.0", "< 1.0.0"])
28
- s.add_dependency('github-markdown')
29
- s.add_dependency('pygments.rb', "~> 0.2.0")
30
- s.add_dependency('escape_utils', "0.2.4")
31
- s.add_dependency('sinatra', "~> 1.0")
32
- s.add_dependency('mustache', [">= 0.11.2", "< 1.0.0"])
33
- s.add_dependency('sanitize', "~> 2.0.0")
34
- s.add_dependency('nokogiri', "~> 1.4")
35
- s.add_dependency('useragent', "~> 0.4.9")
36
- s.add_dependency('stringex', "~> 1.4.0")
26
+ s.add_dependency('grit', '~> 2.5.0')
27
+ s.add_dependency('github-markup', ['>= 0.7.4', '< 1.0.0'])
28
+ s.add_dependency('github-markdown', '~> 0.5.1')
29
+ s.add_dependency('pygments.rb', '~> 0.3.1')
30
+ s.add_dependency('escape_utils', '0.2.4')
31
+ s.add_dependency('sinatra', '~> 1.3.3')
32
+ s.add_dependency('mustache', ['>= 0.99.4', '< 1.0.0'])
33
+ s.add_dependency('sanitize', '~> 2.0.3')
34
+ s.add_dependency('nokogiri', '~> 1.5.5')
35
+ s.add_dependency('useragent', '~> 0.4.10')
36
+ s.add_dependency('stringex', '~> 1.4.0')
37
37
 
38
- s.add_development_dependency('RedCloth')
39
- s.add_development_dependency('mocha')
40
- s.add_development_dependency('org-ruby', '~> 0.7.0')
41
- s.add_development_dependency('shoulda')
42
- s.add_development_dependency('rack-test')
43
- s.add_development_dependency('wikicloth', '~>0.8.0')
44
- s.add_development_dependency('rake', '~> 0.9.2')
38
+ s.add_development_dependency('RedCloth', '~> 4.2.9')
39
+ s.add_development_dependency('mocha', '~> 0.12.6')
40
+ s.add_development_dependency('org-ruby', '~> 0.7.1')
41
+ s.add_development_dependency('shoulda', '~> 3.1.1')
42
+ s.add_development_dependency('rack-test', '~> 0.6.2')
43
+ s.add_development_dependency('wikicloth', '~> 0.8.0')
44
+ s.add_development_dependency('rake', '~> 0.9.2.2')
45
45
 
46
46
  # = MANIFEST =
47
47
  s.files = %w[
@@ -426,6 +426,7 @@ Gem::Specification.new do |s|
426
426
  lib/gollum/frontend/public/gollum/livepreview/licenses/retina_display_icon_set/by_sa_3.0_unported_legalcode.txt
427
427
  lib/gollum/frontend/public/gollum/livepreview/licenses/sizzle/LICENSE.txt
428
428
  lib/gollum/frontend/public/gollum/livepreview/licenses/sundown/sundown.txt
429
+ lib/gollum/frontend/public/gollum/livepreview/licenses/templarian_windowsicons/license.txt
429
430
  lib/gollum/frontend/public/gollum/livepreview/readme.md
430
431
  lib/gollum/frontend/templates/compare.mustache
431
432
  lib/gollum/frontend/templates/create.mustache
@@ -453,6 +454,7 @@ Gem::Specification.new do |s|
453
454
  lib/gollum/frontend/views/pages.rb
454
455
  lib/gollum/frontend/views/search.rb
455
456
  lib/gollum/git_access.rb
457
+ lib/gollum/gitcode.rb
456
458
  lib/gollum/markup.rb
457
459
  lib/gollum/page.rb
458
460
  lib/gollum/pagination.rb
@@ -464,156 +466,9 @@ Gem::Specification.new do |s|
464
466
  licenses/licenses.txt
465
467
  licenses/unity_asset_pool/COPYRIGHT
466
468
  templates/formatting.html
467
- test/examples/empty.git/HEAD
468
- test/examples/empty.git/config
469
- test/examples/empty.git/description
470
- test/examples/empty.git/hooks/applypatch-msg.sample
471
- test/examples/empty.git/hooks/commit-msg.sample
472
- test/examples/empty.git/hooks/post-commit.sample
473
- test/examples/empty.git/hooks/post-receive.sample
474
- test/examples/empty.git/hooks/post-update.sample
475
- test/examples/empty.git/hooks/pre-applypatch.sample
476
- test/examples/empty.git/hooks/pre-commit.sample
477
- test/examples/empty.git/hooks/pre-rebase.sample
478
- test/examples/empty.git/hooks/prepare-commit-msg.sample
479
- test/examples/empty.git/hooks/update.sample
480
- test/examples/empty.git/info/exclude
481
- test/examples/empty.git/objects/info/.gitkeep
482
- test/examples/empty.git/objects/pack/.gitkeep
483
- test/examples/empty.git/refs/heads/.gitkeep
484
- test/examples/lotr.git/COMMIT_EDITMSG
485
- test/examples/lotr.git/HEAD
486
- test/examples/lotr.git/ORIG_HEAD
487
- test/examples/lotr.git/config
488
- test/examples/lotr.git/description
489
- test/examples/lotr.git/index
490
- test/examples/lotr.git/info/exclude
491
- test/examples/lotr.git/logs/HEAD
492
- test/examples/lotr.git/logs/refs/heads/master
493
- test/examples/lotr.git/objects/06/131480411710c92a82fe2d1e76932c70feb2e5
494
- test/examples/lotr.git/objects/0a/de1e2916346d4c1f2fb63b863fd3c16808fe44
495
- test/examples/lotr.git/objects/0d/c9016ca928c78d5421a99a53b379b53929221e
496
- test/examples/lotr.git/objects/0e/d8cbe0a25235bd867e65193c7d837c66b328ef
497
- test/examples/lotr.git/objects/12/629d666c5e3178f82f533f543d61b53dc78c0b
498
- test/examples/lotr.git/objects/1c/79ddc69707f7b164bc2ea58beb5d8965ff6bd0
499
- test/examples/lotr.git/objects/1d/b89ebba7e2c14d93b94ff98cfa3708a4f0d4e3
500
- test/examples/lotr.git/objects/24/49c2681badfd3c189e8ed658dacffe8ba48fe5
501
- test/examples/lotr.git/objects/25/4bdc1ba27d8b8a794538a8522d9a2b56ec2dd9
502
- test/examples/lotr.git/objects/27/680b0fce1abfbc528e7aa53d92645852d52eb6
503
- test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad
504
- test/examples/lotr.git/objects/45/3b250f979c7bd6dfb62640c944c982ae6721ee
505
- test/examples/lotr.git/objects/45/f319ee12f2b551b901b22e72602963c366fff1
506
- test/examples/lotr.git/objects/46/a697caf435815bb07bbce947fc2d58be15f087
507
- test/examples/lotr.git/objects/4c/45c2b4e297a726c3d3f66886f35373e48fe1c5
508
- test/examples/lotr.git/objects/4e/023f460ce466e154ca09d8774c79ad5a53fc15
509
- test/examples/lotr.git/objects/5d/cac289a8603188d2c5caf481dcba2985126aaa
510
- test/examples/lotr.git/objects/60/f12f4254f58801b9ee7db7bca5fa8aeefaa56b
511
- test/examples/lotr.git/objects/62/9aa678272b017a4d136d35e77ac94d80b08dc2
512
- test/examples/lotr.git/objects/6e/48abfc56565574859e081ee58eae655d48cf71
513
- test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f
514
- test/examples/lotr.git/objects/7b/60c5a20a501a70f2317fa0ef763e1e2ce22d6b
515
- test/examples/lotr.git/objects/7d/981cd984ad589e3cf00d8122170c6f7d685979
516
- test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10
517
- test/examples/lotr.git/objects/93/6b83ee0dd8837adb82511e40d5e4ebe59bb675
518
- test/examples/lotr.git/objects/94/523d7ae48aeba575099dd12926420d8fd0425d
519
- test/examples/lotr.git/objects/94/9a9cc3119b9c98817f375e976d2bb5e2a42809
520
- test/examples/lotr.git/objects/96/97dc65e095658bbd1b8e8678e08881e86d32f1
521
- test/examples/lotr.git/objects/9b/e95b960ac388d4e7db55f610f828e9c31344e6
522
- test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814
523
- test/examples/lotr.git/objects/a6/59b3763b822dd97544621fd0beef162ea37b14
524
- test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813
525
- test/examples/lotr.git/objects/aa/b61fe89d56f8614c0a8151da34f939dcedfa68
526
- test/examples/lotr.git/objects/b0/de6e794dfdc7ef3400e894225bfe23308aae5c
527
- test/examples/lotr.git/objects/b1/6b3d9fad9d78e5a669e7f33d94c96da374eccd
528
- test/examples/lotr.git/objects/bc/4b5fc0ce2c2ba3acef6647e4f67256ee45ab60
529
- test/examples/lotr.git/objects/c3/b43e9f08966b088e7a0192e436b7a884542e05
530
- test/examples/lotr.git/objects/c9/6a7645db5d4c76389e77cd103ef3ed77d81e4c
531
- test/examples/lotr.git/objects/ca/7355dc497e9729fbaf0c0e3f424b86afef5614
532
- test/examples/lotr.git/objects/cf/ea406f5f77afc7fb673a43e97721234385b1bd
533
- test/examples/lotr.git/objects/d5/29304506d37f544675244c335d85cab5d29966
534
- test/examples/lotr.git/objects/dc/596d6b2dd89ab05c66f4abd7d5eb706bc17f19
535
- test/examples/lotr.git/objects/ec/da3205bee14520aab5a7bb307392064b938e83
536
- test/examples/lotr.git/objects/f4/84ebb1f40f8eb20d1bcd8d1d71934d2b8ae961
537
- test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465
538
- test/examples/lotr.git/objects/fb/c5dd7d807707b4a0a97c1182fecfef1eced5df
539
- test/examples/lotr.git/objects/fc/3eee516ff72dc9099ba00d4611eb02e5c9e634
540
- test/examples/lotr.git/objects/ff/6f7de62644369380ba73b4e4297c1a2d6f0b66
541
- test/examples/lotr.git/objects/info/packs
542
- test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.idx
543
- test/examples/lotr.git/objects/pack/pack-dcbeaf3f6ff6c5eb08ea2b0a2d83626e8763546b.pack
544
- test/examples/lotr.git/packed-refs
545
- test/examples/lotr.git/refs/heads/master
546
- test/examples/lotr.git/refs/remotes/origin/HEAD
547
- test/examples/page_file_dir.git/COMMIT_EDITMSG
548
- test/examples/page_file_dir.git/HEAD
549
- test/examples/page_file_dir.git/config
550
- test/examples/page_file_dir.git/description
551
- test/examples/page_file_dir.git/index
552
- test/examples/page_file_dir.git/info/exclude
553
- test/examples/page_file_dir.git/logs/HEAD
554
- test/examples/page_file_dir.git/logs/refs/heads/master
555
- test/examples/page_file_dir.git/objects/0c/7d27db1f575263efdcab3dc650f4502a2dbcbf
556
- test/examples/page_file_dir.git/objects/22/b404803c966dd92865614d86ff22ca12e50c1e
557
- test/examples/page_file_dir.git/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99
558
- test/examples/page_file_dir.git/objects/57/16ca5987cbf97d6bb54920bea6adde242d87e6
559
- test/examples/page_file_dir.git/objects/5b/43e14e0a15fb6f08feab1773d1c0991e9f71e2
560
- test/examples/page_file_dir.git/refs/heads/master
561
- test/examples/revert.git/COMMIT_EDITMSG
562
- test/examples/revert.git/HEAD
563
- test/examples/revert.git/config
564
- test/examples/revert.git/description
565
- test/examples/revert.git/index
566
- test/examples/revert.git/info/exclude
567
- test/examples/revert.git/logs/HEAD
568
- test/examples/revert.git/logs/refs/heads/master
569
- test/examples/revert.git/objects/10/2685c42018f802557f05db171f44443e8dacab
570
- test/examples/revert.git/objects/20/2ced67cea93c7b6bd2928aa1daef8d1d55a20d
571
- test/examples/revert.git/objects/41/76394bfa11222363c66ce7e84b5f154095b6d9
572
- test/examples/revert.git/objects/6a/69f92020f5df77af6e8813ff1232493383b708
573
- test/examples/revert.git/objects/8e/83f898e5e16ae400db59dda1017acad540f3aa
574
- test/examples/revert.git/objects/b4/785957bc986dc39c629de9fac9df46972c00fc
575
- test/examples/revert.git/objects/ed/6c9f63b98acf73c25b5ffbb38da557d3682023
576
- test/examples/revert.git/objects/f4/03b791119f8232b7cb0ba455c624ac6435f433
577
- test/examples/revert.git/objects/info/packs
578
- test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.idx
579
- test/examples/revert.git/objects/pack/pack-a561f8437234f74d0bacb9e0eebe52d207f5770d.pack
580
- test/examples/revert.git/packed-refs
581
- test/examples/revert.git/refs/heads/master
582
- test/examples/revert.git/refs/remotes/origin/HEAD
583
- test/examples/yubiwa.git/HEAD
584
- test/examples/yubiwa.git/config
585
- test/examples/yubiwa.git/description
586
- test/examples/yubiwa.git/info/exclude
587
- test/examples/yubiwa.git/objects/10/fa2ddc4e3b4009d8a453aace10bd6148c1ad00
588
- test/examples/yubiwa.git/objects/52/4b82874327ea7cbf730389964ba7cb3de966de
589
- test/examples/yubiwa.git/objects/58/3fc201cb457fb3f1480f3e1e5999b119633835
590
- test/examples/yubiwa.git/objects/87/bc1dd46ab3d3874d4e898d45dd512cc20a7cc8
591
- test/examples/yubiwa.git/objects/89/64ed1b4e21aa90e831763bbce9034bfda81b70
592
- test/examples/yubiwa.git/objects/9f/f6dd0660da5fba2d3374adb2b84fa653bb538b
593
- test/examples/yubiwa.git/objects/ac/e97abf2b177815a1972d7db22f229f58c83309
594
- test/examples/yubiwa.git/objects/b1/f443863a4816628807fbf86141ebef055dda34
595
- test/examples/yubiwa.git/refs/heads/master
596
- test/file_view/1_file.txt
597
- test/file_view/1_file_1_folder.txt
598
- test/file_view/1_folder.txt
599
- test/file_view/2_files_2_folders.txt
600
- test/file_view/2_files_2_folders_1_root.txt
601
- test/file_view/nested_folders.txt
602
- test/helper.rb
603
- test/test_app.rb
604
- test/test_app_helpers.rb
605
- test/test_committer.rb
606
- test/test_file.rb
607
- test/test_file_view.rb
608
- test/test_git_access.rb
609
- test/test_markup.rb
610
- test/test_page.rb
611
- test/test_page_revert.rb
612
- test/test_pages_view.rb
613
- test/test_unicode.rb
614
- test/test_wiki.rb
469
+ templates/helper_wiki.rb
615
470
  ]
616
471
  # = MANIFEST =
617
472
 
618
473
  s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
619
- end
474
+ end
data/lib/gollum.rb CHANGED
@@ -23,7 +23,7 @@ require File.expand_path('../gollum/web_sequence_diagram', __FILE__)
23
23
  require File.expand_path('../gollum/frontend/uri_encode_component', __FILE__)
24
24
 
25
25
  module Gollum
26
- VERSION = '2.2.1'
26
+ VERSION = '2.2.2'
27
27
 
28
28
  def self.assets_path
29
29
  ::File.expand_path('gollum/frontend/public', ::File.dirname(__FILE__))
@@ -89,12 +89,6 @@ module Precious
89
89
  redirect File.join(settings.wiki_options[:base_path].to_s, 'Home')
90
90
  end
91
91
 
92
- # Removes all slashes from the start of string.
93
- def clean_url url
94
- return url if url.nil?
95
- url.gsub('%2F','/').gsub(/^\/+/,'')
96
- end
97
-
98
92
  # path is set to name if path is nil.
99
93
  # if path is 'a/b' and a and b are dirs, then
100
94
  # path must have a trailing slash 'a/b/' or
@@ -369,8 +363,19 @@ module Precious
369
363
  wiki.update_page(page, name, format, content.to_s, commit)
370
364
  end
371
365
 
366
+ private
367
+
368
+ # Options parameter to Gollum::Committer#initialize
369
+ # :message - The String commit message.
370
+ # :name - The String author full name.
371
+ # :email - The String email address.
372
+ # message is sourced from the incoming request parameters
373
+ # author details are sourced from the session, to be populated by rack middleware ahead of us
372
374
  def commit_message
373
- { :message => params[:message] }
375
+ commit_message = { :message => params[:message] }
376
+ author_parameters = session['gollum.author']
377
+ commit_message.merge! author_parameters unless author_parameters.nil?
378
+ commit_message
374
379
  end
375
380
  end
376
381
  end
@@ -17,5 +17,11 @@ module Precious
17
17
  def sanitize_empty_params(param)
18
18
  [nil,''].include?(param) ? nil : CGI.unescape(param)
19
19
  end
20
+
21
+ # Remove all slashes from the start of string.
22
+ def clean_url url
23
+ return url if url.nil?
24
+ url.gsub('%2F','/').gsub(/^\/+/,'')
25
+ end
20
26
  end
21
27
  end
@@ -39,11 +39,5 @@ var require = {
39
39
  <script src='js/sundown.js'></script>
40
40
  <script src='js/md_sundown.js'></script>
41
41
  <script src='js/livepreview.js'></script>
42
- <!--<script>(function(d,j){
43
- j = d.createElement('script');
44
- j.src = 'https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
45
- (d.head || d.getElementsByTagName('head')[0]).appendChild(j);
46
- }(document));
47
- </script>-->
48
42
  </body>
49
43
  </html>
@@ -269,8 +269,6 @@ var makePreviewHtml = function () {
269
269
  // Update the text using feature detection to support IE.
270
270
  // preview.innerHTML = text; // this doesn't work on IE.
271
271
  previewSet( text );
272
- // MathJax is loaded asynchronously.
273
- if (typeof MathJax != 'undefined') { MathJax.Hub.Typeset( content ); }
274
272
 
275
273
  // highlight code blocks.
276
274
  var codeElements = preview.getElementsByTagName( 'pre' );
@@ -57,3 +57,10 @@ http://www.thecssninja.com/css/css-tree-menu
57
57
  http://www.thecssninja.com/demo/license.txt
58
58
 
59
59
  lib/gollum/frontend/public/css/_styles.css
60
+
61
+ ---
62
+
63
+ `lr_24.png` is a modified version of http://templarian.com/files/wp_icons/icons/light/appbar.arrow.right.left.png
64
+
65
+ https://github.com/Templarian/WindowsIcons/blob/21189bffeb17237d444419ef43ed1b49e9f4e9f8/WindowsPhone/license.txt
66
+
@@ -0,0 +1,40 @@
1
+ Read the license:
2
+ http://creativecommons.org/licenses/by/3.0/ **
3
+
4
+ Basicaly, use it anyway you want but include this license file in the source if your project is open source. Nothing is needed in the front facing project. Commercial use is not only allowed but encouraged. This pack was made to promote consistency in applications.
5
+
6
+ Creator
7
+ - Austin Andrews (@templarian)
8
+
9
+ Contributor*
10
+ - Oren Nachman
11
+ - appbar.chevron.down
12
+ - appbar.chevron.up
13
+ - appbar.chevron.left
14
+ - appbar.chevron.right
15
+ - Kris Vandermotten (@kvandermotten)
16
+ - appbar.medical.pulse
17
+ - Constantin Kichinsky (@kichinsky)
18
+ - appbar.currency.rubles
19
+ - appbar.currency.grivna
20
+ - Massimo Savazzi (@msavazzi)
21
+ - List of missing exported icons
22
+ - Proletkult Graphik, from The Noun Project
23
+ - appbar.draw.pen (inspired)
24
+ - Olivier Guin, from The Noun Project
25
+ - appbar.draw.marker
26
+ - Gibran Bisio, from The Noun Project
27
+ - appbar.draw.bucket
28
+
29
+ * Developers and designers that emailed Templarian the source .design icons to be added into the package. PNGs also accepted, but may take longer to be added.
30
+
31
+
32
+ Contact
33
+ - http://templarian.com/
34
+ - admin[@]templarian[.]com
35
+
36
+ ** Does not apply to copyrighted logos
37
+ - Skype
38
+ - Facebook
39
+ - Twitter
40
+ - etc...
@@ -0,0 +1,47 @@
1
+ require 'net/http'
2
+ require 'net/https' # ruby 1.8.7 fix, remove at upgrade
3
+ require 'uri'
4
+ require 'open-uri'
5
+
6
+ module Gollum
7
+ class Gitcode
8
+ def initialize path
9
+ raise(ArgumentError, 'path is nil or empty') if path.nil? or path.empty?
10
+
11
+ @uri = URI::HTTP.build({
12
+ :path => self.unchomp(path),
13
+ :host => 'raw.github.com',
14
+ :scheme => 'https',
15
+ :port => 443 })
16
+ end
17
+
18
+ def contents
19
+ @contents ||= self.req @uri
20
+ end
21
+
22
+ def unchomp p
23
+ return p if p.nil?
24
+ p[0] == '/' ? p : ('/' + p)
25
+ end
26
+
27
+ def req uri, cut = 1
28
+ return "Too many redirects or retries" if cut >= 10
29
+ http = Net::HTTP.new uri.host, uri.port
30
+ http.use_ssl = true
31
+ resp = http.get uri.path, {
32
+ 'Accept' => 'text/plain',
33
+ 'Cache-Control' => 'no-cache',
34
+ 'Connection' => 'keep-alive',
35
+ 'Host' => uri.host,
36
+ 'User-Agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0'
37
+ }
38
+ code = resp.code.to_i
39
+ return resp.body if code == 200
40
+ return "Not Found" if code == 404
41
+ return "Unhandled Response Code #{code}" unless code == 304 or not resp.header['location'].nil?
42
+ loc = URI.parse resp.header['location']
43
+ uri2 = loc.relative?() ? (uri + loc) : loc # overloads (+)
44
+ return req uri2, (cut + 1)
45
+ end
46
+ end
47
+ end