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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a96803a6b78cfe143f001aa01776f1c8433f2f175d9bda40bda8e79a052024ef
4
- data.tar.gz: 1d3379588b8f0fa1cbd403c4677ea018a2ecf785da2c2b8e584bc15998daac89
3
+ metadata.gz: 187ef216e2478fc25e5e99f4cecd4d85d34d055a65b589165ab41ff756d67752
4
+ data.tar.gz: 4e3c3c4ecb8b0e303dc33ee93489ae241c73c89318335bfc415b5c021c22e4af
5
5
  SHA512:
6
- metadata.gz: bbbf5de2ffe4e812e3439007f9ea6e2154db87db5ef02b32fa1b35bbfdc678ded0a52a3de6d1a0ea063f5386c2aaf8565eb4da380e598a9b1a5c01dbec67d855
7
- data.tar.gz: 8ace2a2100ef4da408d3bab91a227c520b759403a167ac70970ce086b1a47e1b431df6f7a367ef91ce71443b70b5da89b5816f7b2c51cb00e401480a107ab47a
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)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Directives
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
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.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-08-16 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake