prosereflect 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +23 -4
- data/README.adoc +193 -12
- data/lib/prosereflect/attribute/base.rb +34 -0
- data/lib/prosereflect/attribute/bold.rb +20 -0
- data/lib/prosereflect/attribute/href.rb +24 -0
- data/lib/prosereflect/attribute/id.rb +24 -0
- data/lib/prosereflect/attribute.rb +13 -0
- data/lib/prosereflect/blockquote.rb +85 -0
- data/lib/prosereflect/bullet_list.rb +83 -0
- data/lib/prosereflect/code_block.rb +135 -0
- data/lib/prosereflect/code_block_wrapper.rb +66 -0
- data/lib/prosereflect/document.rb +99 -24
- data/lib/prosereflect/hard_break.rb +11 -9
- data/lib/prosereflect/heading.rb +64 -0
- data/lib/prosereflect/horizontal_rule.rb +70 -0
- data/lib/prosereflect/image.rb +126 -0
- data/lib/prosereflect/input/html.rb +505 -0
- data/lib/prosereflect/list_item.rb +65 -0
- data/lib/prosereflect/mark/base.rb +49 -0
- data/lib/prosereflect/mark/bold.rb +15 -0
- data/lib/prosereflect/mark/code.rb +14 -0
- data/lib/prosereflect/mark/italic.rb +15 -0
- data/lib/prosereflect/mark/link.rb +18 -0
- data/lib/prosereflect/mark/strike.rb +15 -0
- data/lib/prosereflect/mark/subscript.rb +15 -0
- data/lib/prosereflect/mark/superscript.rb +15 -0
- data/lib/prosereflect/mark/underline.rb +15 -0
- data/lib/prosereflect/mark.rb +11 -0
- data/lib/prosereflect/node.rb +181 -32
- data/lib/prosereflect/ordered_list.rb +85 -0
- data/lib/prosereflect/output/html.rb +374 -0
- data/lib/prosereflect/paragraph.rb +26 -15
- data/lib/prosereflect/parser.rb +111 -24
- data/lib/prosereflect/table.rb +40 -9
- data/lib/prosereflect/table_cell.rb +33 -8
- data/lib/prosereflect/table_header.rb +92 -0
- data/lib/prosereflect/table_row.rb +31 -8
- data/lib/prosereflect/text.rb +13 -17
- data/lib/prosereflect/user.rb +63 -0
- data/lib/prosereflect/version.rb +1 -1
- data/lib/prosereflect.rb +6 -0
- data/prosereflect.gemspec +1 -0
- data/spec/prosereflect/document_spec.rb +436 -36
- data/spec/prosereflect/hard_break_spec.rb +218 -22
- data/spec/prosereflect/input/html_spec.rb +797 -0
- data/spec/prosereflect/node_spec.rb +258 -89
- data/spec/prosereflect/output/html_spec.rb +369 -0
- data/spec/prosereflect/paragraph_spec.rb +424 -49
- data/spec/prosereflect/parser_spec.rb +304 -91
- data/spec/prosereflect/table_cell_spec.rb +268 -57
- data/spec/prosereflect/table_row_spec.rb +210 -40
- data/spec/prosereflect/table_spec.rb +392 -61
- data/spec/prosereflect/text_spec.rb +206 -48
- data/spec/prosereflect/user_spec.rb +73 -0
- data/spec/prosereflect_spec.rb +5 -0
- data/spec/support/shared_examples.rb +44 -15
- metadata +47 -3
- data/debug_loading.rb +0 -34
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'spec_helper'
|
4
|
+
|
3
5
|
RSpec.describe Prosereflect::Text do
|
4
6
|
describe 'initialization' do
|
5
7
|
it 'initializes as a text node' do
|
@@ -14,42 +16,212 @@ RSpec.describe Prosereflect::Text do
|
|
14
16
|
end
|
15
17
|
|
16
18
|
it 'initializes with marks' do
|
17
|
-
marks = [
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
})
|
19
|
+
marks = [
|
20
|
+
Prosereflect::Mark::Bold.new,
|
21
|
+
Prosereflect::Mark::Italic.new
|
22
|
+
]
|
23
|
+
text = described_class.new(text: 'Hello', marks: marks)
|
23
24
|
|
24
|
-
expect(text.
|
25
|
+
expect(text.raw_marks).to eq(marks)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
describe '.create' do
|
29
|
-
it 'creates a text node
|
30
|
+
it 'creates a simple text node' do
|
30
31
|
text = described_class.create('Hello world')
|
31
|
-
|
32
|
-
|
32
|
+
|
33
|
+
expected = {
|
34
|
+
'type' => 'text',
|
35
|
+
'text' => 'Hello world'
|
36
|
+
}
|
37
|
+
|
38
|
+
expect(text.to_h).to eq(expected)
|
33
39
|
end
|
34
40
|
|
35
41
|
it 'creates a text node with marks' do
|
36
|
-
|
37
|
-
|
42
|
+
text = described_class.create('Formatted text', [
|
43
|
+
Prosereflect::Mark::Bold.new,
|
44
|
+
Prosereflect::Mark::Italic.new
|
45
|
+
])
|
46
|
+
|
47
|
+
expected = {
|
48
|
+
'type' => 'text',
|
49
|
+
'text' => 'Formatted text',
|
50
|
+
'marks' => [
|
51
|
+
{ 'type' => 'bold' },
|
52
|
+
{ 'type' => 'italic' }
|
53
|
+
]
|
54
|
+
}
|
55
|
+
|
56
|
+
expect(text.to_h).to eq(expected)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'creates a text node with marks and attributes' do
|
60
|
+
text = described_class.create('Link text', [
|
61
|
+
Prosereflect::Mark::Link.new(attrs: { 'href' => 'https://example.com', 'title' => 'Example' }),
|
62
|
+
Prosereflect::Mark::Bold.new
|
63
|
+
])
|
64
|
+
|
65
|
+
expected = {
|
66
|
+
'type' => 'text',
|
67
|
+
'text' => 'Link text',
|
68
|
+
'marks' => [
|
69
|
+
{
|
70
|
+
'type' => 'link',
|
71
|
+
'attrs' => {
|
72
|
+
'href' => 'https://example.com',
|
73
|
+
'title' => 'Example'
|
74
|
+
}
|
75
|
+
},
|
76
|
+
{ 'type' => 'bold' }
|
77
|
+
]
|
78
|
+
}
|
38
79
|
|
39
|
-
expect(text.
|
40
|
-
expect(text.marks).to eq(marks)
|
80
|
+
expect(text.to_h).to eq(expected)
|
41
81
|
end
|
42
82
|
end
|
43
83
|
|
44
|
-
describe '
|
45
|
-
it '
|
46
|
-
text = described_class.
|
47
|
-
|
84
|
+
describe 'text structure' do
|
85
|
+
it 'creates text with special characters' do
|
86
|
+
text = described_class.create('Special chars: →, ←, ©, ®, ™')
|
87
|
+
|
88
|
+
expected = {
|
89
|
+
'type' => 'text',
|
90
|
+
'text' => 'Special chars: →, ←, ©, ®, ™'
|
91
|
+
}
|
92
|
+
|
93
|
+
expect(text.to_h).to eq(expected)
|
48
94
|
end
|
49
95
|
|
50
|
-
it '
|
51
|
-
text = described_class.
|
52
|
-
|
96
|
+
it 'creates text with multiple marks and attributes' do
|
97
|
+
text = described_class.create('Complex text', [
|
98
|
+
Prosereflect::Mark::Bold.new,
|
99
|
+
Prosereflect::Mark::Italic.new,
|
100
|
+
Prosereflect::Mark::Strike.new,
|
101
|
+
Prosereflect::Mark::Link.new(attrs: { 'href' => 'https://example.com' }),
|
102
|
+
Prosereflect::Mark::Underline.new
|
103
|
+
])
|
104
|
+
|
105
|
+
expected = {
|
106
|
+
'type' => 'text',
|
107
|
+
'text' => 'Complex text',
|
108
|
+
'marks' => [
|
109
|
+
{ 'type' => 'bold' },
|
110
|
+
{ 'type' => 'italic' },
|
111
|
+
{ 'type' => 'strike' },
|
112
|
+
{
|
113
|
+
'type' => 'link',
|
114
|
+
'attrs' => {
|
115
|
+
'href' => 'https://example.com'
|
116
|
+
}
|
117
|
+
},
|
118
|
+
{ 'type' => 'underline' }
|
119
|
+
]
|
120
|
+
}
|
121
|
+
|
122
|
+
expect(text.to_h).to eq(expected)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
describe 'text operations' do
|
127
|
+
describe '#text_content' do
|
128
|
+
it 'returns the text content regardless of marks' do
|
129
|
+
text = described_class.create('Sample text', [
|
130
|
+
Prosereflect::Mark::Bold.new,
|
131
|
+
Prosereflect::Mark::Italic.new
|
132
|
+
])
|
133
|
+
|
134
|
+
expect(text.text_content).to eq('Sample text')
|
135
|
+
end
|
136
|
+
|
137
|
+
it 'returns empty string for empty text' do
|
138
|
+
text = described_class.create('')
|
139
|
+
expect(text.text_content).to eq('')
|
140
|
+
end
|
141
|
+
|
142
|
+
it 'preserves whitespace and special characters' do
|
143
|
+
text = described_class.create(" Multiple spaces \t\nand\ttabs ")
|
144
|
+
expect(text.text_content).to eq(" Multiple spaces \t\nand\ttabs ")
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '#marks' do
|
149
|
+
it 'preserves mark order' do
|
150
|
+
text = described_class.new(text: 'Hello')
|
151
|
+
marks = [
|
152
|
+
Prosereflect::Mark::Bold.new,
|
153
|
+
Prosereflect::Mark::Italic.new,
|
154
|
+
Prosereflect::Mark::Strike.new
|
155
|
+
]
|
156
|
+
text.marks = marks
|
157
|
+
|
158
|
+
expect(text.raw_marks.map(&:type)).to eq(%w[bold italic strike])
|
159
|
+
end
|
160
|
+
|
161
|
+
it 'handles empty marks array' do
|
162
|
+
text = described_class.create('No marks', [])
|
163
|
+
expect(text.marks).to eq([])
|
164
|
+
expect(text.to_h).not_to have_key('marks')
|
165
|
+
end
|
166
|
+
|
167
|
+
it 'handles nil marks' do
|
168
|
+
text = described_class.create('No marks', nil)
|
169
|
+
expect(text.marks).to be_nil
|
170
|
+
expect(text.to_h).not_to have_key('marks')
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
describe 'mark attributes' do
|
176
|
+
it 'preserves mark attributes in serialization' do
|
177
|
+
text = described_class.create('Styled text', [
|
178
|
+
Prosereflect::Mark::Link.new(attrs: {
|
179
|
+
'href' => 'https://example.com',
|
180
|
+
'title' => 'Example Link',
|
181
|
+
'target' => '_blank'
|
182
|
+
}),
|
183
|
+
Prosereflect::Mark::Bold.new,
|
184
|
+
Prosereflect::Mark::Italic.new
|
185
|
+
])
|
186
|
+
|
187
|
+
expected = {
|
188
|
+
'type' => 'text',
|
189
|
+
'text' => 'Styled text',
|
190
|
+
'marks' => [
|
191
|
+
{
|
192
|
+
'type' => 'link',
|
193
|
+
'attrs' => {
|
194
|
+
'href' => 'https://example.com',
|
195
|
+
'title' => 'Example Link',
|
196
|
+
'target' => '_blank'
|
197
|
+
}
|
198
|
+
},
|
199
|
+
{ 'type' => 'bold' },
|
200
|
+
{ 'type' => 'italic' }
|
201
|
+
]
|
202
|
+
}
|
203
|
+
|
204
|
+
expect(text.to_h).to eq(expected)
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'handles marks with empty attributes' do
|
208
|
+
text = described_class.create('Test text', [
|
209
|
+
Prosereflect::Mark::Link.new(attrs: {}),
|
210
|
+
Prosereflect::Mark::Bold.new,
|
211
|
+
Prosereflect::Mark::Italic.new
|
212
|
+
])
|
213
|
+
|
214
|
+
expected = {
|
215
|
+
'type' => 'text',
|
216
|
+
'text' => 'Test text',
|
217
|
+
'marks' => [
|
218
|
+
{ 'type' => 'link' },
|
219
|
+
{ 'type' => 'bold' },
|
220
|
+
{ 'type' => 'italic' }
|
221
|
+
]
|
222
|
+
}
|
223
|
+
|
224
|
+
expect(text.to_h).to eq(expected)
|
53
225
|
end
|
54
226
|
end
|
55
227
|
|
@@ -63,15 +235,12 @@ RSpec.describe Prosereflect::Text do
|
|
63
235
|
end
|
64
236
|
|
65
237
|
it 'includes marks in hash representation when present' do
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
'text' => 'Bold text',
|
70
|
-
'marks' => marks
|
71
|
-
})
|
238
|
+
mark = Prosereflect::Mark::Base.new(type: 'bold')
|
239
|
+
marks = [mark]
|
240
|
+
text = described_class.new(text: 'Bold text', marks: marks)
|
72
241
|
|
73
242
|
hash = text.to_h
|
74
|
-
expect(hash['marks']).to eq(
|
243
|
+
expect(hash['marks']).to eq([{ 'type' => 'bold' }])
|
75
244
|
end
|
76
245
|
end
|
77
246
|
|
@@ -84,33 +253,22 @@ RSpec.describe Prosereflect::Text do
|
|
84
253
|
|
85
254
|
describe 'with marks' do
|
86
255
|
it 'can have multiple marks' do
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
]
|
256
|
+
bold_mark = Prosereflect::Mark::Base.new(type: 'bold')
|
257
|
+
italic_mark = Prosereflect::Mark::Base.new(type: 'italic')
|
258
|
+
underline_mark = Prosereflect::Mark::Base.new(type: 'underline')
|
259
|
+
marks = [bold_mark, italic_mark, underline_mark]
|
92
260
|
|
93
|
-
text = described_class.new(
|
94
|
-
'type' => 'text',
|
95
|
-
'text' => 'Formatted text',
|
96
|
-
'marks' => marks
|
97
|
-
})
|
261
|
+
text = described_class.new(text: 'Formatted text', marks: marks)
|
98
262
|
|
99
263
|
expect(text.marks.size).to eq(3)
|
100
264
|
end
|
101
265
|
|
102
266
|
it 'can have marks with attributes' do
|
103
|
-
|
104
|
-
|
105
|
-
]
|
106
|
-
|
107
|
-
text = described_class.new({
|
108
|
-
'type' => 'text',
|
109
|
-
'text' => 'Link text',
|
110
|
-
'marks' => marks
|
111
|
-
})
|
267
|
+
text = described_class.new(text: 'Hello')
|
268
|
+
mark = Prosereflect::Mark::Link.new(attrs: { 'href' => 'https://example.com' })
|
269
|
+
text.marks = [mark]
|
112
270
|
|
113
|
-
expect(text.
|
271
|
+
expect(text.raw_marks[0].attrs['href']).to eq('https://example.com')
|
114
272
|
end
|
115
273
|
end
|
116
274
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Prosereflect::User do
|
6
|
+
let(:user) { described_class.new }
|
7
|
+
|
8
|
+
describe '#initialize' do
|
9
|
+
it 'creates a user mention node with empty content' do
|
10
|
+
expect(user.content).to eq([])
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
describe '#id' do
|
15
|
+
it 'gets and sets the user id' do
|
16
|
+
user.id = '123'
|
17
|
+
expect(user.id).to eq('123')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'gets id from attrs' do
|
21
|
+
user = described_class.new(attrs: { 'id' => '456' })
|
22
|
+
expect(user.id).to eq('456')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#add_child' do
|
27
|
+
it 'raises NotImplementedError' do
|
28
|
+
expect { user.add_child(double) }.to raise_error(NotImplementedError, 'User mention nodes cannot have children')
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
describe '#to_h' do
|
33
|
+
it 'serializes correctly' do
|
34
|
+
user.id = '789'
|
35
|
+
expect(user.to_h).to eq({
|
36
|
+
'type' => 'user',
|
37
|
+
'attrs' => { 'id' => '789' },
|
38
|
+
'content' => []
|
39
|
+
})
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe 'integration with Document' do
|
44
|
+
it 'can be added to a document' do
|
45
|
+
document = Prosereflect::Document.create
|
46
|
+
user = document.add_user('123')
|
47
|
+
|
48
|
+
expect(user).to be_a(described_class)
|
49
|
+
expect(user.id).to eq('123')
|
50
|
+
expect(document.content.size).to eq(1)
|
51
|
+
expect(document.content.first).to be_a(described_class)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe 'HTML conversion' do
|
56
|
+
it 'converts to HTML correctly' do
|
57
|
+
document = Prosereflect::Document.create
|
58
|
+
document.add_user('123')
|
59
|
+
|
60
|
+
html = Prosereflect::Output::Html.convert(document)
|
61
|
+
expect(html).to eq('<user-mention data-id="123"></user-mention>')
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'parses from HTML correctly' do
|
65
|
+
html = '<user-mention data-id="123"></user-mention>'
|
66
|
+
document = Prosereflect::Input::Html.parse(html)
|
67
|
+
|
68
|
+
expect(document.content.size).to eq(1)
|
69
|
+
expect(document.content.first).to be_a(described_class)
|
70
|
+
expect(document.content.first.id).to eq('123')
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/spec/prosereflect_spec.rb
CHANGED
@@ -53,5 +53,10 @@ RSpec.describe Prosereflect do
|
|
53
53
|
context 'with JSON format' do
|
54
54
|
include_examples 'format round-trip', :json
|
55
55
|
end
|
56
|
+
|
57
|
+
context 'with HTML format' do
|
58
|
+
include_examples 'format round-trip', :html
|
59
|
+
include_examples 'html conversion'
|
60
|
+
end
|
56
61
|
end
|
57
62
|
end
|
@@ -30,7 +30,7 @@ RSpec.shared_examples 'a parsable format' do |format|
|
|
30
30
|
when :yaml
|
31
31
|
YAML.safe_load(document.to_yaml)
|
32
32
|
when :json
|
33
|
-
|
33
|
+
document.to_h
|
34
34
|
end
|
35
35
|
|
36
36
|
# Compare the structures
|
@@ -129,7 +129,7 @@ RSpec.shared_examples 'document creation' do
|
|
129
129
|
|
130
130
|
it 'creates a document with attributes' do
|
131
131
|
attrs = { 'version' => '1.0' }
|
132
|
-
document = Prosereflect::Document.
|
132
|
+
document = Prosereflect::Document.new(attrs: attrs)
|
133
133
|
expect(document.attrs).to eq(attrs)
|
134
134
|
end
|
135
135
|
|
@@ -196,25 +196,54 @@ RSpec.shared_examples 'format round-trip' do |format|
|
|
196
196
|
expect(parsed_doc.find_all('hard_break').size).to eq(document.find_all('hard_break').size)
|
197
197
|
|
198
198
|
# Verify table structure
|
199
|
-
table_in_parsed = parsed_doc.
|
200
|
-
expect(table_in_parsed.rows.size).to eq(document.
|
201
|
-
expect(table_in_parsed.header_row.cells.size).to eq(document.
|
199
|
+
table_in_parsed = parsed_doc.find_first('table')
|
200
|
+
expect(table_in_parsed.rows.size).to eq(document.find_first('table').rows.size)
|
201
|
+
expect(table_in_parsed.header_row.cells.size).to eq(document.find_first('table').header_row.cells.size)
|
202
202
|
end
|
203
203
|
|
204
204
|
def round_trip_conversion(doc, format)
|
205
205
|
case format
|
206
206
|
when :yaml
|
207
|
-
|
208
|
-
parsed = Prosereflect::Parser.parse_document(YAML.safe_load(yaml))
|
209
|
-
# Compare structures
|
210
|
-
expect(YAML.safe_load(parsed.to_yaml)).to be_equivalent_yaml(YAML.safe_load(doc.to_yaml))
|
211
|
-
parsed
|
207
|
+
Prosereflect::Parser.parse_document(YAML.safe_load(doc.to_yaml))
|
212
208
|
when :json
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
parsed
|
209
|
+
Prosereflect::Parser.parse_document(doc.to_h)
|
210
|
+
when :html
|
211
|
+
html = Prosereflect::Output::Html.convert(doc)
|
212
|
+
Prosereflect::Input::Html.parse(html)
|
218
213
|
end
|
219
214
|
end
|
220
215
|
end
|
216
|
+
|
217
|
+
RSpec.shared_examples 'html conversion' do
|
218
|
+
it 'converts to HTML and back' do
|
219
|
+
# Create a document with various elements
|
220
|
+
document = Prosereflect::Document.create
|
221
|
+
|
222
|
+
# Add paragraph with formatted text
|
223
|
+
para = document.add_paragraph('Plain text')
|
224
|
+
para.add_text(' bold text', [Prosereflect::Mark::Bold.new])
|
225
|
+
para.add_hard_break
|
226
|
+
para.add_text('After line break', [Prosereflect::Mark::Italic.new])
|
227
|
+
|
228
|
+
# Add a table
|
229
|
+
table = document.add_table
|
230
|
+
table.add_header(['Header 1', 'Header 2'])
|
231
|
+
table.add_row(['Cell 1', 'Cell 2'])
|
232
|
+
|
233
|
+
# Convert to HTML
|
234
|
+
html = Prosereflect::Output::Html.convert(document)
|
235
|
+
expect(html).to be_a(String)
|
236
|
+
expect(html).not_to be_empty
|
237
|
+
|
238
|
+
# Convert back to document model
|
239
|
+
parsed_doc = Prosereflect::Input::Html.parse(html)
|
240
|
+
expect(parsed_doc).to be_a(Prosereflect::Document)
|
241
|
+
|
242
|
+
# Check content was preserved
|
243
|
+
expect(parsed_doc.content.size).to be > 0
|
244
|
+
expect(parsed_doc.text_content).to include('Plain text')
|
245
|
+
expect(parsed_doc.text_content).to include('bold text')
|
246
|
+
expect(parsed_doc.text_content).to include('After line break')
|
247
|
+
expect(parsed_doc.find_all('table').size).to eq(1)
|
248
|
+
end
|
249
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prosereflect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nokogiri
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.18'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.18'
|
27
41
|
description:
|
28
42
|
email:
|
29
43
|
- open.source@ribose.com
|
@@ -40,17 +54,44 @@ files:
|
|
40
54
|
- Gemfile
|
41
55
|
- README.adoc
|
42
56
|
- Rakefile
|
43
|
-
- debug_loading.rb
|
44
57
|
- lib/prosereflect.rb
|
58
|
+
- lib/prosereflect/attribute.rb
|
59
|
+
- lib/prosereflect/attribute/base.rb
|
60
|
+
- lib/prosereflect/attribute/bold.rb
|
61
|
+
- lib/prosereflect/attribute/href.rb
|
62
|
+
- lib/prosereflect/attribute/id.rb
|
63
|
+
- lib/prosereflect/blockquote.rb
|
64
|
+
- lib/prosereflect/bullet_list.rb
|
65
|
+
- lib/prosereflect/code_block.rb
|
66
|
+
- lib/prosereflect/code_block_wrapper.rb
|
45
67
|
- lib/prosereflect/document.rb
|
46
68
|
- lib/prosereflect/hard_break.rb
|
69
|
+
- lib/prosereflect/heading.rb
|
70
|
+
- lib/prosereflect/horizontal_rule.rb
|
71
|
+
- lib/prosereflect/image.rb
|
72
|
+
- lib/prosereflect/input/html.rb
|
73
|
+
- lib/prosereflect/list_item.rb
|
74
|
+
- lib/prosereflect/mark.rb
|
75
|
+
- lib/prosereflect/mark/base.rb
|
76
|
+
- lib/prosereflect/mark/bold.rb
|
77
|
+
- lib/prosereflect/mark/code.rb
|
78
|
+
- lib/prosereflect/mark/italic.rb
|
79
|
+
- lib/prosereflect/mark/link.rb
|
80
|
+
- lib/prosereflect/mark/strike.rb
|
81
|
+
- lib/prosereflect/mark/subscript.rb
|
82
|
+
- lib/prosereflect/mark/superscript.rb
|
83
|
+
- lib/prosereflect/mark/underline.rb
|
47
84
|
- lib/prosereflect/node.rb
|
85
|
+
- lib/prosereflect/ordered_list.rb
|
86
|
+
- lib/prosereflect/output/html.rb
|
48
87
|
- lib/prosereflect/paragraph.rb
|
49
88
|
- lib/prosereflect/parser.rb
|
50
89
|
- lib/prosereflect/table.rb
|
51
90
|
- lib/prosereflect/table_cell.rb
|
91
|
+
- lib/prosereflect/table_header.rb
|
52
92
|
- lib/prosereflect/table_row.rb
|
53
93
|
- lib/prosereflect/text.rb
|
94
|
+
- lib/prosereflect/user.rb
|
54
95
|
- lib/prosereflect/version.rb
|
55
96
|
- prosereflect.gemspec
|
56
97
|
- sig/prosemirror.rbs
|
@@ -92,13 +133,16 @@ files:
|
|
92
133
|
- spec/fixtures/ituob-1001/ituob-1001-Q708_ISPC.yaml
|
93
134
|
- spec/prosereflect/document_spec.rb
|
94
135
|
- spec/prosereflect/hard_break_spec.rb
|
136
|
+
- spec/prosereflect/input/html_spec.rb
|
95
137
|
- spec/prosereflect/node_spec.rb
|
138
|
+
- spec/prosereflect/output/html_spec.rb
|
96
139
|
- spec/prosereflect/paragraph_spec.rb
|
97
140
|
- spec/prosereflect/parser_spec.rb
|
98
141
|
- spec/prosereflect/table_cell_spec.rb
|
99
142
|
- spec/prosereflect/table_row_spec.rb
|
100
143
|
- spec/prosereflect/table_spec.rb
|
101
144
|
- spec/prosereflect/text_spec.rb
|
145
|
+
- spec/prosereflect/user_spec.rb
|
102
146
|
- spec/prosereflect/version_spec.rb
|
103
147
|
- spec/prosereflect_spec.rb
|
104
148
|
- spec/spec_helper.rb
|
data/debug_loading.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
puts 'Debug script to check class loading'
|
5
|
-
|
6
|
-
begin
|
7
|
-
puts '1. Adding lib to path'
|
8
|
-
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
|
9
|
-
puts "Load path: #{$LOAD_PATH.inspect}"
|
10
|
-
|
11
|
-
puts "\n2. Requiring prosereflect"
|
12
|
-
require 'prosereflect'
|
13
|
-
puts 'Successfully required prosereflect'
|
14
|
-
|
15
|
-
puts "\n3. Checking Prosereflect module"
|
16
|
-
puts "Prosereflect defined? #{!defined?(Prosereflect).nil?}"
|
17
|
-
puts "Prosereflect is a #{Prosereflect.class}"
|
18
|
-
|
19
|
-
puts "\n4. Checking individual classes"
|
20
|
-
classes = %w[Node Document Paragraph Text HardBreak Table TableRow TableCell Parser]
|
21
|
-
classes.each do |klass|
|
22
|
-
full_class = "Prosereflect::#{klass}"
|
23
|
-
is_defined = begin
|
24
|
-
!defined?(Object.const_get(full_class)).nil?
|
25
|
-
rescue StandardError
|
26
|
-
false
|
27
|
-
end
|
28
|
-
puts "#{full_class} defined? #{is_defined}"
|
29
|
-
puts " #{full_class} is a #{Object.const_get(full_class).class}" if is_defined
|
30
|
-
end
|
31
|
-
rescue StandardError => e
|
32
|
-
puts "ERROR: #{e.class}: #{e.message}"
|
33
|
-
puts e.backtrace
|
34
|
-
end
|