itamae-plugin-resource-cask 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 504f328b4e8baa1de4c102eece3200236d44fc5c
4
- data.tar.gz: 74681bc4b50dc1f495e5a3a4d769583d3fa802ad
3
+ metadata.gz: 0409d495c508979ab7501dfdb89b47c438f3c6a0
4
+ data.tar.gz: 480464d936a3ca59fa951c32526380c5e60e7708
5
5
  SHA512:
6
- metadata.gz: 1960c1cc3aa07eb8c42836fad046aea86ddb533f55e2eaa0fdb50fbf2b076dc53b6c9e397f71537902606b60cfc4848f47a1c750d628498749efd3729656b7a2
7
- data.tar.gz: 84fd79eafb677ab8ede861d3bfa769ec71e72bff9a12cacb4b3e03e116186b73d2ce090613ae9dcc7c26e8494c0eb0a16607a15b54b77ee4d10376ac3275351d
6
+ metadata.gz: 7e66f83a139b323078f86c7758bf5c10d4d1b3ddde4fef86a66020000575b72ec84052ac72550ad765089d57258adc5fc198ee13f57fb0ca4b2d321c77a099fd
7
+ data.tar.gz: 937a19292643e41d23de4c4b8203b7b1bfeb00d5d5c57b685aaea2a0f1646aaeedd7bfc234ac8c041ec1a61ba715ef9885dd091cc441096c5fb25af93f1b106e
data/README.md CHANGED
@@ -23,7 +23,13 @@ Or install it yourself as:
23
23
  ```ruby
24
24
  require "itamae/plugin/resource/cask"
25
25
 
26
+ # brew cask install google-chrome
26
27
  cask "google-chrome"
28
+
29
+ # brew cask alfred link
30
+ cask "link" do
31
+ action :alfred
32
+ end
27
33
  ```
28
34
 
29
35
  ## Contributing
@@ -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.0.2"
7
+ spec.version = "0.0.3"
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,23 +4,27 @@ module Itamae
4
4
  module Plugin
5
5
  module Resource
6
6
  class Cask < Itamae::Resource::Base
7
- define_attribute :action, default: :create
8
- define_attribute :formula, type: String, default_name: true
7
+ define_attribute :action, default: :install
8
+ define_attribute :target, type: String, default_name: true
9
9
 
10
10
  def set_current_attributes
11
11
  super
12
12
  ensure_brew_cask_availability
13
13
 
14
- result = run_command("brew cask list | grep '#{attributes.formula}$'", error: false)
14
+ result = run_command("brew cask list | grep '#{attributes.target}$'", error: false)
15
15
  current.exist = result.exit_status == 0
16
16
  end
17
17
 
18
- def action_create(options)
18
+ def action_install(options)
19
19
  unless current.exist
20
- run_command(["brew", "cask", "install", attributes.formula])
20
+ run_command(["brew", "cask", "install", attributes.target])
21
21
  end
22
22
  end
23
23
 
24
+ def action_alfred(options)
25
+ run_command(["brew", "cask", "alfred", attributes.target])
26
+ end
27
+
24
28
  private
25
29
 
26
30
  def ensure_brew_cask_availability
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-plugin-resource-cask
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun