itamae-plugin-resource-cask 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: ed564cf5af93a48f55aee856344f7d1a8b42b6347fd56aca8ced2d3879a02999
4
- data.tar.gz: c2d120cdcc317558b6d2d39686a3753b9fe93a07c70d53dee6fd632d540ef9de
3
+ metadata.gz: 0f0461874851a511dd51951ff7eaac901928539cf1d0f8b784f6aa1a804052fe
4
+ data.tar.gz: de8c893f08d78579837a4761ab8c3f553f9ea885a5f75ca1695a8e3936c4f63e
5
5
  SHA512:
6
- metadata.gz: e7ad81760910d31d03f7a9b9acac26abcef47c9e515900108996b79497ca5ccfbd15ba2a077708e9bc1b243554a0fc48691af290763c8f2a65784b790441232f
7
- data.tar.gz: f172f3ad4c62b52091e219634d7d161cc2582713b462f197e198312c234e4561aadaa4ca67f38c55e5032533f6b1dc7321754e47420aa7187c6612e4a44e9d98
6
+ metadata.gz: cb38ee1fccef276e5f4f293d68270627196272ac5e119c34ea7991dde30867fca4271ee21ca74db96c11ac6d40bd546690d6cad251eccc683c1bc4b202539fb2
7
+ data.tar.gz: 40de74c40b5aa0f2f5755da1b3d331c7202bfb4ed9f9c98607bdf9fd4f4084d534c46a4e370ccbb839bd14433218723ba418fde81c3fb9181ce546cf84e5bc25
@@ -1,5 +1,23 @@
1
1
  # Change Log
2
2
 
3
+ ## [Unreleased](https://github.com/k0kubun/itamae-plugin-resource-cask/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/k0kubun/itamae-plugin-resource-cask/compare/v0.2.3...HEAD)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Support uninstall operation [\#8](https://github.com/k0kubun/itamae-plugin-resource-cask/pull/8) ([hirocaster](https://github.com/hirocaster))
10
+
11
+ ## [v0.2.3](https://github.com/k0kubun/itamae-plugin-resource-cask/tree/v0.2.3) (2018-06-07)
12
+ [Full Changelog](https://github.com/k0kubun/itamae-plugin-resource-cask/compare/v0.2.2...v0.2.3)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - homebrew-cask has been merged into homebrew-core [\#7](https://github.com/k0kubun/itamae-plugin-resource-cask/pull/7) ([kenchan](https://github.com/kenchan))
17
+ - Change module name to top-level [\#6](https://github.com/k0kubun/itamae-plugin-resource-cask/pull/6) ([gongo](https://github.com/gongo))
18
+ - Fix repository url [\#5](https://github.com/k0kubun/itamae-plugin-resource-cask/pull/5) ([takkanm](https://github.com/takkanm))
19
+ - Port cask resource for itamae-mruby [\#4](https://github.com/k0kubun/itamae-plugin-resource-cask/pull/4) ([k0kubun](https://github.com/k0kubun))
20
+
3
21
  ## [v0.2.2](https://github.com/k0kubun/itamae-plugin-resource-cask/tree/v0.2.2) (2015-12-14)
4
22
  [Full Changelog](https://github.com/k0kubun/itamae-plugin-resource-cask/compare/v0.2.1...v0.2.2)
5
23
 
@@ -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.2.3"
7
+ spec.version = "0.2.4"
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.}
@@ -21,6 +21,12 @@ module Itamae
21
21
  end
22
22
  end
23
23
 
24
+ def action_remove(options)
25
+ unless current.exist
26
+ run_command(["brew", "cask", "uninstall", attributes.target])
27
+ end
28
+ end
29
+
24
30
  def action_alfred(options)
25
31
  run_command(["brew", "cask", "alfred", *Array(attributes.options), attributes.target])
26
32
  end
@@ -6,7 +6,7 @@ module ::MItamae
6
6
  define_attribute :target, type: String, default_name: true
7
7
  define_attribute :options, type: [String, Array], default: "--appdir=/Applications"
8
8
 
9
- self.available_actions = [:install, :alfred]
9
+ self.available_actions = [:install, :remove, :alfred]
10
10
  end
11
11
  end
12
12
  end
@@ -8,6 +8,10 @@ module ::MItamae
8
8
  run_command(["brew", "cask", "install", *Array(desired.options), desired.target])
9
9
  end
10
10
 
11
+ if current.exist && !desired.exist
12
+ run_command(["brew", "cask", "uninstall", desired.target])
13
+ end
14
+
11
15
  if desired.alfred_linked
12
16
  run_command(["brew", "cask", "alfred", *Array(desired.options), desired.target])
13
17
  end
@@ -20,6 +24,9 @@ module ::MItamae
20
24
  when :install
21
25
  result = run_command("#{brew_cask_list} | grep '#{attributes.target}$'", error: false)
22
26
  current.exist = (result.exit_status == 0)
27
+ when :remove
28
+ result = run_command("#{brew_cask_list} | grep '#{attributes.target}$'", error: false)
29
+ current.exist = (result.exit_status == 0)
23
30
  end
24
31
  end
25
32
 
@@ -27,6 +34,8 @@ module ::MItamae
27
34
  case action
28
35
  when :install
29
36
  desired.exist = true
37
+ when :remove
38
+ desired.exist = false
30
39
  when :alfred
31
40
  desired.alfred_linked = true
32
41
  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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-07 00:00:00.000000000 Z
11
+ date: 2018-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler