codex 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/History.txt +8 -0
  2. data/LICENSE.txt +29 -0
  3. data/Manifest.txt +95 -0
  4. data/PostInstall.txt +5 -0
  5. data/README.txt +31 -0
  6. data/Rakefile +4 -0
  7. data/app_generators/codex/USAGE +5 -0
  8. data/app_generators/codex/codex_generator.rb +106 -0
  9. data/app_generators/codex/templates/Rakefile +54 -0
  10. data/app_generators/codex/templates/bin/build_all.rb +47 -0
  11. data/app_generators/codex/templates/bin/postprocess_all.rb +5 -0
  12. data/app_generators/codex/templates/bin/pressie.rb +7 -0
  13. data/app_generators/codex/templates/code/control/basic_continuation.rb +11 -0
  14. data/app_generators/codex/templates/code/control/cc_throw_catch.rb +59 -0
  15. data/app_generators/codex/templates/code/control/closure_continuation.rb +8 -0
  16. data/app_generators/codex/templates/code/control/closure_continuation_2.rb +12 -0
  17. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html +115 -0
  18. data/app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html +134 -0
  19. data/app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html +90 -0
  20. data/app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html +190 -0
  21. data/app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html +108 -0
  22. data/app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html +112 -0
  23. data/app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html +90 -0
  24. data/app_generators/codex/templates/dp.SyntaxHighlighter/Index.html +80 -0
  25. data/app_generators/codex/templates/dp.SyntaxHighlighter/Java.html +122 -0
  26. data/app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html +112 -0
  27. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html +89 -0
  28. data/app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html +89 -0
  29. data/app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html +102 -0
  30. data/app_generators/codex/templates/dp.SyntaxHighlighter/Python.html +121 -0
  31. data/app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html +131 -0
  32. data/app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html +98 -0
  33. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf +0 -0
  34. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js +32 -0
  35. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js +73 -0
  36. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js +52 -0
  37. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js +34 -0
  38. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js +22 -0
  39. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js +28 -0
  40. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js +60 -0
  41. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js +30 -0
  42. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js +28 -0
  43. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js +42 -0
  44. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js +29 -0
  45. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js +70 -0
  46. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js +414 -0
  47. data/app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js +674 -0
  48. data/app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html +89 -0
  49. data/app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html +88 -0
  50. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css +158 -0
  51. data/app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css +63 -0
  52. data/app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt +80 -0
  53. data/app_generators/codex/templates/dp.SyntaxHighlighter/VB.html +115 -0
  54. data/app_generators/codex/templates/dp.SyntaxHighlighter/XML.html +136 -0
  55. data/app_generators/codex/templates/html/all.html +0 -0
  56. data/app_generators/codex/templates/readme.txt +4 -0
  57. data/app_generators/codex/templates/slides/basics.slides +37 -0
  58. data/app_generators/codex/templates/slides/building.slides +27 -0
  59. data/app_generators/codex/templates/slides/example.slides +80 -0
  60. data/app_generators/codex/templates/slides/including_code.slides +80 -0
  61. data/app_generators/codex/templates/slides/metadata.yml +4 -0
  62. data/app_generators/codex/templates/slides/table_of_contents.slides +14 -0
  63. data/app_generators/codex/templates/ui/default/blank.gif +0 -0
  64. data/app_generators/codex/templates/ui/default/bodybg.gif +0 -0
  65. data/app_generators/codex/templates/ui/default/framing.css +23 -0
  66. data/app_generators/codex/templates/ui/default/iepngfix.htc +42 -0
  67. data/app_generators/codex/templates/ui/default/opera.css +7 -0
  68. data/app_generators/codex/templates/ui/default/outline.css +15 -0
  69. data/app_generators/codex/templates/ui/default/pretty.css +86 -0
  70. data/app_generators/codex/templates/ui/default/print.css +1 -0
  71. data/app_generators/codex/templates/ui/default/s5-core.css +9 -0
  72. data/app_generators/codex/templates/ui/default/slides.css +3 -0
  73. data/app_generators/codex/templates/ui/default/slides.js +553 -0
  74. data/bin/codex +17 -0
  75. data/codex.gemspec +30 -0
  76. data/config/hoe.rb +75 -0
  77. data/config/requirements.rb +15 -0
  78. data/lib/codex.rb +7 -0
  79. data/lib/codex/content.rb +160 -0
  80. data/lib/codex/pressie.rb +108 -0
  81. data/lib/codex/version.rb +9 -0
  82. data/lib/stylesheets/pressie.css +196 -0
  83. data/lib/stylesheets/print.css +149 -0
  84. data/lib/stylesheets/ruby.png +0 -0
  85. data/script/console +10 -0
  86. data/script/destroy +14 -0
  87. data/script/generate +14 -0
  88. data/setup.rb +1585 -0
  89. data/tasks/deployment.rake +34 -0
  90. data/tasks/environment.rake +7 -0
  91. data/tasks/website.rake +9 -0
  92. data/test/test_codex.rb +11 -0
  93. data/test/test_codex_generator.rb +78 -0
  94. data/test/test_generator_helper.rb +29 -0
  95. data/test/test_helper.rb +2 -0
  96. metadata +163 -0
@@ -0,0 +1,34 @@
1
+ desc 'Release the website and new gem version'
2
+ task :deploy => [:check_version, :website, :release] do
3
+ puts "Remember to create SVN tag:"
4
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
+ puts "Suggested comment:"
7
+ puts "Tagging release #{CHANGES}"
8
+ end
9
+
10
+ desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
11
+ task :local_deploy => [:website_generate, :install_gem]
12
+
13
+ task :check_version do
14
+ unless ENV['VERSION']
15
+ puts 'Must pass a VERSION=x.y.z release version'
16
+ exit
17
+ end
18
+ unless ENV['VERSION'] == VERS
19
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
20
+ exit
21
+ end
22
+ end
23
+
24
+ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
+ task :install_gem_no_doc => [:clean, :package] do
26
+ sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
+ end
28
+
29
+ namespace :manifest do
30
+ desc 'Recreate Manifest.txt to include ALL files'
31
+ task :refresh do
32
+ `rake check_manifest | patch -p0 > Manifest.txt`
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end
@@ -0,0 +1,9 @@
1
+ # stubs for the website generation
2
+ # To install the website framework:
3
+ # script/generate website
4
+
5
+ task :website_generate
6
+
7
+ task :website_upload
8
+
9
+ task :website => :publish_docs
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestCodex < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
@@ -0,0 +1,78 @@
1
+ require File.join(File.dirname(__FILE__), "test_generator_helper.rb")
2
+
3
+ class TestCodexGenerator < Test::Unit::TestCase
4
+ include RubiGen::GeneratorTestHelper
5
+
6
+ def setup
7
+ bare_setup
8
+ end
9
+
10
+ def teardown
11
+ bare_teardown
12
+ end
13
+
14
+ # Some generator-related assertions:
15
+ # assert_generated_file(name, &block) # block passed the file contents
16
+ # assert_directory_exists(name)
17
+ # assert_generated_class(name, &block)
18
+ # assert_generated_module(name, &block)
19
+ # assert_generated_test_for(name, &block)
20
+ # The assert_generated_(class|module|test_for) &block is passed the body of the class/module within the file
21
+ # assert_has_method(body, *methods) # check that the body has a list of methods (methods with parentheses not supported yet)
22
+ #
23
+ # Other helper methods are:
24
+ # app_root_files - put this in teardown to show files generated by the test method (e.g. p app_root_files)
25
+ # bare_setup - place this in setup method to create the APP_ROOT folder for each test
26
+ # bare_teardown - place this in teardown method to destroy the TMP_ROOT or APP_ROOT folder after each test
27
+
28
+ def test_generator_without_options
29
+ run_generator('codex', [APP_ROOT], sources)
30
+ assert_directory_exists "bin"
31
+ assert_directory_exists "code/control"
32
+ assert_directory_exists "html"
33
+ assert_directory_exists "slides"
34
+ assert_directory_exists "dp.SyntaxHighlighter"
35
+ assert_directory_exists "script"
36
+ assert_generated_file "Rakefile"
37
+ assert_generated_file "html/all.html"
38
+ %w[basics building example including_code table_of_contents].each do |slide|
39
+ assert_generated_file "slides/#{slide}.slides"
40
+ end
41
+ assert_generated_file "slides/metadata.yml"
42
+ %w[build_all postprocess_all pressie].each do |bin|
43
+ assert_generated_file "bin/#{bin}.rb"
44
+ end
45
+ %w[basic_continuation cc_throw_catch closure_continuation closure_continuation_2].each do |code|
46
+ assert_generated_file "code/control/#{code}.rb"
47
+ end
48
+ ["CollapseCode.html", "Cpp.html", "CrashTest.html", "CSharp.html", "CSS.html",
49
+ "Delphi.html", "FirstLine.html", "Index.html", "Java.html", "JavaScript.html",
50
+ "NoControls.html", "NoGutter.html", "PHP.html", "Python.html", "Ruby.html",
51
+ "ShowColumns.html", "SmartTabs.html", "SQL.html",
52
+ "VB.html", "XML.html",
53
+ "Scripts/clipboard.swf", "Scripts/shBrushCpp.js", "Scripts/shBrushCSharp.js",
54
+ "Scripts/shBrushCss.js", "Scripts/shBrushDelphi.js", "Scripts/shBrushJava.js",
55
+ "Scripts/shBrushJScript.js", "Scripts/shBrushPhp.js", "Scripts/shBrushPython.js",
56
+ "Scripts/shBrushRuby.js", "Scripts/shBrushSql.js", "Scripts/shBrushVb.js",
57
+ "Scripts/shBrushXml.js", "Scripts/shCore.js", "Scripts/shCore.uncompressed.js",
58
+ "Styles/SyntaxHighlighter.css", "Styles/TestPages.css",
59
+ "Templates/Test.dwt"
60
+ ].each do |syntax|
61
+ assert_generated_file "dp.SyntaxHighlighter/#{syntax}"
62
+ end
63
+ ["blank.gif", "bodybg.gif", "framing.css", "iepngfix.htc", "opera.css", "outline.css",
64
+ "pretty.css", "print.css", "s5-core.css", "slides.css", "slides.js"].each do |asset|
65
+ assert_generated_file "ui/default/#{asset}"
66
+ end
67
+ end
68
+
69
+ private
70
+ def sources
71
+ [RubiGen::PathSource.new(:test, File.join(File.dirname(__FILE__),"..", generator_path))
72
+ ]
73
+ end
74
+
75
+ def generator_path
76
+ "app_generators"
77
+ end
78
+ end
@@ -0,0 +1,29 @@
1
+ begin
2
+ require File.dirname(__FILE__) + '/test_helper'
3
+ rescue LoadError
4
+ require 'test/unit'
5
+ end
6
+ require 'fileutils'
7
+
8
+ # Must set before requiring generator libs.
9
+ TMP_ROOT = File.dirname(__FILE__) + "/tmp" unless defined?(TMP_ROOT)
10
+ PROJECT_NAME = "myproject" unless defined?(PROJECT_NAME)
11
+ app_root = File.join(TMP_ROOT, PROJECT_NAME)
12
+ if defined?(APP_ROOT)
13
+ APP_ROOT.replace(app_root)
14
+ else
15
+ APP_ROOT = app_root
16
+ end
17
+ if defined?(RAILS_ROOT)
18
+ RAILS_ROOT.replace(app_root)
19
+ else
20
+ RAILS_ROOT = app_root
21
+ end
22
+
23
+ begin
24
+ require 'rubigen'
25
+ rescue LoadError
26
+ require 'rubygems'
27
+ require 'rubigen'
28
+ end
29
+ require 'rubigen/helpers/generator_test_helper'
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/codex'
metadata ADDED
@@ -0,0 +1,163 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: codex
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Dave Thomas
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-05-22 00:00:00 +10:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: Simple tool for creating source-code intensive presentations and courses
17
+ email:
18
+ - dave@pragprog.com
19
+ executables:
20
+ - codex
21
+ extensions: []
22
+
23
+ extra_rdoc_files:
24
+ - History.txt
25
+ - LICENSE.txt
26
+ - Manifest.txt
27
+ - PostInstall.txt
28
+ - README.txt
29
+ - app_generators/codex/templates/readme.txt
30
+ files:
31
+ - History.txt
32
+ - LICENSE.txt
33
+ - Manifest.txt
34
+ - PostInstall.txt
35
+ - README.txt
36
+ - Rakefile
37
+ - app_generators/codex/USAGE
38
+ - app_generators/codex/codex_generator.rb
39
+ - app_generators/codex/templates/Rakefile
40
+ - app_generators/codex/templates/bin/build_all.rb
41
+ - app_generators/codex/templates/bin/postprocess_all.rb
42
+ - app_generators/codex/templates/bin/pressie.rb
43
+ - app_generators/codex/templates/code/control/basic_continuation.rb
44
+ - app_generators/codex/templates/code/control/cc_throw_catch.rb
45
+ - app_generators/codex/templates/code/control/closure_continuation.rb
46
+ - app_generators/codex/templates/code/control/closure_continuation_2.rb
47
+ - app_generators/codex/templates/dp.SyntaxHighlighter/CSS.html
48
+ - app_generators/codex/templates/dp.SyntaxHighlighter/CSharp.html
49
+ - app_generators/codex/templates/dp.SyntaxHighlighter/CollapseCode.html
50
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Cpp.html
51
+ - app_generators/codex/templates/dp.SyntaxHighlighter/CrashTest.html
52
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Delphi.html
53
+ - app_generators/codex/templates/dp.SyntaxHighlighter/FirstLine.html
54
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Index.html
55
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Java.html
56
+ - app_generators/codex/templates/dp.SyntaxHighlighter/JavaScript.html
57
+ - app_generators/codex/templates/dp.SyntaxHighlighter/NoControls.html
58
+ - app_generators/codex/templates/dp.SyntaxHighlighter/NoGutter.html
59
+ - app_generators/codex/templates/dp.SyntaxHighlighter/PHP.html
60
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Python.html
61
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Ruby.html
62
+ - app_generators/codex/templates/dp.SyntaxHighlighter/SQL.html
63
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/clipboard.swf
64
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCSharp.js
65
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCpp.js
66
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushCss.js
67
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushDelphi.js
68
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJScript.js
69
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushJava.js
70
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPhp.js
71
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushPython.js
72
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushRuby.js
73
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushSql.js
74
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushVb.js
75
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shBrushXml.js
76
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.js
77
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Scripts/shCore.uncompressed.js
78
+ - app_generators/codex/templates/dp.SyntaxHighlighter/ShowColumns.html
79
+ - app_generators/codex/templates/dp.SyntaxHighlighter/SmartTabs.html
80
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css
81
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Styles/TestPages.css
82
+ - app_generators/codex/templates/dp.SyntaxHighlighter/Templates/Test.dwt
83
+ - app_generators/codex/templates/dp.SyntaxHighlighter/VB.html
84
+ - app_generators/codex/templates/dp.SyntaxHighlighter/XML.html
85
+ - app_generators/codex/templates/html/all.html
86
+ - app_generators/codex/templates/readme.txt
87
+ - app_generators/codex/templates/slides/basics.slides
88
+ - app_generators/codex/templates/slides/building.slides
89
+ - app_generators/codex/templates/slides/example.slides
90
+ - app_generators/codex/templates/slides/including_code.slides
91
+ - app_generators/codex/templates/slides/metadata.yml
92
+ - app_generators/codex/templates/slides/table_of_contents.slides
93
+ - app_generators/codex/templates/ui/default/blank.gif
94
+ - app_generators/codex/templates/ui/default/bodybg.gif
95
+ - app_generators/codex/templates/ui/default/framing.css
96
+ - app_generators/codex/templates/ui/default/iepngfix.htc
97
+ - app_generators/codex/templates/ui/default/opera.css
98
+ - app_generators/codex/templates/ui/default/outline.css
99
+ - app_generators/codex/templates/ui/default/pretty.css
100
+ - app_generators/codex/templates/ui/default/print.css
101
+ - app_generators/codex/templates/ui/default/s5-core.css
102
+ - app_generators/codex/templates/ui/default/slides.css
103
+ - app_generators/codex/templates/ui/default/slides.js
104
+ - bin/codex
105
+ - codex.gemspec
106
+ - config/hoe.rb
107
+ - config/requirements.rb
108
+ - lib/codex.rb
109
+ - lib/codex/content.rb
110
+ - lib/codex/pressie.rb
111
+ - lib/codex/version.rb
112
+ - lib/stylesheets/pressie.css
113
+ - lib/stylesheets/print.css
114
+ - lib/stylesheets/ruby.png
115
+ - script/console
116
+ - script/destroy
117
+ - script/generate
118
+ - setup.rb
119
+ - tasks/deployment.rake
120
+ - tasks/environment.rake
121
+ - tasks/website.rake
122
+ - test/test_codex.rb
123
+ - test/test_codex_generator.rb
124
+ - test/test_generator_helper.rb
125
+ - test/test_helper.rb
126
+ has_rdoc: true
127
+ homepage: http://codex.rubyforge.org
128
+ post_install_message: |
129
+
130
+ To create new presentations:
131
+
132
+ codex path/to/presentation/folder
133
+
134
+
135
+ rdoc_options:
136
+ - --main
137
+ - README.txt
138
+ require_paths:
139
+ - lib
140
+ required_ruby_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: "0"
145
+ version:
146
+ required_rubygems_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: "0"
151
+ version:
152
+ requirements: []
153
+
154
+ rubyforge_project: codex
155
+ rubygems_version: 1.1.1
156
+ signing_key:
157
+ specification_version: 2
158
+ summary: Simple tool for creating source-code intensive presentations and courses
159
+ test_files:
160
+ - test/test_codex.rb
161
+ - test/test_codex_generator.rb
162
+ - test/test_generator_helper.rb
163
+ - test/test_helper.rb