[ruby/benchmark] Don't use version.rb

https://github.com/ruby/benchmark/commit/6d51b10500
This commit is contained in:
Hiroshi SHIBATA authored and git committed 2023-05-25 07:08:44 +00:00
1 parent 8e2fac7b9c
commit 5bfb317a93
3 files changed
+9 -10

No files matched your search

+2
View File
@@ -121,6 +121,8 @@
module Benchmark
VERSION = "0.2.1"
BENCHMARK_VERSION = "2002-04-25" # :nodoc:
# Invokes the block with a Benchmark::Report object, which
+7 -6
View File
@@ -1,12 +1,13 @@
begin
require_relative "lib/benchmark/version"
rescue LoadError # Fallback to load version file in ruby core repository
require_relative "version"
name = File.basename(__FILE__, ".gemspec")
version = ["lib", Array.new(name.count("-")+1, ".").join("/")].find do |dir|
break File.foreach(File.join(__dir__, dir, "#{name.tr('-', '/')}.rb")) do |line|
/^\s*VERSION\s*=\s*"(.*)"/ =~ line and break $1
end rescue nil
end
Gem::Specification.new do |spec|
spec.name = "benchmark"
spec.version = Benchmark::VERSION
spec.name = name
spec.version = version
spec.authors = ["Yukihiro Matsumoto"]
spec.email = ["matz@ruby-lang.org"]
-4
View File
@@ -1,4 +0,0 @@
# frozen_string_literal: true
module Benchmark
VERSION = "0.2.1"
end