knife-changelog 0.2.0 → 0.3.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: f81188840372e00e434ec07bf0d41eb244cfceaa
4
- data.tar.gz: 072e13d4343196b03d64489b299de2d51271ba4d
3
+ metadata.gz: 26c9f2f01235739907e993394c6732e6e77e4593
4
+ data.tar.gz: ad18e2e2fc22fe507473d13c2a3234e5b691f686
5
5
  SHA512:
6
- metadata.gz: afc75a1cfa41c9a3774bc900a236a0241a1e2036f7b5d7561225aff141a2835759c245744f0bbd5c9d9d63c0697d879fe5fc9a749d074d52f7bf1caa51e02368
7
- data.tar.gz: f9c084bdc8e72ef76f75a171b80238a450b50766230411317dfb0fdf06a0df2efbfd5224292e50ebdec27444bfb2b30fef01622db3e5f6edf973d69fdedc488b
6
+ metadata.gz: 0b9189296b5ddd78faf8590fd4649babebb76fa0c582588476772f449add1691f2ecd3ad3b1b0d04c8fbcaae08b87efe161abf75e2d9bb6d78404324dcef9016
7
+ data.tar.gz: a63da099e100e37b8b26bbc3b175234fc4e234688b97fbbcb7ef438d57cb8d06f58955c497903ba4879f82ef80d2cbcbaf87c3b09053be2025eb44d54c9a02d3
@@ -13,7 +13,7 @@ class Chef
13
13
  def initialize(options)
14
14
  super
15
15
  berksfile = Berkshelf::Berksfile.from_options({})
16
- @changelog = KnifeChangelog::Changelog.new(berksfile, config)
16
+ @changelog = KnifeChangelog::Changelog.new(berksfile.lockfile.locks, config)
17
17
  end
18
18
 
19
19
  option :linkify,
@@ -5,9 +5,9 @@ require 'json'
5
5
 
6
6
  class KnifeChangelog
7
7
  class Changelog
8
- def initialize(berksfile, config = {})
8
+ def initialize(locked_versions, config = {})
9
9
  @tmp_prefix = 'knife-changelog'
10
- @berksfile = berksfile
10
+ @locked_versions = locked_versions
11
11
  @config = config
12
12
  @tmp_dirs = []
13
13
  end
@@ -15,7 +15,7 @@ class KnifeChangelog
15
15
  def run(cookbooks)
16
16
  begin
17
17
  if cookbooks.empty?
18
- cks = @berksfile.cookbooks.collect {|c| c.cookbook_name }
18
+ cks = locked_versions.keys
19
19
  else
20
20
  cks = cookbooks
21
21
  end
@@ -39,16 +39,15 @@ class KnifeChangelog
39
39
  end
40
40
 
41
41
  def ck_dep(name)
42
- @berksfile.lockfile.locks[name]
42
+ @locked_versions[name]
43
43
  end
44
44
 
45
45
  def ck_location(name)
46
46
  ck_dep(name).location
47
47
  end
48
48
 
49
- def version_for(name)
50
- # FIXME uses public methods instead
51
- @berksfile.lockfile.graph.instance_variable_get(:@graph)[name].version
49
+ def guess_version_for(name)
50
+ @locked_versions[name].locked_version.to_s
52
51
  end
53
52
 
54
53
  def execute(name, submodule=false)
@@ -91,7 +90,7 @@ class KnifeChangelog
91
90
  url = "https://github.com/#{$1.chomp('/')}.git"
92
91
  options = {
93
92
  :git => url,
94
- :revision => version_for(name),
93
+ :revision => guess_version_for(name),
95
94
  }
96
95
  location = Berkshelf::GitLocation.new dep, options
97
96
  handle_git(location)
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Changelog
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregoire Seux