mkmatter 3.1.7 → 3.1.9
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/lib/mkmatter/answers.rb +1 -1
- data/lib/mkmatter/questions.rb +52 -2
- data/lib/mkmatter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e04a2dba62d872a90c9626200f345c78a6cce58f457a8c850b7049c992eb44d
|
4
|
+
data.tar.gz: dceb7a9c7e078b50895db3841ab0527bd4c35acff281cd0db90f4a15252e7eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e132cca4c1f8a2242e6e206f4bc9d9033d50a3fabcbfe2bce84594d14a0118938fbae86ab81d8cef75817b9732cc6d3a12ef1a3c51485b956f81b61e37bdac02
|
7
|
+
data.tar.gz: '00386f42c5cfb8fdc637bbbce8dd27e1487cf41c411ae8e4e0e94398f26653684a1bfbd1e0c6264dc6963706ab7226f5441ea9d22ebad3de146744c51fdce096'
|
data/lib/mkmatter/answers.rb
CHANGED
@@ -50,7 +50,7 @@ module Mkmatter
|
|
50
50
|
# Custom matter
|
51
51
|
if hl.agree('Do you want to add custom fields? (usable as {{LAYOUT_TYPE.FIELD}} in templates) ', true)
|
52
52
|
hl.say('Your fields should be inputted as FIELD=>TEXT HERE')
|
53
|
-
hl.say("
|
53
|
+
hl.say("Type 'EOL' on a new line then press Enter when you are done.")
|
54
54
|
hl.say("<% HighLine.color('NOTE', :bold, :red) %>: Input is <% HighLine.color('NOT', :bold, :red) %> evaluated!")
|
55
55
|
custom_fields = hl.ask('Fields?') do |q|
|
56
56
|
q.gather = /^EOL$/
|
data/lib/mkmatter/questions.rb
CHANGED
@@ -102,7 +102,32 @@ module Mkmatter
|
|
102
102
|
menu.prompt = '? '
|
103
103
|
end
|
104
104
|
end
|
105
|
-
|
105
|
+
# @return [String]
|
106
|
+
def get_006_extra_fields
|
107
|
+
hl = @hl
|
108
|
+
custom_fields = nil
|
109
|
+
if hl.agree('Do you want to add custom fields? (usable as {{LAYOUT_TYPE.FIELD}} in templates) ', true)
|
110
|
+
hl.say('Your fields should be inputted as FIELD=>TEXT HERE')
|
111
|
+
hl.say("Type 'EOL' on a new line then press Enter when you are done.")
|
112
|
+
hl.say("<% HighLine.color('NOTE', :bold, :red) %>: Input is <% HighLine.color('NOT', :bold, :red) %> evaluated!")
|
113
|
+
custom_fields = hl.ask('Fields?') do |q|
|
114
|
+
q.gather = /^EOL$/
|
115
|
+
end
|
116
|
+
end
|
117
|
+
if custom_fields
|
118
|
+
fields = Hash.new
|
119
|
+
custom_fields.each do |field|
|
120
|
+
field = field.split(/=>/)
|
121
|
+
fields.store(field[0].to_s, field[1])
|
122
|
+
end
|
123
|
+
self.to_h = fields
|
124
|
+
elsif custom_fields.nil?
|
125
|
+
hl.say('No extra fields were added.')
|
126
|
+
return
|
127
|
+
else
|
128
|
+
end
|
129
|
+
custom_fields
|
130
|
+
end
|
106
131
|
# @return [OpenStruct]
|
107
132
|
end
|
108
133
|
|
@@ -186,7 +211,32 @@ module Mkmatter
|
|
186
211
|
menu.prompt = '? '
|
187
212
|
end
|
188
213
|
end
|
189
|
-
|
214
|
+
# @return [Array[Hash]]
|
215
|
+
def get_006_extra_fields
|
216
|
+
hl = @hl
|
217
|
+
custom_fields = nil
|
218
|
+
if hl.agree('Do you want to add custom fields? (usable as {{LAYOUT_TYPE.FIELD}} in templates) ', true)
|
219
|
+
hl.say('Your fields should be inputted as FIELD=>TEXT HERE')
|
220
|
+
hl.say("Type 'EOL' on a new line then press Enter when you are done.")
|
221
|
+
hl.say("<% HighLine.color('NOTE', :bold, :red) %>: Input is <% HighLine.color('NOT', :bold, :red) %> evaluated!")
|
222
|
+
custom_fields = hl.ask('Fields?') do |q|
|
223
|
+
q.gather = /^EOL$/
|
224
|
+
end
|
225
|
+
end
|
226
|
+
if custom_fields
|
227
|
+
fields = Hash.new
|
228
|
+
custom_fields.each do |field|
|
229
|
+
field = field.split(/=>/)
|
230
|
+
fields.store(field[0].to_s, field[1])
|
231
|
+
end
|
232
|
+
self.to_h = fields
|
233
|
+
elsif custom_fields.nil?
|
234
|
+
hl.say('No extra fields were added.')
|
235
|
+
return
|
236
|
+
else
|
237
|
+
end
|
238
|
+
custom_fields
|
239
|
+
end
|
190
240
|
# @return [OpenStruct]
|
191
241
|
end
|
192
242
|
end
|
data/lib/mkmatter/version.rb
CHANGED