d-mark 1.0.0b1 → 1.0.0b2
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/Gemfile.lock +56 -54
- data/NEWS.md +6 -0
- data/Rakefile +1 -1
- data/d-mark.gemspec +1 -1
- data/ideas.dmark +17 -0
- data/lib/d-mark/parser.rb +5 -3
- data/lib/d-mark/version.rb +1 -1
- data/spec/d-mark/parser_spec.rb +5 -7
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5108217b3f4db3e0f50eaf6613a7ac7be6fc1df7ed910167c014593c2e05f74c
|
4
|
+
data.tar.gz: 1fcfc2341f5f3b49d903e52a2c743b02fbaece7d4415a5d2e72db4bac90ccb09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d5238ced88d951e8edf2b6323a4ff698a24c70021265353d3f778b854b235f76aad85d872bce2c8bcb7683b4078f7a0b839e21f39380e9fe1583a7cebcb2e9
|
7
|
+
data.tar.gz: 41f4a62ed8cf1d86da8e0b5615f0e5ff485e3d314a5590e518e6ca5d32984b9ba792484bd60be2654a057ef68df4512b3de9ba9a4f2fa489b92651d72bc9e517
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
d-mark (1.0.
|
4
|
+
d-mark (1.0.0b2)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
codecov (0.
|
9
|
+
ast (2.4.1)
|
10
|
+
codecov (0.2.12)
|
11
11
|
json
|
12
12
|
simplecov
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
ffi (1.9.23)
|
13
|
+
coderay (1.1.3)
|
14
|
+
diff-lcs (1.4.4)
|
15
|
+
docile (1.3.4)
|
16
|
+
ffi (1.14.2)
|
18
17
|
formatador (0.2.5)
|
19
|
-
guard (2.
|
18
|
+
guard (2.16.2)
|
20
19
|
formatador (>= 0.2.4)
|
21
20
|
listen (>= 2.7, < 4.0)
|
22
21
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -28,60 +27,63 @@ GEM
|
|
28
27
|
guard-rake (1.0.0)
|
29
28
|
guard
|
30
29
|
rake
|
31
|
-
json (2.1
|
32
|
-
listen (3.
|
33
|
-
rb-fsevent (~> 0.
|
34
|
-
rb-inotify (~> 0.9, >= 0.9.
|
35
|
-
|
36
|
-
|
37
|
-
method_source (0.9.0)
|
30
|
+
json (2.5.1)
|
31
|
+
listen (3.4.0)
|
32
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
33
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
34
|
+
lumberjack (1.2.8)
|
35
|
+
method_source (1.0.0)
|
38
36
|
nenv (0.3.0)
|
39
|
-
notiffany (0.1.
|
37
|
+
notiffany (0.1.3)
|
40
38
|
nenv (~> 0.1)
|
41
39
|
shellany (~> 0.0)
|
42
|
-
parallel (1.
|
43
|
-
parser (
|
44
|
-
ast (~> 2.4.
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
method_source (~> 0.9.0)
|
40
|
+
parallel (1.20.1)
|
41
|
+
parser (3.0.0.0)
|
42
|
+
ast (~> 2.4.1)
|
43
|
+
pry (0.13.1)
|
44
|
+
coderay (~> 1.1)
|
45
|
+
method_source (~> 1.0)
|
49
46
|
rainbow (3.0.0)
|
50
|
-
rake (
|
51
|
-
rb-fsevent (0.10.
|
52
|
-
rb-inotify (0.
|
53
|
-
ffi (
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
rspec-
|
58
|
-
|
59
|
-
rspec-
|
60
|
-
rspec-
|
47
|
+
rake (13.0.3)
|
48
|
+
rb-fsevent (0.10.4)
|
49
|
+
rb-inotify (0.10.1)
|
50
|
+
ffi (~> 1.0)
|
51
|
+
regexp_parser (2.0.3)
|
52
|
+
rexml (3.2.4)
|
53
|
+
rspec (3.10.0)
|
54
|
+
rspec-core (~> 3.10.0)
|
55
|
+
rspec-expectations (~> 3.10.0)
|
56
|
+
rspec-mocks (~> 3.10.0)
|
57
|
+
rspec-core (3.10.1)
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-expectations (3.10.1)
|
61
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-mocks (3.
|
61
|
+
rspec-support (~> 3.10.0)
|
62
|
+
rspec-mocks (3.10.1)
|
64
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.
|
66
|
-
rspec-support (3.
|
67
|
-
rubocop (
|
64
|
+
rspec-support (~> 3.10.0)
|
65
|
+
rspec-support (3.10.1)
|
66
|
+
rubocop (1.7.0)
|
68
67
|
parallel (~> 1.10)
|
69
|
-
parser (>= 2.
|
70
|
-
powerpack (~> 0.1)
|
68
|
+
parser (>= 2.7.1.5)
|
71
69
|
rainbow (>= 2.2.2, < 4.0)
|
70
|
+
regexp_parser (>= 1.8, < 3.0)
|
71
|
+
rexml
|
72
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
72
73
|
ruby-progressbar (~> 1.7)
|
73
|
-
unicode-display_width (
|
74
|
-
|
75
|
-
|
74
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
75
|
+
rubocop-ast (1.3.0)
|
76
|
+
parser (>= 2.7.1.5)
|
77
|
+
ruby-progressbar (1.11.0)
|
76
78
|
shellany (0.0.1)
|
77
|
-
simplecov (0.
|
78
|
-
docile (~> 1.1
|
79
|
-
|
80
|
-
|
81
|
-
simplecov-html (0.
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
simplecov (0.20.0)
|
80
|
+
docile (~> 1.1)
|
81
|
+
simplecov-html (~> 0.11)
|
82
|
+
simplecov_json_formatter (~> 0.1)
|
83
|
+
simplecov-html (0.12.3)
|
84
|
+
simplecov_json_formatter (0.1.2)
|
85
|
+
thor (1.0.1)
|
86
|
+
unicode-display_width (1.7.0)
|
85
87
|
|
86
88
|
PLATFORMS
|
87
89
|
ruby
|
@@ -95,4 +97,4 @@ DEPENDENCIES
|
|
95
97
|
rubocop
|
96
98
|
|
97
99
|
BUNDLED WITH
|
98
|
-
1.
|
100
|
+
1.17.3
|
data/NEWS.md
CHANGED
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ end
|
|
8
8
|
|
9
9
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
10
10
|
task.options = %w[--display-cop-names --format simple]
|
11
|
-
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'Gemfile
|
11
|
+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb', 'Gemfile', '*.gemspec', 'Rakefile']
|
12
12
|
end
|
13
13
|
|
14
14
|
task default: %i[spec rubocop]
|
data/d-mark.gemspec
CHANGED
data/ideas.dmark
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#h1 Ideas
|
2
|
+
|
3
|
+
#ul
|
4
|
+
#li
|
5
|
+
#p Support validation. Which elements can contain which other elements? Which elements can live at the root?
|
6
|
+
|
7
|
+
#li
|
8
|
+
#p Have different translators built-in. I’m thinking %code{BasicMarkdown2HTML} and %code{HTMLForWriters2HTML}, and perhaps %code{DocBook2HTML}.
|
9
|
+
|
10
|
+
#li
|
11
|
+
#p A refactored parser that does not need to reset %code{@pos}, and maybe not even have any kind of mutable state at all.
|
12
|
+
|
13
|
+
#li
|
14
|
+
#p Fancy exception handling actually used somewhere.
|
15
|
+
|
16
|
+
#li
|
17
|
+
#p Documentation for every exception that occurs.
|
data/lib/d-mark/parser.rb
CHANGED
@@ -55,6 +55,7 @@ module DMark
|
|
55
55
|
|
56
56
|
loop do
|
57
57
|
break if eof?
|
58
|
+
|
58
59
|
res << read_block_with_children
|
59
60
|
end
|
60
61
|
|
@@ -77,10 +78,10 @@ module DMark
|
|
77
78
|
@col_nr += 1
|
78
79
|
end
|
79
80
|
|
80
|
-
def read_char(
|
81
|
+
def read_char(expected_char)
|
81
82
|
char = @input_chars[@pos]
|
82
|
-
if char !=
|
83
|
-
raise_parse_error("expected #{
|
83
|
+
if char != expected_char
|
84
|
+
raise_parse_error("expected #{expected_char.inspect}, but got #{char.nil? ? 'EOF' : char.inspect}")
|
84
85
|
else
|
85
86
|
advance
|
86
87
|
char
|
@@ -232,6 +233,7 @@ module DMark
|
|
232
233
|
loop do
|
233
234
|
char = @input_chars[@pos]
|
234
235
|
break unless IDENTIFIER_CHARS.include?(char)
|
236
|
+
|
235
237
|
advance
|
236
238
|
res << char
|
237
239
|
end
|
data/lib/d-mark/version.rb
CHANGED
data/spec/d-mark/parser_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
def parse(
|
2
|
-
DMark::Parser.new(
|
1
|
+
def parse(str)
|
2
|
+
DMark::Parser.new(str).parse
|
3
3
|
end
|
4
4
|
|
5
5
|
def element(name, attributes, children)
|
@@ -8,11 +8,9 @@ end
|
|
8
8
|
|
9
9
|
describe DMark::Parser::ParserError do
|
10
10
|
subject(:error) do
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
break e
|
15
|
-
end
|
11
|
+
DMark::Parser.new(content).parse
|
12
|
+
rescue described_class => e
|
13
|
+
break e
|
16
14
|
end
|
17
15
|
|
18
16
|
let(:content) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: d-mark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.0b2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: D★Mark is a markup language aimed at being able to write semantically
|
14
14
|
meaningful text without limiting itself to the semantics provided by HTML or Markdown.
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- README.md
|
29
29
|
- Rakefile
|
30
30
|
- d-mark.gemspec
|
31
|
+
- ideas.dmark
|
31
32
|
- lib/d-mark.rb
|
32
33
|
- lib/d-mark/element_node.rb
|
33
34
|
- lib/d-mark/parser.rb
|
@@ -43,7 +44,7 @@ homepage: http://rubygems.org/gems/d-mark
|
|
43
44
|
licenses:
|
44
45
|
- MIT
|
45
46
|
metadata: {}
|
46
|
-
post_install_message:
|
47
|
+
post_install_message:
|
47
48
|
rdoc_options:
|
48
49
|
- "--main"
|
49
50
|
- README.md
|
@@ -51,18 +52,17 @@ require_paths:
|
|
51
52
|
- lib
|
52
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
54
|
requirements:
|
54
|
-
- - "
|
55
|
+
- - ">="
|
55
56
|
- !ruby/object:Gem::Version
|
56
|
-
version: '2.
|
57
|
+
version: '2.5'
|
57
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
59
|
requirements:
|
59
60
|
- - ">"
|
60
61
|
- !ruby/object:Gem::Version
|
61
62
|
version: 1.3.1
|
62
63
|
requirements: []
|
63
|
-
|
64
|
-
|
65
|
-
signing_key:
|
64
|
+
rubygems_version: 3.2.4
|
65
|
+
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: markup language for writing text
|
68
68
|
test_files: []
|