puppetlabs_spec_helper 2.1.3 → 2.2.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4e32792b5b1b9ff5cb3e4549b2e34f8c067358e
4
- data.tar.gz: bde81e497fccf351baa4c2b7304346ae134f71c7
3
+ metadata.gz: feee2f3cf5d61beaccc0515e95befc300307a526
4
+ data.tar.gz: 4931b17333960330bf64c0e6d9d54242d873be49
5
5
  SHA512:
6
- metadata.gz: d61b5e9fb3e9d439f72be5cd436a8c1b2b154696b81647e9a8d133640560e46e0f33be60c046b50715e3e1c8eaa3c691ee416408aa119067f5da1917e8c562ef
7
- data.tar.gz: 31c88292d17c418fb89bc02f6a80ed5acfabd2384c578f7a8e978e23f27084154e52f465770e73976d2ddbea8386227a7d0b1abdf18f01be452cd9fa957200e7
6
+ metadata.gz: 5ade464305fa7a9b1e237e0ecf379c23a2e27d38f963b7c7129432859c3b311f1a933a69a9624ba53e26cab68ec4d1461f888ddccd504a860889f450762fe94c
7
+ data.tar.gz: 63648ac51c6b670f3ad180b39ac6ce6fd7150b3457aa47faa555af86199ff806f5156354f7ec92c42a4f0997af2a8904b677ac939591b03791b472b34299fda6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
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.2.0]
6
+ ### Summary
7
+ i18n rake task, and unbreak windows again.
8
+
9
+ ### Added
10
+ - New rake task for i18n stuff.
11
+
12
+ ### Fixed
13
+ - Fixture path calculation for windows
14
+ - Log to stderr instead of stdout as per rspec's spec
15
+
16
+ ## [2.1.5]
17
+ ### Summary:
18
+ Fix symlinks fixtures code.
19
+
20
+ ## [2.1.4]
21
+ ### Summary:
22
+ Better Windows support.
23
+
24
+ ### Fixed:
25
+ - Create directory junctions instead of symlinks on windows (#192)
26
+ - Replace check:symlinks with platform independent alternative (#193)
27
+
5
28
  ## [2.1.3]
6
29
  ### Summary:
7
30
  This release fixes puppet module install into paths with spaces, and fix conflicting build names for CI jobs.
@@ -338,7 +361,10 @@ compatible yet.
338
361
  ### Added
339
362
  * Initial release
340
363
 
341
- [unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.3...master
364
+ [unreleased]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.2.0...master
365
+ [2.2.0]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.5...v2.2.0
366
+ [2.1.5]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.4...v2.1.5
367
+ [2.1.4]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.3...v2.1.4
342
368
  [2.1.3]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.2...v2.1.3
343
369
  [2.1.2]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.1...v2.1.2
344
370
  [2.1.1]: https://github.com/puppetlabs/puppetlabs_spec_helper/compare/v2.1.0...v2.1.1
@@ -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
@@ -94,7 +95,7 @@ def vagrant_ssh(set, node = nil)
94
95
  end
95
96
 
96
97
  def auto_symlink
97
- { Dir.pwd.split('/').last.split('-').last => '#{source_dir}' }
98
+ { File.basename(Dir.pwd).split('-').last => '#{source_dir}' }
98
99
  end
99
100
 
100
101
  def fixtures(category)
@@ -192,7 +193,7 @@ def logger
192
193
  else
193
194
  level = Logger::INFO
194
195
  end
195
- @logger = Logger.new(STDOUT)
196
+ @logger = Logger.new(STDERR)
196
197
  @logger.level = level
197
198
  end
198
199
  @logger
@@ -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
- puppet_symlink_available = false
244
- begin
245
- require 'puppet'
246
- puppet_symlink_available = Puppet::FileSystem.respond_to?(:symlink)
247
- rescue
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
@@ -281,12 +283,18 @@ task :spec_prep do
281
283
  # wait for all the threads to finish
282
284
  repositories.each {|remote, opts| opts[:thread].join }
283
285
 
284
- fixtures("symlinks").each do |source, target|
285
- if is_windows
286
- fail "Cannot symlink on Windows unless using at least Puppet 3.5" if !puppet_symlink_available
287
- Puppet::FileSystem::exist?(target) || Puppet::FileSystem::symlink(source, target)
288
- else
289
- File::exists?(target) || FileUtils::ln_sf(source, target)
286
+ fixtures("symlinks").each do |target, link|
287
+ unless File.symlink?(link)
288
+ logger.info("Creating symlink from #{link} to #{target}")
289
+ if is_windows
290
+ if Dir.respond_to?(:create_junction)
291
+ Dir.create_junction(link, target)
292
+ else
293
+ system("call mklink /J \"#{link.gsub('/', '\\')}\" \"#{target.gsub('/', '\\')}\"")
294
+ end
295
+ else
296
+ FileUtils::ln_sf(target, link)
297
+ end
290
298
  end
291
299
  end
292
300
 
@@ -534,13 +542,28 @@ task :release_checks do
534
542
  Rake::Task["check:git_ignore"].invoke
535
543
  end
536
544
 
545
+ def check_directory_for_symlinks(dir='.')
546
+ dir = Pathname.new(dir) unless dir.is_a?(Pathname)
547
+ results = []
548
+
549
+ dir.each_child(true) do |child|
550
+ if child.symlink?
551
+ results << child
552
+ elsif child.directory? && child.basename.to_s != '.git'
553
+ results.concat(check_directory_for_symlinks(child))
554
+ end
555
+ end
556
+
557
+ results
558
+ end
559
+
537
560
  namespace :check do
538
561
  desc "Fails if symlinks are present in directory"
539
562
  task :symlinks do
540
- symlink = `find . -path ./.git -prune -o -type l -ls`
541
- unless symlink == ""
542
- puts symlink
543
- fail "A symlink exists within this directory"
563
+ symlinks = check_directory_for_symlinks
564
+ unless symlinks.empty?
565
+ symlinks.each { |r| puts "Symlink found: #{r.to_s} => #{r.readlink}" }
566
+ fail "Symlink(s) exist within this directory"
544
567
  end
545
568
  end
546
569
 
@@ -607,4 +630,11 @@ if File.exist? locales_dir
607
630
  rescue Gem::LoadError
608
631
  puts "No gettext-setup gem found, skipping gettext initialization" if Rake.verbose == true
609
632
  end
633
+ namespace :module do
634
+ desc "Runs all tasks to build a modules POT file for internationalization"
635
+ task :pot_gen do
636
+ Rake::Task["gettext:pot"].invoke()
637
+ Rake::Task["gettext:metadata_pot"].invoke("#{module_dir}/metadata.json")
638
+ end
639
+ end
610
640
  end
@@ -1,5 +1,5 @@
1
1
  module PuppetlabsSpecHelper
2
- VERSION = "2.1.3"
2
+ VERSION = "2.2.0"
3
3
 
4
4
  # compat for pre-1.2.0 users; deprecated
5
5
  module Version
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.3
4
+ version: 2.2.0
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-05-31 00:00:00.000000000 Z
12
+ date: 2017-06-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mocha