knife-changelog 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98c4159a0fc3b58953636b8ccf0c8c8382177e4d
4
- data.tar.gz: 6771513114075ccae583f8ad398fd59e74a29c3d
3
+ metadata.gz: 8dead3f297d3603760f675f9aacfc4c22b8219e2
4
+ data.tar.gz: 9f6a5cd6f86f608282e5887f123324d08a92998a
5
5
  SHA512:
6
- metadata.gz: 65d40a2adf64c8a95efc6c6a2f64c2a2b350d488b208e189a7846357194ce59c632cadb6da7fd570b39569cb97614fcf817be9a35635ab482e6d3227a5499372
7
- data.tar.gz: b60b63be3884ee0297b6aa9acc8bd7b2be55898fdba6c719624a0fa79cabd767f73c0cb6970597f0f0f755a0e891e6a03e966a3d7af2e9d3437bccaac614c7d9
6
+ metadata.gz: af10ab7b0dd0bcc98405b3557af2651761178d3dfb1e327881461485c8844d07bdc8fe6bc7e40366c30b5f20b0e2617f0fcf12b1f129acf476166856a968317c
7
+ data.tar.gz: 1b3e851a1f305ae918dd7d85cfa619df6ea3b52a7bac562e9c8045934e388aaa47bc6a6a34bfb417a9f2b3f9c814ebe8b59034588534e8ce7abdf7fd1b049c9c
@@ -22,6 +22,12 @@ class Chef
22
22
  :description => 'add markdown links where relevant',
23
23
  :boolean => true
24
24
 
25
+ option :markdown,
26
+ :short => '-m',
27
+ :long => '--markdown',
28
+ :description => 'use markdown syntax',
29
+ :boolean => true
30
+
25
31
  option :ignore_changelog_file,
26
32
  :long => '--ignore-changelog-file',
27
33
  :description => "Ignore changelog file presence, use git history instead",
@@ -130,14 +136,15 @@ class Chef
130
136
  def generate_from_git_history(tmp_dir, location, current_rev, rev_parse)
131
137
  log = Mixlib::ShellOut.new("git log --no-merges --abbrev-commit --pretty=oneline #{current_rev}..#{rev_parse}", :cwd => tmp_dir)
132
138
  log.run_command
133
- c = log.stdout
139
+ c = log.stdout.lines
134
140
  n = https_url(location)
135
141
  c = linkify(n, c) if config[:linkify] and n
142
+ c = c.map { |line| "* " + line } if config[:markdown]
136
143
  c
137
144
  end
138
145
 
139
146
  def linkify(url, changelog)
140
- changelog = changelog.lines.map { |line|
147
+ changelog.map { |line|
141
148
  line.gsub(/^([a-f0-9]+) /, '[%s/commit/\1](\1) ' % [url])
142
149
  }
143
150
  end
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Changelog
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregoire Seux
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-22 00:00:00.000000000 Z
11
+ date: 2014-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler