serverkit-homebrew 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +16 -4
- data/lib/serverkit/homebrew/version.rb +1 -1
- data/lib/serverkit/resources/homebrew_tap.rb +5 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2bae282394e85dffefe7e797dd842ab3399cd41
|
4
|
+
data.tar.gz: 151ae1c7dca64c6ad10592989d05423642891a10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3c334db0e4d37b7fd9de9d177e7fb6e9c0b26d2e5c0caf4aaf7178c9022c04eba431dddab0690e72ffcbd2922af777f4d7d883b6d878b64556c7486f4f29508
|
7
|
+
data.tar.gz: 91064a37421160a353a7c352d9af34c64d3b2e7482d9602ae53ee4c48a3942bdb52badd6c73b4c84ba702f4558d6064c488f60a3ec07c407abd0db9c75768ee6
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,19 @@
|
|
1
|
-
#
|
1
|
+
# serverkit-homebrew
|
2
2
|
[Serverkit](https://github.com/r7kamura/serverkit) plug-in for [Homebrew](http://brew.sh/).
|
3
3
|
|
4
|
-
|
4
|
+
- [Installation](#installation)
|
5
|
+
- [Resource](#resource)
|
6
|
+
- [homebrew_package](#homebrew_package)
|
7
|
+
- [Attributes](#attributes)
|
8
|
+
- [Example](#example)
|
9
|
+
- [homebrew_cask_package](#homebrew_cask_package)
|
10
|
+
- [Attributes](#attributes-1)
|
11
|
+
- [Example](#example-1)
|
12
|
+
- [homebrew_tap](#homebrew_tap)
|
13
|
+
- [Attributes](#attributes-2)
|
14
|
+
- [Example](#example-2)
|
15
|
+
|
16
|
+
## Install
|
5
17
|
```rb
|
6
18
|
gem "serverkit-homebrew"
|
7
19
|
```
|
@@ -46,7 +58,7 @@ Make sure the specified GitHub repo is tapped (or untapped).
|
|
46
58
|
#### Attributes
|
47
59
|
- name - repository name (required)
|
48
60
|
- options - command-line-options for `brew tap` and `brew untap`
|
49
|
-
-
|
61
|
+
- state - pass `"untapped"` to make sure the repo is untapped
|
50
62
|
|
51
63
|
#### Example
|
52
64
|
```yaml
|
@@ -55,5 +67,5 @@ resources:
|
|
55
67
|
name: caskroom/cask
|
56
68
|
- type: homebrew_tap
|
57
69
|
name: homebrew/versions
|
58
|
-
|
70
|
+
state: untapped
|
59
71
|
```
|
@@ -4,7 +4,7 @@ module Serverkit
|
|
4
4
|
module Resources
|
5
5
|
class HomebrewTap < Base
|
6
6
|
attribute :name, required: true, type: String
|
7
|
-
attribute :
|
7
|
+
attribute :state, type: String, inclusion: { allow_nil: true, in: ["untapped"] }
|
8
8
|
|
9
9
|
# @note Override
|
10
10
|
def apply
|
@@ -13,14 +13,14 @@ module Serverkit
|
|
13
13
|
|
14
14
|
# @note Override
|
15
15
|
def check
|
16
|
-
|
16
|
+
has_untapped_state? ^ check_command("brew tap | grep -E '^#{name}$'")
|
17
17
|
end
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
21
|
# @return [String]
|
22
22
|
def applied_action_name
|
23
|
-
if
|
23
|
+
if has_untapped_state?
|
24
24
|
"untap"
|
25
25
|
else
|
26
26
|
"tap"
|
@@ -32,8 +32,8 @@ module Serverkit
|
|
32
32
|
name
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def has_untapped_state?
|
36
|
+
state == "untapped"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|