Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 907a86f

Browse files
committed
Merge pull request #72 from namesco/add-pspell-extension
Add pspell extension
2 parents 34a4077 + dedd6a3 commit 907a86f

File tree

5 files changed

+84
-0
lines changed

5 files changed

+84
-0
lines changed

manifests/extension/pspell.pp

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Installs the pspell extension for a specific version of php.
2+
#
3+
# Usage:
4+
#
5+
# php::extension::pspell { 'pspell for 5.4.10':
6+
# php => '5.4.10'
7+
# }
8+
#
9+
define php::extension::pspell(
10+
$php,
11+
) {
12+
require php::config
13+
require aspell
14+
15+
# Ensure that the specified version of PHP is installed.
16+
php_require($php)
17+
18+
$extension = 'pspell'
19+
20+
# Final module install path
21+
$module_path = "${php::config::root}/versions/${php}/modules/${extension}.so"
22+
23+
# Additional options
24+
$configure_params = "--with-pspell=${boxen::config::homebrewdir}/opt/aspell"
25+
26+
php_extension { $name:
27+
provider => php_source,
28+
29+
extension => $extension,
30+
31+
homebrew_path => $boxen::config::homebrewdir,
32+
phpenv_root => $php::config::root,
33+
php_version => $php,
34+
35+
configure_params => $configure_params,
36+
}
37+
38+
# Add config file once extension is installed
39+
40+
file { "${php::config::configdir}/${php}/conf.d/${extension}.ini":
41+
content => template('php/extensions/generic.ini.erb'),
42+
require => Php_extension[$name],
43+
}
44+
45+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
require 'spec_helper'
2+
3+
describe "php::extension::pspell" do
4+
let(:facts) { default_test_facts }
5+
let(:title) { "pspell for 5.4.17" }
6+
let(:params) do
7+
{
8+
:php => "5.4.17",
9+
}
10+
end
11+
12+
it do
13+
should contain_class("php::config")
14+
should contain_class("aspell")
15+
should contain_php__version("5.4.17")
16+
17+
should contain_php_extension("pspell for 5.4.17").with({
18+
:provider => "php_source",
19+
:extension => "pspell",
20+
:homebrew_path => "/test/boxen/homebrew",
21+
:phpenv_root => "/test/boxen/phpenv",
22+
:php_version => "5.4.17",
23+
:configure_params => "--with-pspell=/test/boxen/homebrew/opt/aspell",
24+
})
25+
26+
should contain_file("/test/boxen/config/php/5.4.17/conf.d/pspell.ini").with({
27+
:content => File.read("spec/fixtures/pspell.ini"),
28+
:require => "Php_extension[pspell for 5.4.17]"
29+
})
30+
end
31+
end

spec/fixtures/Puppetfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ mod "mysql", "1.1.3", :github_tarball => "boxen/puppet-mysql"
1212
mod "postgresql", "2.0.1", :github_tarball => "boxen/puppet-postgresql"
1313
mod "nginx", "1.4.2", :github_tarball => "boxen/puppet-nginx"
1414
mod "module_data", "0.0.3", :github_tarball => "ripienaar/puppet-module-data"
15+
mod "aspell", "0.0.1", :github_tarball => "namesco/puppet-aspell"

spec/fixtures/Puppetfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ GITHUBTARBALL
5858
specs:
5959
wget (1.0.0)
6060

61+
GITHUBTARBALL
62+
remote: namesco/puppet-aspell
63+
specs:
64+
aspell (0.0.1)
65+
6166
GITHUBTARBALL
6267
remote: puppetlabs/puppetlabs-stdlib
6368
specs:
@@ -69,6 +74,7 @@ GITHUBTARBALL
6974
module_data (0.0.3)
7075

7176
DEPENDENCIES
77+
aspell (= 0.0.1)
7278
autoconf (= 1.0.0)
7379
boxen (= 3.0.2)
7480
homebrew (= 1.4.1)

spec/fixtures/pspell.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extension=/test/boxen/phpenv/versions/5.4.17/modules/pspell.so

0 commit comments

Comments
 (0)