Skip to content

Commit 7769ecd

Browse files
committed
Synchronize generated gemspec with current bundler template
See template at https://github.com/rubygems/rubygems/blob/d786a1ccca3922d21572f77b021c51bfaf005819/bundler/lib/bundler/templates/newgem/newgem.gemspec.tt#L34 Additionally, exclude .gem files, since there seem to be several gems built from swagger-codegen that are recursively including older .gem versions, and thus growing in size exponentially
1 parent f41ecbf commit 7769ecd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache

+8-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ Gem::Specification.new do |s|
3636
s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16'
3737
s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12'
3838

39-
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
40-
s.test_files = `find spec/*`.split("\n")
39+
gemspec = File.basename(__FILE__)
40+
spec.files = IO.popen(%w[find * -print0], chdir: __dir__, err: IO::NULL) do |ls|
41+
ls.readlines("\x0", chomp: true).reject do |f|
42+
(f == gemspec) ||
43+
f.start_with?(*%w[bin/ test/ spec/ features/ .git Gemfile]) ||
44+
f.end_with?(".gem")
45+
end
46+
end
4147
s.executables = []
4248
s.require_paths = ["lib"]
4349
end

0 commit comments

Comments
 (0)