Skip to content

Instantly share code, notes, and snippets.

@csexton
Created June 6, 2014 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save csexton/fda2a5b5d8f683b09819 to your computer and use it in GitHub Desktop.
Save csexton/fda2a5b5d8f683b09819 to your computer and use it in GitHub Desktop.
def pack_size(desc)
if (desc.match(/([\d]+)[\s]pack/i){ |m| pack_count = m[:pack_count].to_i }
$1.to_i
else
1
end
end
def pack_size(desc)
desc.match(/([\d]+)[\s]pack/i){ |m| pack_count = m[1].to_i } || 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment