org-ruby 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/History.txt +32 -24
  2. data/README.txt +66 -66
  3. data/Rakefile +26 -22
  4. data/bin/org-ruby +40 -40
  5. data/lib/org-ruby.rb +50 -48
  6. data/lib/org-ruby/headline.rb +75 -75
  7. data/lib/org-ruby/html_output_buffer.rb +81 -80
  8. data/lib/org-ruby/line.rb +173 -172
  9. data/lib/org-ruby/output_buffer.rb +154 -154
  10. data/lib/org-ruby/parser.rb +76 -72
  11. data/lib/org-ruby/regexp_helper.rb +156 -156
  12. data/lib/org-ruby/textile_output_buffer.rb +67 -67
  13. data/spec/data/freeform.org +111 -111
  14. data/spec/data/hyp-planning.org +335 -335
  15. data/spec/data/remember.org +53 -53
  16. data/spec/headline_spec.rb +55 -55
  17. data/spec/html_examples/block_code.html +30 -29
  18. data/spec/html_examples/block_code.org +35 -35
  19. data/spec/html_examples/blockquote.html +7 -7
  20. data/spec/html_examples/blockquote.org +13 -13
  21. data/spec/html_examples/escape-pre.html +7 -0
  22. data/spec/html_examples/escape-pre.org +6 -0
  23. data/spec/html_examples/inline-formatting.html +10 -10
  24. data/spec/html_examples/inline-formatting.org +17 -17
  25. data/spec/html_examples/lists.html +19 -19
  26. data/spec/html_examples/lists.org +36 -36
  27. data/spec/html_examples/only-list.html +5 -0
  28. data/spec/html_examples/only-list.org +3 -0
  29. data/spec/html_examples/only-table.html +6 -0
  30. data/spec/html_examples/only-table.org +5 -0
  31. data/spec/html_examples/tables.html +20 -20
  32. data/spec/html_examples/tables.org +26 -26
  33. data/spec/html_examples/text.html +2 -2
  34. data/spec/html_examples/text.org +16 -16
  35. data/spec/line_spec.rb +89 -89
  36. data/spec/parser_spec.rb +86 -86
  37. data/spec/regexp_helper_spec.rb +57 -57
  38. data/spec/spec_helper.rb +20 -20
  39. data/spec/textile_examples/block_code.org +35 -35
  40. data/spec/textile_examples/block_code.textile +29 -29
  41. data/spec/textile_examples/blockquote.org +13 -13
  42. data/spec/textile_examples/blockquote.textile +11 -11
  43. data/spec/textile_examples/keywords.org +13 -13
  44. data/spec/textile_examples/keywords.textile +11 -11
  45. data/spec/textile_examples/links.org +11 -11
  46. data/spec/textile_examples/links.textile +10 -10
  47. data/spec/textile_examples/lists.org +36 -36
  48. data/spec/textile_examples/lists.textile +20 -20
  49. data/spec/textile_examples/single-space-plain-list.org +13 -13
  50. data/spec/textile_examples/single-space-plain-list.textile +10 -10
  51. data/spec/textile_examples/tables.org +26 -26
  52. data/spec/textile_examples/tables.textile +23 -23
  53. data/spec/textile_output_buffer_spec.rb +21 -21
  54. data/tasks/test_case.rake +49 -0
  55. metadata +21 -5
  56. data/.bnsignore +0 -18
@@ -0,0 +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
+
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.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dewey
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-26 00:00:00 -08:00
13
- default_executable: org-ruby
12
+ date: 2009-12-27 00:00:00 -08:00
13
+ default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rubypants
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.2.0
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: bones
17
27
  type: :development
@@ -37,7 +47,6 @@ extra_rdoc_files:
37
47
  - README.txt
38
48
  - bin/org-ruby
39
49
  files:
40
- - .bnsignore
41
50
  - History.txt
42
51
  - README.txt
43
52
  - Rakefile
@@ -59,10 +68,16 @@ files:
59
68
  - spec/html_examples/block_code.org
60
69
  - spec/html_examples/blockquote.html
61
70
  - spec/html_examples/blockquote.org
71
+ - spec/html_examples/escape-pre.html
72
+ - spec/html_examples/escape-pre.org
62
73
  - spec/html_examples/inline-formatting.html
63
74
  - spec/html_examples/inline-formatting.org
64
75
  - spec/html_examples/lists.html
65
76
  - spec/html_examples/lists.org
77
+ - spec/html_examples/only-list.html
78
+ - spec/html_examples/only-list.org
79
+ - spec/html_examples/only-table.html
80
+ - spec/html_examples/only-table.org
66
81
  - spec/html_examples/tables.html
67
82
  - spec/html_examples/tables.org
68
83
  - spec/html_examples/text.html
@@ -86,9 +101,10 @@ files:
86
101
  - spec/textile_examples/tables.org
87
102
  - spec/textile_examples/tables.textile
88
103
  - spec/textile_output_buffer_spec.rb
104
+ - tasks/test_case.rake
89
105
  - test/test_orgmode_parser.rb
90
106
  has_rdoc: true
91
- homepage: http://bdewey.com
107
+ homepage: http://github.com/bdewey/org-ruby
92
108
  licenses: []
93
109
 
94
110
  post_install_message:
data/.bnsignore DELETED
@@ -1,18 +0,0 @@
1
- # The list of files that should be ignored by Mr Bones.
2
- # Lines that start with '#' are comments.
3
- #
4
- # A .gitignore file can be used instead by setting it as the ignore
5
- # file in your Rakefile:
6
- #
7
- # Bones {
8
- # ignore_file '.gitignore'
9
- # }
10
- #
11
- # For a project with a C extension, the following would be a good set of
12
- # exclude patterns (uncomment them if you want to use them):
13
- # *.[oa]
14
- # *~
15
- announcement.txt
16
- coverage
17
- doc
18
- pkg