Skip to content

Commit 5eda23d

Browse files
committed
(MAINT) Gemspec explicit file declarations
Prior to this commit spec.files used git to collect the required files for the gem. This would pull in everything that had been checked in to git. We can actually be a little bit more explicit here. This commit updates spec.files to contain a known list of files to include in the gem.
1 parent 6633bcd commit 5eda23d

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os:
18-
- "windows-latest"
19-
- "windows-2019"
2018
- "ubuntu-latest"
2119
ruby:
2220
- 2.5

ruby-pwsh.gemspec

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
1818
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
1919
# to allow pushing to a single host or delete this section to allow pushing to any host.
2020
if spec.respond_to?(:metadata)
21-
2221
spec.metadata['homepage_uri'] = spec.homepage
2322
spec.metadata['source_code_uri'] = 'https://github.com/puppetlabs/ruby-pwsh'
2423
spec.metadata['changelog_uri'] = 'https://github.com/puppetlabs/ruby-pwsh'
@@ -27,11 +26,14 @@ Gem::Specification.new do |spec|
2726
'public gem pushes.'
2827
end
2928

30-
# Specify which files should be added to the gem when it is released.
31-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
33-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34-
end
29+
spec.files = Dir[
30+
'README.md',
31+
'LICENSE',
32+
'.rubocop.yml',
33+
'lib/**/*',
34+
'bin/**/*',
35+
'spec/**/*',
36+
]
3537

3638
spec.bindir = 'exe'
3739
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }

spec/unit/pwsh_spec.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,11 @@ def close_stream(stream, style = :inprocess)
401401

402402
context 'it should handle UTF-8' do
403403
# different UTF-8 widths
404-
# rubocop:disable Style/AsciiComments
405404
# 1-byte A
406405
# 2-byte ۿ - http://www.fileformat.info/info/unicode/char/06ff/index.htm - 0xDB 0xBF / 219 191
407406
# 3-byte ᚠ - http://www.fileformat.info/info/unicode/char/16A0/index.htm - 0xE1 0x9A 0xA0 / 225 154 160
408407
# 4-byte 𠜎 - http://www.fileformat.info/info/unicode/char/2070E/index.htm - 0xF0 0xA0 0x9C 0x8E / 240 160 156 142
409408
let(:mixed_utf8) { "A\u06FF\u16A0\u{2070E}" } # Aۿᚠ𠜎
410-
# rubocop:enable Style/AsciiComments
411-
412409
it 'when writing basic text' do
413410
code = "Write-Output '#{mixed_utf8}'"
414411
result = manager.execute(code)

0 commit comments

Comments
 (0)