serverkit-homebrew 0.0.1 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 60265b934358fb8ff4b32f4a94c3fe634edec2ac
4
- data.tar.gz: 32bcbdd9e9a32143a17db16d55ba881b5a97bac0
2
+ SHA256:
3
+ metadata.gz: ad2a5dea7f1176f96d6f32a26e43452971a9ee2ead08554e4905206c7d94a79d
4
+ data.tar.gz: 44de85e7e6b3b90e7b22b70526ecd10b7e1e21ce363e471c3139f2fc01268e41
5
5
  SHA512:
6
- metadata.gz: f2d9e6a9589766f4a149fc2c29be9076ec024ad136b380a677394ce18ac0d0a091dffc13021df0556d6eee246a59332ecf99fbe01d164e760fe7376a9c5cf777
7
- data.tar.gz: 28b69446ee64bc1a1040f247f1224e0bc3951295ca02b12a37c9a9328e42f151ef8e651d65549129e3ccefd4593e438cdf05371ea59985b9bbfc07588d806a32
6
+ metadata.gz: 04c6333ed96cdea18203738619e3b447fa3a05ad28ec75c96346e4ec9fb7e7740a55598e030a314e7e7b4083d4232b2d7bb12698d9a761f94f3ffce25338963c
7
+ data.tar.gz: fb95c91af744c36d79136057b32c119b446d2e1059cbd815ee195ec284d167aa237952a373b0cadfe40d31177c3dfadbb70922dfc535a65848f32f22e9d7aaa9
@@ -0,0 +1,23 @@
1
+ ## 0.0.6
2
+
3
+ - Fix homebrew-cask install error.
4
+
5
+ ## 0.0.5
6
+
7
+ - Fix bug on installation of nested package name.
8
+
9
+ ## 0.0.4
10
+
11
+ - Support linuxbrew on homebrew_package resource.
12
+
13
+ ## 0.0.3
14
+
15
+ - Rename: status -> state.
16
+
17
+ ## 0.0.2
18
+
19
+ - Support nested package name (e.g. caskroom/cask/brew-cask).
20
+
21
+ ## 0.0.1
22
+
23
+ - 1st Release.
data/README.md CHANGED
@@ -1,7 +1,19 @@
1
- # Serverkit::Homebrew
1
+ # serverkit-homebrew
2
2
  [Serverkit](https://github.com/r7kamura/serverkit) plug-in for [Homebrew](http://brew.sh/).
3
3
 
4
- ## Installation
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
- - status - pass `"untapped"` to make sure the repo is untapped
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
- status: untapped
70
+ state: untapped
59
71
  ```
@@ -1,5 +1,5 @@
1
1
  module Serverkit
2
2
  module Homebrew
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -8,12 +8,12 @@ module Serverkit
8
8
 
9
9
  # @note Override
10
10
  def apply
11
- run_command("brew cask install #{options} #{name}")
11
+ run_command("brew install --cask #{options} #{name}")
12
12
  end
13
13
 
14
14
  # @note Override
15
15
  def check
16
- check_command("brew cask list -1 | grep -E '^#{name}$'")
16
+ check_command("brew list --cask -1 | grep -E '^#{name}$'")
17
17
  end
18
18
 
19
19
  private
@@ -3,6 +3,34 @@ require "serverkit/resources/package"
3
3
  module Serverkit
4
4
  module Resources
5
5
  class HomebrewPackage < Package
6
+ # @note Override to force to use brew command
7
+ def apply
8
+ run_command(
9
+ ::Specinfra::Command::Darwin::Base::Package.install(
10
+ name,
11
+ version,
12
+ options,
13
+ ),
14
+ )
15
+ end
16
+
17
+ # @note Override to force to use brew command
18
+ def check
19
+ check_command(
20
+ ::Specinfra::Command::Darwin::Base::Package.check_is_installed(
21
+ unnested_name,
22
+ version,
23
+ ),
24
+ )
25
+ end
26
+
27
+ private
28
+
29
+ # @return [String]
30
+ # @example "brew-cask" # for "caskroom/cask/brew-cask"
31
+ def unnested_name
32
+ name.split("/").last
33
+ end
6
34
  end
7
35
  end
8
36
  end
@@ -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 :status, type: String, inclusion: { allow_nil: true, in: ["untapped"] }
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
- has_untapped_status? ^ check_command("brew tap | grep -E '^#{name}$'")
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 has_untapped_status?
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 has_untapped_status?
36
- status == "untapped"
35
+ def has_untapped_state?
36
+ state == "untapped"
37
37
  end
38
38
  end
39
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverkit-homebrew
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-13 00:00:00.000000000 Z
11
+ date: 2020-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: serverkit
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".travis.yml"
64
+ - CHANGELOG.md
64
65
  - Gemfile
65
66
  - LICENSE.txt
66
67
  - README.md
@@ -90,10 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.4.5
94
+ rubygems_version: 3.1.4
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: Serverkit plug-in for Homebrew.
98
98
  test_files: []
99
- has_rdoc: