puppetlabs_spec_helper 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/puppetlabs_spec_helper/rake_tasks.rb +35 -13
- data/lib/puppetlabs_spec_helper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1889098dbf439ae7274e2b27fb3953d82a8c53a8
|
4
|
+
data.tar.gz: dd27b2e161f3c4a7c77ba38e044f4a1a322bb3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6ae9d52ec46f3b3cf480b03a12491e79fe771b3f61b846da7b3fabd8a9a772783c61ec0c6c24552d68108be344958c37191af91f3081c79caa9317af9eae629
|
7
|
+
data.tar.gz: 78c2779abc91960af397c0129249c4ea8e8724dfe60214e98014f1f0e0f0d5063c8039600bf2bb0bf37a3e1278b869aa11b0bcaa5b6da08064560fe19acc240a
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [2.1.4]
|
6
|
+
### Summary:
|
7
|
+
Better Windows support.
|
8
|
+
|
9
|
+
### Fixed:
|
10
|
+
- Create directory junctions instead of symlinks on windows (#192)
|
11
|
+
- Replace check:symlinks with platform independent alternative (#193)
|
12
|
+
|
5
13
|
## [2.1.3]
|
6
14
|
### Summary:
|
7
15
|
This release fixes puppet module install into paths with spaces, and fix conflicting build names for CI jobs.
|
@@ -3,6 +3,7 @@ require 'rake'
|
|
3
3
|
require 'rspec/core/rake_task'
|
4
4
|
require 'tmpdir'
|
5
5
|
require 'yaml'
|
6
|
+
require 'pathname'
|
6
7
|
|
7
8
|
# optional gems
|
8
9
|
begin
|
@@ -240,11 +241,12 @@ task :spec_prep do
|
|
240
241
|
# Ruby only sets File::ALT_SEPARATOR on Windows and Rubys standard library
|
241
242
|
# uses this to check for Windows
|
242
243
|
is_windows = !!File::ALT_SEPARATOR
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
244
|
+
if is_windows
|
245
|
+
begin
|
246
|
+
require 'win32/dir'
|
247
|
+
rescue LoadError
|
248
|
+
$stderr.puts "win32-dir gem not installed, falling back to executing mklink directly"
|
249
|
+
end
|
248
250
|
end
|
249
251
|
|
250
252
|
# git has a race condition creating that directory, that would lead to aborted clone operations
|
@@ -282,11 +284,16 @@ task :spec_prep do
|
|
282
284
|
repositories.each {|remote, opts| opts[:thread].join }
|
283
285
|
|
284
286
|
fixtures("symlinks").each do |source, target|
|
285
|
-
|
286
|
-
|
287
|
-
|
287
|
+
unless File.symlink(target)
|
288
|
+
if is_windows
|
289
|
+
if Dir.respond_to?(:create_junction)
|
290
|
+
Dir.create_junction(target, source)
|
291
|
+
else
|
292
|
+
system("call mklink /J \"#{target.gsub('/', '\\')}\" \"#{source.gsub('/', '\\')}\"")
|
293
|
+
end
|
294
|
+
end
|
288
295
|
else
|
289
|
-
|
296
|
+
FileUtils::ln_sf(source, target)
|
290
297
|
end
|
291
298
|
end
|
292
299
|
|
@@ -534,13 +541,28 @@ task :release_checks do
|
|
534
541
|
Rake::Task["check:git_ignore"].invoke
|
535
542
|
end
|
536
543
|
|
544
|
+
def check_directory_for_symlinks(dir='.')
|
545
|
+
dir = Pathname.new(dir) unless dir.is_a?(Pathname)
|
546
|
+
results = []
|
547
|
+
|
548
|
+
dir.each_child(true) do |child|
|
549
|
+
if child.symlink?
|
550
|
+
results << child
|
551
|
+
elsif child.directory? && child.basename.to_s != '.git'
|
552
|
+
results.concat(check_directory_for_symlinks(child))
|
553
|
+
end
|
554
|
+
end
|
555
|
+
|
556
|
+
results
|
557
|
+
end
|
558
|
+
|
537
559
|
namespace :check do
|
538
560
|
desc "Fails if symlinks are present in directory"
|
539
561
|
task :symlinks do
|
540
|
-
|
541
|
-
unless
|
542
|
-
puts
|
543
|
-
fail "
|
562
|
+
symlinks = check_directory_for_symlinks
|
563
|
+
unless symlinks.empty?
|
564
|
+
symlinks.each { |r| puts "Symlink found: #{r.to_s} => #{r.readlink}" }
|
565
|
+
fail "Symlink(s) exist within this directory"
|
544
566
|
end
|
545
567
|
end
|
546
568
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetlabs_spec_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mocha
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.5.
|
218
|
+
rubygems_version: 2.5.2
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: Standard tasks and configuration for module spec tests.
|