Skip to content
This repository was archived by the owner on Aug 9, 2022. It is now read-only.

Commit 734c041

Browse files
gavindidrichsenskpaterson
authored andcommitted
Remove unnecessary interpolation and
update documentation Signed-off-by: Gavin Didrichsen <[email protected]>
1 parent 6f39bc0 commit 734c041

File tree

5 files changed

+49
-9
lines changed

5 files changed

+49
-9
lines changed

README.md

+44-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,53 @@
44

55
## Maintainers
66

7-
* The Habitat Maintainers: <[email protected]>
7+
* The Core Planners: <[email protected]>
88

99
## Type of Package
1010

1111
Binary package
1212

13-
## Usage
13+
### Use as Dependency
1414

15-
*TODO: Add instructions for usage*
15+
Binary packages can be set as runtime or build time dependencies. See [Defining your dependencies](https://www.habitat.sh/docs/developing-packages/developing-packages/#sts=Define%20Your%20Dependencies) for more information.
16+
17+
To add core/patch as a dependency, you can add one of the following to your plan file.
18+
19+
##### Buildtime Dependency
20+
21+
> pkg_build_deps=(core/patch)
22+
23+
##### Runtime dependency
24+
25+
> pkg_deps=(core/patch)
26+
27+
### Use as Tool
28+
29+
#### Installation
30+
31+
To install this plan, you should run the following commands to first install, and then link the binaries this plan creates.
32+
33+
``hab pkg install core/patch --binlink``
34+
35+
will add the following binary to the PATH:
36+
37+
* /bin/patch
38+
39+
#### Using an example binary
40+
41+
You can now use the binary as normal. For example:
42+
43+
``/bin/patch --help`` or ``patch --help``
44+
45+
```bash
46+
patch --help
47+
Usage: patch [OPTION]... [ORIGFILE [PATCHFILE]]
48+
49+
Input options:
50+
51+
-p NUM --strip=NUM Strip NUM leading components from file names.
52+
-F LINES --fuzz LINES Set the fuzz factor to LINES for inexact matching.
53+
-l --ignore-whitespace Ignore white space changes between patch and input.
54+
...
55+
...
56+
```

attributes.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
plan_name: 'patch'
12
command_relative_path: 'bin/patch'

controls/patch_exists.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
end
1818

1919
command_relative_path = input('command_relative_path', value: 'bin/patch')
20-
command_full_path = File.join(plan_installation_directory.stdout.strip, "#{command_relative_path}")
20+
command_full_path = File.join(plan_installation_directory.stdout.strip, command_relative_path)
2121
describe file(command_full_path) do
2222
it { should exist }
2323
end

controls/patch_works.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
end
2121

2222
command_relative_path = input('command_relative_path', value: 'bin/patch')
23-
command_full_path = File.join(plan_installation_directory.stdout.strip, "#{command_relative_path}")
23+
command_full_path = File.join(plan_installation_directory.stdout.strip, command_relative_path)
2424
plan_pkg_version = plan_installation_directory.stdout.split("/")[5]
2525
describe command("#{command_full_path} --version") do
2626
its('exit_status') { should eq 0 }

inspec.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: patch
22
title: Habitat Core Plan patch
3-
maintainer: "The Habitat Maintainers <[email protected]>"
3+
maintainer: "The Core Planners <[email protected]>"
44
summary: InSpec controls for testing Habitat Core Plan patch
5-
copyright: 2019, Chef Software, Inc.
6-
copyright_email: [email protected]
75
version: 0.1.0
86
license: Apache-2.0
9-
inspec_version: '>= 3.0.25'
7+
inspec_version: '>= 4.18.108'

0 commit comments

Comments
 (0)