Generate information cards with titles You must take input in the form of

title|line1|line2|(...)|line[n]


And output an information card. It's hard to explain how to make the card, so here's a quick example:

Input

1234567890|12345|1234567890123|pie|potato|unicorn


Output

/===============\
|  1234567890   |
|===============|
| 12345         |
| 1234567890123 |
| pie           |
| potato        |
| unicorn       |
\---------------/


Detailed specifications:


The title must be centered (if there are an odd number of characters you can decide whether to put an extra space after or before it).
The remaining lines must be left-aligned.
All of them must have at least one space of padding before and after.
Each line must be the same length.
The lines must be the smallest length possible in order to fit all of the text.
The first and last character of each row (except for the first and last rows) must be a |.
There must be a /, a row of =s, and a \ in the line right before the title. (the first line)
There must be a |, a row of =s. and a | in the line right after the title. (the third line)
There must be a \, a row of -s, and a / in the last line.
For the example input provided, your program's output must exactly match the example output provided.
The input will always contain at least one |; your programs behaivior when a string like badstring is input does not matter.


This is code-golf so the shortest code in character count wins.
Ruby, 153 147 140 characters

h,*d=s=gets.chop.split(?|)
puts"/%s\\
|%s|
|%s|"%[e=?=*k=2+l=s.map(&amp;:size).max,h.center(k),e]
d.map{|x|puts"| %%-%ds |"%l%x}
$&gt;&lt;&lt;?\\+?-*k+?/


Double format string in the second-to-last line :D