[ruby/securerandom] Expose SecureRandom::VERSION
https://github.com/ruby/securerandom/commit/2e6434331d
This commit is contained in:
parent
60f22ebf86
commit
ebe620def6
@ -1,6 +1,13 @@
|
|||||||
|
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|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "securerandom"
|
spec.name = name
|
||||||
spec.version = "0.2.2"
|
spec.version = version
|
||||||
spec.authors = ["Tanaka Akira"]
|
spec.authors = ["Tanaka Akira"]
|
||||||
spec.email = ["akr@fsij.org"]
|
spec.email = ["akr@fsij.org"]
|
||||||
|
|
||||||
|
@ -39,6 +39,9 @@ require 'random/formatter'
|
|||||||
# +NotImplementedError+ is raised.
|
# +NotImplementedError+ is raised.
|
||||||
|
|
||||||
module SecureRandom
|
module SecureRandom
|
||||||
|
|
||||||
|
VERSION = "0.2.2"
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def bytes(n)
|
def bytes(n)
|
||||||
return gen_random(n)
|
return gen_random(n)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user