poise-languages 2.0.5 → 2.1.0

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: 5fcceac2b90bd84a52cf585a0c822fbad9414a11
4
- data.tar.gz: 9e44805de886e6b3da58a1544455b1ea91da6525
3
+ metadata.gz: d4448e524a99d73c852fc7b6dd532f442cdd6a03
4
+ data.tar.gz: 7f6850bcefea620ff988ccaca523dcce7aa9d150
5
5
  SHA512:
6
- metadata.gz: d57acf64731c04828f9647460e2d811d0d27a91ad57b876475c7e400442e0009ad204b8c8457f0753676193d66a30cb1f58ce161822a1bd6c3dc21b87cf6949c
7
- data.tar.gz: 7a889cba9e2f8882826fae01967ad23dce09d86ba3ae6ce4b355b2d80598ecffcecd6645348ca36a677f2bc0cb7791ebd2e3c3cee542de0ef504bda15341c9ce
6
+ metadata.gz: 1c7f8efa6b84aea37d4490aa221750c7a6f1801dd531c01bfc60bb0a1cfccf90e23fec2dc8db71b7b38fd0c7dda71fe1faf84e945cfbaa10af33dc874197593a
7
+ data.tar.gz: 907ccd6c1363d5e61934be7c8cf5308986c78b4e3b8bcca067223ef9a862053b3ec0c4278265a43d5ce9522c4c8fd93219861c43f98b4245a4854a07d3464fe3
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.1.0
4
+
5
+ * Allow customizing properties on the system package install resource via a block
6
+
3
7
  ## v2.0.5
4
8
 
5
9
  * Fixes to work with the latest Chef (again).
@@ -27,7 +27,7 @@ module PoiseLanguages
27
27
  #
28
28
  # @api public
29
29
  # @return [PoiseLanguages::System::Resource]
30
- def install_system_packages
30
+ def install_system_packages(&block)
31
31
  dev_package_overrides = system_dev_package_overrides
32
32
  poise_languages_system system_package_name do
33
33
  # Otherwise use the default install action.
@@ -38,6 +38,7 @@ module PoiseLanguages
38
38
  dev_package_overrides dev_package_overrides
39
39
  package_version options['package_version'] if options['package_version']
40
40
  version options['version']
41
+ instance_exec(&block) if block
41
42
  end
42
43
  end
43
44
 
@@ -45,9 +46,10 @@ module PoiseLanguages
45
46
  #
46
47
  # @api public
47
48
  # @return [PoiseLanguages::System::Resource]
48
- def uninstall_system_packages
49
+ def uninstall_system_packages(&block)
49
50
  install_system_packages.tap do |r|
50
51
  r.action(:uninstall)
52
+ r.instance_exec(&block) if block
51
53
  end
52
54
  end
53
55
 
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  module PoiseLanguages
19
- VERSION = '2.0.5'
19
+ VERSION = '2.1.0'
20
20
  end
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
34
34
  spec.require_paths = %w{lib}
35
35
 
36
- spec.add_dependency 'chef', '~> 12.1'
36
+ spec.add_dependency 'chef', '>= 12.1', '< 14'
37
37
  spec.add_dependency 'halite', '~> 1.0'
38
38
  spec.add_dependency 'poise', '~> 2.5'
39
39
  spec.add_dependency 'poise-archive', '~> 1.0'
@@ -18,6 +18,7 @@ eval_gemfile File.expand_path('../../../Gemfile', __FILE__)
18
18
 
19
19
  gem 'chef', github: 'chef/chef'
20
20
  gem 'halite', github: 'poise/halite'
21
+ gem 'ohai', github: 'chef/ohai'
21
22
  gem 'poise', github: 'poise/poise'
22
23
  gem 'poise-archive', github: 'poise/poise-archive'
23
24
  gem 'poise-boiler', github: 'poise/poise-boiler'
@@ -46,6 +46,30 @@ describe PoiseLanguages::System::Mixin do
46
46
  dev_package_overrides: {},
47
47
  package_version: nil,
48
48
  version: '') }
49
+
50
+ context 'with a block override' do
51
+ provider(:poise_test) do
52
+ include Poise
53
+ include described_class
54
+ def system_package_name
55
+ 'mylang'
56
+ end
57
+ def options
58
+ {}
59
+ end
60
+ def action_run
61
+ install_system_packages do
62
+ dev_package false
63
+ end
64
+ end
65
+ end
66
+
67
+ it { is_expected.to install_poise_languages_system('mylang').with(parent: chef_run.poise_test('test'),
68
+ dev_package: false,
69
+ dev_package_overrides: {},
70
+ package_version: nil,
71
+ version: '') }
72
+ end # /context with a block override
49
73
  end # /describe #install_system_packages
50
74
 
51
75
  describe '#uninstall_system_packages' do
@@ -67,6 +91,26 @@ describe PoiseLanguages::System::Mixin do
67
91
  end
68
92
 
69
93
  it { is_expected.to uninstall_poise_languages_system('mylang') }
94
+
95
+ context 'with a block override' do
96
+ provider(:poise_test) do
97
+ include Poise
98
+ include described_class
99
+ def system_package_name
100
+ 'mylang'
101
+ end
102
+ def options
103
+ {}
104
+ end
105
+ def action_run
106
+ uninstall_system_packages do
107
+ dev_package false
108
+ end
109
+ end
110
+ end
111
+
112
+ it { is_expected.to uninstall_poise_languages_system('mylang').with(dev_package: false) }
113
+ end # /context with a block override
70
114
  end # /describe #uninstall_system_packages
71
115
 
72
116
  describe '#system_package_candidates' do
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poise-languages
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '12.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '14'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '12.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '14'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: halite
29
35
  requirement: !ruby/object:Gem::Requirement