jruby
https://github.com/jruby/jruby
Ruby
JRuby, an implementation of Ruby on the JVM
Random::Formatter#choose
SecureRandom.choose generates a string that randomly draws from a source array of characters. The argument _source_ specifies the array of characters from which to generate the string. The argument _n_ specifies the length, in characters, of the string to be generated. The result may contain whatever characters are in the source array. p SecureRandom.choose([*'l'..'r']) #=> "lmrqpoonmmlqlron" p SecureRandom.choose([*'0'..'9'], 5) #=> "27309" If a secure random number generator is not available, +NotImplementedError+ is raised.
Edit
git clone [email protected]:jruby/jruby.git
cd jruby
open lib/ruby/stdlib/securerandom.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Random--Formatter-choose-for-pr
# Commit to gitgit add lib/ruby/stdlib/securerandom.rbgit commit -m "better docs for Random::Formatter#choose"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Random--Formatter-choose-for-pr
hub pull-request
# Celebrate!