Skip to content

Commit

Permalink
Detect json version from version.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 5, 2023
1 parent da84ab4 commit 3ef57b5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion json-java.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
/^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
end rescue nil

spec = Gem::Specification.new do |s|
s.name = "json"
s.version = File.read("VERSION").chomp
s.version = version

s.summary = "JSON Implementation for Ruby"
s.description = "A JSON implementation as a JRuby extension."
Expand Down
6 changes: 5 additions & 1 deletion json.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
/^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
end rescue nil

Gem::Specification.new do |s|
s.name = "json"
s.version = File.read(File.expand_path('../VERSION', __FILE__)).chomp
s.version = version

s.summary = "JSON Implementation for Ruby"
s.description = "This is a JSON implementation as a Ruby extension in C."
Expand Down
6 changes: 5 additions & 1 deletion json_pure.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
version = File.foreach(File.join(__dir__, "lib/json/version.rb")) do |line|
/^\s*VERSION\s*=\s*'(.*)'/ =~ line and break $1
end rescue nil

Gem::Specification.new do |s|
s.name = "json_pure".freeze
s.version = File.read("VERSION").chomp
s.version = version

s.summary = "JSON Implementation for Ruby".freeze
s.description = "This is a JSON implementation in pure Ruby.".freeze
Expand Down

0 comments on commit 3ef57b5

Please sign in to comment.