puppet_module_packaging 0.0.1 → 0.0.2

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: 355d955a3532b7fd7bec451b8177c3220247f5f1
4
- data.tar.gz: 6d8e077720efe12fe7c556dd77af6cf09a3a62ae
3
+ metadata.gz: ccc2278c587b1d85d0717646163e3725f8abc4a2
4
+ data.tar.gz: 3973f313a92372db4c5a2f9bfa136aa381392d3d
5
5
  SHA512:
6
- metadata.gz: c19b218cdeafa6f4f11362842c3e4e4198905bf62da25cb415decf44094c8bdcaf03abdc2397719dfa2412b768be61a04ede7815a91fd301b158eabaf65c692c
7
- data.tar.gz: 9dac89efa58e82ac8e090f9f8fdc3bcafc8a87f5ffbca2e3875f1045206ee5e4095e9d65d5dd128243b584c9cb6c0073601da3d8270bb50562b71faf2f04db7c
6
+ metadata.gz: 05f80f6e6262799d7640c355f15885146962932cca63812526e5a2f852ff84996bd65f8327aa76a662fd1b2cba2c1f78079519723ae50bee34b4ec6998f8f1bb
7
+ data.tar.gz: d6f15dd4ba72dba9b29077feaec6a4f0e0c6e51fccd567d5309db62b45fdf1b08e2fbf131125e479df0af5d929754dbc5d3db61f482e34f9adf9cd7f7442b6b2
checksums.yaml.gz.sig CHANGED
Binary file
data/Changelog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.2
4
+
5
+ * Fix a bug that let the tasks fail if not all the standard module directories
6
+ were present (see #1).
7
+
3
8
  ## 0.0.1
4
9
 
5
10
  * Add `rpm`, `deb`, `install` and `clean` tasks.
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Puppet Module Packaging
2
2
 
3
3
  [![Build Status](https://travis-ci.org/stefanozanella/puppet_module_packaging.png?branch=master)](https://travis-ci.org/stefanozanella/puppet_module_packaging)
4
+ [![Gem Version](https://badge.fury.io/rb/puppet_module_packaging.png)](http://badge.fury.io/rb/puppet_module_packaging)
5
+ [![Dependency Status](https://gemnasium.com/stefanozanella/puppet_module_packaging.png)](https://gemnasium.com/stefanozanella/puppet_module_packaging)
4
6
 
5
7
  Provides Rake tasks to ease shipping of Puppet modules as proper system
6
8
  packages.
@@ -31,9 +33,11 @@ Or install it yourself as:
31
33
  ## Usage
32
34
 
33
35
  To have the shipped Rake tasks available for your module, just add the
34
- following line to your `Rakefile`:
36
+ following lines to your `Rakefile`:
35
37
 
36
- require 'puppet_module_packaging/rake_task'
38
+ require 'puppet_module/pkg/rake_task'
39
+
40
+ PuppetModule::Pkg::Tasks.new
37
41
 
38
42
  This will add the following tasks to your set:
39
43
 
@@ -7,9 +7,7 @@ module PuppetModule
7
7
  end
8
8
 
9
9
  def cp(src, dest)
10
- sanitized_src = src.is_a?(Range) ? src.to_a : src
11
-
12
- FileUtils.cp_r sanitized_src, dest
10
+ FileUtils.cp_r only_existing_entries_of(ensure_array(src)), dest
13
11
  end
14
12
 
15
13
  def rm(path)
@@ -19,6 +17,16 @@ module PuppetModule
19
17
  def sh(cmd)
20
18
  `#{cmd}`
21
19
  end
20
+
21
+ private
22
+
23
+ def ensure_array(src)
24
+ src.is_a?(Range) ? src.to_a : src
25
+ end
26
+
27
+ def only_existing_entries_of(src)
28
+ src.select { |f| File.exists? f }
29
+ end
22
30
  end
23
31
  end
24
32
  end
@@ -1,5 +1,5 @@
1
1
  module PuppetModule
2
2
  module Pkg
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -1,11 +1,11 @@
1
1
  require 'test_helper'
2
2
 
3
3
  describe 'install task' do
4
- around do |t|
5
- do_into_tmp_module('testmod', t)
6
- end
7
-
8
4
  describe 'by default' do
5
+ around do |t|
6
+ do_into_tmp_module('testmod', t)
7
+ end
8
+
9
9
  let(:output_dir) { 'build/usr/share/puppet/modules/testmod' }
10
10
 
11
11
  it 'installs all module dirs into the `build` subfolder' do
@@ -31,4 +31,28 @@ describe 'install task' do
31
31
  }.must_exist_within output_dir
32
32
  end
33
33
  end
34
+
35
+ # Issue #1
36
+ describe 'when not all standard module directories are present' do
37
+ around do |t|
38
+ do_into_tmp_module('testmod_small', t)
39
+ end
40
+
41
+ let(:output_dir) { 'build/usr/share/puppet/modules/testmod_small' }
42
+
43
+ it 'installs the module anyway' do
44
+ `rake install`
45
+
46
+ assert directory?(output_dir), "expected #{output_dir} to exist, but it didn't"
47
+ filesystem {
48
+ dir 'manifests' do
49
+ file 'init.pp'
50
+ end
51
+
52
+ dir 'templates' do
53
+ file 'config.erb'
54
+ end
55
+ }.must_exist_within output_dir
56
+ end
57
+ end
34
58
  end
@@ -0,0 +1,2 @@
1
+ name 'testdev/testmod_small'
2
+ version '0.0.1'
@@ -0,0 +1,3 @@
1
+ require 'puppet_module/pkg/tasks'
2
+
3
+ PuppetModule::Pkg::Tasks.new
File without changes
File without changes
@@ -38,6 +38,16 @@ describe PuppetModule::Pkg::Tasks::System do
38
38
  assert file?(join 'out', dir, "test_#{dir}"), "expected file out/#{dir}/test_#{dir} to exist"
39
39
  end
40
40
  end
41
+
42
+ it 'doesn`t complain if some directories are not found' do
43
+ mkdir 'directory'
44
+ mkdir 'out'
45
+
46
+ fs.cp(['directory', 'not', 'found'], 'out')
47
+
48
+ refute exists?(join 'out', 'not')
49
+ refute exists?(join 'out', 'found')
50
+ end
41
51
  end
42
52
 
43
53
  describe 'rm' do
data/test/test_helper.rb CHANGED
@@ -64,6 +64,10 @@ def rpmbuild_found?
64
64
  return $? == 0
65
65
  end
66
66
 
67
+ def exists?(f)
68
+ File.exists? f
69
+ end
70
+
67
71
  def directory?(d)
68
72
  File.directory? d
69
73
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet_module_packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Zanella
@@ -186,6 +186,10 @@ files:
186
186
  - test/fixture/testmod/lib/utils.rb
187
187
  - test/fixture/testmod/manifests/init.pp
188
188
  - test/fixture/testmod/templates/config.erb
189
+ - test/fixture/testmod_small/Modulefile
190
+ - test/fixture/testmod_small/Rakefile
191
+ - test/fixture/testmod_small/manifests/init.pp
192
+ - test/fixture/testmod_small/templates/config.erb
189
193
  - test/integration/modulefile_test.rb
190
194
  - test/integration/system_test.rb
191
195
  - test/test_helper.rb
@@ -232,6 +236,10 @@ test_files:
232
236
  - test/fixture/testmod/lib/utils.rb
233
237
  - test/fixture/testmod/manifests/init.pp
234
238
  - test/fixture/testmod/templates/config.erb
239
+ - test/fixture/testmod_small/Modulefile
240
+ - test/fixture/testmod_small/Rakefile
241
+ - test/fixture/testmod_small/manifests/init.pp
242
+ - test/fixture/testmod_small/templates/config.erb
235
243
  - test/integration/modulefile_test.rb
236
244
  - test/integration/system_test.rb
237
245
  - test/test_helper.rb
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- #�Ell��4�;�6�_����hQ�H����7*�2$��E$ߌ�׭�p4C2O,c*DVQ���a檞fh�y�?/=���( �`�;_82-�2 ������$G<�������E���͡���^_Jjٴ��,�q �\�jOvH��B�J�h��%k5A�==�7��~ ؗD��2[�� ��Z�ؒ�
2
- Z��s�@0�h����F�����h@>.��T�-�?���t���N�?q̢�����i�q!ݙ
1
+ 5��R�hi��}gg�A���"Q��d5@��}?�Sg�Z�+�m$t� �9x!��@^�R�����ҟ��e�ڂͨ^��Ь��a�6�΄)ŝyR�5F�iDz���֊�3fl�ԅ�L����[Q����g)m��١,Yh~���v^c���k��2����r(�(��FmcG��z6�Gv2���