kitchen-transport-express 1.3.0 → 1.3.1

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
  SHA256:
3
- metadata.gz: b255fcbeed01b423bd2bd8e71069501b2c0b636e3d2313ccdd48f8347106333d
4
- data.tar.gz: 9696bbf314ccbda4c978cf89963e22005a18d064a359d835ccf033403d46f6b8
3
+ metadata.gz: 23840e5574cc8a84acfcb87e24a3a4f6c26ea1174a3c5c2bc8390d3fc23843b6
4
+ data.tar.gz: eb2165a04339df078065117b00af095b8cba4903d0c5d03233cedfc5b3ac6a8e
5
5
  SHA512:
6
- metadata.gz: 548f04230a39e196b59fd952a4a5247bb9ee4c754d88785f61400565d7c0bd8802a1857a3c7896bb7f1a311bb63475c7416b7746768436eee60fb9cfa0b2dcc7
7
- data.tar.gz: ba37810bfcdafaa6ba2973e6410c35aac5ac57bc0f9102db149829cffadea1043a4a24c509f41801eacbc6347cec41ae66907c0b79d90d95484a8bc3ea4d3707
6
+ metadata.gz: 8257d47351212661fd997b9b3397cdcc63f5f998352fd96362cd6d21092aba753943349db7c31688a705acbbec2582e4754f31b2dc57938b5771c3a726bb95f5
7
+ data.tar.gz: a3d90892108b59c591f965debb21bb38de8a6eab34f397703660ee5866c7c9a5158bb5a1e90974788d0c41ee8829c95a9457409ab8f4dca62c9b650a17cf2d2a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # kitchen-transport-express CHANGELOG
2
2
 
3
+ ## 1.3.1
4
+ * fix: 🐛 ensure directories that only contain dot files get archived
5
+
3
6
  ## 1.3.0
4
7
  * chore: 📝 minor updates to method documentation
5
8
  * chore: 🔧 add metadata to gemspec
@@ -30,16 +30,17 @@ module Kitchen
30
30
  def archive(path)
31
31
  archive_basename = ::File.basename(path) + ".tgz"
32
32
  archive_full_name = ::File.join(::File.dirname(path), archive_basename)
33
-
34
- file_count = ::Dir.glob(::File.join(path, "**/*")).size
35
- logger.debug("[#{Express::LOG_PREFIX}] #{path} contains #{file_count} files.")
36
- create_archive(path, archive_full_name)
33
+ files = all_files(path)
34
+ logger.debug("[#{Express::LOG_PREFIX}] #{path} contains #{files.size} files.")
35
+ create_archive(path, files, archive_full_name)
37
36
  archive_full_name
38
37
  end
39
38
 
40
39
  # Extracts the archive on the remote host.
41
40
  #
42
- # @param session [Net::SSH::Connection::Session] The SSH session used to connect to the remote host and execute the extract and cleanup commands.
41
+ # @param session [Net::SSH::Connection::Session] the SSH session used to connect to the remote host and execute the extract and cleanup commands.
42
+ # @param local [String] the directory in the local sandbox that is being processed.
43
+ # @param remote [String] the remote directory (kitchen_root).
43
44
  def extract(session, local, remote)
44
45
  return unless local.match(/.*\.tgz/)
45
46
 
@@ -54,15 +55,25 @@ module Kitchen
54
55
 
55
56
  private
56
57
 
58
+ # Creates a list of all files that are in the directory to be archived.
59
+ #
60
+ # @param path [String] the path to the directory that will be archived.
61
+ # @return [Array] an array of all files to be archived.
62
+ # @api private
63
+ def all_files(path)
64
+ Dir.glob(File.join(path, "/**/*"), File::FNM_DOTMATCH).reject { |f| %w{. ..}.include? File.basename(f) }
65
+ end
66
+
57
67
  # Creats a archive of the directory provided.
58
68
  #
59
69
  # @param path [String] the path to the directory that will be archived.
70
+ # @param files [Array] the array of all files that will be archived.
60
71
  # @param archive_path [String] the fully qualified path to the archive that will be created.
61
72
  # @api private
62
- def create_archive(path, archive_path)
73
+ def create_archive(path, files, archive_path)
63
74
  Archive.write_open_filename(archive_path, Archive::COMPRESSION_GZIP,
64
75
  Archive::FORMAT_TAR_PAX_RESTRICTED) do |tar|
65
- write_content(tar, path)
76
+ write_content(tar, path, files)
66
77
  end
67
78
  end
68
79
 
@@ -70,10 +81,10 @@ module Kitchen
70
81
  #
71
82
  # @param tar [Archive::Writer] the instance of the archive class.
72
83
  # @param path [String] the path to the directory that will be archived.
84
+ # @param files [Array] the array of all files that will be archived.
73
85
  # @api private
74
- def write_content(tar, path)
75
- all_files = Dir.glob("#{path}/**/*")
76
- all_files.each do |f|
86
+ def write_content(tar, path, files)
87
+ files.each do |f|
77
88
  if File.file? f
78
89
  tar.new_entry do |e|
79
90
  entry(e, f, path)
@@ -20,7 +20,7 @@ module Kitchen
20
20
  # The version string for Kitchen Transport Express.
21
21
  #
22
22
  # @author Justin Steele <justin.steele@oracle.com>
23
- VERSION = "1.3.0"
23
+ VERSION = "1.3.1"
24
24
  end
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-transport-express
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Steele
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-14 00:00:00.000000000 Z
11
+ date: 2025-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
182
  requirements: []
183
- rubygems_version: 3.3.7
183
+ rubygems_version: 3.3.27
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: Skip the long lines in Kitchen Transport!