chef-config 13.11.3 → 13.12.3

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: 78f53cd4934e00da3e847a75579b3d41ca1aadbe
4
- data.tar.gz: e0e4097e329354f05f86db01c7abc74b882cf31a
3
+ metadata.gz: fa079055478562802cde38ab1a7b1a69082d9fc0
4
+ data.tar.gz: 4f13e1bf0f0d850fcc35138f1cba1de4ef5e72af
5
5
  SHA512:
6
- metadata.gz: 2ca4a6acf203226763e82c5c2bc561c2b4a7909ae87b868ce27cd8deb4b887d26e057b64b032ee24c66d25bde9d10649ae32f4ee3aaad64f3ff0ea66759a19a7
7
- data.tar.gz: b9fc37ff6047a91a5ac59a58946706ffe98aeabad87cc0f52c14bc8fc12bf368baf44ce2402090b0371a5c6026eb3f44bc40bc016a255f4092aaea738b0df40c
6
+ metadata.gz: 5c47ee5d6b6435d20eddbf34fea6f28b3c16198a70fadf90a59d466cab02e67e78f2b7009a2d7dffa4ce1fdc4d600f208e0c4fbf0aea08f0ccfadbff5267ac21
7
+ data.tar.gz: e1e1f4c9e897ef898fa8d7be09f6c56c0c623fe8f4d0b112c8ff64d7cbd0ac24a8e86d670e5367ac88d106f8594420fdec485a84aa5e6996e97c084a75587540
data/Rakefile CHANGED
@@ -1,10 +1,6 @@
1
- require "chef-config/package_task"
1
+ require "bundler/gem_tasks"
2
2
 
3
- ChefConfig::PackageTask.new(File.expand_path("..", __FILE__), "ChefConfig", "chef-config") do |package|
4
- package.module_path = "chef-config"
5
- end
6
-
7
- task :default => :spec
3
+ task default: :spec
8
4
 
9
5
  begin
10
6
  require "rspec/core/rake_task"
@@ -21,13 +21,13 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "addressable"
22
22
  spec.add_dependency "tomlrb", "~> 1.2"
23
23
 
24
- spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rake"
25
25
 
26
26
  %w{rspec-core rspec-expectations rspec-mocks}.each do |rspec|
27
27
  spec.add_development_dependency(rspec, "~> 3.2")
28
28
  end
29
29
 
30
- spec.files = %w{Rakefile LICENSE README.md} + Dir.glob("*.gemspec") +
30
+ spec.files = %w{Rakefile LICENSE} + Dir.glob("*.gemspec") +
31
31
  Dir.glob("{lib,spec}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
32
32
 
33
33
  spec.bindir = "bin"
@@ -251,7 +251,7 @@ module ChefConfig
251
251
  # Determine if the given path is protected by OS X System Integrity Protection.
252
252
  def self.is_sip_path?(path, node)
253
253
  if node["platform"] == "mac_os_x" && Gem::Version.new(node["platform_version"]) >= Gem::Version.new("10.11")
254
- # todo: parse rootless.conf for this?
254
+ # @todo: parse rootless.conf for this?
255
255
  sip_paths = [
256
256
  "/System", "/bin", "/sbin", "/usr"
257
257
  ]
@@ -21,7 +21,7 @@
21
21
 
22
22
  module ChefConfig
23
23
  CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
24
- VERSION = "13.11.3"
24
+ VERSION = "13.12.3"
25
25
  end
26
26
 
27
27
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.11.3
4
+ version: 13.12.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-26 00:00:00.000000000 Z
11
+ date: 2018-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -90,16 +90,16 @@ dependencies:
90
90
  name: rake
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - "~>"
93
+ - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: '10.0'
95
+ version: '0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - "~>"
100
+ - - ">="
101
101
  - !ruby/object:Gem::Version
102
- version: '10.0'
102
+ version: '0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rspec-core
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -150,7 +150,6 @@ extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
152
  - LICENSE
153
- - README.md
154
153
  - Rakefile
155
154
  - chef-config.gemspec
156
155
  - lib/chef-config.rb
@@ -161,7 +160,6 @@ files:
161
160
  - lib/chef-config/mixin/credentials.rb
162
161
  - lib/chef-config/mixin/dot_d.rb
163
162
  - lib/chef-config/mixin/fuzzy_hostname_matcher.rb
164
- - lib/chef-config/package_task.rb
165
163
  - lib/chef-config/path_helper.rb
166
164
  - lib/chef-config/version.rb
167
165
  - lib/chef-config/windows.rb
data/README.md DELETED
@@ -1,4 +0,0 @@
1
- # ChefConfig
2
-
3
- This repo is experimental. Use at your own risk.
4
-
@@ -1,289 +0,0 @@
1
- #
2
- # Author:: Kartik Null Cating-Subramanian (<ksubramanian@chef.io>)
3
- # Copyright:: Copyright 2015-2016, Chef, Inc.
4
- # License:: Apache License, Version 2.0
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
-
19
- require "rake"
20
- require "rubygems"
21
- require "rubygems/package_task"
22
-
23
- module ChefConfig
24
- class PackageTask < Rake::TaskLib
25
-
26
- # Full path to root of top-level repository. All other files (like VERSION or
27
- # lib/<module_path>/version.rb are rooted at this path).
28
- attr_accessor :root_path
29
-
30
- # Name of the top-level module/library build built. This is used to define
31
- # the top level module which contains VERSION and MODULE_ROOT.
32
- attr_accessor :module_name
33
-
34
- # Name of the gem being built. This is used to find the lines to fix in
35
- # Gemfile.lock.
36
- attr_accessor :gem_name
37
-
38
- # Should the generated version.rb be in a class or module? Default is false (module).
39
- attr_accessor :generate_version_class
40
-
41
- # Paths to the roots of any components that also support ChefPackageTask.
42
- # If relative paths are provided, they are rooted against root_path.
43
- attr_accessor :component_paths
44
-
45
- # This is the module name as it appears on the path "lib/module/".
46
- # e.g. for module_name "ChefDK", you'd want module_path to be "chef-dk".
47
- # The default is module_name but lower-cased.
48
- attr_writer :module_path
49
-
50
- def module_path
51
- @module_path || module_name.downcase
52
- end
53
-
54
- # Directory used to store package files and output that is generated.
55
- # This has the same meaning (or lack thereof) as package_dir in
56
- # rake/packagetask.
57
- attr_accessor :package_dir
58
-
59
- # Name of git remote used to push tags during a release. Default is origin.
60
- attr_accessor :git_remote
61
-
62
- # True if should use Chef::VersionString.
63
- attr_accessor :use_versionstring
64
-
65
- def initialize(root_path = nil, module_name = nil, gem_name = nil)
66
- init(root_path, module_name, gem_name)
67
- yield self if block_given?
68
- define unless root_path.nil? || module_name.nil?
69
- end
70
-
71
- def init(root_path, module_name, gem_name)
72
- @root_path = root_path
73
- @module_name = module_name
74
- @gem_name = gem_name
75
- @component_paths = []
76
- @module_path = nil
77
- @package_dir = "pkg"
78
- @git_remote = "origin"
79
- @generate_version_class = false
80
- end
81
-
82
- def component_full_paths
83
- component_paths.map { |path| File.expand_path(path, root_path) }
84
- end
85
-
86
- def version_rb_path
87
- File.expand_path("lib/#{module_path}/version.rb", root_path)
88
- end
89
-
90
- def chef_root_path
91
- module_name == "Chef" ? root_path : File.dirname(root_path)
92
- end
93
-
94
- def version_file_path
95
- File.join(chef_root_path, "VERSION")
96
- end
97
-
98
- def gemfile_lock_path
99
- File.join(root_path, "Gemfile.lock")
100
- end
101
-
102
- def version
103
- IO.read(version_file_path).strip
104
- end
105
-
106
- def full_package_dir
107
- File.expand_path(package_dir, root_path)
108
- end
109
-
110
- def class_or_module
111
- generate_version_class ? "class" : "module"
112
- end
113
-
114
- def with_clean_env(&block)
115
- if defined?(Bundler)
116
- Bundler.with_clean_env(&block)
117
- else
118
- yield
119
- end
120
- end
121
-
122
- def define
123
- raise "Need to provide package root and module name" if root_path.nil? || module_name.nil?
124
-
125
- desc "Build Gems of component dependencies"
126
- task :package_components do
127
- component_full_paths.each do |component_path|
128
- Dir.chdir(component_path) do
129
- sh "rake package"
130
- end
131
- end
132
- end
133
-
134
- task :package => :package_components
135
-
136
- desc "Build and install component dependencies"
137
- task :install_components => :package_components do
138
- component_full_paths.each do |component_path|
139
- Dir.chdir(component_path) do
140
- sh "rake install"
141
- end
142
- end
143
- end
144
-
145
- task :install => :install_components
146
-
147
- desc "Clean up builds of component dependencies"
148
- task :clobber_component_packages do
149
- component_full_paths.each do |component_path|
150
- Dir.chdir(component_path) do
151
- sh "rake clobber_package"
152
- end
153
- end
154
- end
155
-
156
- task :clobber_package => :clobber_component_packages
157
-
158
- desc "Update the version number for component dependencies"
159
- task :update_components_versions do
160
- component_full_paths.each do |component_path|
161
- Dir.chdir(component_path) do
162
- sh "rake version"
163
- end
164
- end
165
- end
166
-
167
- namespace :version do
168
- desc "Regenerate lib/#{module_path}/version.rb from VERSION file"
169
- task :update => :update_components_versions do
170
- update_version_rb
171
- update_gemfile_lock
172
- end
173
-
174
- task :bump => %w{version:bump_patch version:update}
175
-
176
- task :show do
177
- puts version
178
- end
179
-
180
- # Add 1 to the current patch version in the VERSION file, and write it back out.
181
- task :bump_patch do
182
- current_version = version
183
- new_version = current_version.sub(/^(\d+\.\d+\.)(\d+)/) { "#{$1}#{$2.to_i + 1}" }
184
- puts "Updating version in #{version_rb_path} from #{current_version.chomp} to #{new_version.chomp}"
185
- IO.write(version_file_path, new_version)
186
- end
187
-
188
- task :bump_minor do
189
- current_version = version
190
- new_version = current_version.sub(/^(\d+)\.(\d+)\.(\d+)/) { "#{$1}.#{$2.to_i + 1}.0" }
191
- puts "Updating version in #{version_rb_path} from #{current_version.chomp} to #{new_version.chomp}"
192
- IO.write(version_file_path, new_version)
193
- end
194
-
195
- task :bump_major do
196
- current_version = version
197
- new_version = current_version.sub(/^(\d+)\.(\d+\.\d+)/) { "#{$1.to_i + 1}.0.0" }
198
- puts "Updating version in #{version_rb_path} from #{current_version.chomp} to #{new_version.chomp}"
199
- IO.write(version_file_path, new_version)
200
- end
201
-
202
- def update_version_rb # rubocop:disable Lint/NestedMethodDefinition
203
- puts "Updating #{version_rb_path} to include version #{version} ..."
204
- contents = <<-VERSION_RB
205
- # Copyright:: Copyright 2010-2016, Chef Software, Inc.
206
- # License:: Apache License, Version 2.0
207
- #
208
- # Licensed under the Apache License, Version 2.0 (the "License");
209
- # you may not use this file except in compliance with the License.
210
- # You may obtain a copy of the License at
211
- #
212
- # http://www.apache.org/licenses/LICENSE-2.0
213
- #
214
- # Unless required by applicable law or agreed to in writing, software
215
- # distributed under the License is distributed on an "AS IS" BASIS,
216
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
217
- # See the License for the specific language governing permissions and
218
- # limitations under the License.
219
-
220
- #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
221
- # NOTE: This file is generated by running `rake version` in the top level of
222
- # this repo. Do not edit this manually. Edit the VERSION file and run the rake
223
- # task instead.
224
- #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
225
- #{"\nrequire \"chef/version_string\"\n" if use_versionstring}
226
- #{class_or_module} #{module_name}
227
- #{module_name.upcase}_ROOT = File.expand_path("../..", __FILE__)
228
- VERSION = #{use_versionstring ? "Chef::VersionString.new(\"#{version}\")" : "\"#{version}\""}
229
- end
230
-
231
- #
232
- # NOTE: the Chef::Version class is defined in version_class.rb
233
- #
234
- # NOTE: DO NOT Use the Chef::Version class on #{module_name}::VERSIONs. The
235
- # Chef::Version class is for _cookbooks_ only, and cannot handle
236
- # pre-release versions like "10.14.0.rc.2". Please use Rubygem's
237
- # Gem::Version class instead.
238
- #
239
- VERSION_RB
240
- IO.write(version_rb_path, contents)
241
- end
242
-
243
- def update_gemfile_lock # rubocop:disable Lint/NestedMethodDefinition
244
- if File.exist?(gemfile_lock_path)
245
- puts "Updating #{gemfile_lock_path} to include version #{version} ..."
246
- contents = IO.read(gemfile_lock_path)
247
- contents.gsub!(/^\s*(chef|chef-config)\s*\((= )?\S+\)\s*$/) do |line|
248
- line.gsub(/\((= )?\d+(\.\d+)+/) { "(#{$1}#{version}" }
249
- end
250
- IO.write(gemfile_lock_path, contents)
251
- end
252
- end
253
- end
254
-
255
- task :version => "version:update"
256
-
257
- gemspec_platform_to_install = ""
258
- Dir[File.expand_path("*.gemspec", root_path)].reverse_each do |gemspec_path|
259
- gemspec = eval(IO.read(gemspec_path))
260
- Gem::PackageTask.new(gemspec) do |task|
261
- task.package_dir = full_package_dir
262
- end
263
- gemspec_platform_to_install = "-#{gemspec.platform}" if gemspec.platform != Gem::Platform::RUBY && Gem::Platform.match(gemspec.platform)
264
- end
265
-
266
- desc "Build and install a #{module_path} gem"
267
- task :install => [:package] do
268
- with_clean_env do
269
- full_module_path = File.join(full_package_dir, module_path)
270
- sh %{gem install #{full_module_path}-#{version}#{gemspec_platform_to_install}.gem --no-rdoc --no-ri}
271
- end
272
- end
273
-
274
- task :uninstall do
275
- sh %{gem uninstall #{module_path} -x -v #{version} }
276
- end
277
-
278
- desc "Build it, tag it and ship it"
279
- task :ship => [:clobber_package, :gem] do
280
- sh("git tag #{version}")
281
- sh("git push #{git_remote} --tags")
282
- Dir[File.expand_path("*.gem", full_package_dir)].reverse_each do |built_gem|
283
- sh("gem push #{built_gem}")
284
- end
285
- end
286
- end
287
- end
288
-
289
- end