mumukit-directives 0.4.0 → 0.6.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: c91feb2d8d4868f7fd628f9b3c05638f22ef17945a6531b5578634a75ad23738
4
+ data.tar.gz: 0edd51c9170107747223548f319144b906166abdcb1769d4dc526b54442b926f
5
5
  SHA512:
6
- metadata.gz: bbbf5de2ffe4e812e3439007f9ea6e2154db87db5ef02b32fa1b35bbfdc678ded0a52a3de6d1a0ea063f5386c2aaf8565eb4da380e598a9b1a5c01dbec67d855
7
- data.tar.gz: 8ace2a2100ef4da408d3bab91a227c520b759403a167ac70970ce086b1a47e1b431df6f7a367ef91ce71443b70b5da89b5816f7b2c51cb00e401480a107ab47a
6
+ metadata.gz: 6d7b250cc114211183b0134908bba5bee23f1b3b819d3731e3dba79e0781b3480911c67b3335b4588e5b6a22112be28225153509eae616a35832e590062b117d
7
+ data.tar.gz: c35a9c9d444d826133760bd536500fdfd06f5dfd944a08f219ab3a4c3804af9f4c3dbea91274c3ac7e64ba38d2b628c3081cdeac72e51e935f541833fd6309f8
@@ -8,7 +8,7 @@ class Mumukit::Directives::Interpolations < Mumukit::Directives::Directive
8
8
  end
9
9
 
10
10
  def interpolations?(code)
11
- (code =~ comment_regexp).present?
11
+ code.is_a?(String) && (code =~ comment_regexp).present?
12
12
  end
13
13
 
14
14
  def interpolate(code, sections)
@@ -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.6.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.6.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: 2023-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.0'
19
+ version: '12.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.0'
26
+ version: '12.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: '2.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.7'
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '2'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: codeclimate-test-reporter
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -70,22 +70,16 @@ dependencies:
70
70
  name: mumukit-core
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0.1'
76
- - - "<"
73
+ - - "~>"
77
74
  - !ruby/object:Gem::Version
78
- version: '2'
75
+ version: '1.20'
79
76
  type: :runtime
80
77
  prerelease: false
81
78
  version_requirements: !ruby/object:Gem::Requirement
82
79
  requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- version: '0.1'
86
- - - "<"
80
+ - - "~>"
87
81
  - !ruby/object:Gem::Version
88
- version: '2'
82
+ version: '1.20'
89
83
  description: A directives preprocessor for mumuki
90
84
  email:
91
85
  - franco@mumuki.org
@@ -116,15 +110,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
110
  requirements:
117
111
  - - ">="
118
112
  - !ruby/object:Gem::Version
119
- version: '0'
113
+ version: '3.0'
120
114
  required_rubygems_version: !ruby/object:Gem::Requirement
121
115
  requirements:
122
116
  - - ">="
123
117
  - !ruby/object:Gem::Version
124
118
  version: '0'
125
119
  requirements: []
126
- rubyforge_project:
127
- rubygems_version: 2.7.7
120
+ rubygems_version: 3.4.10
128
121
  signing_key:
129
122
  specification_version: 4
130
123
  summary: Interpolations, sections and flags pipelines for mumuki