From 7de4850afdfb19b492a47e41a61aca80605afc5a Mon Sep 17 00:00:00 2001 From: Jacob Kjeldahl Date: Thu, 19 May 2022 11:31:55 +0200 Subject: [PATCH 1/3] Skips files in vendor When installing gems using bundler on a CI system the gems end up in the vendor/bundle folder pr default and these files are not supposed to be included in the package, so they should be skipped. Also locally if installing gems in vendor/ I get a "Too many open files" error as each AppFile is opened upon instantiation. Some systems will not the path be changed: https://github.com/ruby/setup-ruby/issues/136 --- lib/zendesk_apps_support/package.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zendesk_apps_support/package.rb b/lib/zendesk_apps_support/package.rb index 8473f022..de27e873 100644 --- a/lib/zendesk_apps_support/package.rb +++ b/lib/zendesk_apps_support/package.rb @@ -90,7 +90,7 @@ def files Dir[root.join('**/**')].each do |f| next unless File.file?(f) relative_file_name = f.sub(%r{#{root}/?}, '') - next if relative_file_name =~ %r{^tmp/} + next if relative_file_name =~ %r{^(tmp|vendor)/} files << AppFile.new(self, relative_file_name) end files From 42101b65ac52446618161fe6c136742d06b081ac Mon Sep 17 00:00:00 2001 From: Jacob Kjeldahl Date: Thu, 19 May 2022 11:36:12 +0200 Subject: [PATCH 2/3] Adds dummy bundled gem file --- spec/app/vendor/bundle/bundled_gem.rb | 1 + 1 file changed, 1 insertion(+) create mode 100644 spec/app/vendor/bundle/bundled_gem.rb diff --git a/spec/app/vendor/bundle/bundled_gem.rb b/spec/app/vendor/bundle/bundled_gem.rb new file mode 100644 index 00000000..573d759c --- /dev/null +++ b/spec/app/vendor/bundle/bundled_gem.rb @@ -0,0 +1 @@ +# An example of a vendor bundled gem file From 2260f8326b79440676ec8a7aad222bcdbfe0360a Mon Sep 17 00:00:00 2001 From: Jacob Kjeldahl Date: Thu, 19 May 2022 11:37:03 +0200 Subject: [PATCH 3/3] Updates spec for files --- spec/package_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/package_spec.rb b/spec/package_spec.rb index ff725675..1b4710aa 100644 --- a/spec/package_spec.rb +++ b/spec/package_spec.rb @@ -111,7 +111,7 @@ end describe 'files' do - it 'should return all the files within the app folder excluding files in tmp folder' do + it 'should return all the files within the app folder excluding files in tmp and vendor folder' do files = %w[app.css app.js assets/logo-small.png assets/logo.png lib/a.js lib/a.txt lib/nested/b.js manifest.json templates/layout.hdbs translations/en.json translations/nl.json] expect(@package.files.map(&:relative_path)).to match_array(files)