journal-cli 1.0.15 → 1.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +1 -1
- data/bin/journal +31 -12
- data/lib/journal-cli/checkin.rb +2 -0
- data/lib/journal-cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4136001bd545e3de4b52f3419a3519be7d553aa01f7b68a646f968bee9c08c9
|
4
|
+
data.tar.gz: c87a3326570e1776685ef4d9ab383890e391d1cdf2dfb44c34890f2120d813aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9005246872181e4dd93006b2b3c65d10575b868d1448cb641ac6da486612a63ba73b33ee9f5853ca2cd34e40ae28022701232736160145f059e31c725b35ccaf
|
7
|
+
data.tar.gz: 295e23386630c3df7f7cc68ce4bfed45861255d7441ccb7b9daace7667ee85f65580ba4026797c4b5173bb6c0df9abcc1983703109dd26301bdd725b67577736
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
### 1.0.17
|
2
|
+
|
3
|
+
2023-09-08 07:21
|
4
|
+
|
5
|
+
#### IMPROVED
|
6
|
+
|
7
|
+
- More confirmation messages when saving
|
8
|
+
|
9
|
+
### 1.0.16
|
10
|
+
|
11
|
+
2023-09-07 11:12
|
12
|
+
|
13
|
+
#### IMPROVED
|
14
|
+
|
15
|
+
- Use optparse for command line options
|
16
|
+
- Completion-friendly list of journals with `journal -l`
|
17
|
+
|
1
18
|
### 1.0.15
|
2
19
|
|
3
20
|
2023-09-07 07:57
|
data/Gemfile.lock
CHANGED
data/bin/journal
CHANGED
@@ -2,17 +2,20 @@
|
|
2
2
|
|
3
3
|
$LOAD_PATH.unshift File.join(__dir__, '..', 'lib')
|
4
4
|
require 'journal-cli'
|
5
|
+
require 'optparse'
|
5
6
|
|
6
7
|
module Journal
|
7
8
|
class << self
|
8
9
|
def usage
|
9
|
-
puts "journal v#{Journal::VERSION}"
|
10
|
-
puts
|
11
10
|
puts 'Usage: journal [type] [date]'
|
12
11
|
puts
|
13
12
|
puts 'Available journal types:'
|
13
|
+
list_journals
|
14
|
+
end
|
15
|
+
|
16
|
+
def list_journals
|
14
17
|
config = Journal.config
|
15
|
-
puts
|
18
|
+
puts config['journals'].keys
|
16
19
|
end
|
17
20
|
|
18
21
|
def run(args)
|
@@ -22,15 +25,6 @@ module Journal
|
|
22
25
|
Process.exit 1
|
23
26
|
end
|
24
27
|
|
25
|
-
case args[0]
|
26
|
-
when /(-v|--version)/
|
27
|
-
puts "journal v#{Journal::VERSION}"
|
28
|
-
Process.exit 0
|
29
|
-
when /(help|-h|--help)/
|
30
|
-
usage
|
31
|
-
Process.exit 0
|
32
|
-
end
|
33
|
-
|
34
28
|
journal = args.shift
|
35
29
|
|
36
30
|
date = if args.length.positive?
|
@@ -51,4 +45,29 @@ module Journal
|
|
51
45
|
end
|
52
46
|
end
|
53
47
|
|
48
|
+
optparse = OptionParser.new do |opts|
|
49
|
+
opts.banner = 'Usage: journal JOURNAL_KEY [NATURAL LANGUAGE DATE]'
|
50
|
+
|
51
|
+
opts.on('-v', '--version', 'Display version') do
|
52
|
+
puts "journal v#{Journal::VERSION}"
|
53
|
+
Process.exit 0
|
54
|
+
end
|
55
|
+
|
56
|
+
opts.on('-l', '--list', 'List available journals') do
|
57
|
+
Journal.list_journals
|
58
|
+
Process.exit 0
|
59
|
+
end
|
60
|
+
|
61
|
+
opts.on('-h', '--help', 'Display help') do
|
62
|
+
puts opts
|
63
|
+
puts
|
64
|
+
puts 'Available journal types:'
|
65
|
+
config = Journal.config
|
66
|
+
puts(config['journals'].keys.map { |k| "- #{k}" })
|
67
|
+
Process.exit 0
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
optparse.parse!
|
72
|
+
|
54
73
|
Journal.run(ARGV)
|
data/lib/journal-cli/checkin.rb
CHANGED
@@ -63,6 +63,7 @@ module Journal
|
|
63
63
|
cmd << %(-t #{@journal['tags'].join(' ')}) if @journal.key?('tags')
|
64
64
|
cmd << %(-date "#{@date.strftime('%Y-%m-%d %I:%M %p')}")
|
65
65
|
`echo #{Shellwords.escape(to_markdown(yaml: false, title: true))} | #{cmd.join(' ')} -- new`
|
66
|
+
puts "Entered into Day One"
|
66
67
|
end
|
67
68
|
|
68
69
|
def save_single_markdown
|
@@ -245,6 +246,7 @@ module Journal
|
|
245
246
|
data.sort_by! { |e| e['date'] }
|
246
247
|
|
247
248
|
File.open(db, 'w') { |f| f.puts JSON.pretty_generate(data) }
|
249
|
+
puts "Saved #{db}"
|
248
250
|
end
|
249
251
|
end
|
250
252
|
end
|
data/lib/journal-cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: journal-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|