rbnotes 0.4.1 → 0.4.2
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/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/lib/rbnotes/commands/add.rb +1 -0
- data/lib/rbnotes/commands/update.rb +22 -2
- data/lib/rbnotes/version.rb +2 -2
- data/rbnotes.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a43f87f2f4b03c9f8e27d06eb4fc426abb6dafbd420d5bbbcdb4ec2ea38d497
|
4
|
+
data.tar.gz: 0f9c060bfefde2e6c3f611d7d7e683fdd5ced20327b3ae6a3cbfcac39cdaf5a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e28ed07cde6f385945a9ed3b92ff6402b8ec2dcdd2a75f6d1d0a8e391a2bf5e000245d708903fa815ec5faecfb2cfc39034240ef83a44818bd9a9ccb39c326ed
|
7
|
+
data.tar.gz: 0e2a87a92c5b5a674d143c3d4461577976e5f62508d67ebbdb5202bfbc771c04aacaab520f8860e29429411f50677351f059e01a919e0836fc889b6285507fbd
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
## [Unreleased]
|
8
8
|
Nothing to record here.
|
9
9
|
|
10
|
+
## [0.4.2] - 2020-11-05
|
11
|
+
### Added
|
12
|
+
- Add a feature to keep the timestamp in `update` command. (#44)
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Fix issue #45: hanging up of `add` command.
|
16
|
+
|
10
17
|
## [0.4.1] - 2020-11-04
|
11
18
|
### Added
|
12
19
|
- Add a feature to accept a timestamp in `add` command. (#34)
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbnotes (0.4.
|
5
|
-
textrepo (~> 0.5)
|
4
|
+
rbnotes (0.4.2)
|
5
|
+
textrepo (~> 0.5.4)
|
6
6
|
unicode-display_width (~> 1.7)
|
7
7
|
|
8
8
|
GEM
|
@@ -10,7 +10,7 @@ GEM
|
|
10
10
|
specs:
|
11
11
|
minitest (5.14.2)
|
12
12
|
rake (13.0.1)
|
13
|
-
textrepo (0.5.
|
13
|
+
textrepo (0.5.4)
|
14
14
|
unicode-display_width (1.7.0)
|
15
15
|
|
16
16
|
PLATFORMS
|
@@ -20,7 +20,7 @@ DEPENDENCIES
|
|
20
20
|
minitest (~> 5.0)
|
21
21
|
rake (~> 13.0)
|
22
22
|
rbnotes!
|
23
|
-
textrepo (~> 0.5)
|
23
|
+
textrepo (~> 0.5.4)
|
24
24
|
|
25
25
|
BUNDLED WITH
|
26
26
|
2.1.4
|
data/lib/rbnotes/commands/add.rb
CHANGED
@@ -5,6 +5,9 @@ module Rbnotes::Commands
|
|
5
5
|
# The timestamp associated with the note will be updated to new one,
|
6
6
|
# which is generated while the command exection.
|
7
7
|
#
|
8
|
+
# When "-k" (or "--keep") option is specified, the timestamp will
|
9
|
+
# remain unchanged.
|
10
|
+
#
|
8
11
|
# A timestamp string must be specified as the only argument. It
|
9
12
|
# must exactly match to the one of the target note in the
|
10
13
|
# repository. When the given timestamp was not found, the command
|
@@ -32,6 +35,18 @@ module Rbnotes::Commands
|
|
32
35
|
# "20201020112233" -> "20201021123400"
|
33
36
|
|
34
37
|
def execute(args, conf)
|
38
|
+
@opts = {}
|
39
|
+
while args.size > 0
|
40
|
+
arg = args.shift
|
41
|
+
case arg
|
42
|
+
when "-k", "--keep"
|
43
|
+
@opts[:keep_timestamp] = true
|
44
|
+
else
|
45
|
+
args.unshift(arg)
|
46
|
+
break
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
35
50
|
target_stamp = Rbnotes::Utils.read_timestamp(args)
|
36
51
|
editor = find_editor(conf[:editor])
|
37
52
|
repo = Textrepo.init(conf)
|
@@ -47,13 +62,18 @@ module Rbnotes::Commands
|
|
47
62
|
text = File.readlines(tmpfile, :chomp => true)
|
48
63
|
|
49
64
|
unless text.empty?
|
65
|
+
keep = @opts[:keep_timestamp] || false
|
50
66
|
newstamp = nil
|
51
67
|
begin
|
52
|
-
newstamp = repo.update(target_stamp, text)
|
68
|
+
newstamp = repo.update(target_stamp, text, keep)
|
53
69
|
rescue StandardError => e
|
54
70
|
puts e.message
|
55
71
|
else
|
56
|
-
|
72
|
+
if keep
|
73
|
+
puts "Update the note content, the timestamp unchanged [%s]" % newstamp
|
74
|
+
else
|
75
|
+
puts "Update the note [%s -> %s]" % [target_stamp, newstamp] unless target_stamp == newstamp
|
76
|
+
end
|
57
77
|
ensure
|
58
78
|
# Don't forget to remove the temporary file.
|
59
79
|
File.delete(tmpfile)
|
data/lib/rbnotes/version.rb
CHANGED
data/rbnotes.gemspec
CHANGED
@@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ["lib"]
|
27
27
|
|
28
|
-
spec.add_dependency "textrepo", "~> 0.5"
|
28
|
+
spec.add_dependency "textrepo", "~> 0.5.4"
|
29
29
|
spec.add_dependency "unicode-display_width", "~> 1.7"
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbnotes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mnbi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: textrepo
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.5.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.5.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: unicode-display_width
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|