Skip to content

Commit d16695e

Browse files
committed
fix BOUNCY_CASTLE_VERSION matching in gemspec
1 parent d42498e commit d16695e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

jruby-openssl.gemspec

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Gem::Specification.new do |s|
44
s.name = 'jruby-openssl'
55

6-
path = File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
7-
s.version = File.read(path).match( /.*VERSION\s*=\s*['"](.*)['"]/m )[1]
6+
version_rb = File.expand_path('lib/jopenssl/version.rb', File.dirname(__FILE__))
7+
version_rb = File.read(version_rb)
8+
s.version = version_rb.match( /.*VERSION\s*=\s*['"](.*)['"]/m )[1]
89

910
s.platform = 'java'
1011
s.authors = ['Ola Bini', 'JRuby contributors']
@@ -21,8 +22,11 @@ Gem::Specification.new do |s|
2122
select { |f| f =~ /^(lib)/ || f =~ /^History|LICENSE|README|Rakefile/i } +
2223
Dir.glob('lib/**/*.jar') # 'lib/jopenssl.jar' and potentially BC jars
2324

24-
s.requirements << "jar org.bouncycastle:bcpkix-jdk15on, #{Jopenssl::Version::BOUNCY_CASTLE_VERSION}"
25-
s.requirements << "jar org.bouncycastle:bcprov-jdk15on, #{Jopenssl::Version::BOUNCY_CASTLE_VERSION}"
25+
bc_version = version_rb.match( /.*BOUNCY_CASTLE_VERSION\s*=\s*['"](.*)['"]/m )[1]
26+
raise 'BOUNCY_CASTLE_VERSION not matched' if (bc_version || '').empty?
27+
28+
s.requirements << "jar org.bouncycastle:bcpkix-jdk15on, #{bc_version}"
29+
s.requirements << "jar org.bouncycastle:bcprov-jdk15on, #{bc_version}"
2630

2731
s.add_development_dependency 'jar-dependencies', '~> 0.1.0'
2832

0 commit comments

Comments
 (0)