gorgyrella 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (233) hide show
  1. data/.bzr/README +3 -0
  2. data/.bzr/branch/branch.conf +2 -0
  3. data/.bzr/branch/format +1 -0
  4. data/.bzr/branch/last-revision +1 -0
  5. data/.bzr/branch/tags +0 -0
  6. data/.bzr/branch-format +1 -0
  7. data/.bzr/checkout/conflicts +1 -0
  8. data/.bzr/checkout/dirstate +0 -0
  9. data/.bzr/checkout/format +1 -0
  10. data/.bzr/checkout/merge-hashes +33 -0
  11. data/.bzr/repository/format +1 -0
  12. data/.bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.iix +0 -0
  13. data/.bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.rix +0 -0
  14. data/.bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.six +5 -0
  15. data/.bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.tix +0 -0
  16. data/.bzr/repository/indices/747331f41951a7f9509b3190e9082de2.iix +0 -0
  17. data/.bzr/repository/indices/747331f41951a7f9509b3190e9082de2.rix +0 -0
  18. data/.bzr/repository/indices/747331f41951a7f9509b3190e9082de2.six +5 -0
  19. data/.bzr/repository/indices/747331f41951a7f9509b3190e9082de2.tix +0 -0
  20. data/.bzr/repository/indices/94ae76525de86acde2f4722e88fec764.iix +0 -0
  21. data/.bzr/repository/indices/94ae76525de86acde2f4722e88fec764.rix +0 -0
  22. data/.bzr/repository/indices/94ae76525de86acde2f4722e88fec764.six +5 -0
  23. data/.bzr/repository/indices/94ae76525de86acde2f4722e88fec764.tix +0 -0
  24. data/.bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.iix +0 -0
  25. data/.bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.rix +0 -0
  26. data/.bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.six +5 -0
  27. data/.bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.tix +0 -0
  28. data/.bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.iix +0 -0
  29. data/.bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.rix +0 -0
  30. data/.bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.six +5 -0
  31. data/.bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.tix +0 -0
  32. data/.bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.iix +0 -0
  33. data/.bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.rix +0 -0
  34. data/.bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.six +5 -0
  35. data/.bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.tix +0 -0
  36. data/.bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.iix +0 -0
  37. data/.bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.rix +0 -0
  38. data/.bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.six +5 -0
  39. data/.bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.tix +0 -0
  40. data/.bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.iix +0 -0
  41. data/.bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.pack +0 -0
  42. data/.bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.rix +0 -0
  43. data/.bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.six +5 -0
  44. data/.bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.tix +0 -0
  45. data/.bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.iix +0 -0
  46. data/.bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.pack +0 -0
  47. data/.bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.rix +0 -0
  48. data/.bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.six +5 -0
  49. data/.bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.tix +0 -0
  50. data/.bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.iix +0 -0
  51. data/.bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.pack +0 -0
  52. data/.bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.rix +0 -0
  53. data/.bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.six +5 -0
  54. data/.bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.tix +0 -0
  55. data/.bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.iix +0 -0
  56. data/.bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.pack +0 -0
  57. data/.bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.rix +0 -0
  58. data/.bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.six +5 -0
  59. data/.bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.tix +0 -0
  60. data/.bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.iix +0 -0
  61. data/.bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.pack +0 -0
  62. data/.bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.rix +0 -0
  63. data/.bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.six +5 -0
  64. data/.bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.tix +0 -0
  65. data/.bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.iix +0 -0
  66. data/.bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.pack +0 -0
  67. data/.bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.rix +0 -0
  68. data/.bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.six +5 -0
  69. data/.bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.tix +0 -0
  70. data/.bzr/repository/pack-names +0 -0
  71. data/.bzr/repository/packs/7433d7509bfad4e7de61716fd159a28e.pack +0 -0
  72. data/.bzr/repository/packs/747331f41951a7f9509b3190e9082de2.pack +0 -0
  73. data/.bzr/repository/packs/94ae76525de86acde2f4722e88fec764.pack +0 -0
  74. data/.bzr/repository/packs/ae5f61661ebb8f30600ce7443b2ea000.pack +0 -0
  75. data/.bzr/repository/packs/e34ba77fcb41bb254463c3c177123bb1.pack +0 -0
  76. data/.bzr/repository/packs/e409e77b2da885ef4e5bc5089a04e60e.pack +0 -0
  77. data/.bzr/repository/packs/fa740d26e5ddc0570df1ec65a7a2af1c.pack +0 -0
  78. data/.bzrignore +5 -0
  79. data/History.txt +4 -0
  80. data/LICENSE +619 -0
  81. data/README.txt +27 -0
  82. data/Rakefile +59 -0
  83. data/bin/gorgyrella +6 -0
  84. data/gorgyrella-manual-0-0-1.pdf +0 -0
  85. data/gorgyrella.gemspec +36 -0
  86. data/lib/gorgyrella/builder.rb +49 -0
  87. data/lib/gorgyrella/composer.rb +79 -0
  88. data/lib/gorgyrella/formatters/coderay.rb +28 -0
  89. data/lib/gorgyrella/formatters/pygments.rb +35 -0
  90. data/lib/gorgyrella/formatters/pygments_guess_lexer.py +9 -0
  91. data/lib/gorgyrella/formatters/ultraviolet.rb +35 -0
  92. data/lib/gorgyrella/gorgyrella.rb +9 -0
  93. data/lib/gorgyrella/parser.rb +637 -0
  94. data/lib/gorgyrella/parser.rl +133 -0
  95. data/lib/gorgyrella.rb +46 -0
  96. data/lib/webby/gorgyrella_helper.rb +31 -0
  97. data/spec/builder_spec.rb +7 -0
  98. data/spec/composer_spec.rb +70 -0
  99. data/spec/data/coderay.css +126 -0
  100. data/spec/data/example-python.html +24 -0
  101. data/spec/data/example-ruby.html +30 -0
  102. data/spec/data/pygments.css +59 -0
  103. data/spec/data/test.py +21 -0
  104. data/spec/data/test.rb +13 -0
  105. data/spec/data/ultraviolet/css/active4d.css +114 -0
  106. data/spec/data/ultraviolet/css/all_hallows_eve.css +72 -0
  107. data/spec/data/ultraviolet/css/amy.css +147 -0
  108. data/spec/data/ultraviolet/css/blackboard.css +88 -0
  109. data/spec/data/ultraviolet/css/brilliance_black.css +605 -0
  110. data/spec/data/ultraviolet/css/brilliance_dull.css +599 -0
  111. data/spec/data/ultraviolet/css/cobalt.css +149 -0
  112. data/spec/data/ultraviolet/css/dawn.css +121 -0
  113. data/spec/data/ultraviolet/css/eiffel.css +121 -0
  114. data/spec/data/ultraviolet/css/espresso_libre.css +109 -0
  115. data/spec/data/ultraviolet/css/idle.css +62 -0
  116. data/spec/data/ultraviolet/css/iplastic.css +80 -0
  117. data/spec/data/ultraviolet/css/lazy.css +73 -0
  118. data/spec/data/ultraviolet/css/mac_classic.css +123 -0
  119. data/spec/data/ultraviolet/css/magicwb_amiga.css +104 -0
  120. data/spec/data/ultraviolet/css/pastels_on_dark.css +188 -0
  121. data/spec/data/ultraviolet/css/slush_poppies.css +85 -0
  122. data/spec/data/ultraviolet/css/spacecadet.css +51 -0
  123. data/spec/data/ultraviolet/css/sunburst.css +180 -0
  124. data/spec/data/ultraviolet/css/twilight.css +137 -0
  125. data/spec/data/ultraviolet/css/zenburnesque.css +91 -0
  126. data/spec/data/unmarked.rb +32 -0
  127. data/spec/gorgyrella_spec.rb +7 -0
  128. data/spec/parser_spec.rb +73 -0
  129. data/spec/spec_helper.rb +13 -0
  130. data/spec/tmp/example-python-processed-coderay.html +31 -0
  131. data/spec/tmp/example-python-processed-pygments.html +31 -0
  132. data/spec/tmp/example-python-processed-ultraviolet.html +31 -0
  133. data/spec/tmp/example-ruby-processed-coderay.html +31 -0
  134. data/spec/tmp/example-ruby-processed-pygments.html +37 -0
  135. data/spec/tmp/example-ruby-processed-ultraviolet.html +33 -0
  136. data/tasks/ann.rake +80 -0
  137. data/tasks/bones.rake +20 -0
  138. data/tasks/gem.rake +201 -0
  139. data/tasks/git.rake +40 -0
  140. data/tasks/notes.rake +27 -0
  141. data/tasks/post_load.rake +34 -0
  142. data/tasks/rdoc.rake +51 -0
  143. data/tasks/rubyforge.rake +55 -0
  144. data/tasks/setup.rb +292 -0
  145. data/tasks/spec.rake +54 -0
  146. data/tasks/svn.rake +47 -0
  147. data/tasks/test.rake +40 -0
  148. data/tasks/zentest.rake +36 -0
  149. data/webby/.DS_Store +0 -0
  150. data/webby/README.txt +6 -0
  151. data/webby/Sitefile +24 -0
  152. data/webby/content/css/blueprint/ie.css +26 -0
  153. data/webby/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  154. data/webby/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  155. data/webby/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  156. data/webby/content/css/blueprint/plugins/buttons/readme.txt +32 -0
  157. data/webby/content/css/blueprint/plugins/buttons/screen.css +97 -0
  158. data/webby/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  159. data/webby/content/css/blueprint/plugins/fancy-type/screen.css +71 -0
  160. data/webby/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  161. data/webby/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  162. data/webby/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  163. data/webby/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  164. data/webby/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  165. data/webby/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  166. data/webby/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  167. data/webby/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  168. data/webby/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
  169. data/webby/content/css/blueprint/plugins/link-icons/screen.css +40 -0
  170. data/webby/content/css/blueprint/plugins/rtl/readme.txt +10 -0
  171. data/webby/content/css/blueprint/plugins/rtl/screen.css +109 -0
  172. data/webby/content/css/blueprint/print.css +30 -0
  173. data/webby/content/css/blueprint/screen.css +251 -0
  174. data/webby/content/css/blueprint/src/forms.css +49 -0
  175. data/webby/content/css/blueprint/src/grid.css +212 -0
  176. data/webby/content/css/blueprint/src/grid.png +0 -0
  177. data/webby/content/css/blueprint/src/ie.css +59 -0
  178. data/webby/content/css/blueprint/src/print.css +85 -0
  179. data/webby/content/css/blueprint/src/reset.css +38 -0
  180. data/webby/content/css/blueprint/src/typography.css +105 -0
  181. data/webby/content/css/pygments.txt +6 -0
  182. data/webby/content/css/site.css +78 -0
  183. data/webby/content/gorgyrella-manual.erb +33 -0
  184. data/webby/content/index.txt +15 -0
  185. data/webby/layouts/book.txt +29 -0
  186. data/webby/layouts/default.txt +27 -0
  187. data/webby/layouts/two_column.txt +25 -0
  188. data/webby/layouts/web.txt +42 -0
  189. data/webby/output/.cairn +0 -0
  190. data/webby/output/css/blueprint/ie.css +26 -0
  191. data/webby/output/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  192. data/webby/output/css/blueprint/plugins/buttons/icons/key.png +0 -0
  193. data/webby/output/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  194. data/webby/output/css/blueprint/plugins/buttons/readme.txt +32 -0
  195. data/webby/output/css/blueprint/plugins/buttons/screen.css +97 -0
  196. data/webby/output/css/blueprint/plugins/fancy-type/readme.txt +14 -0
  197. data/webby/output/css/blueprint/plugins/fancy-type/screen.css +71 -0
  198. data/webby/output/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
  199. data/webby/output/css/blueprint/plugins/link-icons/icons/email.png +0 -0
  200. data/webby/output/css/blueprint/plugins/link-icons/icons/external.png +0 -0
  201. data/webby/output/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
  202. data/webby/output/css/blueprint/plugins/link-icons/icons/im.png +0 -0
  203. data/webby/output/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  204. data/webby/output/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
  205. data/webby/output/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
  206. data/webby/output/css/blueprint/plugins/link-icons/readme.txt +18 -0
  207. data/webby/output/css/blueprint/plugins/link-icons/screen.css +40 -0
  208. data/webby/output/css/blueprint/plugins/rtl/readme.txt +10 -0
  209. data/webby/output/css/blueprint/plugins/rtl/screen.css +109 -0
  210. data/webby/output/css/blueprint/print.css +30 -0
  211. data/webby/output/css/blueprint/screen.css +251 -0
  212. data/webby/output/css/blueprint/src/forms.css +49 -0
  213. data/webby/output/css/blueprint/src/grid.css +212 -0
  214. data/webby/output/css/blueprint/src/grid.png +0 -0
  215. data/webby/output/css/blueprint/src/ie.css +59 -0
  216. data/webby/output/css/blueprint/src/print.css +85 -0
  217. data/webby/output/css/blueprint/src/reset.css +38 -0
  218. data/webby/output/css/blueprint/src/typography.css +105 -0
  219. data/webby/output/css/pygments.css +59 -0
  220. data/webby/output/css/site.css +62 -0
  221. data/webby/output/gorgyrella-manual.aux +17 -0
  222. data/webby/output/gorgyrella-manual.erb +51 -0
  223. data/webby/output/gorgyrella-manual.log +271 -0
  224. data/webby/output/gorgyrella-manual.out +2 -0
  225. data/webby/output/gorgyrella-manual.pdf +0 -0
  226. data/webby/output/gorgyrella-manual.tex +191 -0
  227. data/webby/output/index.html +41 -0
  228. data/webby/rsync-exclude +7 -0
  229. data/webby/tasks/latex.rake +14 -0
  230. data/webby/templates/article.erb +15 -0
  231. data/webby/templates/book.erb +16 -0
  232. data/webby/templates/page.erb +12 -0
  233. metadata +313 -0
data/Rakefile ADDED
@@ -0,0 +1,59 @@
1
+ # Look in the tasks/setup.rb file for the various options that can be
2
+ # configured in this Rakefile. The .rake files in the tasks directory
3
+ # are where the options are used.
4
+
5
+ begin
6
+ require 'bones'
7
+ Bones.setup
8
+ rescue LoadError
9
+ begin
10
+ load 'tasks/setup.rb'
11
+ rescue LoadError
12
+ raise RuntimeError, '### please install the "bones" gem ###'
13
+ end
14
+ end
15
+
16
+ ensure_in_path 'lib'
17
+ require 'gorgyrella'
18
+
19
+ PROJ.name = 'gorgyrella'
20
+ PROJ.authors = 'Ana Nelson'
21
+ PROJ.email = 'ana@ananelson.com'
22
+ PROJ.url = 'http://gorgyrella.rubyforge.org'
23
+ PROJ.version = Gorgyrella::VERSION
24
+ PROJ.rubyforge.name = 'gorgyrella'
25
+
26
+ PROJ.spec.opts << '--color'
27
+
28
+
29
+ require 'spec/rake/spectask'
30
+ require 'spec/rake/verify_rcov'
31
+
32
+ task :spec => :verify_rcov
33
+ task :default => :verify_rcov
34
+
35
+ desc "Verify RCOV coverage above threshold"
36
+ RCov::VerifyTask.new(:verify_rcov => [:compile, 'spec:rcov']) do |t|
37
+ t.threshold = 90.2
38
+ t.index_html = 'coverage/index.html'
39
+ end
40
+
41
+ desc "Compile Ragel parser to a Ruby file"
42
+ task :compile do
43
+ result = system("ragel -R lib/gorgyrella/parser.rl")
44
+ raise "ragel compile error" unless result
45
+ end
46
+
47
+ task :pygments_css do
48
+ style = "manni"
49
+ system("pygmentize -S #{style} -f html > spec/data/pygments.css")
50
+ end
51
+
52
+ task :coderay_css do
53
+ system("coderay_stylesheet > spec/data/coderay.css")
54
+ end
55
+
56
+ task :uv_css do
57
+ require "uv"
58
+ Uv.copy_files "xhtml", "spec/data/ultraviolet/"
59
+ end
data/bin/gorgyrella ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.expand_path(
4
+ File.join(File.dirname(__FILE__), %w[.. lib gorgyrella]))
5
+
6
+ puts Gorgyrella.process(ARGV[0])
Binary file
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{gorgyrella}
5
+ s.version = "0.0.1"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Ana Nelson"]
9
+ s.date = %q{2009-07-02}
10
+ s.default_executable = %q{gorgyrella}
11
+ s.description = %q{FIXME (describe your package)}
12
+ s.email = %q{ana@ananelson.com}
13
+ s.executables = ["gorgyrella"]
14
+ s.extra_rdoc_files = ["History.txt", "README.txt", "bin/gorgyrella", "lib/gorgyrella/formatters/pygments_guess_lexer.py", "lib/gorgyrella/parser.rl", "webby/README.txt", "webby/content/css/blueprint/plugins/buttons/readme.txt", "webby/content/css/blueprint/plugins/fancy-type/readme.txt", "webby/content/css/blueprint/plugins/link-icons/readme.txt", "webby/content/css/blueprint/plugins/rtl/readme.txt", "webby/content/css/pygments.txt", "webby/content/index.txt", "webby/layouts/book.txt", "webby/layouts/default.txt", "webby/layouts/two_column.txt", "webby/layouts/web.txt", "webby/output/css/blueprint/plugins/buttons/readme.txt", "webby/output/css/blueprint/plugins/fancy-type/readme.txt", "webby/output/css/blueprint/plugins/link-icons/readme.txt", "webby/output/css/blueprint/plugins/rtl/readme.txt"]
15
+ s.files = [".bzr/README", ".bzr/branch-format", ".bzr/branch/branch.conf", ".bzr/branch/format", ".bzr/branch/last-revision", ".bzr/branch/tags", ".bzr/checkout/conflicts", ".bzr/checkout/dirstate", ".bzr/checkout/format", ".bzr/checkout/merge-hashes", ".bzr/repository/format", ".bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.iix", ".bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.rix", ".bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.six", ".bzr/repository/indices/7433d7509bfad4e7de61716fd159a28e.tix", ".bzr/repository/indices/747331f41951a7f9509b3190e9082de2.iix", ".bzr/repository/indices/747331f41951a7f9509b3190e9082de2.rix", ".bzr/repository/indices/747331f41951a7f9509b3190e9082de2.six", ".bzr/repository/indices/747331f41951a7f9509b3190e9082de2.tix", ".bzr/repository/indices/94ae76525de86acde2f4722e88fec764.iix", ".bzr/repository/indices/94ae76525de86acde2f4722e88fec764.rix", ".bzr/repository/indices/94ae76525de86acde2f4722e88fec764.six", ".bzr/repository/indices/94ae76525de86acde2f4722e88fec764.tix", ".bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.iix", ".bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.rix", ".bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.six", ".bzr/repository/indices/ae5f61661ebb8f30600ce7443b2ea000.tix", ".bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.iix", ".bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.rix", ".bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.six", ".bzr/repository/indices/e34ba77fcb41bb254463c3c177123bb1.tix", ".bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.iix", ".bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.rix", ".bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.six", ".bzr/repository/indices/e409e77b2da885ef4e5bc5089a04e60e.tix", ".bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.iix", ".bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.rix", ".bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.six", ".bzr/repository/indices/fa740d26e5ddc0570df1ec65a7a2af1c.tix", ".bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.iix", ".bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.pack", ".bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.rix", ".bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.six", ".bzr/repository/obsolete_packs/24b89e5a96bc1f03a7ce1a200ab48dc9.tix", ".bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.iix", ".bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.pack", ".bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.rix", ".bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.six", ".bzr/repository/obsolete_packs/3ed72fa820dea2da6169d4361433a5f3.tix", ".bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.iix", ".bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.pack", ".bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.rix", ".bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.six", ".bzr/repository/obsolete_packs/acd9bdd28baefb868bf64371dde19d2b.tix", ".bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.iix", ".bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.pack", ".bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.rix", ".bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.six", ".bzr/repository/obsolete_packs/c408af011313ac56380f5716caffaf43.tix", ".bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.iix", ".bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.pack", ".bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.rix", ".bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.six", ".bzr/repository/obsolete_packs/cf2fbd7a25e9ab28e03fe483b1232f54.tix", ".bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.iix", ".bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.pack", ".bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.rix", ".bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.six", ".bzr/repository/obsolete_packs/fedc9930335a072ae735da013bf94c74.tix", ".bzr/repository/pack-names", ".bzr/repository/packs/7433d7509bfad4e7de61716fd159a28e.pack", ".bzr/repository/packs/747331f41951a7f9509b3190e9082de2.pack", ".bzr/repository/packs/94ae76525de86acde2f4722e88fec764.pack", ".bzr/repository/packs/ae5f61661ebb8f30600ce7443b2ea000.pack", ".bzr/repository/packs/e34ba77fcb41bb254463c3c177123bb1.pack", ".bzr/repository/packs/e409e77b2da885ef4e5bc5089a04e60e.pack", ".bzr/repository/packs/fa740d26e5ddc0570df1ec65a7a2af1c.pack", ".bzrignore", "History.txt", "LICENSE", "README.txt", "Rakefile", "bin/gorgyrella", "gorgyrella-manual-0-0-1.pdf", "lib/gorgyrella.rb", "lib/gorgyrella/builder.rb", "lib/gorgyrella/composer.rb", "lib/gorgyrella/formatters/coderay.rb", "lib/gorgyrella/formatters/pygments.rb", "lib/gorgyrella/formatters/pygments_guess_lexer.py", "lib/gorgyrella/formatters/ultraviolet.rb", "lib/gorgyrella/gorgyrella.rb", "lib/gorgyrella/parser.rb", "lib/gorgyrella/parser.rl", "lib/webby/gorgyrella_helper.rb", "spec/builder_spec.rb", "spec/composer_spec.rb", "spec/data/coderay.css", "spec/data/example-python.html", "spec/data/example-ruby.html", "spec/data/pygments.css", "spec/data/test.py", "spec/data/test.rb", "spec/data/ultraviolet/css/active4d.css", "spec/data/ultraviolet/css/all_hallows_eve.css", "spec/data/ultraviolet/css/amy.css", "spec/data/ultraviolet/css/blackboard.css", "spec/data/ultraviolet/css/brilliance_black.css", "spec/data/ultraviolet/css/brilliance_dull.css", "spec/data/ultraviolet/css/cobalt.css", "spec/data/ultraviolet/css/dawn.css", "spec/data/ultraviolet/css/eiffel.css", "spec/data/ultraviolet/css/espresso_libre.css", "spec/data/ultraviolet/css/idle.css", "spec/data/ultraviolet/css/iplastic.css", "spec/data/ultraviolet/css/lazy.css", "spec/data/ultraviolet/css/mac_classic.css", "spec/data/ultraviolet/css/magicwb_amiga.css", "spec/data/ultraviolet/css/pastels_on_dark.css", "spec/data/ultraviolet/css/slush_poppies.css", "spec/data/ultraviolet/css/spacecadet.css", "spec/data/ultraviolet/css/sunburst.css", "spec/data/ultraviolet/css/twilight.css", "spec/data/ultraviolet/css/zenburnesque.css", "spec/data/unmarked.rb", "spec/gorgyrella_spec.rb", "spec/parser_spec.rb", "spec/spec_helper.rb", "spec/tmp/example-python-processed-coderay.html", "spec/tmp/example-python-processed-pygments.html", "spec/tmp/example-python-processed-ultraviolet.html", "spec/tmp/example-ruby-processed-coderay.html", "spec/tmp/example-ruby-processed-pygments.html", "spec/tmp/example-ruby-processed-ultraviolet.html", "webby/.DS_Store", "webby/README.txt", "webby/Sitefile", "webby/content/css/blueprint/ie.css", "webby/content/css/blueprint/plugins/buttons/icons/cross.png", "webby/content/css/blueprint/plugins/buttons/icons/key.png", "webby/content/css/blueprint/plugins/buttons/icons/tick.png", "webby/content/css/blueprint/plugins/buttons/readme.txt", "webby/content/css/blueprint/plugins/buttons/screen.css", "webby/content/css/blueprint/plugins/fancy-type/readme.txt", "webby/content/css/blueprint/plugins/fancy-type/screen.css", "webby/content/css/blueprint/plugins/link-icons/icons/doc.png", "webby/content/css/blueprint/plugins/link-icons/icons/email.png", "webby/content/css/blueprint/plugins/link-icons/icons/external.png", "webby/content/css/blueprint/plugins/link-icons/icons/feed.png", "webby/content/css/blueprint/plugins/link-icons/icons/im.png", "webby/content/css/blueprint/plugins/link-icons/icons/pdf.png", "webby/content/css/blueprint/plugins/link-icons/icons/visited.png", "webby/content/css/blueprint/plugins/link-icons/icons/xls.png", "webby/content/css/blueprint/plugins/link-icons/readme.txt", "webby/content/css/blueprint/plugins/link-icons/screen.css", "webby/content/css/blueprint/plugins/rtl/readme.txt", "webby/content/css/blueprint/plugins/rtl/screen.css", "webby/content/css/blueprint/print.css", "webby/content/css/blueprint/screen.css", "webby/content/css/blueprint/src/forms.css", "webby/content/css/blueprint/src/grid.css", "webby/content/css/blueprint/src/grid.png", "webby/content/css/blueprint/src/ie.css", "webby/content/css/blueprint/src/print.css", "webby/content/css/blueprint/src/reset.css", "webby/content/css/blueprint/src/typography.css", "webby/content/css/pygments.txt", "webby/content/css/site.css", "webby/content/gorgyrella-manual.erb", "webby/content/index.txt", "webby/layouts/book.txt", "webby/layouts/default.txt", "webby/layouts/two_column.txt", "webby/layouts/web.txt", "webby/output/.cairn", "webby/output/css/blueprint/ie.css", "webby/output/css/blueprint/plugins/buttons/icons/cross.png", "webby/output/css/blueprint/plugins/buttons/icons/key.png", "webby/output/css/blueprint/plugins/buttons/icons/tick.png", "webby/output/css/blueprint/plugins/buttons/readme.txt", "webby/output/css/blueprint/plugins/buttons/screen.css", "webby/output/css/blueprint/plugins/fancy-type/readme.txt", "webby/output/css/blueprint/plugins/fancy-type/screen.css", "webby/output/css/blueprint/plugins/link-icons/icons/doc.png", "webby/output/css/blueprint/plugins/link-icons/icons/email.png", "webby/output/css/blueprint/plugins/link-icons/icons/external.png", "webby/output/css/blueprint/plugins/link-icons/icons/feed.png", "webby/output/css/blueprint/plugins/link-icons/icons/im.png", "webby/output/css/blueprint/plugins/link-icons/icons/pdf.png", "webby/output/css/blueprint/plugins/link-icons/icons/visited.png", "webby/output/css/blueprint/plugins/link-icons/icons/xls.png", "webby/output/css/blueprint/plugins/link-icons/readme.txt", "webby/output/css/blueprint/plugins/link-icons/screen.css", "webby/output/css/blueprint/plugins/rtl/readme.txt", "webby/output/css/blueprint/plugins/rtl/screen.css", "webby/output/css/blueprint/print.css", "webby/output/css/blueprint/screen.css", "webby/output/css/blueprint/src/forms.css", "webby/output/css/blueprint/src/grid.css", "webby/output/css/blueprint/src/grid.png", "webby/output/css/blueprint/src/ie.css", "webby/output/css/blueprint/src/print.css", "webby/output/css/blueprint/src/reset.css", "webby/output/css/blueprint/src/typography.css", "webby/output/css/pygments.css", "webby/output/css/site.css", "webby/output/gorgyrella-manual.aux", "webby/output/gorgyrella-manual.erb", "webby/output/gorgyrella-manual.log", "webby/output/gorgyrella-manual.out", "webby/output/gorgyrella-manual.pdf", "webby/output/gorgyrella-manual.tex", "webby/output/index.html", "webby/rsync-exclude", "webby/tasks/latex.rake", "webby/templates/article.erb", "webby/templates/book.erb", "webby/templates/page.erb"]
16
+ s.has_rdoc = true
17
+ s.homepage = %q{http://gorgyrella.rubyforge.org}
18
+ s.rdoc_options = ["--main", "README.txt"]
19
+ s.require_paths = ["lib"]
20
+ s.rubyforge_project = %q{gorgyrella}
21
+ s.rubygems_version = %q{1.3.1}
22
+ s.summary = %q{FIXME (describe your package)}
23
+
24
+ if s.respond_to? :specification_version then
25
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
26
+ s.specification_version = 2
27
+
28
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
29
+ s.add_development_dependency(%q<bones>, [">= 2.5.0"])
30
+ else
31
+ s.add_dependency(%q<bones>, [">= 2.5.0"])
32
+ end
33
+ else
34
+ s.add_dependency(%q<bones>, [">= 2.5.0"])
35
+ end
36
+ end
@@ -0,0 +1,49 @@
1
+ module Gorgyrella
2
+ class Builder
3
+ attr_reader :sections
4
+
5
+ def initialize
6
+ @anonymous_section_index = 0
7
+ @line = 1
8
+
9
+ @sections = []
10
+ append_section()
11
+ end
12
+
13
+ def section(name)
14
+ selected_sections = sections.find_all {|s| s[:section] == name}
15
+ raise "section #{name} not found!" if selected_sections.size == 0
16
+ raise "section #{name} not unique!" if selected_sections.size > 1
17
+ selected_sections.first
18
+ end
19
+
20
+ def append_line(text)
21
+ @sections.last[:lines] << [@line, text]
22
+ @line += 1
23
+ end
24
+
25
+ def lines_for(section_name)
26
+ section(section_name)[:lines]
27
+ end
28
+
29
+ def next_anonymous_section
30
+ (@anonymous_section_index += 1).to_s
31
+ end
32
+
33
+ def append_section(params = {})
34
+ command = params[:command] || 'export'
35
+ section = params[:section] || next_anonymous_section
36
+
37
+ new_section = {
38
+ :command => command,
39
+ :section => section,
40
+ :file => params[:file],
41
+ :format => params[:format],
42
+ :language => params[:language],
43
+ :lines => []
44
+ }
45
+
46
+ @sections << new_section
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,79 @@
1
+ module Gorgyrella
2
+ class Composer
3
+ attr_writer :formatter
4
+
5
+ def initialize(formatter = 'Coderay')
6
+ @formatter = formatter
7
+
8
+ # Caches
9
+ @includes = {}
10
+ @loads = {}
11
+ end
12
+
13
+ def load(filename)
14
+ with_cache(@loads, filename) do
15
+ content = File.read(filename)
16
+ Parser.run_machine(content)
17
+ end
18
+ end
19
+
20
+ def with_cache(cache, key)
21
+ cache[key] ||= yield
22
+ end
23
+
24
+ # Process a template file.
25
+ def process(filename)
26
+ builder = load(filename)
27
+ results = []
28
+
29
+ builder.sections.each do |s|
30
+ case s[:command]
31
+ when 'export'
32
+ results << format(s[:lines])
33
+ when 'include'
34
+ results << render_include(s[:file], s[:section], s[:format], s[:language], filename)
35
+ else
36
+ raise "unknown command" + s[:command].to_s
37
+ end
38
+ end
39
+
40
+ results.join("\n")
41
+ end
42
+
43
+ # Render an included section from another document. Called by process() and can
44
+ # also be called directly.
45
+ def render_include(file, section = "1", format = nil, language = nil, parent_filename = nil)
46
+ key = [parent_filename, file, section, format || 'auto'].join("::")
47
+
48
+ with_cache(@includes, key) do
49
+ builder = load(file)
50
+ raise unless builder
51
+
52
+ # Get the lines we will actually render for this section.
53
+ lines = builder.lines_for(section)
54
+
55
+ # Fetch the first few lines of sample text for auto-detecting the lexer.
56
+ firsts = format(builder.lines_for(builder.sections.first[:section]))
57
+
58
+ lexer = formatter.resolve_lexer(file, language, firsts)
59
+ format = formatter.resolve_format(format, parent_filename, lines[0][0])
60
+
61
+ format(lines, lexer, format)
62
+ end
63
+ end
64
+
65
+ def formatter
66
+ Formatters.const_get(@formatter)
67
+ end
68
+
69
+ def format(lines, lexer = nil, format = nil)
70
+ text = lines.collect {|lne| lne[1]}.join("\n")
71
+
72
+ if (format && lexer)
73
+ formatter.highlight(text, lexer, format)
74
+ else
75
+ text
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,28 @@
1
+ require "rubygems"
2
+ require "coderay"
3
+ require "coderay/helpers/file_type"
4
+
5
+ module Gorgyrella
6
+ module Formatters
7
+ class Coderay
8
+ # Will silently ignore unknown lexers, will raise an error if
9
+ # unknown format called.
10
+ def self.highlight(text, lexer, format)
11
+ CodeRay.scan(text, lexer.to_sym).send(format.to_sym)
12
+ end
13
+
14
+ def self.resolve_lexer(file, language = nil, sample_text = "")
15
+ if language
16
+ language
17
+ else
18
+ CodeRay::FileType.fetch(file, :plaintext, true)
19
+ end
20
+ end
21
+
22
+ def self.resolve_format(format, parent_filename = nil, first_line = 0)
23
+ format || 'html'
24
+ end
25
+ end
26
+ end
27
+ end
28
+
@@ -0,0 +1,35 @@
1
+ require "tempfile"
2
+
3
+ module Gorgyrella
4
+ module Formatters
5
+ class Pygments
6
+ def self.highlight(text, lexer, format)
7
+ tempfile = Tempfile.new("pygments")
8
+ tempfile.write(text)
9
+ tempfile.flush
10
+
11
+ raise "lexer is none!" if lexer =~ /none/
12
+ raise "lexer is empty!" if lexer.empty?
13
+ raise "lexer has spaces! '#{lexer}' #{text}" if lexer =~ /\s/
14
+ raise "format has spaces! '#{format}' #{text}" if format =~ /\s/
15
+
16
+ cmd = "pygmentize -l #{lexer} -f #{format} #{tempfile.path}"
17
+ `#{cmd}`
18
+ end
19
+
20
+ def self.resolve_lexer(file, language = nil, sample_text = "")
21
+ if language && !language.empty?
22
+ language
23
+ else
24
+ pygments_guess_lexer_file = File.join(File.dirname(__FILE__), "pygments_guess_lexer.py")
25
+ pygments_lexer = `python #{pygments_guess_lexer_file} #{file}`.chomp
26
+ pygments_lexer.empty? ? 'text' : pygments_lexer
27
+ end
28
+ end
29
+
30
+ def self.resolve_format(format, parent_filename = nil, first_line = 0)
31
+ format || 'html'
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ import sys
2
+ from pygments.lexers import guess_lexer_for_filename
3
+
4
+ try:
5
+ lexer_name = guess_lexer_for_filename(sys.argv[1], "").aliases[0]
6
+ except:
7
+ lexer_name = ""
8
+
9
+ print lexer_name
@@ -0,0 +1,35 @@
1
+ require "uv"
2
+
3
+ module Gorgyrella
4
+ module Formatters
5
+ class Ultraviolet
6
+ # Will silently ignore unknown lexers, will raise an error if
7
+ # unknown format called.
8
+ def self.highlight(text, lexer, format, line_numbers = true, theme = 'amy')
9
+ raise "#{lexer} syntax not available" unless Uv.syntaxes.include?(lexer)
10
+ Uv.parse( text, format, lexer, line_numbers, theme)
11
+ end
12
+
13
+ def self.resolve_lexer(file, language = nil, sample_text = "")
14
+ if language
15
+ language
16
+ else
17
+ candidates = Uv.syntax_for_file(file)
18
+
19
+ if candidates.size == 1
20
+ candidates.first[0]
21
+ else
22
+ nil
23
+ end
24
+ end
25
+ end
26
+
27
+ def self.resolve_format(format, parent_filename = nil, first_line = 0)
28
+ format ||= 'xhtml'
29
+ format = nil if format === 'text'
30
+ format = 'xhtml' if format === 'html'
31
+ format
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,9 @@
1
+ module Gorgyrella
2
+ def self.process(filename)
3
+ Composer.new.process(filename)
4
+ end
5
+
6
+ def self.render_section(filename, section = "1", format = nil, language = nil, formatter = 'Pygments')
7
+ Composer.new(formatter).render_include(filename, section, format, language)
8
+ end
9
+ end