standup_md 0.3.6 → 0.3.11
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/Gemfile.lock +1 -1
- data/README.md +9 -20
- data/doc/README_md.html +9 -22
- data/doc/StandupMD.html +14 -85
- data/doc/StandupMD/Cli.html +17 -159
- data/doc/StandupMD/Cli/Helpers.html +5 -27
- data/doc/StandupMD/Config.html +7 -44
- data/doc/StandupMD/Config/Cli.html +8 -76
- data/doc/StandupMD/Config/Entry.html +8 -64
- data/doc/StandupMD/Config/EntryList.html +7 -48
- data/doc/StandupMD/Config/File.html +11 -143
- data/doc/StandupMD/Entry.html +22 -133
- data/doc/StandupMD/EntryList.html +16 -198
- data/doc/StandupMD/File.html +31 -165
- data/doc/StandupMD/Version.html +63 -40
- data/doc/created.rid +9 -9
- data/doc/css/rdoc.css +1 -1
- data/doc/index.html +9 -36
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +42 -94
- data/lib/standup_md.rb +8 -5
- data/lib/standup_md/cli.rb +7 -7
- data/lib/standup_md/cli/helpers.rb +10 -13
- data/lib/standup_md/config/file.rb +3 -3
- data/lib/standup_md/entry.rb +7 -9
- data/lib/standup_md/entry_list.rb +2 -2
- data/lib/standup_md/version.rb +26 -4
- metadata +2 -2
data/lib/standup_md.rb
CHANGED
@@ -17,7 +17,7 @@ module StandupMD
|
|
17
17
|
#
|
18
18
|
# @return [StanupMD::Cli]
|
19
19
|
def self.config
|
20
|
-
@config
|
20
|
+
@config || reset_config
|
21
21
|
end
|
22
22
|
|
23
23
|
##
|
@@ -49,11 +49,14 @@ module StandupMD
|
|
49
49
|
# Loads a config file.
|
50
50
|
#
|
51
51
|
# @param [String] file
|
52
|
+
#
|
53
|
+
# @return [String] file
|
52
54
|
def self.load_config_file(file)
|
53
|
-
|
54
|
-
|
55
|
+
::File.expand_path(file).tap do |file|
|
56
|
+
raise "File #{file} does not exist." unless ::File.file?(file)
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
+
@config_file_loaded = true
|
59
|
+
load file
|
60
|
+
end
|
58
61
|
end
|
59
62
|
end
|
data/lib/standup_md/cli.rb
CHANGED
@@ -28,13 +28,13 @@ module StandupMD
|
|
28
28
|
##
|
29
29
|
# Creates an instance of +StandupMD+ and runs what the user requested.
|
30
30
|
def self.execute(options = [])
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
new(options).tap do |exe|
|
32
|
+
exe.write_file if config.write
|
33
|
+
if config.print
|
34
|
+
exe.print(exe.entry)
|
35
|
+
elsif config.edit
|
36
|
+
exe.edit
|
37
|
+
end
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -125,25 +125,22 @@ module StandupMD
|
|
125
125
|
# @return [StandupMD::Entry]
|
126
126
|
def new_entry(file)
|
127
127
|
entry = file.entries.find(config.cli.date)
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
file.entries << entry
|
138
|
-
end
|
139
|
-
entry
|
128
|
+
return entry unless entry.nil? && config.cli.date == Date.today
|
129
|
+
|
130
|
+
StandupMD::Entry.new(
|
131
|
+
config.cli.date,
|
132
|
+
config.entry.current,
|
133
|
+
previous_entry(file),
|
134
|
+
config.entry.impediments,
|
135
|
+
config.entry.notes
|
136
|
+
).tap { |entry| file.entries << entry }
|
140
137
|
end
|
141
138
|
|
142
139
|
##
|
143
140
|
# The "previous" entries.
|
144
141
|
#
|
145
142
|
# @return [Array]
|
146
|
-
def
|
143
|
+
def previous_entry(file)
|
147
144
|
return config.entry.previous_entry unless config.cli.auto_fill_previous
|
148
145
|
|
149
146
|
return prev_entry(prev_file.load.entries) if file.new? && prev_file
|
@@ -200,9 +200,9 @@ module StandupMD
|
|
200
200
|
#
|
201
201
|
# @return [String]
|
202
202
|
def directory=(directory)
|
203
|
-
directory = ::File.expand_path(directory)
|
204
|
-
|
205
|
-
|
203
|
+
@directory = ::File.expand_path(directory).tap do |directory|
|
204
|
+
FileUtils.mkdir_p(directory) unless ::File.directory?(directory)
|
205
|
+
end
|
206
206
|
end
|
207
207
|
end
|
208
208
|
end
|
data/lib/standup_md/entry.rb
CHANGED
@@ -55,15 +55,13 @@ module StandupMD
|
|
55
55
|
#
|
56
56
|
# @return [StandupMD::Entry]
|
57
57
|
def self.create
|
58
|
-
|
58
|
+
new(
|
59
59
|
Date.today,
|
60
60
|
config.current,
|
61
61
|
config.previous,
|
62
62
|
config.impediments,
|
63
63
|
config.notes
|
64
|
-
)
|
65
|
-
yield config if block_given?
|
66
|
-
entry
|
64
|
+
).tap { |entry| yield entry if block_given? }
|
67
65
|
end
|
68
66
|
|
69
67
|
##
|
@@ -82,11 +80,11 @@ module StandupMD
|
|
82
80
|
raise unless date.is_a?(Date)
|
83
81
|
@config = self.class.config
|
84
82
|
|
85
|
-
@date
|
86
|
-
@current
|
87
|
-
@previous
|
88
|
-
@impediments
|
89
|
-
@notes
|
83
|
+
@date = date
|
84
|
+
@current = current
|
85
|
+
@previous = previous
|
86
|
+
@impediments = impediments
|
87
|
+
@notes = notes
|
90
88
|
end
|
91
89
|
|
92
90
|
##
|
@@ -26,7 +26,7 @@ module StandupMD
|
|
26
26
|
def initialize(*entries)
|
27
27
|
@config = self.class.config
|
28
28
|
unless entries.all? { |e| e.is_a?(StandupMD::Entry) }
|
29
|
-
raise ArgumentError, 'Entry must instance of StandupMD::Entry'
|
29
|
+
raise ArgumentError, 'Entry must be an instance of StandupMD::Entry'
|
30
30
|
end
|
31
31
|
@entries = entries
|
32
32
|
end
|
@@ -39,7 +39,7 @@ module StandupMD
|
|
39
39
|
# @return [Array]
|
40
40
|
def <<(entry)
|
41
41
|
unless entry.is_a?(StandupMD::Entry)
|
42
|
-
raise ArgumentError, 'Entry must instance of StandupMD::Entry'
|
42
|
+
raise ArgumentError, 'Entry must be an instance of StandupMD::Entry'
|
43
43
|
end
|
44
44
|
@entries << entry
|
45
45
|
end
|
data/lib/standup_md/version.rb
CHANGED
@@ -1,28 +1,50 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module StandupMD
|
4
|
-
|
5
4
|
##
|
6
5
|
# Module that contains all gem version information. Follows semantic
|
7
6
|
# versioning. Read: https://semver.org/
|
8
7
|
module Version
|
9
|
-
|
10
8
|
##
|
11
9
|
# Major version.
|
10
|
+
#
|
11
|
+
# @return [Integer]
|
12
12
|
MAJOR = 0
|
13
13
|
|
14
14
|
##
|
15
15
|
# Minor version.
|
16
|
+
#
|
17
|
+
# @return [Integer]
|
16
18
|
MINOR = 3
|
17
19
|
|
18
20
|
##
|
19
21
|
# Patch version.
|
20
|
-
|
22
|
+
#
|
23
|
+
# @return [Integer]
|
24
|
+
PATCH = 11
|
25
|
+
|
26
|
+
##
|
27
|
+
# Version as +[MAJOR, MINOR, PATCH]+
|
28
|
+
#
|
29
|
+
# @return [Array]
|
30
|
+
def self.to_a
|
31
|
+
[MAJOR, MINOR, PATCH]
|
32
|
+
end
|
21
33
|
|
22
34
|
##
|
23
35
|
# Version as +MAJOR.MINOR.PATCH+
|
36
|
+
#
|
37
|
+
# @return [String]
|
24
38
|
def self.to_s
|
25
|
-
|
39
|
+
to_a.join('.')
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Version as +{major: MAJOR, minor: MINOR, patch: PATCH}+
|
44
|
+
#
|
45
|
+
# @return [Hash]
|
46
|
+
def self.to_h
|
47
|
+
Hash[%i[major minor patch].zip(to_a)]
|
26
48
|
end
|
27
49
|
end
|
28
50
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Gray
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|