org-ruby 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. data/History.txt +81 -77
  2. data/README.rdoc +66 -66
  3. data/Rakefile +28 -28
  4. data/bin/org-ruby +40 -40
  5. data/lib/org-ruby.rb +50 -50
  6. data/lib/org-ruby/headline.rb +102 -120
  7. data/lib/org-ruby/html_output_buffer.rb +174 -156
  8. data/lib/org-ruby/line.rb +206 -260
  9. data/lib/org-ruby/output_buffer.rb +227 -191
  10. data/lib/org-ruby/parser.rb +320 -272
  11. data/lib/org-ruby/regexp_helper.rb +156 -156
  12. data/lib/org-ruby/textile_output_buffer.rb +67 -68
  13. data/spec/data/freeform-example.org +113 -113
  14. data/spec/data/freeform.org +111 -111
  15. data/spec/data/hyp-planning.org +335 -335
  16. data/spec/data/remember.org +53 -53
  17. data/spec/headline_spec.rb +55 -55
  18. data/spec/html_examples/advanced-code.html +36 -36
  19. data/spec/html_examples/advanced-code.org +53 -53
  20. data/spec/html_examples/advanced-lists.html +31 -31
  21. data/spec/html_examples/advanced-lists.org +31 -31
  22. data/spec/html_examples/block_code.html +28 -28
  23. data/spec/html_examples/block_code.org +35 -35
  24. data/spec/html_examples/blockquote.html +7 -7
  25. data/spec/html_examples/blockquote.org +13 -13
  26. data/spec/html_examples/code-comment.html +18 -18
  27. data/spec/html_examples/code-comment.org +22 -22
  28. data/spec/html_examples/custom-seq-todo.html +15 -15
  29. data/spec/html_examples/custom-seq-todo.org +24 -24
  30. data/spec/html_examples/custom-todo.html +15 -15
  31. data/spec/html_examples/custom-todo.org +24 -24
  32. data/spec/html_examples/custom-typ-todo.html +15 -15
  33. data/spec/html_examples/custom-typ-todo.org +24 -24
  34. data/spec/html_examples/entities.html +4 -4
  35. data/spec/html_examples/entities.org +11 -11
  36. data/spec/html_examples/escape-pre.html +6 -6
  37. data/spec/html_examples/escape-pre.org +6 -6
  38. data/spec/html_examples/export-exclude-only.html +13 -13
  39. data/spec/html_examples/export-exclude-only.org +81 -81
  40. data/spec/html_examples/export-keywords.html +4 -4
  41. data/spec/html_examples/export-keywords.org +18 -18
  42. data/spec/html_examples/export-tags.html +8 -8
  43. data/spec/html_examples/export-tags.org +82 -82
  44. data/spec/html_examples/export-title.html +2 -2
  45. data/spec/html_examples/export-title.org +4 -4
  46. data/spec/html_examples/html-literal.html +2 -2
  47. data/spec/html_examples/html-literal.org +6 -6
  48. data/spec/html_examples/inline-formatting.html +10 -10
  49. data/spec/html_examples/inline-formatting.org +17 -17
  50. data/spec/html_examples/link-features.html +8 -8
  51. data/spec/html_examples/link-features.org +19 -19
  52. data/spec/html_examples/lists.html +19 -19
  53. data/spec/html_examples/lists.org +36 -36
  54. data/spec/html_examples/metadata-comment.html +27 -27
  55. data/spec/html_examples/metadata-comment.org +30 -30
  56. data/spec/html_examples/only-list.html +5 -5
  57. data/spec/html_examples/only-list.org +3 -3
  58. data/spec/html_examples/only-table.html +6 -6
  59. data/spec/html_examples/only-table.org +5 -5
  60. data/spec/html_examples/skip-header.html +3 -3
  61. data/spec/html_examples/skip-header.org +28 -28
  62. data/spec/html_examples/skip-table.html +4 -4
  63. data/spec/html_examples/skip-table.org +19 -19
  64. data/spec/html_examples/tables.html +20 -20
  65. data/spec/html_examples/tables.org +26 -26
  66. data/spec/html_examples/text.html +2 -2
  67. data/spec/html_examples/text.org +16 -16
  68. data/spec/line_spec.rb +151 -151
  69. data/spec/output_buffer_spec.rb +19 -0
  70. data/spec/parser_spec.rb +152 -166
  71. data/spec/regexp_helper_spec.rb +57 -57
  72. data/spec/spec_helper.rb +21 -21
  73. data/spec/textile_examples/block_code.org +35 -35
  74. data/spec/textile_examples/block_code.textile +29 -29
  75. data/spec/textile_examples/blockquote.org +13 -13
  76. data/spec/textile_examples/blockquote.textile +11 -11
  77. data/spec/textile_examples/keywords.org +13 -13
  78. data/spec/textile_examples/keywords.textile +11 -11
  79. data/spec/textile_examples/links.org +11 -11
  80. data/spec/textile_examples/links.textile +10 -10
  81. data/spec/textile_examples/lists.org +36 -36
  82. data/spec/textile_examples/lists.textile +20 -20
  83. data/spec/textile_examples/single-space-plain-list.org +13 -13
  84. data/spec/textile_examples/single-space-plain-list.textile +10 -10
  85. data/spec/textile_examples/tables.org +26 -26
  86. data/spec/textile_examples/tables.textile +23 -23
  87. data/spec/textile_output_buffer_spec.rb +21 -21
  88. data/tasks/test_case.rake +49 -49
  89. metadata +3 -2
@@ -1,10 +1,10 @@
1
- h2. Anatomy of a BVP
2
-
3
- Each BVP followed a simple, one-page template with the following parts:
4
-
5
- * Customer Summary
6
- * Storyboard
7
- * Requirements
8
- * Partner teams
9
-
10
- The following sections walk through each section and give an example from one of our BVPs, "Resource-Smart Virtualization Infrastructure":http://windows/hyper-v/initiatives/Value%20Propositions/DynamicDatacenter-ValueProp.docx (also called _Dynamic Datacenter_).
1
+ h2. Anatomy of a BVP
2
+
3
+ Each BVP followed a simple, one-page template with the following parts:
4
+
5
+ * Customer Summary
6
+ * Storyboard
7
+ * Requirements
8
+ * Partner teams
9
+
10
+ The following sections walk through each section and give an example from one of our BVPs, "Resource-Smart Virtualization Infrastructure":http://windows/hyper-v/initiatives/Value%20Propositions/DynamicDatacenter-ValueProp.docx (also called _Dynamic Datacenter_).
@@ -1,26 +1,26 @@
1
- TABLES
2
-
3
- Different types of ORG tables.
4
-
5
- * Simple table, no header.
6
-
7
- | Cell one | Cell two |
8
- | Cell three | Cell four |
9
-
10
-
11
- * Indented table
12
-
13
- | Cell one |
14
- | Cell two |
15
-
16
- And here's some paragraph content. The line breaks will need to get
17
- removed here, but not for the tables.
18
-
19
- * Table with header
20
-
21
- | One | Two | Three |
22
- |-------+-------+-------|
23
- | Four | Five | Six |
24
- | Seven | Eight | Nine |
25
-
26
- The separator row should not get printed out.
1
+ TABLES
2
+
3
+ Different types of ORG tables.
4
+
5
+ * Simple table, no header.
6
+
7
+ | Cell one | Cell two |
8
+ | Cell three | Cell four |
9
+
10
+
11
+ * Indented table
12
+
13
+ | Cell one |
14
+ | Cell two |
15
+
16
+ And here's some paragraph content. The line breaks will need to get
17
+ removed here, but not for the tables.
18
+
19
+ * Table with header
20
+
21
+ | One | Two | Three |
22
+ |-------+-------+-------|
23
+ | Four | Five | Six |
24
+ | Seven | Eight | Nine |
25
+
26
+ The separator row should not get printed out.
@@ -1,23 +1,23 @@
1
- TABLES
2
-
3
- Different types of ORG tables.
4
-
5
- h1. Simple table, no header.
6
-
7
- | Cell one | Cell two |
8
- | Cell three | Cell four |
9
-
10
- h1. Indented table
11
-
12
- | Cell one |
13
- | Cell two |
14
-
15
- And here's some paragraph content. The line breaks will need to get removed here, but not for the tables.
16
-
17
- h1. Table with header
18
-
19
- | One | Two | Three |
20
- | Four | Five | Six |
21
- | Seven | Eight | Nine |
22
-
23
- The separator row should not get printed out.
1
+ TABLES
2
+
3
+ Different types of ORG tables.
4
+
5
+ h1. Simple table, no header.
6
+
7
+ | Cell one | Cell two |
8
+ | Cell three | Cell four |
9
+
10
+ h1. Indented table
11
+
12
+ | Cell one |
13
+ | Cell two |
14
+
15
+ And here's some paragraph content. The line breaks will need to get removed here, but not for the tables.
16
+
17
+ h1. Table with header
18
+
19
+ | One | Two | Three |
20
+ | Four | Five | Six |
21
+ | Seven | Eight | Nine |
22
+
23
+ The separator row should not get printed out.
@@ -1,21 +1,21 @@
1
- require File.join(File.dirname(__FILE__), %w[spec_helper])
2
-
3
- describe Orgmode::TextileOutputBuffer do
4
- it "should substitute / with _" do
5
- Orgmode::TextileOutputBuffer.new("").inline_formatting("/italic/").should eql("_italic_")
6
- end
7
-
8
- it "should convert simple links" do
9
- Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com]]").should \
10
- eql("\"http://www.google.com\":http://www.google.com")
11
- end
12
-
13
- it "should convert links with text" do
14
- Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com][Google]]").should \
15
- eql("\"Google\":http://www.google.com")
16
- end
17
-
18
- it "should convert spaces in urls" do
19
- Orgmode::TextileOutputBuffer.new("").inline_formatting("[[my url]]").should eql("\"my url\":my%20url")
20
- end
21
- end
1
+ require File.join(File.dirname(__FILE__), %w[spec_helper])
2
+
3
+ describe Orgmode::TextileOutputBuffer do
4
+ it "should substitute / with _" do
5
+ Orgmode::TextileOutputBuffer.new("").inline_formatting("/italic/").should eql("_italic_")
6
+ end
7
+
8
+ it "should convert simple links" do
9
+ Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com]]").should \
10
+ eql("\"http://www.google.com\":http://www.google.com")
11
+ end
12
+
13
+ it "should convert links with text" do
14
+ Orgmode::TextileOutputBuffer.new("").inline_formatting("[[http://www.google.com][Google]]").should \
15
+ eql("\"Google\":http://www.google.com")
16
+ end
17
+
18
+ it "should convert spaces in urls" do
19
+ Orgmode::TextileOutputBuffer.new("").inline_formatting("[[my url]]").should eql("\"my url\":my%20url")
20
+ end
21
+ end
data/tasks/test_case.rake CHANGED
@@ -1,49 +1,49 @@
1
- require File.expand_path(
2
- File.join(File.dirname(__FILE__), %w[.. lib org-ruby]))
3
-
4
- namespace :testcase do
5
- @data_directory = File.join(File.dirname(__FILE__), "../spec/html_examples")
6
-
7
- desc "List all of the current HTML test cases"
8
- task :list do
9
- org_files = File.expand_path(File.join(@data_directory, "*.org" ))
10
- files = Dir.glob(org_files)
11
- files.each do |file|
12
- puts File.basename(file, ".org")
13
- end
14
- end
15
-
16
- desc "Accept the current org-ruby output for the test case as correct"
17
- task :accept, :case do |t, args|
18
- basename = args[:case]
19
- raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
20
- fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
21
- oname = File.expand_path(File.join(@data_directory, "#{basename}.html"))
22
- data = IO.read(fname)
23
- puts "=== #{fname} is: ===>>>\n\n"
24
- puts data
25
- puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n"
26
- p = Orgmode::Parser.new(data)
27
- puts p.to_html
28
- File.open(oname, "w") do |s|
29
- s.write(p.to_html)
30
- end
31
- end
32
-
33
- desc "Look at the current org-ruby output for a test case"
34
- task :inspect, :case do |t, args|
35
- basename = args[:case]
36
- raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
37
- fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
38
- data = IO.read(fname)
39
- puts "=== #{fname} is: ===>>>\n\n"
40
- puts data
41
- puts "\n\n=== #{fname} converts to: ===>>>\n\n"
42
- p = Orgmode::Parser.new(data)
43
- puts p.to_html
44
- end
45
- end
46
-
47
- desc "Alias for testcase:list"
48
- task :testcase => ["testcase:list"]
49
-
1
+ require File.expand_path(
2
+ File.join(File.dirname(__FILE__), %w[.. lib org-ruby]))
3
+
4
+ namespace :testcase do
5
+ @data_directory = File.join(File.dirname(__FILE__), "../spec/html_examples")
6
+
7
+ desc "List all of the current HTML test cases"
8
+ task :list do
9
+ org_files = File.expand_path(File.join(@data_directory, "*.org" ))
10
+ files = Dir.glob(org_files)
11
+ files.each do |file|
12
+ puts File.basename(file, ".org")
13
+ end
14
+ end
15
+
16
+ desc "Accept the current org-ruby output for the test case as correct"
17
+ task :accept, :case do |t, args|
18
+ basename = args[:case]
19
+ raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
20
+ fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
21
+ oname = File.expand_path(File.join(@data_directory, "#{basename}.html"))
22
+ data = IO.read(fname)
23
+ puts "=== #{fname} is: ===>>>\n\n"
24
+ puts data
25
+ puts "\n\n=== ACCEPTING OUTPUT: ===>>>\n\n"
26
+ p = Orgmode::Parser.new(data)
27
+ puts p.to_html
28
+ File.open(oname, "w") do |s|
29
+ s.write(p.to_html)
30
+ end
31
+ end
32
+
33
+ desc "Look at the current org-ruby output for a test case"
34
+ task :inspect, :case do |t, args|
35
+ basename = args[:case]
36
+ raise "Must supply a test case name. Example: rake testcase:accept[casename]" unless basename
37
+ fname = File.expand_path(File.join(@data_directory, "#{basename}.org"))
38
+ data = IO.read(fname)
39
+ puts "=== #{fname} is: ===>>>\n\n"
40
+ puts data
41
+ puts "\n\n=== #{fname} converts to: ===>>>\n\n"
42
+ p = Orgmode::Parser.new(data)
43
+ puts p.to_html
44
+ end
45
+ end
46
+
47
+ desc "Alias for testcase:list"
48
+ task :testcase => ["testcase:list"]
49
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: org-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dewey
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-30 00:00:00 -08:00
12
+ date: 2010-01-06 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -116,6 +116,7 @@ files:
116
116
  - spec/html_examples/text.html
117
117
  - spec/html_examples/text.org
118
118
  - spec/line_spec.rb
119
+ - spec/output_buffer_spec.rb
119
120
  - spec/parser_spec.rb
120
121
  - spec/regexp_helper_spec.rb
121
122
  - spec/spec_helper.rb