standup_md 0.0.10
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 +7 -0
- data/.github/workflows/ruby.yml +24 -0
- data/.gitignore +1 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +23 -0
- data/LICENSE +21 -0
- data/README.md +252 -0
- data/Rakefile +36 -0
- data/_config.yml +1 -0
- data/bin/standup +5 -0
- data/doc/README_md.html +290 -0
- data/doc/StandupMD/Cli.html +898 -0
- data/doc/StandupMD.html +1453 -0
- data/doc/TestHelper.html +282 -0
- data/doc/TestStandupMD.html +1938 -0
- data/doc/created.rid +8 -0
- data/doc/css/fonts.css +167 -0
- data/doc/css/rdoc.css +611 -0
- data/doc/fonts/Lato-Light.ttf +0 -0
- data/doc/fonts/Lato-LightItalic.ttf +0 -0
- data/doc/fonts/Lato-Regular.ttf +0 -0
- data/doc/fonts/Lato-RegularItalic.ttf +0 -0
- data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/doc/images/add.png +0 -0
- data/doc/images/arrow_up.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +286 -0
- data/doc/js/darkfish.js +84 -0
- data/doc/js/navigation.js +105 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search.js +110 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js +229 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +551 -0
- data/lib/standup_md/cli.rb +301 -0
- data/lib/standup_md/version.rb +9 -0
- data/lib/standup_md.rb +530 -0
- data/standup_md.gemspec +36 -0
- metadata +108 -0
data/lib/standup_md.rb
ADDED
@@ -0,0 +1,530 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
require 'fileutils'
|
5
|
+
require_relative 'standup_md/version'
|
6
|
+
|
7
|
+
##
|
8
|
+
# The class for handing reading/writing of entries.
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# su = StandupMD.new
|
12
|
+
class StandupMD
|
13
|
+
|
14
|
+
##
|
15
|
+
# Convenience method for calling +new+ + +load+
|
16
|
+
#
|
17
|
+
# @param [Hash] attributes Attributes to set before loading.
|
18
|
+
#
|
19
|
+
# @example
|
20
|
+
# su = StandupMD.load(bullet_character: '*')
|
21
|
+
def self.load(attributes = {})
|
22
|
+
self.new do |s|
|
23
|
+
attributes.each do |k, v|
|
24
|
+
next unless s.respond_to?(k)
|
25
|
+
s.send("#{k}=", v)
|
26
|
+
end
|
27
|
+
end.load
|
28
|
+
end
|
29
|
+
|
30
|
+
# :section: Attributes that aren't settable by user, but are gettable.
|
31
|
+
|
32
|
+
##
|
33
|
+
# The string that will be used for the entry headers.
|
34
|
+
#
|
35
|
+
# @return [String]
|
36
|
+
attr_reader :header
|
37
|
+
|
38
|
+
##
|
39
|
+
# The file name should equal file_name_format parsed by Date.strftime.
|
40
|
+
# The default is +Date.today.strftime('%Y_%m.md')+
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
# su = StandupMD.new { |s| s.file_name_format = '%y_%m.markdown' }
|
46
|
+
# su.file
|
47
|
+
# # => Users/johnsmith/.cache/standup_md/20_04.markdown
|
48
|
+
attr_reader :file
|
49
|
+
|
50
|
+
##
|
51
|
+
# The file that contains previous entries. When last month's file exists, but
|
52
|
+
# this month's doesn't or is empty, previous_file should equal last month's
|
53
|
+
# file.
|
54
|
+
#
|
55
|
+
# @return [String]
|
56
|
+
#
|
57
|
+
# @example
|
58
|
+
# # Assuming the current month is April, 2020
|
59
|
+
#
|
60
|
+
# Dir.entries(su.directory)
|
61
|
+
# # => []
|
62
|
+
# su = StandupMD.new
|
63
|
+
# su.previous_file
|
64
|
+
# # => ''
|
65
|
+
#
|
66
|
+
# Dir.entries(su.directory)
|
67
|
+
# # => ['2020_03.md']
|
68
|
+
# su = StandupMD.new
|
69
|
+
# su.previous_file
|
70
|
+
# # => '2020_03.md'
|
71
|
+
#
|
72
|
+
# Dir.entries(su.directory)
|
73
|
+
# # => ['2020_03.md', '2020_04.md']
|
74
|
+
# su = StandupMD.new
|
75
|
+
# su.previous_file
|
76
|
+
# # => '2020_04.md'
|
77
|
+
attr_reader :previous_file
|
78
|
+
|
79
|
+
##
|
80
|
+
# The entry for today's date as a hash. If +file+ already has an entry for
|
81
|
+
# today, it will be read and used as +current_entry+. If there is no entry
|
82
|
+
# for today, one should be generated from scaffolding.
|
83
|
+
#
|
84
|
+
# @return [Hash]
|
85
|
+
#
|
86
|
+
# @example
|
87
|
+
# StandupMD.new.current_entry
|
88
|
+
# # => {
|
89
|
+
# # '2020-04-02' => {
|
90
|
+
# # 'Previous' => ['Task from yesterday'],
|
91
|
+
# # 'Current' => ["<!-- ADD TODAY'S WORK HERE -->"],
|
92
|
+
# # 'Impediments' => ['None'],
|
93
|
+
# # 'Notes' => [],
|
94
|
+
# # }
|
95
|
+
# # }
|
96
|
+
attr_reader :current_entry
|
97
|
+
|
98
|
+
##
|
99
|
+
# All previous entry for the same month as today. If it's the first day of
|
100
|
+
# the month, +all_previous_entries+ will be all of last month's entries. They
|
101
|
+
# will be a hash in the same format as +current_entry+.
|
102
|
+
#
|
103
|
+
# @return [Hash]
|
104
|
+
attr_reader :all_previous_entries
|
105
|
+
|
106
|
+
##
|
107
|
+
# Current entry plus all previous entries. This will be a hash in the same
|
108
|
+
# format at +current_entry+ and +all_previous_entries+.
|
109
|
+
#
|
110
|
+
# @return [Hash]
|
111
|
+
attr_reader :all_entries
|
112
|
+
|
113
|
+
# :section: Attributes that are settable by the user, but have custom setters.
|
114
|
+
|
115
|
+
##
|
116
|
+
# The directory where the markdown files are kept.
|
117
|
+
#
|
118
|
+
# @return [String]
|
119
|
+
#
|
120
|
+
# @default
|
121
|
+
# File.join(ENV['HOME'], '.cache', 'standup_md')
|
122
|
+
attr_reader :directory
|
123
|
+
|
124
|
+
##
|
125
|
+
# Array of tasks for today. This is the work expected to be performed today.
|
126
|
+
# Default is an empty array, but when writing to file, the default is
|
127
|
+
#
|
128
|
+
# @return [Array]
|
129
|
+
#
|
130
|
+
# @default
|
131
|
+
# ["<!-- ADD TODAY'S WORK HERE -->"]
|
132
|
+
attr_reader :current_entry_tasks
|
133
|
+
|
134
|
+
##
|
135
|
+
# Array of impediments for today's entry.
|
136
|
+
#
|
137
|
+
# @return [Array]
|
138
|
+
attr_reader :impediments
|
139
|
+
|
140
|
+
##
|
141
|
+
# Character used as bullets for list entries.
|
142
|
+
#
|
143
|
+
# @return [String] either - (dash) or * (asterisk)
|
144
|
+
attr_reader :bullet_character
|
145
|
+
|
146
|
+
##
|
147
|
+
# Number of octothorps that should preface entry headers.
|
148
|
+
#
|
149
|
+
# @return [Integer] between 1 and 5
|
150
|
+
attr_reader :header_depth
|
151
|
+
|
152
|
+
##
|
153
|
+
# Number of octothorps that should preface sub-headers.
|
154
|
+
#
|
155
|
+
# @return [Integer] between 2 and 6
|
156
|
+
attr_reader :sub_header_depth
|
157
|
+
|
158
|
+
##
|
159
|
+
# The tasks from the previous task's "Current" section.
|
160
|
+
#
|
161
|
+
# @return [Array]
|
162
|
+
attr_reader :previous_entry_tasks
|
163
|
+
|
164
|
+
##
|
165
|
+
# Array of notes to add to today's entry.
|
166
|
+
#
|
167
|
+
# @return [Array]
|
168
|
+
attr_reader :notes
|
169
|
+
|
170
|
+
# :section: Attributes with default getters and setters.
|
171
|
+
|
172
|
+
##
|
173
|
+
# The format to use for file names. This should include a month (%m) and
|
174
|
+
# year (%y) so the file can rotate every month. This will prevent files
|
175
|
+
# from getting too large.
|
176
|
+
#
|
177
|
+
# @param [String] file_name_format Parsed by +strftime+
|
178
|
+
#
|
179
|
+
# @return [String]
|
180
|
+
attr_accessor :file_name_format
|
181
|
+
|
182
|
+
##
|
183
|
+
# The date format to use for entry headers.
|
184
|
+
#
|
185
|
+
# @param [String] header_date_format Parsed by +strftime+
|
186
|
+
#
|
187
|
+
# @return [String]
|
188
|
+
attr_accessor :header_date_format
|
189
|
+
|
190
|
+
##
|
191
|
+
# The header to use for the +Current+ section.
|
192
|
+
#
|
193
|
+
# @param [String] current_header
|
194
|
+
#
|
195
|
+
# @return [String]
|
196
|
+
attr_accessor :current_header
|
197
|
+
|
198
|
+
##
|
199
|
+
# The header to use for the +Previous+ section.
|
200
|
+
#
|
201
|
+
# @param [String] previous_header
|
202
|
+
#
|
203
|
+
# @return [String]
|
204
|
+
attr_accessor :previous_header
|
205
|
+
|
206
|
+
##
|
207
|
+
# The header to use for the +Impediments+ section.
|
208
|
+
#
|
209
|
+
# @param [String] impediments_header
|
210
|
+
#
|
211
|
+
# @return [String]
|
212
|
+
attr_accessor :impediments_header
|
213
|
+
|
214
|
+
##
|
215
|
+
# The header to use for the +Notes+ section.
|
216
|
+
#
|
217
|
+
# @param [String] notes_header
|
218
|
+
#
|
219
|
+
# @return [String]
|
220
|
+
attr_accessor :notes_header
|
221
|
+
|
222
|
+
##
|
223
|
+
# Constructor. Yields the instance so you can pass a block to access setters.
|
224
|
+
#
|
225
|
+
# @return [self]
|
226
|
+
#
|
227
|
+
# @example
|
228
|
+
# su = StandupMD.new do |s|
|
229
|
+
# s.directory = @workdir
|
230
|
+
# s.file_name_format = '%y_%m.markdown'
|
231
|
+
# s.bullet_character = '*'
|
232
|
+
# end
|
233
|
+
def initialize
|
234
|
+
@notes = []
|
235
|
+
@header_depth = 1
|
236
|
+
@sub_header_depth = 2
|
237
|
+
@bullet_character = '-'
|
238
|
+
@current_entry_tasks = ["<!-- ADD TODAY'S WORK HERE -->"]
|
239
|
+
@impediments = ['None']
|
240
|
+
@file_name_format = '%Y_%m.md'
|
241
|
+
@directory = File.join(ENV['HOME'], '.cache', 'standup_md')
|
242
|
+
@header_date_format = '%Y-%m-%d'
|
243
|
+
@current_header = 'Current'
|
244
|
+
@previous_header = 'Previous'
|
245
|
+
@impediments_header = 'Impediments'
|
246
|
+
@notes_header = 'Notes'
|
247
|
+
@sub_header_order = %w[previous current impediments notes]
|
248
|
+
|
249
|
+
yield self if block_given?
|
250
|
+
end
|
251
|
+
|
252
|
+
# :section: Booleans
|
253
|
+
# Helper methods for booleans.
|
254
|
+
|
255
|
+
##
|
256
|
+
# Has the file been written since instantiated?
|
257
|
+
#
|
258
|
+
# @return [boolean]
|
259
|
+
#
|
260
|
+
# @example
|
261
|
+
# su = StandupMD.new
|
262
|
+
# su.file_written?
|
263
|
+
# # => false
|
264
|
+
# su.write
|
265
|
+
# su.file_written?
|
266
|
+
# # => true
|
267
|
+
def file_written?
|
268
|
+
@file_written
|
269
|
+
end
|
270
|
+
|
271
|
+
##
|
272
|
+
# Was today's entry already in the file?
|
273
|
+
#
|
274
|
+
# @return [boolean] true if today's entry was already in the file
|
275
|
+
def entry_previously_added?
|
276
|
+
@entry_previously_added
|
277
|
+
end
|
278
|
+
|
279
|
+
# :section: Custom setters
|
280
|
+
# Setters that required validations.
|
281
|
+
|
282
|
+
##
|
283
|
+
# Setter for current entry tasks.
|
284
|
+
#
|
285
|
+
# @param [Array] tasks
|
286
|
+
#
|
287
|
+
# @return [Array]
|
288
|
+
def previous_entry_tasks=(tasks)
|
289
|
+
raise 'Must be an Array' unless tasks.is_a?(Array)
|
290
|
+
@previous_entry_tasks = tasks
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# Setter for notes.
|
295
|
+
#
|
296
|
+
# @param [Array] notes
|
297
|
+
#
|
298
|
+
# @return [Array]
|
299
|
+
def notes=(tasks)
|
300
|
+
raise 'Must be an Array' unless tasks.is_a?(Array)
|
301
|
+
@notes = tasks
|
302
|
+
end
|
303
|
+
|
304
|
+
##
|
305
|
+
# Setter for current entry tasks.
|
306
|
+
#
|
307
|
+
# @param [Array] tasks
|
308
|
+
#
|
309
|
+
# @return [Array]
|
310
|
+
def current_entry_tasks=(tasks)
|
311
|
+
raise 'Must be an Array' unless tasks.is_a?(Array)
|
312
|
+
@current_entry_tasks = tasks
|
313
|
+
end
|
314
|
+
|
315
|
+
##
|
316
|
+
# Setter for impediments.
|
317
|
+
#
|
318
|
+
# @param [Array] tasks
|
319
|
+
#
|
320
|
+
# @return [Array]
|
321
|
+
def impediments=(tasks)
|
322
|
+
raise 'Must be an Array' unless tasks.is_a?(Array)
|
323
|
+
@impediments = tasks
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# Setter for bullet_character. Must be * (asterisk) or - (dash).
|
328
|
+
#
|
329
|
+
# @param [String] character
|
330
|
+
#
|
331
|
+
# @return [String]
|
332
|
+
def bullet_character=(character)
|
333
|
+
raise 'Must be "-" or "*"' unless %w[- *].include?(character)
|
334
|
+
@bullet_character = character
|
335
|
+
end
|
336
|
+
|
337
|
+
##
|
338
|
+
# Setter for directory. Must be expanded in case the user uses `~` for home.
|
339
|
+
# If the directory doesn't exist, it will be created. To reset instance
|
340
|
+
# variables after changing the directory, you'll need to call load.
|
341
|
+
#
|
342
|
+
# @param [String] directory
|
343
|
+
#
|
344
|
+
# @return [String]
|
345
|
+
def directory=(directory)
|
346
|
+
# TODO test this
|
347
|
+
directory = File.expand_path(directory)
|
348
|
+
FileUtils.mkdir_p(directory) unless File.directory?(directory)
|
349
|
+
@directory = directory
|
350
|
+
end
|
351
|
+
|
352
|
+
##
|
353
|
+
# Number of octothorps (#) to use before the main header.
|
354
|
+
#
|
355
|
+
# @param [Integer] depth
|
356
|
+
#
|
357
|
+
# @return [Integer]
|
358
|
+
def header_depth=(depth)
|
359
|
+
if !depth.between?(1, 5)
|
360
|
+
raise 'Header depth out of bounds (1..5)'
|
361
|
+
elsif depth >= sub_header_depth
|
362
|
+
raise 'header_depth must be larger than sub_header_depth'
|
363
|
+
end
|
364
|
+
@header_depth = depth
|
365
|
+
end
|
366
|
+
|
367
|
+
##
|
368
|
+
# Number of octothorps (#) to use before sub headers (Current, Previous, etc).
|
369
|
+
#
|
370
|
+
# @param [Integer] depth
|
371
|
+
#
|
372
|
+
# @return [Integer]
|
373
|
+
def sub_header_depth=(depth)
|
374
|
+
if !depth.between?(2, 6)
|
375
|
+
raise 'Sub-header depth out of bounds (2..6)'
|
376
|
+
elsif depth <= header_depth
|
377
|
+
raise 'sub_header_depth must be smaller than header_depth'
|
378
|
+
end
|
379
|
+
@sub_header_depth = depth
|
380
|
+
end
|
381
|
+
|
382
|
+
##
|
383
|
+
# Preferred order for sub-headers.
|
384
|
+
#
|
385
|
+
# @param [Array] Values must be %w[previous current impediment notes]
|
386
|
+
#
|
387
|
+
# @return [Array]
|
388
|
+
def sub_header_order=(array)
|
389
|
+
order = %w[previous current impediments notes]
|
390
|
+
raise "Values must be #{order.join{', '}}" unless order.sort == array.sort
|
391
|
+
@sub_header_order = array
|
392
|
+
end
|
393
|
+
|
394
|
+
# :section: Misc
|
395
|
+
# Misc.
|
396
|
+
|
397
|
+
##
|
398
|
+
# Return a copy of the sub-header order so the user can't modify the array.
|
399
|
+
#
|
400
|
+
# @return [Array]
|
401
|
+
def sub_header_order
|
402
|
+
@sub_header_order.dup
|
403
|
+
end
|
404
|
+
|
405
|
+
##
|
406
|
+
# Writes a new entry to the file if the first entry in the file isn't today.
|
407
|
+
#
|
408
|
+
# @return [Boolean]
|
409
|
+
def write
|
410
|
+
File.open(file, 'w') do |f|
|
411
|
+
all_entries.each do |head, s_heads|
|
412
|
+
f.puts '#' * header_depth + ' ' + head
|
413
|
+
sub_header_order.map { |value| "#{value}_header" }.each do |sub_head|
|
414
|
+
sh = send(sub_head).capitalize
|
415
|
+
next if !s_heads[sh] || s_heads[sh].empty?
|
416
|
+
f.puts '#' * sub_header_depth + ' ' + sh
|
417
|
+
s_heads[sh].each { |task| f.puts bullet_character + ' ' + task }
|
418
|
+
end
|
419
|
+
f.puts
|
420
|
+
end
|
421
|
+
end
|
422
|
+
@file_written = true
|
423
|
+
end
|
424
|
+
|
425
|
+
##
|
426
|
+
# Sets internal instance variables. Called when first instantiated, or after
|
427
|
+
# directory is set.
|
428
|
+
#
|
429
|
+
# @return [self]
|
430
|
+
def load
|
431
|
+
FileUtils.mkdir_p(directory) unless File.directory?(directory)
|
432
|
+
|
433
|
+
@today = Date.today
|
434
|
+
@header = today.strftime(header_date_format)
|
435
|
+
@file_written = false
|
436
|
+
@file = File.expand_path(File.join(directory, today.strftime(file_name_format)))
|
437
|
+
@previous_file = get_previous_file
|
438
|
+
@all_previous_entries = get_all_previous_entries
|
439
|
+
@entry_previously_added = all_previous_entries.key?(header)
|
440
|
+
@previous_entry_tasks = previous_entry[current_header]
|
441
|
+
@current_entry = @all_previous_entries.delete(header) || new_entry
|
442
|
+
@all_entries = {header => current_entry}.merge(all_previous_entries)
|
443
|
+
|
444
|
+
FileUtils.touch(file) unless File.file?(file)
|
445
|
+
self
|
446
|
+
end
|
447
|
+
|
448
|
+
##
|
449
|
+
# Alias of +load+
|
450
|
+
#
|
451
|
+
# @return [self]
|
452
|
+
alias_method :reload, :load
|
453
|
+
|
454
|
+
private
|
455
|
+
|
456
|
+
##
|
457
|
+
# Scaffolding with which new entries will be created.
|
458
|
+
def new_entry # :nodoc:
|
459
|
+
{
|
460
|
+
previous_header => previous_entry_tasks || [],
|
461
|
+
current_header => current_entry_tasks,
|
462
|
+
impediments_header => impediments,
|
463
|
+
notes_header => notes,
|
464
|
+
}
|
465
|
+
end
|
466
|
+
|
467
|
+
##
|
468
|
+
# Date object of today's date.
|
469
|
+
def today # :nodoc:
|
470
|
+
@today
|
471
|
+
end
|
472
|
+
|
473
|
+
##
|
474
|
+
# The file that contains the previous entry. If previous entry was same month,
|
475
|
+
# previous_file will be the same as file. If previous entry was last month,
|
476
|
+
# and a file exists for last month, previous_file is last month's file.
|
477
|
+
# If neither is true, returns an empty string.
|
478
|
+
def get_previous_file # :nodoc:
|
479
|
+
return file if File.file?(file) && !File.zero?(file)
|
480
|
+
prev_month_file = File.expand_path(File.join(
|
481
|
+
directory,
|
482
|
+
today.prev_month.strftime(file_name_format)
|
483
|
+
))
|
484
|
+
File.file?(prev_month_file) ? prev_month_file : ''
|
485
|
+
end
|
486
|
+
|
487
|
+
def get_all_previous_entries # :nodoc:
|
488
|
+
return {} unless File.file?(previous_file)
|
489
|
+
prev_entries = {}
|
490
|
+
entry_header = ''
|
491
|
+
section_type = ''
|
492
|
+
File.foreach(previous_file) do |line|
|
493
|
+
line.chomp!
|
494
|
+
next if line.strip.empty?
|
495
|
+
if line.match(%r{^#{'#' * header_depth}\s+})
|
496
|
+
entry_header = line.sub(%r{^\#{#{header_depth}}\s*}, '')
|
497
|
+
section_type = notes_header
|
498
|
+
prev_entries[entry_header] ||= {}
|
499
|
+
elsif line.match(%r{^#{'#' * sub_header_depth}\s+})
|
500
|
+
section_type = determine_section_type(
|
501
|
+
line.sub(%r{^\#{#{sub_header_depth}}\s*}, '')
|
502
|
+
)
|
503
|
+
prev_entries[entry_header][section_type] = []
|
504
|
+
else
|
505
|
+
prev_entries[entry_header][section_type] << line.sub(
|
506
|
+
%r{\s*#{bullet_character}\s*}, ''
|
507
|
+
)
|
508
|
+
end
|
509
|
+
end
|
510
|
+
prev_entries
|
511
|
+
rescue => e
|
512
|
+
raise "File malformation: #{e}"
|
513
|
+
end
|
514
|
+
|
515
|
+
def determine_section_type(line) # :nodoc:
|
516
|
+
[
|
517
|
+
current_header,
|
518
|
+
previous_header,
|
519
|
+
impediments_header,
|
520
|
+
notes_header
|
521
|
+
].each { |header| return header if line.include?(header) }
|
522
|
+
raise "Unknown header type [#{line}]"
|
523
|
+
end
|
524
|
+
|
525
|
+
def previous_entry # :nodoc:
|
526
|
+
all_previous_entries.each do |key, value|
|
527
|
+
return value unless key == header
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|
data/standup_md.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative 'lib/standup_md/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'standup_md'
|
5
|
+
spec.version = StandupMD::VERSION
|
6
|
+
spec.authors = ['Evan Gray']
|
7
|
+
spec.email = 'evanthegrayt@vivaldi.net'
|
8
|
+
spec.license = 'MIT'
|
9
|
+
spec.date = Time.now.strftime('%Y-%m-%d')
|
10
|
+
|
11
|
+
spec.summary = %q{The cure for all your standup woes}
|
12
|
+
spec.description = %q{Generate and edit standups in markdown format}
|
13
|
+
spec.homepage = 'https://github.com/evanthegrayt/standup_md'
|
14
|
+
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
17
|
+
if spec.respond_to?(:metadata)
|
18
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
19
|
+
|
20
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
21
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
22
|
+
else
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
24
|
+
'public gem pushes.'
|
25
|
+
end
|
26
|
+
|
27
|
+
# Specify which files should be added to the gem when it is released.
|
28
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
29
|
+
# spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
30
|
+
# `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
31
|
+
# end
|
32
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
33
|
+
spec.bindir = 'bin'
|
34
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ['lib']
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: standup_md
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.10
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Evan Gray
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Generate and edit standups in markdown format
|
14
|
+
email: evanthegrayt@vivaldi.net
|
15
|
+
executables:
|
16
|
+
- standup
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".github/workflows/ruby.yml"
|
21
|
+
- ".gitignore"
|
22
|
+
- Gemfile
|
23
|
+
- Gemfile.lock
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- _config.yml
|
28
|
+
- bin/standup
|
29
|
+
- doc/README_md.html
|
30
|
+
- doc/StandupMD.html
|
31
|
+
- doc/StandupMD/Cli.html
|
32
|
+
- doc/TestHelper.html
|
33
|
+
- doc/TestStandupMD.html
|
34
|
+
- doc/created.rid
|
35
|
+
- doc/css/fonts.css
|
36
|
+
- doc/css/rdoc.css
|
37
|
+
- doc/fonts/Lato-Light.ttf
|
38
|
+
- doc/fonts/Lato-LightItalic.ttf
|
39
|
+
- doc/fonts/Lato-Regular.ttf
|
40
|
+
- doc/fonts/Lato-RegularItalic.ttf
|
41
|
+
- doc/fonts/SourceCodePro-Bold.ttf
|
42
|
+
- doc/fonts/SourceCodePro-Regular.ttf
|
43
|
+
- doc/images/add.png
|
44
|
+
- doc/images/arrow_up.png
|
45
|
+
- doc/images/brick.png
|
46
|
+
- doc/images/brick_link.png
|
47
|
+
- doc/images/bug.png
|
48
|
+
- doc/images/bullet_black.png
|
49
|
+
- doc/images/bullet_toggle_minus.png
|
50
|
+
- doc/images/bullet_toggle_plus.png
|
51
|
+
- doc/images/date.png
|
52
|
+
- doc/images/delete.png
|
53
|
+
- doc/images/find.png
|
54
|
+
- doc/images/loadingAnimation.gif
|
55
|
+
- doc/images/macFFBgHack.png
|
56
|
+
- doc/images/package.png
|
57
|
+
- doc/images/page_green.png
|
58
|
+
- doc/images/page_white_text.png
|
59
|
+
- doc/images/page_white_width.png
|
60
|
+
- doc/images/plugin.png
|
61
|
+
- doc/images/ruby.png
|
62
|
+
- doc/images/tag_blue.png
|
63
|
+
- doc/images/tag_green.png
|
64
|
+
- doc/images/transparent.png
|
65
|
+
- doc/images/wrench.png
|
66
|
+
- doc/images/wrench_orange.png
|
67
|
+
- doc/images/zoom.png
|
68
|
+
- doc/index.html
|
69
|
+
- doc/js/darkfish.js
|
70
|
+
- doc/js/navigation.js
|
71
|
+
- doc/js/navigation.js.gz
|
72
|
+
- doc/js/search.js
|
73
|
+
- doc/js/search_index.js
|
74
|
+
- doc/js/search_index.js.gz
|
75
|
+
- doc/js/searcher.js
|
76
|
+
- doc/js/searcher.js.gz
|
77
|
+
- doc/table_of_contents.html
|
78
|
+
- lib/standup_md.rb
|
79
|
+
- lib/standup_md/cli.rb
|
80
|
+
- lib/standup_md/version.rb
|
81
|
+
- standup_md.gemspec
|
82
|
+
homepage: https://github.com/evanthegrayt/standup_md
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata:
|
86
|
+
allowed_push_host: https://rubygems.org
|
87
|
+
homepage_uri: https://github.com/evanthegrayt/standup_md
|
88
|
+
source_code_uri: https://github.com/evanthegrayt/standup_md
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
103
|
+
requirements: []
|
104
|
+
rubygems_version: 3.0.3
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: The cure for all your standup woes
|
108
|
+
test_files: []
|