mumukit-directives 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/directives/sections.rb +16 -0
- data/lib/mumukit/directives/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 187ef216e2478fc25e5e99f4cecd4d85d34d055a65b589165ab41ff756d67752
|
4
|
+
data.tar.gz: 4e3c3c4ecb8b0e303dc33ee93489ae241c73c89318335bfc415b5c021c22e4af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a7876612229da6499be53fb21c3e28b1ea490b5c4af4bc902638c44e22aa329a82205e8211decda1d8155a4316ffb6f19135ff20b8aedd1488367b5d3953310
|
7
|
+
data.tar.gz: d057c4be231d5f90b0e2885d4148f5ee5ad6842fbc81dbfa042c2d5ca5fb5fe9167839cc6310ef4eee7ecefb961f584c9b58a98e00efb931b9c233dc5f953ba2
|
@@ -55,6 +55,22 @@ class Mumukit::Directives::Sections < Mumukit::Directives::Directive
|
|
55
55
|
result
|
56
56
|
end
|
57
57
|
|
58
|
+
def join(sections)
|
59
|
+
file_declarations, _file_references = sections.map do |section, content|
|
60
|
+
[build(section, content), interpolate(section)]
|
61
|
+
end.transpose
|
62
|
+
|
63
|
+
file_declarations.join "\n"
|
64
|
+
end
|
65
|
+
|
66
|
+
def build(section, content)
|
67
|
+
"#{comment_type.comment "<#{section}#"}#{content}#{comment_type.comment "##{section}>"}"
|
68
|
+
end
|
69
|
+
|
70
|
+
def interpolate(section)
|
71
|
+
comment_type.comment("...#{section}...")
|
72
|
+
end
|
73
|
+
|
58
74
|
private
|
59
75
|
|
60
76
|
def merge_sections!(result, key, code, new_sections)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-directives
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|