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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd83f7e9ad74c7ce8e954a255561017db3c7278d3940c8cac95f4d1097a46c1
4
- data.tar.gz: 35293271672e6c7cdaf9687dab37fb879960e716d738fc8f9e72e338219572fb
3
+ metadata.gz: 0e04a2dba62d872a90c9626200f345c78a6cce58f457a8c850b7049c992eb44d
4
+ data.tar.gz: dceb7a9c7e078b50895db3841ab0527bd4c35acff281cd0db90f4a15252e7eee
5
5
  SHA512:
6
- metadata.gz: 0ea9257b5a7444ebb07badc36252437eb6e611f0311aed2fbbb55b3dbba17390bd25541f68b48f59003a68c3218fd69e8bc7dc5ddc3ab166e722b63fc3509401
7
- data.tar.gz: 721eaa00bed3e627eed35961cf55dde2e8d80f9fb0100dde238bdb90a719f0e0752d1e9ed7f3fb0a68923936064833f5be9388c723bb2f371a21e5bc46785e3e
6
+ metadata.gz: e132cca4c1f8a2242e6e206f4bc9d9033d50a3fabcbfe2bce84594d14a0118938fbae86ab81d8cef75817b9732cc6d3a12ef1a3c51485b956f81b61e37bdac02
7
+ data.tar.gz: '00386f42c5cfb8fdc637bbbce8dd27e1487cf41c411ae8e4e0e94398f26653684a1bfbd1e0c6264dc6963706ab7226f5441ea9d22ebad3de146744c51fdce096'
@@ -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("Enter 'EOL' on a new line and press enter when you are done.")
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$/
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Mkmatter
2
- VERSION = '3.1.7'
2
+ VERSION = '3.1.9'
3
3
 
4
4
  # Return gem information for certain commands and options
5
5
  class GemInfo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.7
4
+ version: 3.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Spencer