Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- username = password = nil
- DATA.each do |line|
- value = line.split("=",2).last.strip
- line[/^\s*username/] && username = value
- line[/^\s*password/] && password = value
- end
- username # => "jim"
- password # => "secret"
- __END__
- username = jim
- password = secret
Add Comment
Please, Sign In to add comment