TwP / inifile

Native Ruby package for reading and writing INI files
http://codeforpeople.rubyforge.org/inifile
95 stars 47 forks source link

Type casting values #28

Closed TwP closed 10 years ago

TwP commented 10 years ago

Pulling in the work done by @dennismonsewicz to make typecasting work when parsing. I decided to make it non-optional - the gem will just typecast whenever it can.

closes #22 closes #23

dennismonsewicz commented 10 years ago

:thumbsup: love it!

G-Bianchi commented 9 years ago

There is a problem : I want to store in ini file a phone number in standard international format like"+393330001234" but when it's loaded typecasting converts it to 393330001234... How can i handle this situation?

TwP commented 9 years ago

With the Integer(value) code in place for casting, the telephone number format you are using will be treated as a Numeric value after parsing. I do not have a good answer for your formatting problem :(

The only suggestion I can give at the moment is to add a space or some other character that will prevent this value from being parsed as a Numeric. But that is not the answer you want to hear :disappointed: