hparser 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. data/.gitignore +2 -0
  2. data/.travis.yml +11 -0
  3. data/ChangeLog +4 -0
  4. data/Gemfile +3 -0
  5. data/README.md +40 -0
  6. data/Rakefile +12 -0
  7. data/VERSION +1 -0
  8. data/hparser.gemspec +21 -0
  9. data/lib/hparser/block/dl.rb +4 -4
  10. data/lib/hparser/block/footnote_list.rb +19 -0
  11. data/lib/hparser/block/head.rb +2 -2
  12. data/lib/hparser/block/list.rb +8 -8
  13. data/lib/hparser/block/p.rb +4 -3
  14. data/lib/hparser/block/pair.rb +12 -7
  15. data/lib/hparser/block/quote.rb +32 -2
  16. data/lib/hparser/block/raw.rb +34 -0
  17. data/lib/hparser/block/see_more.rb +31 -0
  18. data/lib/hparser/block/super_pre.rb +21 -3
  19. data/lib/hparser/block/table.rb +4 -4
  20. data/lib/hparser/hatena.rb +3 -1
  21. data/lib/hparser/html.rb +181 -13
  22. data/lib/hparser/inline/comment.rb +27 -0
  23. data/lib/hparser/inline/footnote.rb +34 -0
  24. data/lib/hparser/inline/fotolife.rb +40 -0
  25. data/lib/hparser/inline/hatena_id.rb +7 -6
  26. data/lib/hparser/inline/parser.rb +3 -2
  27. data/lib/hparser/inline/tex.rb +27 -0
  28. data/lib/hparser/inline/text.rb +3 -2
  29. data/lib/hparser/inline/url.rb +20 -6
  30. data/lib/hparser/latex.rb +273 -0
  31. data/lib/hparser/parser.rb +17 -1
  32. data/lib/hparser/text.rb +42 -0
  33. data/lib/hparser/util/line_scanner.rb +3 -2
  34. data/lib/hparser.rb +1 -0
  35. data/test/integration_texts/error1.ok.hatena +23 -0
  36. data/test/test_block.rb +65 -2
  37. data/test/test_bruteforce.rb +48 -0
  38. data/test/test_dl.rb +13 -1
  39. data/test/test_footnote.rb +42 -0
  40. data/test/test_fotolife.rb +29 -0
  41. data/test/test_from_perl/01_module.t +559 -0
  42. data/test/test_from_perl/02_module_extend.t +36 -0
  43. data/test/test_from_perl/10_autolink.t +78 -0
  44. data/test/test_from_perl/11_autolink_extend.t +43 -0
  45. data/test/test_hatena.rb +2 -2
  46. data/test/test_head.rb +7 -1
  47. data/test/test_helper.rb +11 -0
  48. data/test/test_html.rb +39 -3
  49. data/test/test_id.rb +1 -1
  50. data/test/test_inline.rb +13 -1
  51. data/test/test_inline_html.rb +37 -2
  52. data/test/test_integration.rb +20 -0
  53. data/test/test_latex.rb +101 -0
  54. data/test/test_p.rb +23 -3
  55. data/test/test_pair.rb +22 -4
  56. data/test/test_quote.rb +69 -0
  57. data/test/test_see_more.rb +28 -0
  58. data/test/test_table.rb +1 -1
  59. data/test/test_tex.rb +24 -0
  60. data/test/test_text.rb +12 -2
  61. data/test/test_url.rb +39 -2
  62. metadata +141 -58
  63. data/README +0 -17
metadata CHANGED
@@ -1,95 +1,178 @@
1
- --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
3
- specification_version: 1
1
+ --- !ruby/object:Gem::Specification
4
2
  name: hparser
5
- version: !ruby/object:Gem::Version
6
- version: 0.3.0
7
- date: 2006-08-17 00:00:00 +09:00
8
- summary: Hatena Format Parser
9
- require_paths:
10
- - lib
11
- email: hiroki1124@gmail.com
12
- homepage: http://d.hatena.ne.jp/mzp/
13
- rubyforge_project:
14
- description:
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - HIROKI Mizuno
9
+ - Yuichi Tateno
10
+ - Nitoyon
15
11
  autorequire:
16
- default_executable:
17
12
  bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
25
- platform: ruby
26
- signing_key:
27
- cert_chain:
28
- authors:
29
- - MIZUNO Hiroki
30
- files:
31
- - test/test_block.rb
32
- - test/test_dl.rb
33
- - test/test_hatena.rb
34
- - test/test_head.rb
35
- - test/test_html.rb
36
- - test/test_id.rb
37
- - test/test_inline.rb
38
- - test/test_inline_html.rb
39
- - test/test_p.rb
40
- - test/test_pair.rb
41
- - test/test_table.rb
42
- - test/test_text.rb
43
- - test/test_url.rb
13
+ cert_chain: []
14
+ date: 2012-09-22 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rake
18
+ requirement: !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.2
24
+ type: :development
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: 0.9.2
32
+ - !ruby/object:Gem::Dependency
33
+ name: pry
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ description: Hatena Syntax parser for Ruby
49
+ email: ''
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - .gitignore
55
+ - .travis.yml
56
+ - ChangeLog
57
+ - Gemfile
58
+ - README.md
59
+ - Rakefile
60
+ - VERSION
61
+ - hparser.gemspec
44
62
  - lib/hparser.rb
45
- - lib/hparser/hatena.rb
46
- - lib/hparser/html.rb
47
- - lib/hparser/parser.rb
48
- - lib/hparser/text.rb
49
63
  - lib/hparser/block/all.rb
50
64
  - lib/hparser/block/collectable.rb
51
65
  - lib/hparser/block/dl.rb
66
+ - lib/hparser/block/footnote_list.rb
52
67
  - lib/hparser/block/head.rb
53
68
  - lib/hparser/block/list.rb
54
69
  - lib/hparser/block/p.rb
55
70
  - lib/hparser/block/pair.rb
56
71
  - lib/hparser/block/pre.rb
57
72
  - lib/hparser/block/quote.rb
73
+ - lib/hparser/block/raw.rb
74
+ - lib/hparser/block/see_more.rb
58
75
  - lib/hparser/block/super_pre.rb
59
76
  - lib/hparser/block/table.rb
77
+ - lib/hparser/hatena.rb
78
+ - lib/hparser/html.rb
60
79
  - lib/hparser/inline/all.rb
61
80
  - lib/hparser/inline/collectable.rb
81
+ - lib/hparser/inline/comment.rb
82
+ - lib/hparser/inline/footnote.rb
83
+ - lib/hparser/inline/fotolife.rb
62
84
  - lib/hparser/inline/hatena_id.rb
63
85
  - lib/hparser/inline/parser.rb
86
+ - lib/hparser/inline/tex.rb
64
87
  - lib/hparser/inline/text.rb
65
88
  - lib/hparser/inline/url.rb
89
+ - lib/hparser/latex.rb
90
+ - lib/hparser/parser.rb
91
+ - lib/hparser/text.rb
66
92
  - lib/hparser/util/line_scanner.rb
67
93
  - lib/hparser/util/parser.rb
68
- - README
69
- test_files:
94
+ - test/integration_texts/error1.ok.hatena
70
95
  - test/test_block.rb
96
+ - test/test_bruteforce.rb
71
97
  - test/test_dl.rb
98
+ - test/test_footnote.rb
99
+ - test/test_fotolife.rb
100
+ - test/test_from_perl/01_module.t
101
+ - test/test_from_perl/02_module_extend.t
102
+ - test/test_from_perl/10_autolink.t
103
+ - test/test_from_perl/11_autolink_extend.t
72
104
  - test/test_hatena.rb
73
105
  - test/test_head.rb
106
+ - test/test_helper.rb
74
107
  - test/test_html.rb
75
108
  - test/test_id.rb
76
109
  - test/test_inline.rb
77
110
  - test/test_inline_html.rb
111
+ - test/test_integration.rb
112
+ - test/test_latex.rb
78
113
  - test/test_p.rb
79
114
  - test/test_pair.rb
115
+ - test/test_quote.rb
116
+ - test/test_see_more.rb
80
117
  - test/test_table.rb
118
+ - test/test_tex.rb
81
119
  - test/test_text.rb
82
120
  - test/test_url.rb
83
- rdoc_options:
84
- - --main
85
- - README
86
- extra_rdoc_files:
87
- - README
88
- executables: []
89
-
90
- extensions: []
91
-
121
+ homepage: https://github.com/hotchpotch/hparser
122
+ licenses: []
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ segments:
134
+ - 0
135
+ hash: -2893136199592784256
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ segments:
143
+ - 0
144
+ hash: -2893136199592784256
92
145
  requirements: []
93
-
94
- dependencies: []
95
-
146
+ rubyforge_project:
147
+ rubygems_version: 1.8.24
148
+ signing_key:
149
+ specification_version: 3
150
+ summary: Hatena Syntax parser for Ruby
151
+ test_files:
152
+ - test/integration_texts/error1.ok.hatena
153
+ - test/test_block.rb
154
+ - test/test_bruteforce.rb
155
+ - test/test_dl.rb
156
+ - test/test_footnote.rb
157
+ - test/test_fotolife.rb
158
+ - test/test_from_perl/01_module.t
159
+ - test/test_from_perl/02_module_extend.t
160
+ - test/test_from_perl/10_autolink.t
161
+ - test/test_from_perl/11_autolink_extend.t
162
+ - test/test_hatena.rb
163
+ - test/test_head.rb
164
+ - test/test_helper.rb
165
+ - test/test_html.rb
166
+ - test/test_id.rb
167
+ - test/test_inline.rb
168
+ - test/test_inline_html.rb
169
+ - test/test_integration.rb
170
+ - test/test_latex.rb
171
+ - test/test_p.rb
172
+ - test/test_pair.rb
173
+ - test/test_quote.rb
174
+ - test/test_see_more.rb
175
+ - test/test_table.rb
176
+ - test/test_tex.rb
177
+ - test/test_text.rb
178
+ - test/test_url.rb
data/README DELETED
@@ -1,17 +0,0 @@
1
- =Hatena Format Parser
2
- ==OverReview
3
- +hparser+ is hatena format parser. This format is used at hatena diary(http://d.hatena.ne.jp/)
4
- If you want to know more detail about hatena format, please see http://hatenadiary.g.hatena.ne.jp/keyword/%e3%81%af%e3%81%a6%e3%81%aa%e8%a8%98%e6%b3%95%e4%b8%80%e8%a6%a7
5
-
6
- +hpaser+ is constructed with some little parser.(e.g. header parser,list parser,and ...)
7
- So,+hparser+ can be added new format,or removed unused format.
8
-
9
- ==Basic usage
10
- To parse hatena format,please use Hatena::Parser.
11
-
12
- require 'hatena/parser'
13
- require 'hatena/block/all'
14
- require 'hatena/inline/all'
15
-
16
- parser = Hatena::Parser.new
17
- puts parser.parse(some_text)