cookbook-release 1.1.7 → 1.1.8

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWRhYzA1YzNlZTFkOTUyNWI1NGMwNGZmZTYzMjQzNzFkYTRkMTc0ZQ==
4
+ ZTI0NWQ2NzMwMDU5NDAyNDlhZDNhMzRkMzJlMmJhZjliMzU1NjM5NQ==
5
5
  data.tar.gz: !binary |-
6
- NTM1OTE5YmU1MGU3YzYyNWM1NzUzYzJlNmZkYjI3ZTIzODYyMWU4Mg==
6
+ MTQ0NzhhOTBmZjczNmMxZGE0MWU0MmE0OGM3MGFmYjU4ZjJkZDM3NA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MWM3NmRlOGEyNTEwMGY2MDM1ZWJjM2RlNWRmMjcyODliYjQ1YjkyMDE5MTk1
10
- MGIyODRiMmNhMzY0ZjAxZTkzYWZlZGUxNDNiM2I4MDhhYzg1ODY5N2U2MjJl
11
- MGY5Y2M3MjllZDMxMzg5OTljNTQyNGY0NWRmOGFmNzFkZGRiZmQ=
9
+ NjhiZmI5YzM2ODFjOTAwMjZiYzhlMWM5OTI1ZWZjN2ZkYmU4YzYyZWZlMzAy
10
+ MDk3YTMwZTlmYjZhZDczZmQ5ZDQwNDI5NTIwNjNlZGY1NDI5NzdhMzAwMWQ4
11
+ MDMxYjlmYmEyZmIxNGViMGVhZDg4OWQ3MDY3ZWYyODkzMjYzNjU=
12
12
  data.tar.gz: !binary |-
13
- ODk3MjZmZjcwNmU1YWZkMDI2YTY3ODQzNTVkNmNhMjc0YTVhNjhmOWM2MzY1
14
- NDNjMTI1NjRiNDkzOWY0ODM2NjZhMjk3MWQ3OWExOGJkZmZmNjA0ZTYwMTdj
15
- NjViYTU1MzM3YTJjMTY1OTMyMjJhZjI1MTgwZWE1Y2FjMmZlNTg=
13
+ ZjgwZjJkZjM0OWQ4Mzk5MWIxY2MyMDBjYzIzMzI5OGRkYzYzZDRiMjlmYjYw
14
+ OTMxY2JmZTRjMDYyZmMyOWNjODY2NmI1MzAyZDYyOWZkZTQxYjM3MDkxY2U2
15
+ NzJiOTBlMzNkNGI3MjBmYzVhMmFiYjY3YjNhODI1YzU4Y2NiOWM=
@@ -6,7 +6,7 @@ require 'English'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'cookbook-release'
9
- spec.version = '1.1.7'
9
+ spec.version = '1.1.8'
10
10
  spec.authors = ['Grégoire Seux']
11
11
  spec.email = 'g.seux@criteo.com'
12
12
  spec.summary = 'Provide primitives (and rake tasks) to release a cookbook'
@@ -6,7 +6,10 @@ module CookbookRelease
6
6
  dir = File.dirname(file)
7
7
  version_file = File.join(dir, '.cookbook_version')
8
8
 
9
- return File.read(version_file) if !GitUtilities.git?(dir) && File.exist?(version_file)
9
+ if !GitUtilities.git?(dir)
10
+ return File.read(version_file) if File.exist?(version_file)
11
+ raise "Can't determine version in a non-git environment without #{version_file}"
12
+ end
10
13
 
11
14
  r = Release.new(GitUtilities.new(cwd: dir))
12
15
  begin
@@ -29,6 +29,23 @@ describe CookbookRelease::GitUtilities do
29
29
 
30
30
  let(:git) { CookbookRelease::GitUtilities.new }
31
31
 
32
+ describe 'git directory' do
33
+ it 'detects non-git' do
34
+ tmp = Dir.mktmpdir('cookbook-release')
35
+ expect(CookbookRelease::GitUtilities.git?(tmp)).to be(false)
36
+ FileUtils.rm_rf(tmp)
37
+ end
38
+
39
+ it 'detects git' do
40
+ tmp = Dir.mktmpdir('cookbook-release')
41
+ cmd = Mixlib::ShellOut.new("git init #{tmp}")
42
+ cmd.run_command
43
+ cmd.error!
44
+ expect(CookbookRelease::GitUtilities.git?(tmp)).to be(true)
45
+ FileUtils.rm_rf(tmp)
46
+ end
47
+ end
48
+
32
49
  describe '.clean_index(?|!)' do
33
50
  it 'detects clean index' do
34
51
  expect(git.clean_index?).to be(true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookbook-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grégoire Seux