Re: [Facets] Fw: ini file

4 views
Skip to first unread message

Dice

unread,
Nov 11, 2009, 10:25:28 AM11/11/09
to facets-u...@rubyforge.org
I'm sorry for this late reply. Thank you for explaining clearly, Trans.

I have understood why ini file support was deprecated. I also think
that inifile.rb is good and simple.

But, I think that inifile.rb is not simplest. The simplest ini file
support which I image is only to convert from a file to simple Hash.
It should has only two functions - to parse string and to parse file.
INI class is unnecessary. Comment should be ignored simply.

In short, the following code is my expection.

ini = Ini.parse_file('example.ini')
p ini.class # => Hash
p ini # => {'Section1' => {'Key1' => 'value1', 'Key2' => 'value2'}}

I think that simplest ini file support is universal and good for Ruby
Facets even though there is such as inifile.

How about the simplest ini file support for Ruby Facets? How do you
think whether it is "the most basic/universal addition" or not? If
Ruby Facets accepts it, please see my library. Its library is attached
this mail.

P.S.
Thanks for praising my name.

--------------------------------
Dice
tetr...@gmail.com

2009/10/10 Dice <tetr...@gmail.com>:
> Hi Dice,
>
> You have a cool name, btw.
>
> On Oct 9, 7:42 am, Dice <tetrad... at gmail.com> wrote:
>> Hello, my name is Dice. I'm a rubyist in Japan.
>>
>> I loved ini file support of Ruby Facets because ini file is very
>> simple and useful format for configuration. But ini.rb was deprecated
>> at Ruby Facets 2.7. Which does the decision depend on importance
>> problem, license problem or other problems?
>>
>> If it is license problem, my ini library on Public Domain can be
>> included, instead of deprecated ini.rb?
>
> I will explain. Facets has gotten very big. At first I thought that
> was good. But I realized that it was too big and that made it very
> hard to maintain. So I decided to narrow it's focus to extension
> methods and the most basic/universal additions only. That's why I
> removed 40+ scripts. But just about all the stuff I deprecated I have
> made sure is available in another way. It is better this way now b/c
> it means Facets is more robust and also the libraries that have been
> spun off are more robust too. I know that one of the nice things about
> Facets was that you got a lot with a single dependency. That's good,
> but only to an extent. It is better to have many dependencies if it
> means each gem will be better for it.
>
> In the case of ini.rb, Tim Pease has a library called inifile (http://
> github.com/TwP/inifile). It is similar to ini.rb, and in fact I have
> recently submitted some patches to add a few features it was missing
> that ini.rb had. The only thing it lacks is the comment support. So
> you may want to look into that. Perhaps your library has features that
> you can contribute to inifile? ... yep, that's how having separate
> gems allows things to gem better more easily :-)
>
> Also, I have another INI library that I a have started playing with,
> one that handles all variations including comments. Don't have time to
> work on it right now though, but if you need better ini support then
> inifile maybe we can collaborate.
>
> ~Trans
>

ini.rb

Trans

unread,
Nov 11, 2009, 2:28:27 PM11/11/09
to facets-u...@rubyforge.org

On Nov 11, 10:25 am, Dice <tetrad...@gmail.com> wrote:
> I'm sorry for this late reply. Thank you for explaining clearly, Trans.
>
> I have understood why ini file support was deprecated. I also think
> that inifile.rb is good and simple.
>
> But, I think that inifile.rb is not simplest. The simplest ini file
> support which I image is only to convert from a file to simple Hash.
> It should has only two functions - to parse string and to parse file.
> INI class is unnecessary. Comment should be ignored simply.
>
> In short, the following code is my expection.
>
>     ini = Ini.parse_file('example.ini')
>     p ini.class # => Hash
>     p ini # => {'Section1' => {'Key1' => 'value1', 'Key2' => 'value2'}}
>
> I think that simplest ini file support is universal and good for Ruby
> Facets even though there is such as inifile.
>
> How about the simplest ini file support for Ruby Facets? How do you
> think whether it is "the most basic/universal addition" or not? If
> Ruby Facets accepts it, please see my library. Its library is attached
> this mail.

Nice, I will have a look.

After you contacted me last time I has decided to add ini file support
back in and was planning just to put the script I had back, at least
for time being.

Now, I think I will review both libraries and do as you suggest by
providing most basic support. I will let you know what I conclude.

Thanks.
T.
_______________________________________________
facets-universal mailing list
facets-u...@rubyforge.org
http://rubyforge.org/mailman/listinfo/facets-universal

Dice

unread,
Nov 13, 2009, 8:05:35 AM11/13/09
to facets-u...@rubyforge.org
> After you contacted me last time I has decided to add ini file support
> back in and was planning just to put the script I had back, at least
> for time being.
>
> Now, I think I will review both libraries and do as you suggest by
> providing most basic support. I will let you know what I conclude.

That is good! Thanks for your consideration to ini file support.

--------------------------------
Dice
tetr...@gmail.com

Dice

unread,
Nov 13, 2009, 7:54:07 AM11/13/09
to facets-u...@rubyforge.org
> After you contacted me last time I has decided to add ini file support
> back in and was planning just to put the script I had back, at least
> for time being.
>
> Now, I think I will review both libraries and do as you suggest by
> providing most basic support. I will let you know what I conclude.

That is good! Thanks for your consideration to ini file support.

--------------------------------
Dice
tetr...@gmail.com

Dice

unread,
Nov 13, 2009, 8:00:28 AM11/13/09
to facets-u...@rubyforge.org
> After you contacted me last time I has decided to add ini file support
> back in and was planning just to put the script I had back, at least
> for time being.
>
> Now, I think I will review both libraries and do as you suggest by
> providing most basic support. I will let you know what I conclude.

That is good! Thanks for your consideration to ini file support.

--------------------------------
Dice
tetr...@gmail.com

Reply all
Reply to author
Forward
0 new messages