Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af000f8
commit 24507ec
Showing
4 changed files
with
91 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# asdf_package | ||
|
||
Installs, uninstalls and sets global an asdf package. | ||
**See [Package Dependencies](#package-dependencies) below.** | ||
|
||
```ruby | ||
asdf_package 'name' do | ||
package String | ||
version String | ||
live_stream [true, false] | ||
user String | ||
end | ||
``` | ||
|
||
## Actions | ||
|
||
| Action | Default | | ||
| ------------ | -------- | | ||
| `:install` | ✓ | | ||
| `:global` | | | ||
| `:uninstall` | | | ||
|
||
## Properties | ||
|
||
### `package` | ||
|
||
Which package to install. | ||
|
||
| property | value | | ||
| ------------- | ---------- | | ||
| Type | String | | ||
| Default | `name` | | ||
| Name Property | `true` | | ||
|
||
### `version` | ||
|
||
Which package version to install. | ||
|
||
| property | value | | ||
| -------- | ------ | | ||
| Type | String | | ||
| Default | | | ||
| Required | `true` | | ||
|
||
### `live_stream` | ||
|
||
Whether or not to output verbose stream. | ||
|
||
| property | value | | ||
| -------- | ------------- | | ||
| Type | [true, false] | | ||
| Default | `true` | | ||
|
||
### `user` | ||
|
||
Which user to run asdf code as. | ||
|
||
| property | value | | ||
| -------- | ------ | | ||
| Type | String | | ||
| Default | | | ||
|
||
## Package Dependencies | ||
|
||
Although this cookbook is slowly but surely trying to make sure that | ||
dependencies are installed for each package on all supported operating systems, | ||
you may still need to add dependencies that have not been pre-installed for a | ||
particular package. If you do indeed get a package installed with dependencies | ||
that have not yet been pre-installed via this cookbook, please open up a pull | ||
request for review to be added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
# | ||
# Cookbook:: asdf | ||
# Spec:: package | ||
# | ||
# Copyright:: 2018, Fernando Aleman, All Rights Reserved. | ||
|
||
require 'spec_helper' | ||
|
||
describe 'test::package' do | ||
SUPPORTED_PLATFORMS.each do |platform, versions| | ||
versions.each do |version| | ||
context "Using #{platform} #{version}" do | ||
let(:chef_run) do | ||
runner = ChefSpec::ServerRunner.new(platform: platform, version: version) | ||
runner.converge(described_recipe) | ||
end | ||
describe 'asdf_package' do | ||
step_into :asdf_package | ||
platform 'ubuntu' | ||
|
||
it 'installs ruby package' do | ||
expect(chef_run).to install_asdf_package('ruby').with( | ||
version: '2.5.1', | ||
action: [:install, :global] | ||
) | ||
end | ||
context 'with default properties' do | ||
recipe do | ||
asdf_package 'ruby' do | ||
version '2.6.3' | ||
end | ||
end | ||
|
||
it do | ||
is_expected.to run_asdf_script('install ruby 2.6.3') | ||
.with_live_stream(true) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters