The reason for the difference is because the default '.managed' deps will try to verify the install by checking for a binary in the PATH of the same name. libxml2-dev does not provide any binaries as it is just a library. 'libxml2-dev' is also the Debian-specific package name, so calling the dep 'libxml' and just overriding how it is installed via 'apt-get' allows it to work on more than one platform (and/or opens up the dep to be easily extended for other platforms).
Hope that helps!
- Bo
> --
> To post, email babush...@googlegroups.com
> To unsubscribe, email babushka_app...@googlegroups.com
> ~
> http://babushka.me
> http://github.com/benhoskings/babushka
> http://groups.google.com/group/babushka_app
The idea is that from the point that I want to pull in libxml (say, from a dep that involves installing nokogiri, or something), I don't want to have to remember the specific package name; I want to just say "this requires libxml".
It also means you could add a 'via :yum' or similar alongside the 'via :apt', since fedora probably has a different package name. That way, you don't have to remember either of them.
- Ben
Why isn't the dep simply "libxml" then? Such as:
dep 'libxml' do
installs { via :apt, 'libxml2-dev' }
provides []
end
In this case, is it just a convention stating this dep is managed by the local package manager?
Cheers,
Dan
--
Dan Milne d...@nmilne.com
http://da.nmilne.com/
http://booko.com.au/
'libxml.managed' means it's defined against the 'managed' dep template, which uses the values of #installs and #provides to build a normal dep with met?{} and meet{} blocks.
Check deps/templates/managed.rb for the definition. It's a bit convoluted because the same block of code is used in multiple templates.
A simpler example is deps/templates/tmbundle.rb - the 'tmbundle' template knows how to download and install a TextMate bundle given just its URL.
The idea is that you can just say source 'http://...' and let the template write the dep, instead of repeating the same met?{} and meet{} each time.
(The ones bundled with babushka aren't special; they're just common ones that most people will want to use. You can write your own and store them alongside your deps.
- Ben
The real purpose of suffixes is for deps whose suffixes are part of their identity, like gems and tmbundles. It means you can say
dep 'RSpec.tmbundle'
and have it do the right thing, instead of having to say
dep 'RSpec.tmbundle', template: 'tmbundle'
(The dep is defined in the same way whether you specify the template as a suffix or an option.)
- Ben
The real purpose of suffixes is for deps whose suffixes are part of their identity, like gems and tmbundles. It means you can saydep 'RSpec.tmbundle'and have it do the right thing, instead of having to saydep 'RSpec.tmbundle', template: 'tmbundle'(The dep is defined in the same way whether you specify the template as a suffix or an option.)
I like idea of being explicit with the template name with the "managed" deps.
Thanks for the help guys.
Cheers,
Dan
--