dsu 0.1.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.reek.yml +20 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +192 -0
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +2 -0
  7. data/CODE_OF_CONDUCT.md +84 -0
  8. data/Gemfile +19 -0
  9. data/Gemfile.lock +133 -0
  10. data/LICENSE.txt +21 -0
  11. data/README.md +128 -0
  12. data/Rakefile +12 -0
  13. data/bin/console +15 -0
  14. data/bin/setup +8 -0
  15. data/exe/dsu +11 -0
  16. data/lib/dsu/cli.rb +178 -0
  17. data/lib/dsu/command_services/add_entry_service.rb +61 -0
  18. data/lib/dsu/models/entry.rb +49 -0
  19. data/lib/dsu/models/entry_group.rb +70 -0
  20. data/lib/dsu/services/configuration_loader_service.rb +34 -0
  21. data/lib/dsu/services/entry_group_deleter_service.rb +31 -0
  22. data/lib/dsu/services/entry_group_hydrator_service.rb +43 -0
  23. data/lib/dsu/services/entry_group_reader_service.rb +36 -0
  24. data/lib/dsu/services/entry_group_writer_service.rb +45 -0
  25. data/lib/dsu/services/entry_hydrator_service.rb +35 -0
  26. data/lib/dsu/subcommands/config.rb +49 -0
  27. data/lib/dsu/support/ask.rb +38 -0
  28. data/lib/dsu/support/colorable.rb +13 -0
  29. data/lib/dsu/support/commander/command.rb +130 -0
  30. data/lib/dsu/support/commander/command_help.rb +62 -0
  31. data/lib/dsu/support/commander/subcommand.rb +45 -0
  32. data/lib/dsu/support/configuration.rb +89 -0
  33. data/lib/dsu/support/entry_group_fileable.rb +41 -0
  34. data/lib/dsu/support/entry_group_loadable.rb +52 -0
  35. data/lib/dsu/support/field_errors.rb +11 -0
  36. data/lib/dsu/support/folder_locations.rb +21 -0
  37. data/lib/dsu/support/interactive/cli.rb +161 -0
  38. data/lib/dsu/support/say.rb +40 -0
  39. data/lib/dsu/support/time_formatable.rb +42 -0
  40. data/lib/dsu/validators/entries_validator.rb +64 -0
  41. data/lib/dsu/validators/time_validator.rb +34 -0
  42. data/lib/dsu/version.rb +5 -0
  43. data/lib/dsu/views/entry_group/show.rb +60 -0
  44. data/lib/dsu.rb +38 -0
  45. data/sig/dsu.rbs +4 -0
  46. metadata +199 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 83344cb778f73a92d994326c2ed1e7b807f7cd76b2f8281e21a4595f5a8dda3e
4
+ data.tar.gz: 0d4efd94ab1c8a8030e8ca91479c90102a298fd6562dd70defd76718459819a6
5
+ SHA512:
6
+ metadata.gz: 45cddb27387615f47a8a251dffe678ef16119fb0c04b77eb1312d198f5559f877f20b5d761544995238813ea528548b355c66c5331b83751ea02e813ef79986c
7
+ data.tar.gz: bb5b48f4df258847f54fa66df6f44d3bfbc143531b24bfff538edd48540e80e88a385eb3bdf7cd5c54ada859579ad93f7c61ae2f4e903c579c05b0a484c518c9
data/.reek.yml ADDED
@@ -0,0 +1,20 @@
1
+ exclude_paths:
2
+ - vendor
3
+ - spec
4
+ - scratch*.rb
5
+ - snippets*.rb
6
+ detectors:
7
+ # TooManyInstanceVariables:
8
+ # exclude:
9
+ # - "Class1"
10
+ # - "Class2"
11
+ # private methods do not have to depend on instance state
12
+ # https://github.com/troessner/reek/blob/master/docs/Utility-Function.md
13
+ UtilityFunction:
14
+ public_methods_only: true
15
+ # Check for variable name that doesn't communicate its intent well enough
16
+ # https://github.com/troessner/reek/blob/master/docs/Uncommunicative-Variable-Name.md
17
+ UncommunicativeVariableName:
18
+ accept:
19
+ - /^_$/
20
+ - /^e$/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,192 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 3.0.1
7
+ NewCops: enable
8
+ Exclude:
9
+ - '.git/**/*'
10
+ - '.idea/**/*'
11
+ - 'init/*'
12
+ - 'Rakefile'
13
+ # - '*.gemspec'
14
+ # - 'spec/**/*'
15
+ - 'vendor/**/*'
16
+ - 'scratch*.rb'
17
+ - 'snippets*.rb'
18
+
19
+ # Align the elements of a hash literal if they span more than one line.
20
+ Layout/HashAlignment:
21
+ EnforcedLastArgumentHashStyle: always_ignore
22
+
23
+ # Alignment of parameters in multi-line method definition.
24
+ # The `with_fixed_indentation` style aligns the following lines with one
25
+ # level of indentation relative to the start of the line with the method
26
+ # definition.
27
+ #
28
+ # def my_method(a,
29
+ # b)
30
+ Layout/ParameterAlignment:
31
+ EnforcedStyle: with_fixed_indentation
32
+
33
+ # Alignment of parameters in multi-line method call.
34
+ # The `with_fixed_indentation` style aligns the following lines with one
35
+ # level of indentation relative to the start of the line with the method call.
36
+ #
37
+ # my_method(a,
38
+ # b)
39
+ Layout/ArgumentAlignment:
40
+ EnforcedStyle: with_fixed_indentation
41
+
42
+ # a = case n
43
+ # when 0
44
+ # x * 2
45
+ # else
46
+ # y / 3
47
+ # end
48
+ Layout/CaseIndentation:
49
+ EnforcedStyle: end
50
+
51
+ # Enforces a configured order of definitions within a class body
52
+ Layout/ClassStructure:
53
+ Enabled: true
54
+
55
+ # Align `end` with the matching keyword or starting expression except for
56
+ # assignments, where it should be aligned with the LHS.
57
+ Layout/EndAlignment:
58
+ EnforcedStyleAlignWith: variable
59
+ AutoCorrect: true
60
+
61
+ # The `consistent` style enforces that the first element in an array
62
+ # literal where the opening bracket and the first element are on
63
+ # seprate lines is indented the same as an array literal which is not
64
+ # defined inside a method call.
65
+ Layout/FirstArrayElementIndentation:
66
+ EnforcedStyle: consistent
67
+
68
+ # The `consistent` style enforces that the first key in a hash
69
+ # literal where the opening brace and the first key are on
70
+ # seprate lines is indented the same as a hash literal which is not
71
+ # defined inside a method call.
72
+ Layout/FirstHashElementIndentation:
73
+ EnforcedStyle: consistent
74
+
75
+ # Indent multi-line methods instead of aligning with periods
76
+ Layout/MultilineMethodCallIndentation:
77
+ EnforcedStyle: indented
78
+
79
+ # Allow `debug` in tasks for now
80
+ Lint/Debugger:
81
+ Exclude:
82
+ - 'RakeFile'
83
+
84
+ # A calculated magnitude based on number of assignments, branches, and
85
+ # conditions.
86
+ # NOTE: This is temporarily disabled until we can eliminate existing Rubocop
87
+ # complaints
88
+ Metrics/AbcSize:
89
+ Enabled: false
90
+
91
+ # Avoid long blocks with many lines.
92
+ Metrics/BlockLength:
93
+ Exclude:
94
+ - 'RakeFile'
95
+ - 'db/seeds.rb'
96
+ - 'spec/**/*.rb'
97
+
98
+ # Avoid classes longer than 100 lines of code.
99
+ # NOTE: This is temporarily disabled until we can eliminate existing Rubocop
100
+ # complaints
101
+ Metrics/ClassLength:
102
+ Max: 200
103
+ Exclude:
104
+ - 'spec/**/*.rb'
105
+
106
+ # A complexity metric that is strongly correlated to the number of test cases
107
+ # needed to validate a method.
108
+ Metrics/CyclomaticComplexity:
109
+ Max: 9
110
+
111
+ # Limit lines to 80 characters
112
+ Layout/LineLength:
113
+ Exclude:
114
+ - 'RakeFile'
115
+ - 'spec/**/*.rb'
116
+
117
+ # Avoid methods longer than 15 lines of code.
118
+ Metrics/MethodLength:
119
+ Max: 20
120
+ AllowedMethods:
121
+ - swagger_path
122
+ - operation
123
+
124
+
125
+ # A complexity metric geared towards measuring complexity for a human reader.
126
+ Metrics/PerceivedComplexity:
127
+ Max: 10
128
+
129
+ NestedGroups:
130
+ Max: 4
131
+
132
+ # Naming/FileName:
133
+ # Exclude:
134
+ # - 'lib/file.rb'
135
+
136
+ # Allow `downcase == ` instead of forcing `casecmp`
137
+ Performance/Casecmp:
138
+ Enabled: false
139
+
140
+ # Require children definitions to be nested or compact in classes and modules
141
+ Style/ClassAndModuleChildren:
142
+ Enabled: false
143
+
144
+ # Document classes and non-namespace modules.
145
+ # (Disabled for now, may revisit later)
146
+ Style/Documentation:
147
+ Enabled: false
148
+
149
+ # Checks the formatting of empty method definitions.
150
+ Style/EmptyMethod:
151
+ EnforcedStyle: expanded
152
+
153
+ # Add the frozen_string_literal comment to the top of files to help transition
154
+ # to frozen string literals by default.
155
+ Style/FrozenStringLiteralComment:
156
+ EnforcedStyle: always
157
+
158
+ # Check for conditionals that can be replaced with guard clauses
159
+ Style/GuardClause:
160
+ Enabled: false
161
+
162
+ Style/MixinUsage:
163
+ Exclude:
164
+ - 'RakeFile'
165
+
166
+ # Avoid multi-line method signatures.
167
+ Style/MultilineMethodSignature:
168
+ Enabled: true
169
+
170
+ # Don't use option hashes when you can use keyword arguments.
171
+ Style/OptionHash:
172
+ Enabled: true
173
+
174
+ # Use return instead of return nil.
175
+ Style/ReturnNil:
176
+ Enabled: true
177
+
178
+ # Allow code like `return x, y` as it's occasionally handy.
179
+ Style/RedundantReturn:
180
+ AllowMultipleReturnValues: true
181
+
182
+ # Prefer symbols instead of strings as hash keys.
183
+ Style/StringHashKeys:
184
+ Enabled: true
185
+
186
+ # Checks if configured preferred methods are used over non-preferred.
187
+ Style/StringMethods:
188
+ Enabled: true
189
+
190
+ # Checks for use of parentheses around ternary conditions.
191
+ Style/TernaryParentheses:
192
+ EnforcedStyle: require_parentheses_when_complex
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.1
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ ## [0.1.0.alpha.1] - 2023-05-06
2
+ - Initial (alpha) release. See README.md for instructions.
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at web.gma@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in dsu.gemspec
6
+ gemspec
7
+
8
+ gem 'rake', '~> 13.0'
9
+ gem 'rspec', '~> 3.0'
10
+ gem 'rubocop', '~> 1.50', '>= 1.50.2'
11
+ gem 'rubocop-performance', '~> 1.17', '>= 1.17.1'
12
+ gem 'rubocop-rspec', '~> 2.20'
13
+ gem 'dotenv', '~> 2.8', '>= 2.8.1'
14
+
15
+ gem 'factory_bot', '~> 6.2', '>= 6.2.1'
16
+ gem 'ffaker', '~> 2.21'
17
+ gem 'pry-byebug', '~> 3.9'
18
+ gem 'reek', '~> 6.1', '>= 6.1.1'
19
+ gem 'simplecov', '~> 0.21.2'
data/Gemfile.lock ADDED
@@ -0,0 +1,133 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ dsu (0.1.0.alpha.1)
5
+ activesupport (~> 7.0, >= 7.0.4)
6
+ colorize (~> 0.8.1)
7
+ deco_lite (~> 1.3)
8
+ os (~> 1.1, >= 1.1.4)
9
+ thor (~> 1.2, >= 1.2.1)
10
+ thor_nested_subcommand (~> 1.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ activemodel (7.0.4.3)
16
+ activesupport (= 7.0.4.3)
17
+ activesupport (7.0.4.3)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 1.6, < 2)
20
+ minitest (>= 5.1)
21
+ tzinfo (~> 2.0)
22
+ ast (2.4.2)
23
+ byebug (11.1.3)
24
+ coderay (1.1.3)
25
+ colorize (0.8.1)
26
+ concurrent-ruby (1.2.2)
27
+ deco_lite (1.5.3)
28
+ activemodel (~> 7.0, >= 7.0.3.1)
29
+ activesupport (~> 7.0, >= 7.0.3.1)
30
+ immutable_struct_ex (~> 0.2.0)
31
+ mad_flatter (~> 2.0)
32
+ diff-lcs (1.5.0)
33
+ docile (1.4.0)
34
+ dotenv (2.8.1)
35
+ factory_bot (6.2.1)
36
+ activesupport (>= 5.0.0)
37
+ ffaker (2.21.0)
38
+ i18n (1.13.0)
39
+ concurrent-ruby (~> 1.0)
40
+ immutable_struct_ex (0.2.3)
41
+ json (2.6.3)
42
+ kwalify (0.7.2)
43
+ mad_flatter (2.0.0)
44
+ activesupport (~> 7.0, >= 7.0.3.1)
45
+ immutable_struct_ex (~> 0.2.0)
46
+ method_source (1.0.0)
47
+ minitest (5.18.0)
48
+ os (1.1.4)
49
+ parallel (1.23.0)
50
+ parser (3.2.2.1)
51
+ ast (~> 2.4.1)
52
+ pry (0.14.2)
53
+ coderay (~> 1.1)
54
+ method_source (~> 1.0)
55
+ pry-byebug (3.10.1)
56
+ byebug (~> 11.0)
57
+ pry (>= 0.13, < 0.15)
58
+ rainbow (3.1.1)
59
+ rake (13.0.6)
60
+ reek (6.1.4)
61
+ kwalify (~> 0.7.0)
62
+ parser (~> 3.2.0)
63
+ rainbow (>= 2.0, < 4.0)
64
+ regexp_parser (2.8.0)
65
+ rexml (3.2.5)
66
+ rspec (3.12.0)
67
+ rspec-core (~> 3.12.0)
68
+ rspec-expectations (~> 3.12.0)
69
+ rspec-mocks (~> 3.12.0)
70
+ rspec-core (3.12.2)
71
+ rspec-support (~> 3.12.0)
72
+ rspec-expectations (3.12.3)
73
+ diff-lcs (>= 1.2.0, < 2.0)
74
+ rspec-support (~> 3.12.0)
75
+ rspec-mocks (3.12.5)
76
+ diff-lcs (>= 1.2.0, < 2.0)
77
+ rspec-support (~> 3.12.0)
78
+ rspec-support (3.12.0)
79
+ rubocop (1.50.2)
80
+ json (~> 2.3)
81
+ parallel (~> 1.10)
82
+ parser (>= 3.2.0.0)
83
+ rainbow (>= 2.2.2, < 4.0)
84
+ regexp_parser (>= 1.8, < 3.0)
85
+ rexml (>= 3.2.5, < 4.0)
86
+ rubocop-ast (>= 1.28.0, < 2.0)
87
+ ruby-progressbar (~> 1.7)
88
+ unicode-display_width (>= 2.4.0, < 3.0)
89
+ rubocop-ast (1.28.1)
90
+ parser (>= 3.2.1.0)
91
+ rubocop-capybara (2.18.0)
92
+ rubocop (~> 1.41)
93
+ rubocop-factory_bot (2.22.0)
94
+ rubocop (~> 1.33)
95
+ rubocop-performance (1.17.1)
96
+ rubocop (>= 1.7.0, < 2.0)
97
+ rubocop-ast (>= 0.4.0)
98
+ rubocop-rspec (2.22.0)
99
+ rubocop (~> 1.33)
100
+ rubocop-capybara (~> 2.17)
101
+ rubocop-factory_bot (~> 2.22)
102
+ ruby-progressbar (1.13.0)
103
+ simplecov (0.21.2)
104
+ docile (~> 1.1)
105
+ simplecov-html (~> 0.11)
106
+ simplecov_json_formatter (~> 0.1)
107
+ simplecov-html (0.12.3)
108
+ simplecov_json_formatter (0.1.4)
109
+ thor (1.2.1)
110
+ thor_nested_subcommand (1.0.0)
111
+ tzinfo (2.0.6)
112
+ concurrent-ruby (~> 1.0)
113
+ unicode-display_width (2.4.2)
114
+
115
+ PLATFORMS
116
+ x86_64-darwin-19
117
+
118
+ DEPENDENCIES
119
+ dotenv (~> 2.8, >= 2.8.1)
120
+ dsu!
121
+ factory_bot (~> 6.2, >= 6.2.1)
122
+ ffaker (~> 2.21)
123
+ pry-byebug (~> 3.9)
124
+ rake (~> 13.0)
125
+ reek (~> 6.1, >= 6.1.1)
126
+ rspec (~> 3.0)
127
+ rubocop (~> 1.50, >= 1.50.2)
128
+ rubocop-performance (~> 1.17, >= 1.17.1)
129
+ rubocop-rspec (~> 2.20)
130
+ simplecov (~> 0.21.2)
131
+
132
+ BUNDLED WITH
133
+ 2.3.22
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 gangelo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,128 @@
1
+ # `dsu` (alpha)
2
+
3
+ [![GitHub version](http://badge.fury.io/gh/gangelo%2Fdsu.svg)](https://badge.fury.io/gh/gangelo%2Fdsu)
4
+ [![Gem Version](https://badge.fury.io/rb/dsu.svg)](https://badge.fury.io/rb/dsu)
5
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/dsu/)
6
+ [![Report Issues](https://img.shields.io/badge/report-issues-red.svg)](https://github.com/gangelo/dsu/issues)
7
+ [![License](http://img.shields.io/badge/license-MIT-yellowgreen.svg)](#license)
8
+
9
+ ## About
10
+ `dsu` is little gem that helps manage your Agile DSU (Daily Stand Up) participation. How? by providing a simple command line interface (CLI) which allows you to create, read, update, and delete (CRUD) noteworthy activities that you performed during your day. During your DSU, you can then easily recall and share these these activities with your team. Activities are grouped by day and can be viewed in simple text format from the command line. When viewing a particular day, dsu will automatically display the previous day's activities as well. This is useful for remembering what you did yesterday, so you can share your "Today" and "Yesterday" activities with your team during your DSU.
11
+
12
+ **NOTE:** This gem is in development (alpha version). Please see the [WIP Notes](#wip-notes) section for current `dsu` features.
13
+
14
+ ## Quick Start
15
+
16
+ After installation (`gem install dsu`), the first thing you may want to do is run the `dsu` help:
17
+ ### Displaying Help
18
+ `$ dsu` or `$ dsu help`
19
+ ```shell
20
+ #=>
21
+ Commands:
22
+ dsu --version, -v # Displays...
23
+ dsu add [OPTIONS] DESCRIPTION [LONG-DESCRIPTION] # Adds a dsu entry...
24
+ dsu config SUBCOMMAND # Manage...
25
+ dsu help [COMMAND] # Describe...
26
+ dsu today # Displays...
27
+ dsu tomorrow # Displays...
28
+ dsu yesterday # Displays...
29
+
30
+ Options:
31
+ [--debug], [--no-debug]
32
+ ```
33
+
34
+ The next thing you may want to do is add some DSU activities (entries) for a particular day:
35
+
36
+ ### Adding DSU Entries
37
+ `dsu add [OPTIONS] DESCRIPTION [LONG-DESCRIPTION]`
38
+
39
+ Adding DSU entry using this command will _add_ the DSU entry for the given day (or date, `-d`), and also _display_ the given day's (or date's, `-d`) DSU entries, as well as the DSU entries for the previous day relative to the given day or date (`-d`).
40
+
41
+ #### Today
42
+ If you need to add a DSU entry to the current day (today), you can use the `-t, [--today]` option. Today (`-t`) is the default; therefore, the `-t` flag is optional when adding DSU entries for the current day:
43
+
44
+ `$ dsu add [-t] "Pair with John on ticket IN-12345"`
45
+
46
+ #### Yesterday
47
+ If for some reason you need to add a DSU entry for the previous day, you can use the `-p, [--previous-day]` option:
48
+
49
+ `$ dsu add -p "Pick up ticket IN-12345"`
50
+
51
+ #### Tomorrow
52
+ If you need to add a DSU entry for the previous day, you can use the `-n, [--next-day]` option:
53
+
54
+ `$ dsu add -n "Pick up ticket IN-12345"`
55
+
56
+ #### Miscellaneous Date
57
+ If you need to add a DSU entry for a date other than yesterday, today or tomorrow, you can use the `-d, [--date=DATE]` option, where DATE is any date string that can be parsed using `Time.parse`. For example: `require 'time'; Time.parse("2023-01-01")`:
58
+
59
+ `$ dsu add -d "2022-12-31" "Attend company New Years Coffee Meet & Greet"`
60
+
61
+ ### Display DSU Entries
62
+ You can display DSU entries for a particular day or date (`date`) using any of the following commands. When displaying DSU entries for a particular day or date (`date`), `dsu` will display the given day or date's (`date`) DSU entries, as well as the DSU entries for the _previous_ day, relative to the given day or date (see [WIP Notes](#wip-notes) for caveats when displaying DSU entries for a particular day or date):
63
+
64
+ `dsu today`
65
+ `dsu tomorrow`
66
+ `dsu yesterday`
67
+ `dsu date`
68
+
69
+ #### Examples
70
+ The following displays the entries for "Today", where `Time.now == '2023-05-06 08:54:57.6861 -0400'`
71
+
72
+ `$ dsu today`
73
+ ```shell
74
+ #=>
75
+ Saturday, (Today) 2023-05-06
76
+ 1. 587a2f29 Blocked for locally failing test IN-12345
77
+ Hope to pair with John on it
78
+
79
+ Friday, (Yesterday) 2023-05-05
80
+ 1. edc25a9a Pick up ticket IN-12345
81
+ 2. f7d3018c Attend new hire meet & greet
82
+ ```
83
+
84
+ `$ dsu date "2023-05-06"`
85
+ ```shell
86
+ #=>
87
+ Saturday, (Today) 2023-05-06
88
+ 1. 587a2f29 Blocked for locally failing test IN-12345
89
+ Hope to pair with John on it
90
+
91
+ Friday, (Yesterday) 2023-05-05
92
+ 1. edc25a9a Pick up ticket IN-12345
93
+ 2. f7d3018c Attend new hire meet & greet
94
+ ```
95
+
96
+
97
+ ## WIP Notes
98
+ This gem is in development (alpha release) and currently does not provide the ability to UPDATE or DELETE activities. These features will be added in future releases.
99
+
100
+ In addition to this...
101
+
102
+ `dsu`'s current behavior when viewing a particular day is to display the _previous_ day's activities. This behavior is not necessarily ideal when sharing activities for a DSU that occurs on a Monday. This is because Monday's DSU typically includes sharing what you did on last FRIDAY (not necessarily "Yesterday"), as well as what you plan on doing "Today". This behavior will be changed in a future release to display the previous Friday's activities (as well as Saturday and Sunday) if "Today" happens to fall on a Monday.
103
+
104
+ ## Installation
105
+
106
+ $ gem install dsu
107
+
108
+ ## Usage
109
+
110
+ TODO: Write usage instructions here (see the [Quick Start](#quick-start) for now)
111
+
112
+ ## Development
113
+
114
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
115
+
116
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
117
+
118
+ ## Contributing
119
+
120
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dsu. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/dsu/blob/main/CODE_OF_CONDUCT.md).
121
+
122
+ ## License
123
+
124
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
125
+
126
+ ## Code of Conduct
127
+
128
+ Everyone interacting in the Dsu project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/dsu/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'dsu'
6
+
7
+
8
+ require 'pry-byebug'
9
+
10
+ # So we can use FactoryBot in the console.
11
+ require 'factory_bot'
12
+ require 'ffaker'
13
+ FactoryBot.find_definitions
14
+
15
+ Pry.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/exe/dsu ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'rubygems'
5
+
6
+ lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
7
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
8
+
9
+ require 'dsu'
10
+
11
+ Dsu::CLI.start