itamae-plugin-resource-cask 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/itamae-plugin-resource-cask.gemspec +1 -1
- data/lib/itamae/plugin/resource/cask.rb +8 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e47efb31c37c63c3d14e015fba4b4647fa39751
|
4
|
+
data.tar.gz: 2701167875d52fa76f4c506ecc360dbde647b74e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fb1e5869aecba892baa2d54c4ea586380a819375442c4a6e61ec3c1741c23c8b21b475c2a20a18267db146ce74a961ac55d797f208c4a40aa40d58c89aca2bf
|
7
|
+
data.tar.gz: 70af88f12358707295c84c045db6a3a957a2bfcf036d4b0c611a8001df4c84ae4f72f559c14ebb952c12bed42980fa8044427e3681712e6d8c7f4cc4a75e2630
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "itamae-plugin-resource-cask"
|
7
|
-
spec.version = "0.
|
7
|
+
spec.version = "0.2.0"
|
8
8
|
spec.authors = ["Takashi Kokubun"]
|
9
9
|
spec.email = ["takashikkbn@gmail.com"]
|
10
10
|
spec.summary = %q{Itamae resource plugin to manage homebrew cask packages.}
|
@@ -4,7 +4,7 @@ module Itamae
|
|
4
4
|
module Plugin
|
5
5
|
module Resource
|
6
6
|
class Cask < Itamae::Resource::Base
|
7
|
-
BREW_CASK = '
|
7
|
+
BREW_CASK = 'brew-cask'
|
8
8
|
|
9
9
|
define_attribute :action, default: :install
|
10
10
|
define_attribute :target, type: String, default_name: true
|
@@ -14,7 +14,7 @@ module Itamae
|
|
14
14
|
super
|
15
15
|
ensure_brew_cask_availability
|
16
16
|
|
17
|
-
result = run_command("#{
|
17
|
+
result = run_command("#{brew_cask_list} | grep '#{attributes.target}$'", error: false)
|
18
18
|
current.exist = result.exit_status == 0
|
19
19
|
end
|
20
20
|
|
@@ -30,8 +30,13 @@ module Itamae
|
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
+
# Optimized `brew cask list`
|
34
|
+
def brew_cask_list
|
35
|
+
"ls -1 /opt/homebrew-cask/Caskroom/"
|
36
|
+
end
|
37
|
+
|
33
38
|
def ensure_brew_cask_availability
|
34
|
-
if run_command("#{BREW_CASK}
|
39
|
+
if run_command("which -s #{BREW_CASK}", error: false).exit_status != 0
|
35
40
|
raise "`brew cask` command is not available. Please install brew cask."
|
36
41
|
end
|
37
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae-plugin-resource-cask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: '0'
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
|
-
rubygems_version: 2.5.
|
89
|
+
rubygems_version: 2.4.5.1
|
90
90
|
signing_key:
|
91
91
|
specification_version: 4
|
92
92
|
summary: Itamae resource plugin to manage homebrew cask packages.
|