logchange 0.0.4 → 1.0.0
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/README.md +11 -0
- data/changelog/2017.yaml +7 -0
- data/lib/logchange/dispatch.rb +14 -5
- data/lib/logchange/interactive_logger.rb +8 -4
- data/lib/logchange/template.rb +1 -0
- data/lib/logchange/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3505d84792e31b47a707c42510c1e7a578e0606
|
4
|
+
data.tar.gz: 6cf762f74375bdc467cd1e37421747653f223f86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7598192ca0df05fad8438df4cb7798f08bf9b584dddfe5ac7efb511ed692712b19002c77ec27289d86bff6dc25c58ec753c979af2126c1c5b8fd1ccc9a57f9be
|
7
|
+
data.tar.gz: cc428dd302ac30725dfb2b8b07e54f3b9cb9e3bc50f70e12f6641320b924abd388b22fa6c1ae09a19572afb73c7d578b688c85ab9452bc36620dea922430a52a
|
data/README.md
CHANGED
@@ -36,6 +36,17 @@ Or install the gem with:
|
|
36
36
|
|
37
37
|
## Usage
|
38
38
|
|
39
|
+
$ logchange
|
40
|
+
Usage: logchange COMMAND
|
41
|
+
|
42
|
+
Available commands:
|
43
|
+
init - Initialize logchange at this location - creates
|
44
|
+
the changelog directory.
|
45
|
+
new [MESSAGE] - Log a change. Skip the message to trigger
|
46
|
+
interative mode.
|
47
|
+
release [TAG] - Releases changes in changelog/unreleased.
|
48
|
+
Optionally, tag the release with a string.
|
49
|
+
|
39
50
|
If you've just completed work on a feature, log it with:
|
40
51
|
|
41
52
|
$ logchange new "A cool new feature has been added"
|
data/changelog/2017.yaml
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
---
|
2
2
|
changelog:
|
3
|
+
- timestamp: '2017-05-30T14:38:40Z'
|
4
|
+
tag: v1.0.0
|
5
|
+
changes:
|
6
|
+
- timestamp: '2017-05-30T14:27:25Z'
|
7
|
+
title: Print help if no command, or invalid command is supplied.
|
8
|
+
- timestamp: '2017-05-30T14:25:34Z'
|
9
|
+
title: Exclude empty keys from changelog if skipped during interactive mode.
|
3
10
|
- timestamp: '2017-05-24T05:44:58Z'
|
4
11
|
tag: v0.0.4
|
5
12
|
changes:
|
data/lib/logchange/dispatch.rb
CHANGED
@@ -16,7 +16,7 @@ module Logchange
|
|
16
16
|
when :release
|
17
17
|
Logchange::Release.new(ARGV[1]).execute
|
18
18
|
else
|
19
|
-
|
19
|
+
print_help
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -29,13 +29,22 @@ module Logchange
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def command
|
32
|
-
return ARGV[0].to_sym if %w[init new release
|
33
|
-
|
32
|
+
return ARGV[0].to_sym if %w[init new release].include?(ARGV[0])
|
33
|
+
:unknown
|
34
34
|
end
|
35
35
|
|
36
36
|
def print_help
|
37
|
-
|
38
|
-
|
37
|
+
puts <<~HELP
|
38
|
+
Usage: logchange COMMAND
|
39
|
+
|
40
|
+
Available commands:
|
41
|
+
init - Initialize logchange at this location - creates
|
42
|
+
the changelog directory.
|
43
|
+
new [MESSAGE] - Log a change. Skip the message to trigger
|
44
|
+
interative mode.
|
45
|
+
release [TAG] - Releases changes in changelog/unreleased.
|
46
|
+
Optionally, tag the release with a string.
|
47
|
+
HELP
|
39
48
|
end
|
40
49
|
end
|
41
50
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require_relative 'template'
|
2
2
|
|
3
3
|
module Logchange
|
4
|
+
# Accept change information from the user via command line prompts.
|
4
5
|
class InteractiveLogger
|
5
6
|
def initialize
|
6
7
|
@title = nil
|
@@ -37,12 +38,15 @@ module Logchange
|
|
37
38
|
puts "#{key}: #{value}"
|
38
39
|
user_input = STDIN.gets.chomp
|
39
40
|
|
40
|
-
|
41
|
-
|
42
|
-
|
41
|
+
if user_input.length.positive?
|
42
|
+
# Preserve booleans.
|
43
|
+
if %w[true false].include?(user_input)
|
44
|
+
user_input = (user_input == 'true')
|
45
|
+
end
|
46
|
+
|
47
|
+
@template[key] = user_input
|
43
48
|
end
|
44
49
|
|
45
|
-
@template[key] = user_input
|
46
50
|
puts "\n"
|
47
51
|
end
|
48
52
|
end
|
data/lib/logchange/template.rb
CHANGED
data/lib/logchange/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logchange
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hari Gopal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|