You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@whimsical.apache.org by sebb <se...@gmail.com> on 2016/02/04 01:02:56 UTC

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>     Cleanup only - no functional changes
>     *) Use documented interface for getting the LDAP hostname

Where is the ldap library documented?

There seem to be quite a few ldap libraries for Ruby.
It's not obvious which one was chosen.

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

Posted by Sam Ruby <ru...@intertwingly.net>.
On Thu, Feb 4, 2016 at 6:40 AM, sebb <se...@gmail.com> wrote:
> On 4 February 2016 at 11:26, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Wed, Feb 3, 2016 at 8:09 PM, sebb <se...@gmail.com> wrote:
>>> On 4 February 2016 at 00:55, Sam Ruby <ru...@intertwingly.net> wrote:
>>>> On Wed, Feb 3, 2016 at 7:02 PM, sebb <se...@gmail.com> wrote:
>>>>> On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
>>>>>> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>>>>>>     Cleanup only - no functional changes
>>>>>>     *) Use documented interface for getting the LDAP hostname
>>>>>
>>>>> Where is the ldap library documented?
>>>>
>>>> Not very well :-(
>>>>
>>>> The LDAP library chosen appears to be a thin layer over the C
>>>> interface, and I was able to piece together the interface using some
>>>> guesswork.  I used irb, but the following reproduces what I did:
>>>>
>>>> ruby -r whimsy/asf -e "p ASF.init_ldap.methods"
>>>> ruby -r whimsy/asf -e "p LDAP.constants.grep /HOST/"
>>>>
>>>> ... followed by google searches on the result.
>>>>
>>>>> There seem to be quite a few ldap libraries for Ruby.
>>>>> It's not obvious which one was chosen.
>>>>
>>>> The one used can be found here:
>>>>
>>>> https://github.com/apache/whimsy/blob/master/asf.gemspec#L26
>>>
>>> That says 'ruby-ldap'
>>>
>>>> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L32
>>>
>>> That is just 'ldap'
>>>
>>> These appear to be different, but perhaps I'm missing something?
>>
>> They are the same.
>
> So why use a different name in the two files?

There are at least three names involved.  Here's the source code:

https://github.com/bearded/ruby-ldap

It makes sense to name the gem after the repository.  It makes sense
to name the module after the gem.

It makes sense to include 'ruby' in the repository name.  It does NOT
makes sense to include 'ruby' in the module name.

As I indicated, I would have broken the symmetry in a different place,
but it wasn't my call to make.

- Sam Ruby

> Could they use the same name?
>
>>> I could not find a plain 'ldap' on RubyGems.org, so where does that come from?
>>
>> Naming conventions for gems (see:
>> http://guides.rubygems.org/name-your-gem/) are merely best practices,
>> and are not universally followed.
>>
>> As an example, I should have either placed my ASF module inside a
>> Whimsy module (thus: Whimsy::ASF instead of simply ASF) or named my
>> gem 'asf'.
>>
>> From my perspective, naming my gem 'asf' would be presumptuous,
>> placing an ASF module inside a Whimsy module is unnecessary, and
>> naming a ruby gem with a 'ruby-' prefix simply because it is coded in
>> the ruby language is redundant.
>>
>> - Sam Ruby
>>
>>
>>>> I'm not sure why I picked that one at the time.  This one appears to
>>>> be more popular:
>>>>
>>>> https://rubygems.org/gems/net-ldap/
>>>>
>>>> All calls to LDAP are isolated in a single source file, so should
>>>> switching be something worth considering, the changes should be
>>>> minimal.
>>>>
>>>> - Sam Ruby

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

Posted by sebb <se...@gmail.com>.
On 4 February 2016 at 11:26, Sam Ruby <ru...@intertwingly.net> wrote:
> On Wed, Feb 3, 2016 at 8:09 PM, sebb <se...@gmail.com> wrote:
>> On 4 February 2016 at 00:55, Sam Ruby <ru...@intertwingly.net> wrote:
>>> On Wed, Feb 3, 2016 at 7:02 PM, sebb <se...@gmail.com> wrote:
>>>> On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
>>>>> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>>>>>     Cleanup only - no functional changes
>>>>>     *) Use documented interface for getting the LDAP hostname
>>>>
>>>> Where is the ldap library documented?
>>>
>>> Not very well :-(
>>>
>>> The LDAP library chosen appears to be a thin layer over the C
>>> interface, and I was able to piece together the interface using some
>>> guesswork.  I used irb, but the following reproduces what I did:
>>>
>>> ruby -r whimsy/asf -e "p ASF.init_ldap.methods"
>>> ruby -r whimsy/asf -e "p LDAP.constants.grep /HOST/"
>>>
>>> ... followed by google searches on the result.
>>>
>>>> There seem to be quite a few ldap libraries for Ruby.
>>>> It's not obvious which one was chosen.
>>>
>>> The one used can be found here:
>>>
>>> https://github.com/apache/whimsy/blob/master/asf.gemspec#L26
>>
>> That says 'ruby-ldap'
>>
>>> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L32
>>
>> That is just 'ldap'
>>
>> These appear to be different, but perhaps I'm missing something?
>
> They are the same.

So why use a different name in the two files?
Could they use the same name?

>> I could not find a plain 'ldap' on RubyGems.org, so where does that come from?
>
> Naming conventions for gems (see:
> http://guides.rubygems.org/name-your-gem/) are merely best practices,
> and are not universally followed.
>
> As an example, I should have either placed my ASF module inside a
> Whimsy module (thus: Whimsy::ASF instead of simply ASF) or named my
> gem 'asf'.
>
> From my perspective, naming my gem 'asf' would be presumptuous,
> placing an ASF module inside a Whimsy module is unnecessary, and
> naming a ruby gem with a 'ruby-' prefix simply because it is coded in
> the ruby language is redundant.
>
> - Sam Ruby
>
>
>>> I'm not sure why I picked that one at the time.  This one appears to
>>> be more popular:
>>>
>>> https://rubygems.org/gems/net-ldap/
>>>
>>> All calls to LDAP are isolated in a single source file, so should
>>> switching be something worth considering, the changes should be
>>> minimal.
>>>
>>> - Sam Ruby

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

Posted by Sam Ruby <ru...@intertwingly.net>.
On Wed, Feb 3, 2016 at 8:09 PM, sebb <se...@gmail.com> wrote:
> On 4 February 2016 at 00:55, Sam Ruby <ru...@intertwingly.net> wrote:
>> On Wed, Feb 3, 2016 at 7:02 PM, sebb <se...@gmail.com> wrote:
>>> On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
>>>> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>>>>     Cleanup only - no functional changes
>>>>     *) Use documented interface for getting the LDAP hostname
>>>
>>> Where is the ldap library documented?
>>
>> Not very well :-(
>>
>> The LDAP library chosen appears to be a thin layer over the C
>> interface, and I was able to piece together the interface using some
>> guesswork.  I used irb, but the following reproduces what I did:
>>
>> ruby -r whimsy/asf -e "p ASF.init_ldap.methods"
>> ruby -r whimsy/asf -e "p LDAP.constants.grep /HOST/"
>>
>> ... followed by google searches on the result.
>>
>>> There seem to be quite a few ldap libraries for Ruby.
>>> It's not obvious which one was chosen.
>>
>> The one used can be found here:
>>
>> https://github.com/apache/whimsy/blob/master/asf.gemspec#L26
>
> That says 'ruby-ldap'
>
>> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L32
>
> That is just 'ldap'
>
> These appear to be different, but perhaps I'm missing something?

They are the same.

> I could not find a plain 'ldap' on RubyGems.org, so where does that come from?

Naming conventions for gems (see:
http://guides.rubygems.org/name-your-gem/) are merely best practices,
and are not universally followed.

As an example, I should have either placed my ASF module inside a
Whimsy module (thus: Whimsy::ASF instead of simply ASF) or named my
gem 'asf'.

>From my perspective, naming my gem 'asf' would be presumptuous,
placing an ASF module inside a Whimsy module is unnecessary, and
naming a ruby gem with a 'ruby-' prefix simply because it is coded in
the ruby language is redundant.

- Sam Ruby


>> I'm not sure why I picked that one at the time.  This one appears to
>> be more popular:
>>
>> https://rubygems.org/gems/net-ldap/
>>
>> All calls to LDAP are isolated in a single source file, so should
>> switching be something worth considering, the changes should be
>> minimal.
>>
>> - Sam Ruby

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

Posted by sebb <se...@gmail.com>.
On 4 February 2016 at 00:55, Sam Ruby <ru...@intertwingly.net> wrote:
> On Wed, Feb 3, 2016 at 7:02 PM, sebb <se...@gmail.com> wrote:
>> On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
>>> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>>>     Cleanup only - no functional changes
>>>     *) Use documented interface for getting the LDAP hostname
>>
>> Where is the ldap library documented?
>
> Not very well :-(
>
> The LDAP library chosen appears to be a thin layer over the C
> interface, and I was able to piece together the interface using some
> guesswork.  I used irb, but the following reproduces what I did:
>
> ruby -r whimsy/asf -e "p ASF.init_ldap.methods"
> ruby -r whimsy/asf -e "p LDAP.constants.grep /HOST/"
>
> ... followed by google searches on the result.
>
>> There seem to be quite a few ldap libraries for Ruby.
>> It's not obvious which one was chosen.
>
> The one used can be found here:
>
> https://github.com/apache/whimsy/blob/master/asf.gemspec#L26

That says 'ruby-ldap'

> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L32

That is just 'ldap'

These appear to be different, but perhaps I'm missing something?

I could not find a plain 'ldap' on RubyGems.org, so where does that come from?

>
> I'm not sure why I picked that one at the time.  This one appears to
> be more popular:
>
> https://rubygems.org/gems/net-ldap/
>
> All calls to LDAP are isolated in a single source file, so should
> switching be something worth considering, the changes should be
> minimal.
>
> - Sam Ruby

Re: [whimsy.git] [1/1] Commit 8745cc5: Cleanup only - no functional changes

Posted by Sam Ruby <ru...@intertwingly.net>.
On Wed, Feb 3, 2016 at 7:02 PM, sebb <se...@gmail.com> wrote:
> On 3 February 2016 at 23:23, Sam Ruby <ru...@apache.org> wrote:
>> Commit 8745cc5399c8bf8a13a20dd5e8a41bc59161d0cf:
>>     Cleanup only - no functional changes
>>     *) Use documented interface for getting the LDAP hostname
>
> Where is the ldap library documented?

Not very well :-(

The LDAP library chosen appears to be a thin layer over the C
interface, and I was able to piece together the interface using some
guesswork.  I used irb, but the following reproduces what I did:

ruby -r whimsy/asf -e "p ASF.init_ldap.methods"
ruby -r whimsy/asf -e "p LDAP.constants.grep /HOST/"

... followed by google searches on the result.

> There seem to be quite a few ldap libraries for Ruby.
> It's not obvious which one was chosen.

The one used can be found here:

https://github.com/apache/whimsy/blob/master/asf.gemspec#L26
https://github.com/apache/whimsy/blob/master/lib/whimsy/asf/ldap.rb#L32

I'm not sure why I picked that one at the time.  This one appears to
be more popular:

https://rubygems.org/gems/net-ldap/

All calls to LDAP are isolated in a single source file, so should
switching be something worth considering, the changes should be
minimal.

- Sam Ruby