standup_md 0.2.1 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module StandupMD
4
+ class File
5
+
6
+ ##
7
+ # Module responsible for reading and writing standup files.
8
+ module Helpers # :nodoc:
9
+
10
+ private
11
+
12
+ def is_header?(line) # :nodoc:
13
+ line.match(header_regex)
14
+ end
15
+
16
+ def is_sub_header?(line) # :nodoc:
17
+ line.match(sub_header_regex)
18
+ end
19
+
20
+ def header_regex # :nodoc:
21
+ %r{^#{'#' * StandupMD.config.file.header_depth}\s+}
22
+ end
23
+
24
+ def sub_header_regex # :nodoc:
25
+ %r{^#{'#' * StandupMD.config.file.sub_header_depth}\s+}
26
+ end
27
+
28
+ def bullet_character_regex # :nodoc:
29
+ %r{\s*#{StandupMD.config.file.bullet_character}\s*}
30
+ end
31
+
32
+ def determine_section_type(line) # :nodoc:
33
+ line = line.sub(%r{^\#{#{StandupMD.config.file.sub_header_depth}}\s*}, '')
34
+ [
35
+ StandupMD.config.file.current_header,
36
+ StandupMD.config.file.previous_header,
37
+ StandupMD.config.file.impediments_header,
38
+ StandupMD.config.file.notes_header
39
+ ].each { |header| return header if line.include?(header) }
40
+ raise "Unrecognized header [#{line}]"
41
+ end
42
+
43
+ def new_entry(record) # :nodoc:
44
+ Entry.new(
45
+ Date.strptime(record['header'], StandupMD.config.file.header_date_format),
46
+ record[StandupMD.config.file.current_header],
47
+ record[StandupMD.config.file.previous_header],
48
+ record[StandupMD.config.file.impediments_header],
49
+ record[StandupMD.config.file.notes_header]
50
+ )
51
+ end
52
+
53
+ def header(date)
54
+ '#' * StandupMD.config.file.header_depth + ' ' + date.strftime(StandupMD.config.file.header_date_format)
55
+ end
56
+
57
+ def sub_header(sh)
58
+ '#' * StandupMD.config.file.sub_header_depth + ' ' + sh
59
+ end
60
+ end
61
+ end
62
+ end
@@ -1,9 +1,9 @@
1
- class StandupMD
1
+ # frozen_string_literal: true
2
+
3
+ module StandupMD
2
4
  ##
3
5
  # The gem verision
4
6
  #
5
- # @example
6
- # StandupMD::VERSION
7
- # # => '0.2.1'
8
- VERSION = '0.2.1'
7
+ # @return [String]
8
+ VERSION = '0.3.4'
9
9
  end
@@ -36,4 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.require_paths = ['lib']
37
37
  spec.add_development_dependency 'rake', '~> 13.0', '>= 13.0.1'
38
38
  spec.add_development_dependency 'test-unit', '~> 3.3', '>= 3.3.5'
39
+ spec.add_development_dependency 'simplecov'
39
40
  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.2.1
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Gray
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-03 00:00:00.000000000 Z
11
+ date: 2020-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -50,6 +50,20 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 3.3.5
53
+ - !ruby/object:Gem::Dependency
54
+ name: simplecov
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
53
67
  description: Generate and edit standups in markdown format
54
68
  email: evanthegrayt@vivaldi.net
55
69
  executables:
@@ -69,6 +83,15 @@ files:
69
83
  - doc/README_md.html
70
84
  - doc/StandupMD.html
71
85
  - doc/StandupMD/Cli.html
86
+ - doc/StandupMD/Cli/Helpers.html
87
+ - doc/StandupMD/Config.html
88
+ - doc/StandupMD/Config/Cli.html
89
+ - doc/StandupMD/Config/Entry.html
90
+ - doc/StandupMD/Config/EntryList.html
91
+ - doc/StandupMD/Config/File.html
92
+ - doc/StandupMD/Entry.html
93
+ - doc/StandupMD/EntryList.html
94
+ - doc/StandupMD/File.html
72
95
  - doc/created.rid
73
96
  - doc/css/fonts.css
74
97
  - doc/css/rdoc.css
@@ -115,6 +138,16 @@ files:
115
138
  - doc/table_of_contents.html
116
139
  - lib/standup_md.rb
117
140
  - lib/standup_md/cli.rb
141
+ - lib/standup_md/cli/helpers.rb
142
+ - lib/standup_md/config.rb
143
+ - lib/standup_md/config/cli.rb
144
+ - lib/standup_md/config/entry.rb
145
+ - lib/standup_md/config/entry_list.rb
146
+ - lib/standup_md/config/file.rb
147
+ - lib/standup_md/entry.rb
148
+ - lib/standup_md/entry_list.rb
149
+ - lib/standup_md/file.rb
150
+ - lib/standup_md/file/helpers.rb
118
151
  - lib/standup_md/version.rb
119
152
  - standup_md.gemspec
120
153
  homepage: https://evanthegrayt.github.io/standup_md/