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.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/ruby.yml +24 -0
  3. data/.gitignore +1 -0
  4. data/Gemfile +10 -0
  5. data/Gemfile.lock +23 -0
  6. data/LICENSE +21 -0
  7. data/README.md +252 -0
  8. data/Rakefile +36 -0
  9. data/_config.yml +1 -0
  10. data/bin/standup +5 -0
  11. data/doc/README_md.html +290 -0
  12. data/doc/StandupMD/Cli.html +898 -0
  13. data/doc/StandupMD.html +1453 -0
  14. data/doc/TestHelper.html +282 -0
  15. data/doc/TestStandupMD.html +1938 -0
  16. data/doc/created.rid +8 -0
  17. data/doc/css/fonts.css +167 -0
  18. data/doc/css/rdoc.css +611 -0
  19. data/doc/fonts/Lato-Light.ttf +0 -0
  20. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  21. data/doc/fonts/Lato-Regular.ttf +0 -0
  22. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  23. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  24. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  25. data/doc/images/add.png +0 -0
  26. data/doc/images/arrow_up.png +0 -0
  27. data/doc/images/brick.png +0 -0
  28. data/doc/images/brick_link.png +0 -0
  29. data/doc/images/bug.png +0 -0
  30. data/doc/images/bullet_black.png +0 -0
  31. data/doc/images/bullet_toggle_minus.png +0 -0
  32. data/doc/images/bullet_toggle_plus.png +0 -0
  33. data/doc/images/date.png +0 -0
  34. data/doc/images/delete.png +0 -0
  35. data/doc/images/find.png +0 -0
  36. data/doc/images/loadingAnimation.gif +0 -0
  37. data/doc/images/macFFBgHack.png +0 -0
  38. data/doc/images/package.png +0 -0
  39. data/doc/images/page_green.png +0 -0
  40. data/doc/images/page_white_text.png +0 -0
  41. data/doc/images/page_white_width.png +0 -0
  42. data/doc/images/plugin.png +0 -0
  43. data/doc/images/ruby.png +0 -0
  44. data/doc/images/tag_blue.png +0 -0
  45. data/doc/images/tag_green.png +0 -0
  46. data/doc/images/transparent.png +0 -0
  47. data/doc/images/wrench.png +0 -0
  48. data/doc/images/wrench_orange.png +0 -0
  49. data/doc/images/zoom.png +0 -0
  50. data/doc/index.html +286 -0
  51. data/doc/js/darkfish.js +84 -0
  52. data/doc/js/navigation.js +105 -0
  53. data/doc/js/navigation.js.gz +0 -0
  54. data/doc/js/search.js +110 -0
  55. data/doc/js/search_index.js +1 -0
  56. data/doc/js/search_index.js.gz +0 -0
  57. data/doc/js/searcher.js +229 -0
  58. data/doc/js/searcher.js.gz +0 -0
  59. data/doc/table_of_contents.html +551 -0
  60. data/lib/standup_md/cli.rb +301 -0
  61. data/lib/standup_md/version.rb +9 -0
  62. data/lib/standup_md.rb +530 -0
  63. data/standup_md.gemspec +36 -0
  64. metadata +108 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 41221176dbfd0d5ddc136c700dd2313e3fc618efae2d4b2409df1849192889b4
4
+ data.tar.gz: 37fb6ac0435984844f76b922b88628a06b4f56bf48052a0337248bb3505edb2d
5
+ SHA512:
6
+ metadata.gz: cf13b24ef59d5a34723ec422ff37ebcbc465ab98e2ec31a86a6ab870c071ae229b86850851cbba69615f5be31c722edb87ee8bd072804febf0a3f1eeaada109e
7
+ data.tar.gz: f18d79f594db85ad16acdd11ded9412dfe4cbb4d65c8293a977f980fcb20c8e56f14e27a48e5c908daf15d781004a86cdf6bcbe48e469479c3def51ab17fed76
@@ -0,0 +1,24 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby 2.6
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: 2.6.x
20
+ - name: Build and test with Rake
21
+ run: |
22
+ gem install bundler
23
+ bundle install
24
+ bundle exec rake test
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ standup_md-*.gem
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
6
+
7
+ gemspec
8
+
9
+ gem "rake"
10
+ gem 'test-unit'
data/Gemfile.lock ADDED
@@ -0,0 +1,23 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ standup_md (0.0.10)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ power_assert (1.2.0)
10
+ rake (13.0.1)
11
+ test-unit (3.3.5)
12
+ power_assert
13
+
14
+ PLATFORMS
15
+ ruby
16
+
17
+ DEPENDENCIES
18
+ rake
19
+ standup_md!
20
+ test-unit
21
+
22
+ BUNDLED WITH
23
+ 1.17.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Evan Gray
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,252 @@
1
+ # [The Standup Doctor](https://evanthegrayt.github.io/standup_md/)
2
+ > The cure for all your standup woes.
3
+
4
+ A highly customizable and automated way to keep track of daily standups in
5
+ markdown files.
6
+
7
+ ## Table of Contents
8
+ - [About](#about)
9
+ - [Installation](#Installation)
10
+ - [Via RubyGems](#via-rubygems)
11
+ - [Manual Installation](#manual-installation)
12
+ - [Usage](#usage)
13
+ - [Example](#example)
14
+ - [Customization and Runtime Options](#customization-and-runtime-options)
15
+ - [API](#api)
16
+ - [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
17
+ - [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
18
+ - [Self-Promotion](#self-promotion)
19
+
20
+ ## About
21
+ I've now been at two separate companies where we post our daily standups in a
22
+ chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
23
+ became tedious, as I'd have to look up what I did the day before, copy and paste
24
+ yesterday's work into a new entry, and add today's tasks. This gem automates
25
+ most of this process, along with providing means of opening the file in your
26
+ editor, and displaying entries from the command line.
27
+
28
+ I wasn't sure that others would find this useful, but then the pandemic
29
+ happened, which I assume made doing standups via chat much more common.
30
+
31
+ In a nutshell, calling `standup` from the command line will open a standup file
32
+ for the current month in your preferred editor. If an entry for today is already
33
+ present, no text will be generated. If an entry for today doesn't exist, one
34
+ will be generated, and if a previous entry exists, it will be added to today's
35
+ entry as what your previous day's work. See [example](#example). There's also an
36
+ API if you'd like to use this in your own code somehow.
37
+
38
+ This is a new project, and I have a lot of [updates
39
+ planned](https://github.com/evanthegrayt/standup_md/issues), but I won't push
40
+ to `master` unless all
41
+ [tests](https://github.com/evanthegrayt/standup_md/blob/master/test/standup_md_test.rb)
42
+ are passing and the gem is working as expected. The first official release will
43
+ be once [this milestone](https://github.com/evanthegrayt/standup_md/milestone/1)
44
+ is complete. Until then, consider this gem to be in alpha, and the version will
45
+ remain `< 0.1.0`.
46
+
47
+ ## Installation
48
+ ### Via RubyGems
49
+ *COMING SOON. For now, please use the [manual installation
50
+ instructions](#manual-installation). The gem will be officially released once
51
+ [this milestone](https://github.com/evanthegrayt/standup_md/milestone/1) is
52
+ completed*.
53
+
54
+ <!-- Just install the gem! -->
55
+
56
+ <!-- ```sh -->
57
+ <!-- gem install standup_md -->
58
+ <!-- ``` -->
59
+ <!-- If you don't have permission on your system to install ruby or gems, I recommend -->
60
+ <!-- using [rvm](https://rvm.io/) or -->
61
+ <!-- [rbenv](http://www.rubyinside.com/rbenv-a-simple-new-ruby-version-management-tool-5302.html), -->
62
+ <!-- or you can try to use a manual method below. -->
63
+
64
+
65
+ ### Manual Installation
66
+ From your terminal, clone the repository where you want it. From there, you have
67
+ a couple of installation options.
68
+
69
+ ```sh
70
+ git clone https://github.com/evanthegrayt/standup_md.git
71
+ cd standup_md
72
+
73
+ # Use rake to build and install the gem.
74
+ rake install
75
+
76
+ # OR manually link the executable somewhere. If you use this method, you cannot
77
+ # move the repository after you link it!
78
+ ln -s $PWD/bin/standup /usr/local/bin
79
+ ```
80
+
81
+ ## Usage
82
+ Call the executable.
83
+
84
+ ```sh
85
+ standup
86
+ ```
87
+
88
+ This opens the current month's standup file. If an entry already exists for
89
+ today, nothing is added. If no entry exists for today, the previous "Current" is
90
+ placed in the "Previous" section of a new entry. The format of this file is
91
+ very important; do not change anything, except for adding entries for today.
92
+
93
+ ### Example
94
+ For example, if the standup entry from yesterday reads as follows:
95
+
96
+ ```markdown
97
+ # 2020-04-13
98
+ ## Previous
99
+ - Did something else.
100
+ ## Current
101
+ - Write new feature for `standup_md`
102
+ - Fix bug in `standup_md`
103
+ ## Impediments
104
+ - None
105
+ ```
106
+
107
+ The following scaffolding will be added for current entry at the top of the
108
+ file:
109
+ ```markdown
110
+ # 2020-04-14
111
+ ## Previous
112
+ - Write new feature for `standup_md`
113
+ - Fix bug in `standup_md`
114
+ ## Current
115
+ - <!-- ADD TODAY'S WORK HERE -->
116
+ ## Impediments
117
+ - None
118
+ ```
119
+
120
+ There are also flags that will print entries to the command line. There's a full
121
+ list of features below, but as a quick example, you can copy today's entry to
122
+ your clipboard without even opening your editor.
123
+
124
+ ```sh
125
+ standup -c | pbcopy
126
+ ```
127
+
128
+ ## Customization and Runtime Options
129
+ You can create a file in your home directory called `~/.standup_md.yml`.
130
+ Settings located in this file will override default behavior. This file can also
131
+ have settings overwritten at runtime by the use of options. You can view [my config
132
+ file](https://github.com/evanthegrayt/dotfiles/blob/master/dotfiles/standup_md.yml)
133
+ as an example. Any setting in this file can still be overridden at runtime by
134
+ passing flags to the executable.
135
+
136
+ You'll notice, a lot of settings don't have the ability to be changed at runtime
137
+ when calling the executable. This is because the file structure is very
138
+ important, and changing values that affect formatting will cause problems with
139
+ the file parser. If you don't want to use a default, make the change in your
140
+ config file before you start editing standups. There is an [open
141
+ issue](https://github.com/evanthegrayt/standup_md/issues/16) for handling this
142
+ for the user, but they're not available yet.
143
+
144
+ There are no options to change the headers at runtime because it uses the
145
+ headers to detect tasks from previous entries. If changed at runtime, this would
146
+ cause errors. For this reason, if you don't like the default headers, change
147
+ them in your configuration file after installation, and then try to not change
148
+ them again.
149
+
150
+
151
+ ### Available Config File Keys and Defaults
152
+
153
+ ```yaml
154
+ # Key: Default
155
+ header_depth: 1
156
+ header_date_format: '%Y-%m-%d'
157
+ sub_header_depth: 2
158
+ current_header: 'Current'
159
+ previous_header: 'Previous'
160
+ impediments_header: 'Impediments'
161
+ file_name_format: '%Y_%m.md'
162
+ bullet_character: '-' # (dash)
163
+ directory: '~/.cache/standup_md'
164
+ editor: # $VISUAL, $EDITOR or vim, in that order
165
+ current_entry_tasks:
166
+ - "<!-- ADD TODAY'S WORK HERE -->"
167
+ previous_entry_tasks: # An array of the tasks from the previous entry
168
+ impediments:
169
+ - 'None'
170
+ notes: null # If not null, must be array
171
+ sub_header_order:
172
+ - 'previous'
173
+ - 'current'
174
+ - 'impediments'
175
+ - 'notes'
176
+ ```
177
+
178
+ ### Executable Flags
179
+ ```
180
+ The Standup Doctor
181
+ --current-entry-tasks=ARRAY List of current entry's tasks
182
+ --previous-entry-tasks=ARRAY List of yesterday's tasks
183
+ --impediments=ARRAY List of impediments for current entry
184
+ --notes=ARRAY List of notes for current entry
185
+ --sub-header-order=ARRAY The order of the sub-headers when writing the file
186
+ --[no-]append-previous Append previous tasks? Default is true
187
+ -f, --file-name-format=STRING Date-formattable string to use for standup file name
188
+ -e, --editor=EDITOR Editor to use for opening standup files
189
+ -d, --directory=DIRECTORY The directories where standup files are located
190
+ --[no-]write Write current entry if it doesn't exist. Default is true
191
+ --[no-]edit Open the file in the editor. Default is true
192
+ -j, --[no-]json Print output as formatted json. Default is false.
193
+ -v, --[no-]verbose Verbose output. Default is false.
194
+ -c, --current Print current entry. Disables editing
195
+ -a, --all Print all previous entries. Disables editing
196
+ ```
197
+
198
+ Any options not set in this file will retain their default values. Note that if
199
+ you change `file_name_format`, and don't use a month or year, there will only
200
+ ever be one standup file. This could cause issues long-term, as the files will
201
+ get large over time and possibly cause performance issues.
202
+
203
+ If you wanted to add some tasks at runtime, and without opening the file in an
204
+ editor, you could use the following:
205
+
206
+ ```bash
207
+ standup --no-edit --current-entry-tasks="Work on this thing","And another thing!"
208
+ ```
209
+
210
+ ## API
211
+ Below are some quick examples, but the API is fully documented in the
212
+ [documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
213
+
214
+ This was mainly written as a command line utility, but I made the API available
215
+ for scripting. There are attribute accessors for most of the settings in the
216
+ [customization table](#customization-and-runtime-options) above. To view all
217
+ available methods, read the comments in the [source](lib/standup_md.rb). A
218
+ quick-and-dirty example of how to write a new entry via code could look like the
219
+ following:
220
+
221
+ ```ruby
222
+ require 'standup_md'
223
+
224
+ standup = StandupMD.load(
225
+ current_header: 'Today',
226
+ current_entry_tasks: ['Thing to do today', 'Another thing to do today'],
227
+ impediments: ['Not enough time in the day']
228
+ )
229
+
230
+ standup.write
231
+ ```
232
+
233
+ Entries are just hashes, so you can easily transform them to `json` objects.
234
+
235
+ ```ruby
236
+ require 'standup_md'
237
+ require 'json'
238
+
239
+ standup = StandupMD.load
240
+ standup_entries_as_json = standup.all_entries.to_json
241
+ ```
242
+
243
+ ## Reporting Bugs and Requesting Features
244
+ If you have an idea or find a bug, please [create an
245
+ issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure the topic
246
+ doesn't already exist. Better yet, you can always submit a Pull Request.
247
+
248
+ ## Self-Promotion
249
+ I do these projects for fun, and I enjoy knowing that they're helpful to people.
250
+ Consider starring [the repository](https://github.com/evanthegrayt/standup_md)
251
+ if you like it! If you love it, follow me [on
252
+ Github](https://github.com/evanthegrayt)!
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ require_relative 'lib/standup_md'
2
+ require 'rdoc/task'
3
+
4
+ RDoc::Task.new do |rdoc|
5
+ rdoc.main = "README.md"
6
+ rdoc.rdoc_dir = 'doc'
7
+ rdoc.rdoc_files.include("README.md", "**/*.rb")
8
+ end
9
+
10
+ task :default => :test
11
+
12
+ desc "Build the gem"
13
+ task :build do
14
+ system('gem build standup_md.gemspec')
15
+ end
16
+
17
+ desc "Build and install the gem"
18
+ task install: [:dependencies, :build] do
19
+ system("gem install standup_md-#{StandupMD::VERSION}.gem")
20
+ end
21
+
22
+ desc "Add dependencies"
23
+ task :dependencies do
24
+ system("gem install bundler")
25
+ system("bundle install")
26
+ end
27
+
28
+ desc "Uninstall the gem"
29
+ task :uninstall do
30
+ system('gem uninstall standup')
31
+ end
32
+
33
+ desc "Run test suite"
34
+ task :test do
35
+ Dir.glob(File.join(__dir__, 'test', '**', '*_test.rb')).each { |f| ruby f }
36
+ end
data/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-midnight
data/bin/standup ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative '../lib/standup_md/cli'
4
+
5
+ StandupMD::CLI.execute(ARGV)