From 09c3f84566f4f79c678e9d16417f4dfcf12abba8 Mon Sep 17 00:00:00 2001 From: zzak Date: Fri, 31 Jan 2014 21:12:49 +0000 Subject: * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/securerandom.rb | 6 ++++++ 2 files changed, 12 insertions(+) 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" -- cgit v1.2.3