This cookbook provides a safari_version
library method to retrieve Safari version installed, and a
safari_extension
resource to install Safari extensions.
- User must be logged into GUI before calling safari_extension (see macosx_gui_login cookbook)
- Chef 11.14 or higher (sensitive attribute introduced)
- Mac OS X Mavericks (10.9) or higher
Include the safari as a dependency to make library method and extension resource available.
The safari_version retrieves CFBundleShortVersionString by default:
version = safari_version # => 8.0.4
You can return other version types by passing the name (e.g. BuildVersion, CFBundleVersion, ProjectName or SourceVersion)
bundle_version = safari_version('CFBundleVersion') # => 10600.4.10.7
Tip: use allow_any_instance_of to stub safari_version method when testing with rspec:
allow_any_instance_of(Chef::Recipe).to receive(:safari_version).and_return('8.0.4')
Installs Safari extensions. User must be logged into GUI before calling safari_extension (see macosx_gui_login cookbook).
safariextz
(required) - Path to Safari extension to install. Defaults to the name of the resource block.
Install a Safari extension:
safari_extension 'a safari extension' do
safariextz '/path/to/a.safariextz'
action :install
end
This cookbook includes a custom ChefSpec matcher you can use to test your own cookbooks.
Example Matcher Usage
expect(chef_run).to install_safari_extension('a safari extension').with(
safariextz: '/path/to/a.safariextz')
Cookbook Matcher
- install_safari_extension(safariextz)
- Ask specific questions on Stack Overflow.
- Report bugs and discuss potential features in Github issues.
Please refer to CONTRIBUTING.
MIT - see the accompanying LICENSE file for details.