diff --git a/ChangeLog b/ChangeLog index 4b437bac0b..c6fd8f654d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Feb 1 06:10:49 2014 Zachary Scott + + * lib/securerandom.rb: [DOC] Add note on require for examples + Based on a patch by @schneems [Fixes GH-518] [ci skip] + https://github.com/ruby/ruby/pull/518 + Sat Feb 1 06:04:56 2014 Zachary Scott * numeric.c: [DOC] Fix typo in example for #step [ci skip] diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 4f2c35cabd..3ff5075023 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -8,6 +8,10 @@ end # This library is an interface for secure random number generator which is # suitable for generating session key in HTTP cookies, etc. # +# You can use this library in your application by requiring it: +# +# require 'securerandom' +# # It supports following secure random number generators. # # * openssl @@ -18,6 +22,8 @@ end # # Hexadecimal string. # +# require 'securerandom' +# # p SecureRandom.hex(10) #=> "52750b30ffbc7de3b362" # p SecureRandom.hex(10) #=> "92b15d6c8dc4beb5f559" # p SecureRandom.hex(13) #=> "39b290146bea6ce975c37cfc23"