Skip to content

Instantly share code, notes, and snippets.

@snusnu
Created November 13, 2008 01:45
Show Gist options
  • Save snusnu/24340 to your computer and use it in GitHub Desktop.
Save snusnu/24340 to your computer and use it in GitHub Desktop.
mungo:~/projects/trippings snusnu$ irb
irb(main):001:0> require "rubygems"; require "randexp"
=> true
irb(main):002:0> /\w{10}/.gen
=> "flattering"
irb(main):003:0> /\w{20}/.gen
=> "hypsidolichocephalic"
irb(main):004:0> /\w{30}/.gen
NoMethodError: undefined method `pick' for nil:NilClass
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/randgen.rb:35:in `word'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:64:in `char'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:17:in `random'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:4:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:4:in `reduce'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:12:in `quantify'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:4:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/reducer.rb:4:in `[]'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp.rb:9:in `reduce'
from /usr/local/lib/ruby/gems/1.8/gems/randexp-0.1.4/lib/randexp/core_ext/regexp.rb:3:in `gen'
from (irb):4
irb(main):005:0> /[:sentence:]/.gen[0..30]
=> "Browbeat underway nonsiphonage "
irb(main):006:0> /[:sentence:]/.gen[0..40]
=> "Awrist unwrought motional conceitedly pla"
irb(main):007:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment