Module: Capistrano::Baptize::Plugins::Pecl
- Defined in:
- lib/baptize/plugins/pecl.rb
Instance Method Summary collapse
Instance Method Details
#has_pecl(package_name, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/baptize/plugins/pecl.rb', line 31 def has_pecl(package_name, = {}) package_version = [:version] if package_version raise VerificationFailure, "PECL package #{package_name}-#{package_version} not installed" unless remote_assert "TERM= pecl list | grep \"^#{package_name.shellescape}\\\\s*#{package_version.shellescape}\"" else raise VerificationFailure, "PECL package #{package_name} not installed" unless remote_assert "TERM= pecl list | grep \"^#{package_name.shellescape}\\\\s\"" end end |
#pecl(package_name, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/baptize/plugins/pecl.rb', line 6 def pecl(package_name, = {}) package_version = [:version] if package_version run "TERM= pecl install --alldeps #{package_name.shellescape}-#{package_version.shellescape}" else run "TERM= pecl install --alldeps #{package_name.shellescape}" end ini_file = ! [:ini_file].nil? if ini_file if ini_file.is_a?(String) text = ini_file elsif ini_file.is_a?(Hash) && ini_file[:content] text = ini_file[:content] else text = "extension=#{package_name}.so" end if ini_file.is_a?(Hash) && ini_file[:path] path = ini_file[:path] else path = "/etc/php5/conf.d/#{package_name}.ini" end put(text, path) end end |