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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3639284d0fbc24f5c248a7f623e0e65f02ac5a4
4
- data.tar.gz: 2634fa773942e93ef1f6ce199b75ca27e67455aa
3
+ metadata.gz: a3505d84792e31b47a707c42510c1e7a578e0606
4
+ data.tar.gz: 6cf762f74375bdc467cd1e37421747653f223f86
5
5
  SHA512:
6
- metadata.gz: '0823e3b1882608189638c26b018097f28fd106c93d0cacc6d3a496ad43846ac4c66741dbca55e82ccfccad1fd1663f16a71797c896fd63372cc5fcff08e24bec'
7
- data.tar.gz: 89d644f3e5d5d5dea27e65c5b1b0dc978dcd93a4fe3604c890156f9a31c6d3112dedbeafdce8f3a59cee6e47e729dbf84012120d8f96bf916aeda7c95431b52c
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:
@@ -16,7 +16,7 @@ module Logchange
16
16
  when :release
17
17
  Logchange::Release.new(ARGV[1]).execute
18
18
  else
19
- raise "Unhandled command #{command}"
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 preview].include?(ARGV[0])
33
- print_help
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
- # TODO: Write actual help response.
38
- raise 'Unknown command encountered.'
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
- # Preserve booleans.
41
- if %w[true false].include?(user_input)
42
- user_input = (user_input == 'true')
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
@@ -1,4 +1,5 @@
1
1
  module Logchange
2
+ # Properties of the template used to customize changelogs.
2
3
  class Template
3
4
  def self.load
4
5
  template_path = File.join(Logchange.configuration.changelog_directory_path, 'template.yaml')
@@ -1,3 +1,4 @@
1
1
  module Logchange
2
- VERSION = -'0.0.4'
2
+ # Semantic Versioning. http://semver.org
3
+ VERSION = -'1.0.0'
3
4
  end
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
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-24 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler