cap3 - how to add additional functions?

76 views
Skip to first unread message

Joe Topjian

unread,
Feb 4, 2014, 3:02:48 AM2/4/14
to capis...@googlegroups.com
Hello,

I created a class that allows me to use Hiera alongside Capistrano 3: https://gist.github.com/jtopjian/8799635

This file is added to lib/capistrano, I require it in the Capfile, it works, and I'd be happy using it. But I'm just wondering if there's a better way to go about this? The other Hiera/Capistrano examples that I found are using Capistrano 2 and mix Hiera into the Capistrano module. For example: https://github.com/gtmtechltd/capistrano-hiera-example

Is there a similar way to do this with Capistrano 3? Is the method I used the best way to go about this? 

I apologize if this is more of a general ruby question than specific to Capistrano.

Thanks,
Joe

Lee Hambley

unread,
Feb 4, 2014, 3:07:02 AM2/4/14
to capistrano
You can replace your CapHiera class with a module, and mix it into Capistrano::DSL. either by explicit "Capistrano::DSL.send(:include, CapHiera)" or by a simple include CapHiera in the Capfile, deploy.rb, etc.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/41ad2333-e484-4104-b1d6-11ce0a532aac%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Joe Topjian

unread,
Feb 4, 2014, 9:35:13 AM2/4/14
to capis...@googlegroups.com
Ah - nice! 

Thank you very much, Lee.
Reply all
Reply to author
Forward
0 new messages