standup_md 0.3.13 → 0.3.15
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/.github/workflows/ruby.yml +27 -12
- data/Gemfile.lock +105 -10
- data/Rakefile +29 -9
- data/bin/standup +3 -1
- data/lib/standup_md/cli/helpers.rb +32 -37
- data/lib/standup_md/cli.rb +5 -5
- data/lib/standup_md/config/cli.rb +5 -4
- data/lib/standup_md/config/entry.rb +1 -1
- data/lib/standup_md/config/entry_list.rb +1 -3
- data/lib/standup_md/config/file.rb +21 -25
- data/lib/standup_md/config.rb +7 -7
- data/lib/standup_md/entry.rb +6 -6
- data/lib/standup_md/entry_list.rb +26 -15
- data/lib/standup_md/file/helpers.rb +11 -6
- data/lib/standup_md/file.rb +55 -51
- data/lib/standup_md/version.rb +5 -3
- data/lib/standup_md.rb +15 -13
- data/standup_md.gemspec +25 -24
- metadata +40 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b95cee87e34194f847a9830ccf56694e1c450c0bdbae04b8b0af0df7716daaaa
|
|
4
|
+
data.tar.gz: 2d8466163ca2687ca156e62c12399b01a65454e57eb3d7376931908e0e39a61c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 522d4e0c57d9887456210fb79ac5fd4920350ffd7265f8dd2bc40369405ed4ef624cd29425dae92e480b1e694ad9ff5e5733e36c0800527f8c692f3335128ee8
|
|
7
|
+
data.tar.gz: 1229afe074eacb10dcf0b84dabd80d3a41695c604ade83e175739548bdebdf4d84fd5161f6f50bb9931239816fa885c78ff217b7950fdf31f4498919fccaee0a
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
# .github/workflows/ruby.yml
|
|
2
|
+
name: Ruby CI
|
|
2
3
|
|
|
3
4
|
on:
|
|
4
5
|
push:
|
|
@@ -8,17 +9,31 @@ on:
|
|
|
8
9
|
|
|
9
10
|
jobs:
|
|
10
11
|
test:
|
|
12
|
+
runs-on: ubuntu-22.04
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
ruby-version: ['3.2', '3.3', '4.0']
|
|
13
18
|
|
|
14
19
|
steps:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ruby-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
- uses: actions/checkout@v3
|
|
21
|
+
|
|
22
|
+
# Set up Ruby and Bundler
|
|
23
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
|
24
|
+
uses: ruby/setup-ruby@v1
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
27
|
+
bundler: ${{ matrix.ruby-version == '4.0' && '4.0.9' || '2.4.13' }}
|
|
28
|
+
bundler-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Print Ruby and Bundler versions
|
|
31
|
+
run: |
|
|
32
|
+
ruby -v
|
|
33
|
+
bundle -v
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: bundle install --jobs 4 --retry 3
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: bundle exec rake
|
data/Gemfile.lock
CHANGED
|
@@ -1,31 +1,126 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
standup_md (0.3.
|
|
4
|
+
standup_md (0.3.15)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
ast (2.4.3)
|
|
10
|
+
date (3.5.1)
|
|
11
|
+
docile (1.4.1)
|
|
12
|
+
erb (6.0.4)
|
|
13
|
+
json (2.19.9)
|
|
14
|
+
language_server-protocol (3.17.0.5)
|
|
15
|
+
lint_roller (1.1.0)
|
|
16
|
+
parallel (1.28.0)
|
|
17
|
+
parser (3.3.11.1)
|
|
18
|
+
ast (~> 2.4.1)
|
|
19
|
+
racc
|
|
20
|
+
power_assert (3.0.1)
|
|
21
|
+
prism (1.9.0)
|
|
22
|
+
psych (5.4.0)
|
|
23
|
+
date
|
|
24
|
+
stringio
|
|
25
|
+
racc (1.8.1)
|
|
26
|
+
rainbow (3.1.1)
|
|
27
|
+
rake (13.4.2)
|
|
28
|
+
rdoc (7.2.0)
|
|
29
|
+
erb
|
|
30
|
+
psych (>= 4.0.0)
|
|
31
|
+
tsort
|
|
32
|
+
regexp_parser (2.12.0)
|
|
33
|
+
rubocop (1.84.2)
|
|
34
|
+
json (~> 2.3)
|
|
35
|
+
language_server-protocol (~> 3.17.0.2)
|
|
36
|
+
lint_roller (~> 1.1.0)
|
|
37
|
+
parallel (~> 1.10)
|
|
38
|
+
parser (>= 3.3.0.2)
|
|
39
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
40
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
41
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
42
|
+
ruby-progressbar (~> 1.7)
|
|
43
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
44
|
+
rubocop-ast (1.49.1)
|
|
45
|
+
parser (>= 3.3.7.2)
|
|
46
|
+
prism (~> 1.7)
|
|
47
|
+
rubocop-performance (1.26.1)
|
|
48
|
+
lint_roller (~> 1.1)
|
|
49
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
50
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
51
|
+
ruby-progressbar (1.13.0)
|
|
52
|
+
simplecov (0.22.0)
|
|
13
53
|
docile (~> 1.1)
|
|
14
54
|
simplecov-html (~> 0.11)
|
|
15
55
|
simplecov_json_formatter (~> 0.1)
|
|
16
|
-
simplecov-html (0.
|
|
17
|
-
simplecov_json_formatter (0.1.
|
|
18
|
-
|
|
56
|
+
simplecov-html (0.13.2)
|
|
57
|
+
simplecov_json_formatter (0.1.4)
|
|
58
|
+
standard (1.54.0)
|
|
59
|
+
language_server-protocol (~> 3.17.0.2)
|
|
60
|
+
lint_roller (~> 1.0)
|
|
61
|
+
rubocop (~> 1.84.0)
|
|
62
|
+
standard-custom (~> 1.0.0)
|
|
63
|
+
standard-performance (~> 1.8)
|
|
64
|
+
standard-custom (1.0.2)
|
|
65
|
+
lint_roller (~> 1.0)
|
|
66
|
+
rubocop (~> 1.50)
|
|
67
|
+
standard-performance (1.9.0)
|
|
68
|
+
lint_roller (~> 1.1)
|
|
69
|
+
rubocop-performance (~> 1.26.0)
|
|
70
|
+
stringio (3.2.0)
|
|
71
|
+
test-unit (3.7.8)
|
|
19
72
|
power_assert
|
|
73
|
+
tsort (0.2.0)
|
|
74
|
+
unicode-display_width (3.2.0)
|
|
75
|
+
unicode-emoji (~> 4.1)
|
|
76
|
+
unicode-emoji (4.2.0)
|
|
20
77
|
|
|
21
78
|
PLATFORMS
|
|
22
|
-
|
|
79
|
+
arm64-darwin-25
|
|
80
|
+
ruby
|
|
23
81
|
|
|
24
82
|
DEPENDENCIES
|
|
25
83
|
rake (~> 13.0, >= 13.0.1)
|
|
84
|
+
rdoc
|
|
26
85
|
simplecov
|
|
86
|
+
standard (~> 1.54.0)
|
|
27
87
|
standup_md!
|
|
28
88
|
test-unit (~> 3.3, >= 3.3.5)
|
|
29
89
|
|
|
90
|
+
CHECKSUMS
|
|
91
|
+
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
92
|
+
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
|
|
93
|
+
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
|
|
94
|
+
erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9
|
|
95
|
+
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
|
|
96
|
+
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
97
|
+
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
98
|
+
parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970
|
|
99
|
+
parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
|
|
100
|
+
power_assert (3.0.1) sha256=8ce9876716cc74e863fcd4cdcdc52d792bd983598d1af3447083a3a9a4d34103
|
|
101
|
+
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
102
|
+
psych (5.4.0) sha256=14f72d69a611af663d7d70e4a7b67d9eb1f3ae9f8d916b478961d5a0075ba5b7
|
|
103
|
+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
104
|
+
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
105
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
106
|
+
rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
|
|
107
|
+
regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
|
|
108
|
+
rubocop (1.84.2) sha256=5692cea54168f3dc8cb79a6fe95c5424b7ea893c707ad7a4307b0585e88dbf5f
|
|
109
|
+
rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
|
|
110
|
+
rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
|
|
111
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
112
|
+
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
|
|
113
|
+
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
|
|
114
|
+
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
|
|
115
|
+
standard (1.54.0) sha256=7a4b08f83d9893083c8f03bc486f0feeb6a84d48233b40829c03ef4767ea0100
|
|
116
|
+
standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
|
|
117
|
+
standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
|
|
118
|
+
standup_md (0.3.15)
|
|
119
|
+
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
|
|
120
|
+
test-unit (3.7.8) sha256=689d1ca53f4d46f678b4e5d68d8e4294f87fc5e8b9238cc4de7c5727e8d65943
|
|
121
|
+
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
|
|
122
|
+
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
|
|
123
|
+
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
|
|
124
|
+
|
|
30
125
|
BUNDLED WITH
|
|
31
|
-
|
|
126
|
+
4.0.10
|
data/Rakefile
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require
|
|
6
|
-
require
|
|
3
|
+
$LOAD_PATH.unshift(File.expand_path("lib", __dir__))
|
|
4
|
+
|
|
5
|
+
require "standup_md"
|
|
6
|
+
require "bundler/gem_tasks"
|
|
7
|
+
require "rdoc/task"
|
|
8
|
+
require "rake/testtask"
|
|
9
|
+
|
|
10
|
+
STANDARD_FILES = ["lib", "test"].freeze
|
|
7
11
|
|
|
8
12
|
Rake::TestTask.new do |t|
|
|
9
|
-
t.libs = [
|
|
13
|
+
t.libs = ["lib"]
|
|
10
14
|
t.warning = true
|
|
11
15
|
t.verbose = true
|
|
12
|
-
t.test_files = FileList[
|
|
16
|
+
t.test_files = FileList["test/**/*_test.rb"]
|
|
13
17
|
end
|
|
14
18
|
|
|
15
19
|
RDoc::Task.new do |rdoc|
|
|
16
|
-
rdoc.main =
|
|
17
|
-
rdoc.rdoc_dir =
|
|
18
|
-
rdoc.rdoc_files.include(
|
|
20
|
+
rdoc.main = "README.md"
|
|
21
|
+
rdoc.rdoc_dir = "docs"
|
|
22
|
+
rdoc.rdoc_files.include("README.md", "lib/**/*.rb")
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
desc "Lint with the Standard Ruby style guide"
|
|
26
|
+
task :standard do
|
|
27
|
+
require "standard"
|
|
28
|
+
|
|
29
|
+
exit_code = Standard::Cli.new(STANDARD_FILES).run
|
|
30
|
+
fail unless exit_code.zero?
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
desc "Lint and automatically make safe fixes with the Standard Ruby style guide"
|
|
34
|
+
task :"standard:fix" do
|
|
35
|
+
require "standard"
|
|
36
|
+
|
|
37
|
+
exit_code = Standard::Cli.new(STANDARD_FILES + ["--fix"]).run
|
|
38
|
+
fail unless exit_code.zero?
|
|
19
39
|
end
|
|
20
40
|
|
|
21
41
|
task default: :test
|
data/bin/standup
CHANGED
|
@@ -12,17 +12,15 @@ module StandupMD
|
|
|
12
12
|
#
|
|
13
13
|
# @return [nil]
|
|
14
14
|
def print(entry)
|
|
15
|
-
if entry.nil?
|
|
16
|
-
|
|
17
|
-
return
|
|
18
|
-
end
|
|
15
|
+
return puts "No record found for #{config.cli.date}" if entry.nil?
|
|
16
|
+
|
|
19
17
|
puts header(entry)
|
|
20
18
|
config.file.sub_header_order.each do |header_type|
|
|
21
19
|
tasks = entry.public_send(header_type)
|
|
22
20
|
next if !tasks || tasks.empty?
|
|
23
21
|
|
|
24
22
|
puts sub_header(header_type)
|
|
25
|
-
tasks.each { |task| puts config.file.bullet_character
|
|
23
|
+
tasks.each { |task| puts "#{config.file.bullet_character} #{task}" }
|
|
26
24
|
end
|
|
27
25
|
puts
|
|
28
26
|
end
|
|
@@ -44,73 +42,73 @@ module StandupMD
|
|
|
44
42
|
# @return [Hash]
|
|
45
43
|
def load_runtime_preferences(options)
|
|
46
44
|
OptionParser.new do |opts|
|
|
47
|
-
opts.banner =
|
|
45
|
+
opts.banner = "The Standup Doctor"
|
|
48
46
|
opts.version = "[StandupMD] #{::StandupMD::Version}"
|
|
49
47
|
opts.on(
|
|
50
|
-
|
|
48
|
+
"--current ARRAY", Array,
|
|
51
49
|
"List of current entry's tasks"
|
|
52
50
|
) { |v| config.entry.current = v }
|
|
53
51
|
|
|
54
52
|
opts.on(
|
|
55
|
-
|
|
53
|
+
"--previous ARRAY", Array,
|
|
56
54
|
"List of precious entry's tasks"
|
|
57
55
|
) { |v| config.entry.previous = v }
|
|
58
56
|
|
|
59
57
|
opts.on(
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
"--impediments ARRAY", Array,
|
|
59
|
+
"List of impediments for current entry"
|
|
62
60
|
) { |v| config.entry.impediments = v }
|
|
63
61
|
|
|
64
62
|
opts.on(
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
"--notes ARRAY", Array,
|
|
64
|
+
"List of notes for current entry"
|
|
67
65
|
) { |v| config.entry.notes = v }
|
|
68
66
|
|
|
69
67
|
opts.on(
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
"--sub-header-order ARRAY", Array,
|
|
69
|
+
"The order of the sub-headers when writing the file"
|
|
72
70
|
) { |v| config.file.sub_header_order = v }
|
|
73
71
|
|
|
74
72
|
opts.on(
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
"-f", "--file-name-format STRING",
|
|
74
|
+
"Date-formattable string to use for standup file name"
|
|
77
75
|
) { |v| config.file.name_format = v }
|
|
78
76
|
|
|
79
77
|
opts.on(
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
"-E", "--editor EDITOR",
|
|
79
|
+
"Editor to use for opening standup files"
|
|
82
80
|
) { |v| config.cli.editor = v }
|
|
83
81
|
|
|
84
82
|
opts.on(
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
"-d", "--directory DIRECTORY",
|
|
84
|
+
"The directories where standup files are located"
|
|
87
85
|
) { |v| config.file.directory = v }
|
|
88
86
|
|
|
89
87
|
opts.on(
|
|
90
|
-
|
|
88
|
+
"-w", "--[no-]write",
|
|
91
89
|
"Write current entry if it doesn't exist. Default is true"
|
|
92
90
|
) { |v| config.cli.write = v }
|
|
93
91
|
|
|
94
92
|
opts.on(
|
|
95
|
-
|
|
93
|
+
"-a", "--[no-]auto-fill-previous",
|
|
96
94
|
"Auto-generate 'previous' tasks for new entries. Default is true"
|
|
97
95
|
) { |v| config.cli.auto_fill_previous = v }
|
|
98
96
|
|
|
99
97
|
opts.on(
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
"-e", "--[no-]edit",
|
|
99
|
+
"Open the file in the editor. Default is true"
|
|
102
100
|
) { |v| config.cli.edit = v }
|
|
103
101
|
|
|
104
102
|
opts.on(
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
"-v", "--[no-]verbose",
|
|
104
|
+
"Verbose output. Default is false."
|
|
107
105
|
) { |v| config.cli.verbose = v }
|
|
108
106
|
|
|
109
107
|
opts.on(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
"-p", "--print [DATE]",
|
|
109
|
+
"Print current entry.",
|
|
110
|
+
"If DATE is passed, will print entry for DATE, if it exists.",
|
|
111
|
+
"DATE must be in the same format as file-name-format"
|
|
114
112
|
) do |v|
|
|
115
113
|
config.cli.print = true
|
|
116
114
|
config.cli.date =
|
|
@@ -133,7 +131,7 @@ module StandupMD
|
|
|
133
131
|
previous_entry(file),
|
|
134
132
|
config.entry.impediments,
|
|
135
133
|
config.entry.notes
|
|
136
|
-
).tap { |
|
|
134
|
+
).tap { |e| file.entries << e }
|
|
137
135
|
end
|
|
138
136
|
|
|
139
137
|
##
|
|
@@ -142,7 +140,6 @@ module StandupMD
|
|
|
142
140
|
# @return [Array]
|
|
143
141
|
def previous_entry(file)
|
|
144
142
|
return config.entry.previous_entry unless config.cli.auto_fill_previous
|
|
145
|
-
|
|
146
143
|
return prev_entry(prev_file.load.entries) if file.new? && prev_file
|
|
147
144
|
|
|
148
145
|
prev_entry(file.entries)
|
|
@@ -155,9 +152,7 @@ module StandupMD
|
|
|
155
152
|
#
|
|
156
153
|
# @return [StandupMD::Entry]
|
|
157
154
|
def prev_entry(entries)
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
entries.last.current
|
|
155
|
+
entries.empty? ? [] : entries.last.current
|
|
161
156
|
end
|
|
162
157
|
|
|
163
158
|
##
|
|
@@ -175,7 +170,7 @@ module StandupMD
|
|
|
175
170
|
#
|
|
176
171
|
# @return [String]
|
|
177
172
|
def header(entry)
|
|
178
|
-
|
|
173
|
+
"#" * config.file.header_depth + " " +
|
|
179
174
|
entry.date.strftime(config.file.header_date_format)
|
|
180
175
|
end
|
|
181
176
|
|
|
@@ -186,7 +181,7 @@ module StandupMD
|
|
|
186
181
|
#
|
|
187
182
|
# @return [String]
|
|
188
183
|
def sub_header(header_type)
|
|
189
|
-
|
|
184
|
+
"#" * config.file.sub_header_depth + " " +
|
|
190
185
|
config.file.public_send("#{header_type}_header").capitalize
|
|
191
186
|
end
|
|
192
187
|
end
|
data/lib/standup_md/cli.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
|
|
3
|
+
require "optparse"
|
|
4
|
+
require "standup_md/cli/helpers"
|
|
5
5
|
|
|
6
6
|
module StandupMD
|
|
7
7
|
##
|
|
@@ -60,7 +60,7 @@ module StandupMD
|
|
|
60
60
|
# Constructor. Sets defaults.
|
|
61
61
|
#
|
|
62
62
|
# @param [Array] options
|
|
63
|
-
def initialize(options = [], load_config
|
|
63
|
+
def initialize(options = [], load_config: true)
|
|
64
64
|
@config = self.class.config
|
|
65
65
|
@preference_file_loaded = false
|
|
66
66
|
@options = options
|
|
@@ -87,7 +87,7 @@ module StandupMD
|
|
|
87
87
|
##
|
|
88
88
|
# Has the preference file been loaded?
|
|
89
89
|
#
|
|
90
|
-
# @return boolean
|
|
90
|
+
# @return [boolean]
|
|
91
91
|
def preference_file_loaded?
|
|
92
92
|
@preference_file_loaded
|
|
93
93
|
end
|
|
@@ -111,7 +111,7 @@ module StandupMD
|
|
|
111
111
|
end
|
|
112
112
|
|
|
113
113
|
##
|
|
114
|
-
# Quick access to Cli.echo
|
|
114
|
+
# Quick access to +Cli.echo+.
|
|
115
115
|
#
|
|
116
116
|
# @return [nil]
|
|
117
117
|
def echo(msg)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "date"
|
|
4
4
|
|
|
5
5
|
module StandupMD
|
|
6
6
|
class Config
|
|
@@ -13,14 +13,15 @@ module StandupMD
|
|
|
13
13
|
# @return [Hash]
|
|
14
14
|
DEFAULTS = {
|
|
15
15
|
date: Date.today,
|
|
16
|
-
editor: ENV[
|
|
16
|
+
editor: ENV["VISUAL"] || ENV["EDITOR"] || "vim",
|
|
17
17
|
verbose: false,
|
|
18
18
|
edit: true,
|
|
19
19
|
write: true,
|
|
20
20
|
print: false,
|
|
21
21
|
auto_fill_previous: true,
|
|
22
|
-
preference_file:
|
|
23
|
-
::File.
|
|
22
|
+
preference_file: ::File.expand_path(
|
|
23
|
+
::File.join(ENV["HOME"], ".standuprc")
|
|
24
|
+
)
|
|
24
25
|
}.freeze
|
|
25
26
|
|
|
26
27
|
##
|
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
module StandupMD
|
|
4
4
|
class Config
|
|
5
|
-
|
|
6
5
|
##
|
|
7
6
|
# The configuration class for StandupMD::EntryList
|
|
8
7
|
class EntryList
|
|
9
|
-
|
|
10
8
|
##
|
|
11
9
|
# The default options.
|
|
12
10
|
#
|
|
13
11
|
# @return [Hash]
|
|
14
|
-
DEFAULTS = {}
|
|
12
|
+
DEFAULTS = {}.freeze
|
|
15
13
|
|
|
16
14
|
##
|
|
17
15
|
# Initializes the config with default values.
|
|
@@ -2,29 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
module StandupMD
|
|
4
4
|
class Config
|
|
5
|
-
|
|
6
5
|
##
|
|
7
6
|
# The configuration class for StandupMD::File
|
|
8
7
|
class File
|
|
9
|
-
|
|
10
8
|
##
|
|
11
9
|
# The default options.
|
|
12
10
|
#
|
|
13
11
|
# @return [Hash]
|
|
14
12
|
DEFAULTS = {
|
|
15
|
-
header_date_format:
|
|
13
|
+
header_date_format: "%Y-%m-%d",
|
|
16
14
|
header_depth: 1,
|
|
17
15
|
sub_header_depth: 2,
|
|
18
|
-
current_header:
|
|
19
|
-
previous_header:
|
|
20
|
-
impediments_header:
|
|
21
|
-
notes_header:
|
|
16
|
+
current_header: "Current",
|
|
17
|
+
previous_header: "Previous",
|
|
18
|
+
impediments_header: "Impediments",
|
|
19
|
+
notes_header: "Notes",
|
|
22
20
|
sub_header_order: %w[previous current impediments notes],
|
|
23
|
-
directory: ::File.join(ENV[
|
|
24
|
-
bullet_character:
|
|
25
|
-
name_format:
|
|
26
|
-
create: true
|
|
27
|
-
}
|
|
21
|
+
directory: ::File.join(ENV["HOME"], ".cache", "standup_md"),
|
|
22
|
+
bullet_character: "-",
|
|
23
|
+
name_format: "%Y_%m.md",
|
|
24
|
+
create: true
|
|
25
|
+
}.freeze
|
|
28
26
|
|
|
29
27
|
##
|
|
30
28
|
# Number of octothorps that should preface entry headers.
|
|
@@ -156,11 +154,9 @@ module StandupMD
|
|
|
156
154
|
#
|
|
157
155
|
# @return [Integer]
|
|
158
156
|
def header_depth=(depth)
|
|
159
|
-
if !depth.between?(1, 5)
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
@sub_header_depth = depth + 1
|
|
163
|
-
end
|
|
157
|
+
raise "Header depth out of bounds (1..5)" if !depth.between?(1, 5)
|
|
158
|
+
|
|
159
|
+
@sub_header_depth = depth + 1 if depth >= sub_header_depth
|
|
164
160
|
@header_depth = depth
|
|
165
161
|
end
|
|
166
162
|
|
|
@@ -172,11 +168,9 @@ module StandupMD
|
|
|
172
168
|
#
|
|
173
169
|
# @return [Integer]
|
|
174
170
|
def sub_header_depth=(depth)
|
|
175
|
-
if !depth.between?(2, 6)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
@header_depth = depth - 1
|
|
179
|
-
end
|
|
171
|
+
raise "Sub-header depth out of bounds (2..6)" if !depth.between?(2, 6)
|
|
172
|
+
|
|
173
|
+
@header_depth = depth - 1 if depth <= header_depth
|
|
180
174
|
@sub_header_depth = depth
|
|
181
175
|
end
|
|
182
176
|
|
|
@@ -188,13 +182,15 @@ module StandupMD
|
|
|
188
182
|
# @return [String]
|
|
189
183
|
def bullet_character=(char)
|
|
190
184
|
raise 'Must be "-" or "*"' unless %w[- *].include?(char)
|
|
185
|
+
|
|
191
186
|
@bullet_character = char
|
|
192
187
|
end
|
|
193
188
|
|
|
194
189
|
##
|
|
195
|
-
# Setter for directory. Must be expanded in case the user uses `~` for
|
|
196
|
-
# If the directory doesn't exist, it will be created. To reset
|
|
197
|
-
# variables after changing the directory, you'll need to call
|
|
190
|
+
# Setter for directory. Must be expanded in case the user uses `~` for
|
|
191
|
+
# home. If the directory doesn't exist, it will be created. To reset
|
|
192
|
+
# instance variables after changing the directory, you'll need to call
|
|
193
|
+
# load.
|
|
198
194
|
#
|
|
199
195
|
# @param [String] directory
|
|
200
196
|
#
|
data/lib/standup_md/config.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
require "standup_md/config/cli"
|
|
4
|
+
require "standup_md/config/file"
|
|
5
|
+
require "standup_md/config/entry"
|
|
6
|
+
require "standup_md/config/entry_list"
|
|
7
7
|
|
|
8
8
|
module StandupMD
|
|
9
9
|
##
|
|
@@ -36,9 +36,9 @@ module StandupMD
|
|
|
36
36
|
##
|
|
37
37
|
# Builds the links to the configuration classes.
|
|
38
38
|
def initialize
|
|
39
|
-
@cli
|
|
40
|
-
@file
|
|
41
|
-
@entry
|
|
39
|
+
@cli = StandupMD::Config::Cli.new
|
|
40
|
+
@file = StandupMD::Config::File.new
|
|
41
|
+
@entry = StandupMD::Config::Entry.new
|
|
42
42
|
@entry_list = StandupMD::Config::EntryList.new
|
|
43
43
|
end
|
|
44
44
|
end
|
data/lib/standup_md/entry.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "json"
|
|
4
4
|
|
|
5
5
|
module StandupMD
|
|
6
6
|
##
|
|
@@ -78,8 +78,8 @@ module StandupMD
|
|
|
78
78
|
# @param [Array] notes
|
|
79
79
|
def initialize(date, current, previous, impediments, notes = [])
|
|
80
80
|
raise unless date.is_a?(Date)
|
|
81
|
-
@config = self.class.config
|
|
82
81
|
|
|
82
|
+
@config = self.class.config
|
|
83
83
|
@date = date
|
|
84
84
|
@current = current
|
|
85
85
|
@previous = previous
|
|
@@ -100,10 +100,10 @@ module StandupMD
|
|
|
100
100
|
def to_h
|
|
101
101
|
{
|
|
102
102
|
date => {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
103
|
+
"current" => current,
|
|
104
|
+
"previous" => previous,
|
|
105
|
+
"impediments" => impediments,
|
|
106
|
+
"notes" => notes
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "forwardable"
|
|
4
4
|
|
|
5
5
|
module StandupMD
|
|
6
6
|
##
|
|
@@ -24,10 +24,9 @@ module StandupMD
|
|
|
24
24
|
#
|
|
25
25
|
# @return [StandupMD::EntryList]
|
|
26
26
|
def initialize(*entries)
|
|
27
|
+
entries.each { |entry| validate_entry(entry) }
|
|
28
|
+
|
|
27
29
|
@config = self.class.config
|
|
28
|
-
unless entries.all? { |e| e.is_a?(StandupMD::Entry) }
|
|
29
|
-
raise ArgumentError, 'Entry must be an instance of StandupMD::Entry'
|
|
30
|
-
end
|
|
31
30
|
@entries = entries
|
|
32
31
|
end
|
|
33
32
|
|
|
@@ -38,9 +37,8 @@ module StandupMD
|
|
|
38
37
|
#
|
|
39
38
|
# @return [Array]
|
|
40
39
|
def <<(entry)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
end
|
|
40
|
+
validate_entry(entry)
|
|
41
|
+
|
|
44
42
|
@entries << entry
|
|
45
43
|
end
|
|
46
44
|
|
|
@@ -52,7 +50,7 @@ module StandupMD
|
|
|
52
50
|
#
|
|
53
51
|
# @return [StandupMD::Entry]
|
|
54
52
|
def find(date)
|
|
55
|
-
entries.bsearch { |
|
|
53
|
+
entries.bsearch { |entry| date <=> entry.date }
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
##
|
|
@@ -73,7 +71,7 @@ module StandupMD
|
|
|
73
71
|
end
|
|
74
72
|
|
|
75
73
|
##
|
|
76
|
-
# Returns a copy of self sorted by date.
|
|
74
|
+
# Returns a copy of self sorted by date, reversed.
|
|
77
75
|
#
|
|
78
76
|
# @return [StandupMD::EntryList]
|
|
79
77
|
def sort_reverse
|
|
@@ -113,12 +111,17 @@ module StandupMD
|
|
|
113
111
|
#
|
|
114
112
|
# @return [Hash]
|
|
115
113
|
def to_h
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
114
|
+
@entries.map do |e|
|
|
115
|
+
[
|
|
116
|
+
e.date,
|
|
117
|
+
{
|
|
118
|
+
"current" => e.current,
|
|
119
|
+
"previous" => e.previous,
|
|
120
|
+
"impediments" => e.impediments,
|
|
121
|
+
"notes" => e.notes
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
end.to_h
|
|
122
125
|
end
|
|
123
126
|
|
|
124
127
|
##
|
|
@@ -145,5 +148,13 @@ module StandupMD
|
|
|
145
148
|
#
|
|
146
149
|
# +last+:: The last record in the list.
|
|
147
150
|
def_delegators :@entries, :each, :empty?, :size, :first, :last
|
|
151
|
+
|
|
152
|
+
private
|
|
153
|
+
|
|
154
|
+
def validate_entry(entry)
|
|
155
|
+
return if entry.is_a?(StandupMD::Entry)
|
|
156
|
+
|
|
157
|
+
raise ArgumentError, "Entry must be an instance of StandupMD::Entry"
|
|
158
|
+
end
|
|
148
159
|
end
|
|
149
160
|
end
|
|
@@ -16,11 +16,11 @@ module StandupMD
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def header_regex # :nodoc:
|
|
19
|
-
/^#{
|
|
19
|
+
/^#{"#" * StandupMD.config.file.header_depth}\s+/
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def sub_header_regex # :nodoc:
|
|
23
|
-
/^#{
|
|
23
|
+
/^#{"#" * StandupMD.config.file.sub_header_depth}\s+/
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def bullet_character_regex # :nodoc:
|
|
@@ -28,7 +28,7 @@ module StandupMD
|
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def determine_section_type(line) # :nodoc:
|
|
31
|
-
line = line.sub(/^\#{#{StandupMD.config.file.sub_header_depth}}\s*/,
|
|
31
|
+
line = line.sub(/^\#{#{StandupMD.config.file.sub_header_depth}}\s*/, "")
|
|
32
32
|
[
|
|
33
33
|
StandupMD.config.file.current_header,
|
|
34
34
|
StandupMD.config.file.previous_header,
|
|
@@ -40,7 +40,10 @@ module StandupMD
|
|
|
40
40
|
|
|
41
41
|
def new_entry(record) # :nodoc:
|
|
42
42
|
Entry.new(
|
|
43
|
-
Date.strptime(
|
|
43
|
+
Date.strptime(
|
|
44
|
+
record["header"],
|
|
45
|
+
StandupMD.config.file.header_date_format
|
|
46
|
+
),
|
|
44
47
|
record[StandupMD.config.file.current_header],
|
|
45
48
|
record[StandupMD.config.file.previous_header],
|
|
46
49
|
record[StandupMD.config.file.impediments_header],
|
|
@@ -49,11 +52,13 @@ module StandupMD
|
|
|
49
52
|
end
|
|
50
53
|
|
|
51
54
|
def header(date)
|
|
52
|
-
|
|
55
|
+
"#" * StandupMD.config.file.header_depth +
|
|
56
|
+
" " +
|
|
57
|
+
date.strftime(StandupMD.config.file.header_date_format)
|
|
53
58
|
end
|
|
54
59
|
|
|
55
60
|
def sub_header(subhead)
|
|
56
|
-
|
|
61
|
+
"#" * StandupMD.config.file.sub_header_depth + " " + subhead
|
|
57
62
|
end
|
|
58
63
|
end
|
|
59
64
|
end
|
data/lib/standup_md/file.rb
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
|
|
3
|
+
require "date"
|
|
4
|
+
require "fileutils"
|
|
5
|
+
require "standup_md/file/helpers"
|
|
6
6
|
|
|
7
7
|
module StandupMD
|
|
8
8
|
##
|
|
@@ -10,58 +10,62 @@ module StandupMD
|
|
|
10
10
|
class File
|
|
11
11
|
include StandupMD::File::Helpers
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
##
|
|
22
|
-
# Convenience method for calling File.find(file_name).load
|
|
23
|
-
#
|
|
24
|
-
# @param [String] file_name
|
|
25
|
-
#
|
|
26
|
-
# @return [StandupMD::File]
|
|
27
|
-
def self.load(file_name)
|
|
28
|
-
unless ::File.directory?(config.directory)
|
|
29
|
-
raise "Dir #{config.directory} not found." unless config.create
|
|
13
|
+
class << self
|
|
14
|
+
##
|
|
15
|
+
# Access to the class's configuration.
|
|
16
|
+
#
|
|
17
|
+
# @return [StandupMD::Config::EntryList]
|
|
18
|
+
def config
|
|
19
|
+
@config ||= StandupMD.config.file
|
|
20
|
+
end
|
|
30
21
|
|
|
31
|
-
|
|
22
|
+
##
|
|
23
|
+
# Convenience method for calling File.find(file_name).load
|
|
24
|
+
#
|
|
25
|
+
# @param [String] file_name
|
|
26
|
+
#
|
|
27
|
+
# @return [StandupMD::File]
|
|
28
|
+
def load(file_name)
|
|
29
|
+
unless ::File.directory?(config.directory)
|
|
30
|
+
raise "Dir #{config.directory} not found." unless config.create
|
|
31
|
+
|
|
32
|
+
FileUtils.mkdir_p(config.directory)
|
|
33
|
+
end
|
|
34
|
+
new(file_name).load
|
|
32
35
|
end
|
|
33
|
-
new(file_name).load
|
|
34
|
-
end
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
##
|
|
38
|
+
# Find standup file in directory by file name.
|
|
39
|
+
#
|
|
40
|
+
# @param [String] File_naem
|
|
41
|
+
def find(file_name)
|
|
42
|
+
unless ::File.directory?(config.directory)
|
|
43
|
+
raise "Dir #{config.directory} not found." unless config.create
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
FileUtils.mkdir_p(config.directory)
|
|
46
|
+
end
|
|
47
|
+
file_path = ::File.join(config.directory, file_name)
|
|
48
|
+
unless ::File.file?(file_path) || config.create
|
|
49
|
+
raise "File #{file_name} not found."
|
|
50
|
+
end
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
new(file_name)
|
|
53
|
+
end
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
##
|
|
56
|
+
# Find standup file in directory by Date object.
|
|
57
|
+
#
|
|
58
|
+
# @param [Date] date
|
|
59
|
+
def find_by_date(date)
|
|
60
|
+
raise ArgumentError, "Must be a Date object" unless date.is_a?(Date)
|
|
58
61
|
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
unless ::File.directory?(config.directory)
|
|
63
|
+
raise "Dir #{config.directory} not found." unless config.create
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
FileUtils.mkdir_p(config.directory)
|
|
66
|
+
end
|
|
67
|
+
find(date.strftime(config.name_format))
|
|
63
68
|
end
|
|
64
|
-
find(date.strftime(config.name_format))
|
|
65
69
|
end
|
|
66
70
|
|
|
67
71
|
##
|
|
@@ -141,7 +145,7 @@ module StandupMD
|
|
|
141
145
|
|
|
142
146
|
entry_list = EntryList.new
|
|
143
147
|
record = {}
|
|
144
|
-
section_type =
|
|
148
|
+
section_type = ""
|
|
145
149
|
::File.foreach(name) do |line|
|
|
146
150
|
line.chomp!
|
|
147
151
|
next if line.strip.empty?
|
|
@@ -151,14 +155,14 @@ module StandupMD
|
|
|
151
155
|
entry_list << new_entry(record)
|
|
152
156
|
record = {}
|
|
153
157
|
end
|
|
154
|
-
record[
|
|
158
|
+
record["header"] = line.sub(/^\#{#{@config.header_depth}}\s*/, "")
|
|
155
159
|
section_type = @config.notes_header
|
|
156
160
|
record[section_type] = []
|
|
157
161
|
elsif sub_header?(line)
|
|
158
162
|
section_type = determine_section_type(line)
|
|
159
163
|
record[section_type] = []
|
|
160
164
|
else
|
|
161
|
-
record[section_type] << line.sub(bullet_character_regex,
|
|
165
|
+
record[section_type] << line.sub(bullet_character_regex, "")
|
|
162
166
|
end
|
|
163
167
|
end
|
|
164
168
|
entry_list << new_entry(record) unless record.empty?
|
|
@@ -181,7 +185,7 @@ module StandupMD
|
|
|
181
185
|
sorted_entries = entries.sort
|
|
182
186
|
start_date = dates.fetch(:start_date, sorted_entries.first.date)
|
|
183
187
|
end_date = dates.fetch(:end_date, sorted_entries.last.date)
|
|
184
|
-
::File.open(name,
|
|
188
|
+
::File.open(name, "w") do |f|
|
|
185
189
|
sorted_entries.filter(start_date, end_date).sort_reverse.each do |entry|
|
|
186
190
|
f.puts header(entry.date)
|
|
187
191
|
@config.sub_header_order.each do |attr|
|
|
@@ -189,7 +193,7 @@ module StandupMD
|
|
|
189
193
|
next if !tasks || tasks.empty?
|
|
190
194
|
|
|
191
195
|
f.puts sub_header(@config.public_send("#{attr}_header").capitalize)
|
|
192
|
-
tasks.each { |task| f.puts @config.bullet_character
|
|
196
|
+
tasks.each { |task| f.puts "#{@config.bullet_character} #{task}" }
|
|
193
197
|
end
|
|
194
198
|
f.puts
|
|
195
199
|
end
|
data/lib/standup_md/version.rb
CHANGED
|
@@ -21,7 +21,7 @@ module StandupMD
|
|
|
21
21
|
# Patch version.
|
|
22
22
|
#
|
|
23
23
|
# @return [Integer]
|
|
24
|
-
PATCH =
|
|
24
|
+
PATCH = 15
|
|
25
25
|
|
|
26
26
|
##
|
|
27
27
|
# Version as +[MAJOR, MINOR, PATCH]+
|
|
@@ -36,7 +36,7 @@ module StandupMD
|
|
|
36
36
|
#
|
|
37
37
|
# @return [String]
|
|
38
38
|
def self.to_s
|
|
39
|
-
to_a.join(
|
|
39
|
+
to_a.join(".")
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
##
|
|
@@ -44,7 +44,9 @@ module StandupMD
|
|
|
44
44
|
#
|
|
45
45
|
# @return [Hash]
|
|
46
46
|
def self.to_h
|
|
47
|
-
|
|
47
|
+
%i[major minor patch].zip(to_a).to_h
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
+
|
|
51
|
+
VERSION = StandupMD::Version.to_s
|
|
50
52
|
end
|
data/lib/standup_md.rb
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
require "standup_md/version"
|
|
4
|
+
require "standup_md/file"
|
|
5
|
+
require "standup_md/entry"
|
|
6
|
+
require "standup_md/entry_list"
|
|
7
|
+
require "standup_md/cli"
|
|
8
|
+
require "standup_md/config"
|
|
9
9
|
|
|
10
10
|
##
|
|
11
11
|
# The main module for the gem. Provides access to configuration classes.
|
|
12
12
|
module StandupMD
|
|
13
13
|
@config_file_loaded = false
|
|
14
14
|
|
|
15
|
+
module_function
|
|
16
|
+
|
|
15
17
|
##
|
|
16
18
|
# Method for accessing the configuration.
|
|
17
19
|
#
|
|
18
|
-
# @return [StanupMD::
|
|
19
|
-
def
|
|
20
|
+
# @return [StanupMD::Config]
|
|
21
|
+
def config
|
|
20
22
|
@config || reset_config
|
|
21
23
|
end
|
|
22
24
|
|
|
@@ -24,7 +26,7 @@ module StandupMD
|
|
|
24
26
|
# Reset all configuration values to their defaults.
|
|
25
27
|
#
|
|
26
28
|
# @return [StandupMD::Config]
|
|
27
|
-
def
|
|
29
|
+
def reset_config
|
|
28
30
|
@config = StandupMD::Config.new
|
|
29
31
|
end
|
|
30
32
|
|
|
@@ -33,7 +35,7 @@ module StandupMD
|
|
|
33
35
|
#
|
|
34
36
|
# @example
|
|
35
37
|
# StandupMD.configure { |s| s.cli.editor = 'mate' }
|
|
36
|
-
def
|
|
38
|
+
def configure
|
|
37
39
|
yield config
|
|
38
40
|
end
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ module StandupMD
|
|
|
41
43
|
# Has a config file been loaded?
|
|
42
44
|
#
|
|
43
45
|
# @return [Boolean]
|
|
44
|
-
def
|
|
46
|
+
def config_file_loaded?
|
|
45
47
|
@config_file_loaded
|
|
46
48
|
end
|
|
47
49
|
|
|
@@ -51,8 +53,8 @@ module StandupMD
|
|
|
51
53
|
# @param [String] file
|
|
52
54
|
#
|
|
53
55
|
# @return [String] file
|
|
54
|
-
def
|
|
55
|
-
::File.expand_path(
|
|
56
|
+
def load_config_file(config_file)
|
|
57
|
+
::File.expand_path(config_file).tap do |file|
|
|
56
58
|
raise "File #{file} does not exist." unless ::File.file?(file)
|
|
57
59
|
|
|
58
60
|
@config_file_loaded = true
|
data/standup_md.gemspec
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
require_relative
|
|
1
|
+
require_relative "lib/standup_md/version"
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
|
-
spec.name
|
|
5
|
-
spec.version
|
|
6
|
-
spec.authors
|
|
7
|
-
spec.email
|
|
8
|
-
spec.license
|
|
9
|
-
spec.date = Time.now.strftime('%Y-%m-%d')
|
|
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"
|
|
10
9
|
|
|
11
|
-
spec.summary
|
|
12
|
-
spec.description
|
|
13
|
-
spec.homepage
|
|
10
|
+
spec.summary = %(The cure for all your standup woes)
|
|
11
|
+
spec.description = %(Generate and edit standups in markdown format)
|
|
12
|
+
spec.homepage = "https://evanthegrayt.github.io/standup_md/"
|
|
14
13
|
|
|
15
14
|
unless spec.respond_to?(:metadata)
|
|
16
|
-
raise
|
|
17
|
-
|
|
15
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
16
|
+
"public gem pushes."
|
|
18
17
|
end
|
|
19
18
|
|
|
20
|
-
spec.metadata[
|
|
21
|
-
spec.metadata[
|
|
22
|
-
spec.metadata[
|
|
23
|
-
|
|
24
|
-
spec.metadata[
|
|
25
|
-
|
|
19
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
21
|
+
spec.metadata["source_code_uri"] =
|
|
22
|
+
"https://github.com/evanthegrayt/standup_md"
|
|
23
|
+
spec.metadata["documentation_uri"] =
|
|
24
|
+
"https://evanthegrayt.github.io/standup_md/"
|
|
26
25
|
|
|
27
26
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
28
27
|
f.match(%r{^(test|spec|features)/})
|
|
29
28
|
end
|
|
30
|
-
spec.bindir
|
|
31
|
-
spec.executables
|
|
32
|
-
spec.require_paths = [
|
|
33
|
-
spec.add_development_dependency
|
|
34
|
-
spec.add_development_dependency
|
|
35
|
-
spec.add_development_dependency
|
|
29
|
+
spec.bindir = "bin"
|
|
30
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
32
|
+
spec.add_development_dependency "rake", "~> 13.0", ">= 13.0.1"
|
|
33
|
+
spec.add_development_dependency "rdoc"
|
|
34
|
+
spec.add_development_dependency "simplecov"
|
|
35
|
+
spec.add_development_dependency "standard", "~> 1.54.0"
|
|
36
|
+
spec.add_development_dependency "test-unit", "~> 3.3", ">= 3.3.5"
|
|
36
37
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: standup_md
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Evan Gray
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -31,25 +30,19 @@ dependencies:
|
|
|
31
30
|
- !ruby/object:Gem::Version
|
|
32
31
|
version: 13.0.1
|
|
33
32
|
- !ruby/object:Gem::Dependency
|
|
34
|
-
name:
|
|
33
|
+
name: rdoc
|
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
|
36
35
|
requirements:
|
|
37
|
-
- - "~>"
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: '3.3'
|
|
40
36
|
- - ">="
|
|
41
37
|
- !ruby/object:Gem::Version
|
|
42
|
-
version:
|
|
38
|
+
version: '0'
|
|
43
39
|
type: :development
|
|
44
40
|
prerelease: false
|
|
45
41
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
42
|
requirements:
|
|
47
|
-
- - "~>"
|
|
48
|
-
- !ruby/object:Gem::Version
|
|
49
|
-
version: '3.3'
|
|
50
43
|
- - ">="
|
|
51
44
|
- !ruby/object:Gem::Version
|
|
52
|
-
version:
|
|
45
|
+
version: '0'
|
|
53
46
|
- !ruby/object:Gem::Dependency
|
|
54
47
|
name: simplecov
|
|
55
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,6 +57,40 @@ dependencies:
|
|
|
64
57
|
- - ">="
|
|
65
58
|
- !ruby/object:Gem::Version
|
|
66
59
|
version: '0'
|
|
60
|
+
- !ruby/object:Gem::Dependency
|
|
61
|
+
name: standard
|
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
|
63
|
+
requirements:
|
|
64
|
+
- - "~>"
|
|
65
|
+
- !ruby/object:Gem::Version
|
|
66
|
+
version: 1.54.0
|
|
67
|
+
type: :development
|
|
68
|
+
prerelease: false
|
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
70
|
+
requirements:
|
|
71
|
+
- - "~>"
|
|
72
|
+
- !ruby/object:Gem::Version
|
|
73
|
+
version: 1.54.0
|
|
74
|
+
- !ruby/object:Gem::Dependency
|
|
75
|
+
name: test-unit
|
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - "~>"
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '3.3'
|
|
81
|
+
- - ">="
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: 3.3.5
|
|
84
|
+
type: :development
|
|
85
|
+
prerelease: false
|
|
86
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - "~>"
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: '3.3'
|
|
91
|
+
- - ">="
|
|
92
|
+
- !ruby/object:Gem::Version
|
|
93
|
+
version: 3.3.5
|
|
67
94
|
description: Generate and edit standups in markdown format
|
|
68
95
|
email: evanthegrayt@vivaldi.net
|
|
69
96
|
executables:
|
|
@@ -102,7 +129,6 @@ metadata:
|
|
|
102
129
|
homepage_uri: https://evanthegrayt.github.io/standup_md/
|
|
103
130
|
source_code_uri: https://github.com/evanthegrayt/standup_md
|
|
104
131
|
documentation_uri: https://evanthegrayt.github.io/standup_md/
|
|
105
|
-
post_install_message:
|
|
106
132
|
rdoc_options: []
|
|
107
133
|
require_paths:
|
|
108
134
|
- lib
|
|
@@ -117,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
117
143
|
- !ruby/object:Gem::Version
|
|
118
144
|
version: '0'
|
|
119
145
|
requirements: []
|
|
120
|
-
rubygems_version:
|
|
121
|
-
signing_key:
|
|
146
|
+
rubygems_version: 4.0.10
|
|
122
147
|
specification_version: 4
|
|
123
148
|
summary: The cure for all your standup woes
|
|
124
149
|
test_files: []
|