Skip to content

Commit f891dd2

Browse files
Fix bundler vendoring/caching (sinatra#2144)
When using Bundler's bundle package to vendor/cache gems, sinatra-contrib and rack-protection gemspecs failed with: No such file or directory @ rb_sysopen - /path/to/vendor/cache/VERSION Both gemspecs read the version from a parent VERSION file using ../VERSION. When Bundler copies gems to vendor/cache, the parent directory structure doesn't exist, so ../VERSION points to a non-existent file.
1 parent 9e5c4ec commit f891dd2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

rack-protection/rack-protection.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# frozen_string_literal: true
22

3-
version = File.read(File.expand_path('../VERSION', __dir__)).strip
3+
require_relative 'lib/rack/protection/version'
44

55
Gem::Specification.new do |s|
66
# general infos
77
s.name = 'rack-protection'
8-
s.version = version
8+
s.version = Rack::Protection::VERSION
99
s.description = 'Protect against typical web attacks, works with all Rack apps, including Rails'
1010
s.homepage = 'https://sinatrarb.com/protection/'
1111
s.summary = "#{s.description}."

sinatra-contrib/sinatra-contrib.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# frozen_string_literal: true
22

3-
version = File.read(File.expand_path('../VERSION', __dir__)).strip
3+
require_relative 'lib/sinatra/contrib/version'
4+
5+
version = Sinatra::Contrib::VERSION
46

57
Gem::Specification.new do |s|
68
s.name = 'sinatra-contrib'

0 commit comments

Comments
 (0)