brew-cask-upgrade 0.1.1 → 0.2.0

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: 09384e171521de8393058deafd66facc4a754586
4
- data.tar.gz: 22c4b682e6da1310447cdc839c92984cb8c948fe
3
+ metadata.gz: 296c86d54f2ea0df78729ff68e246fdf9370712b
4
+ data.tar.gz: 7bdc376d9c192419c48ffc556282453f0ddec961
5
5
  SHA512:
6
- metadata.gz: c5ed11d58df013e6c4c5dfe7ea0d01f021fb23aeb1219406f818214a9440fa76501c64192723fee64abbe1471da192982aad16f8b5bf367a84c82e48bd326706
7
- data.tar.gz: f7201e46b176b81225496efb5088ac06b0bebf33e5f0cb4a56a6e6b38dfdb047828347f5a21bf058c4a1a0b0ced75d006f0ce171e0968634ad6d0277df969a3d
6
+ metadata.gz: a01c777a0e818599d7fd6ba2ff71d53410aa57352134b2973484bf7ba050e86bd1284dcd22a85cdf7733dbeeb1b6c2f163e4a31c1a9097a012b5904770328176
7
+ data.tar.gz: 610f15a2e44cf13c26af5c5a202d318744558c16a3f49bd6150c677a2fd1666e8fa2a98026ce8649e7c9ee4efd55115e017988fbc64695646b246e9a72ee8692
data/README.md CHANGED
@@ -1,5 +1,15 @@
1
+ [![Gem Version](https://badge.fury.io/rb/brew-cask-upgrade.svg)](https://badge.fury.io/rb/brew-cask-upgrade)
1
2
  # brew-cask-upgrade
2
3
 
4
+ `brew-cask-upgrade` is a command-line tool for upgrading every outdated apps
5
+ installed by [Homebrew Cask](https://caskroom.github.io).
6
+
7
+ Homebrew Cask extends [Homebrew](http://brew.sh) and brings its elegance,
8
+ simplicity, and speed to OS X applications and large binaries alike, but it
9
+ lacks a sub-command like `brew upgrade` for upgrading installed apps, so if you want to upgrade the installed apps, you have to delete the previous versions and re-install the latest version manually for every single app.
10
+
11
+ With `brew-cask-upgrade`, you just need to type one command to upgrade all the apps installed by Homebrew Cask.
12
+
3
13
  ## Installation
4
14
 
5
15
  ```
@@ -11,3 +21,9 @@ gem install brew-cask-upgrade
11
21
  ```
12
22
  brew-cask-upgrade
13
23
  ```
24
+
25
+ [![asciicast](https://asciinema.org/a/2c2lcz9jp68dflgm3y0dclsaz.png)](https://asciinema.org/a/2c2lcz9jp68dflgm3y0dclsaz)
26
+
27
+
28
+ [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/buo/brew-cask-upgrade/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
29
+
@@ -4,14 +4,22 @@
4
4
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
5
5
  require 'brew-cask-upgrade'
6
6
 
7
- installed.each do |app|
7
+ count = Hbc.installed.length
8
+
9
+ outdated = []
10
+ each_installed do |app, i|
8
11
  if app[:installed].include? app[:cask].version.to_s
9
- puts "#{app[:name]}: up to date"
12
+ puts "(#{i+1}/#{count}) #{app[:name]}: up to date"
10
13
  else
11
- puts "Upgrading #{app[:name]} #{app[:installed]} -> #{app[:cask].version}"
12
- system "brew cask install #{app[:name]} --force"
13
- app[:installed].each do |version|
14
- system "rm -rf /opt/homebrew-cask/Caskroom/#{app[:name]}/#{version}"
15
- end
14
+ puts "(#{i+1}/#{count}) #{app[:name]}: #{app[:installed].join(', ')} -> #{app[:cask].version}"
15
+ outdated.push app
16
+ end
17
+ end
18
+
19
+ outdated.each do |app|
20
+ puts "==> Upgrading #{app[:name]}"
21
+ system "brew cask install #{app[:name]} --force"
22
+ app[:installed].each do |version|
23
+ system "rm -rf /opt/homebrew-cask/Caskroom/#{app[:name]}/#{version}"
16
24
  end
17
25
  end
@@ -1,7 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "brew-cask-upgrade"
3
- s.version = "0.1.1"
4
- s.date = "2015-11-06"
3
+ s.version = "0.2.0"
5
4
  s.summary = "A command line tool for Homebrew Cask"
6
5
  s.description = "A command line tool for upgrading every outdated apps installed by Homebrew Cask"
7
6
  s.authors = ["buo"]
@@ -7,17 +7,15 @@ require 'hbc'
7
7
 
8
8
  CASKROOM = "/opt/homebrew-cask/Caskroom"
9
9
 
10
- def installed
11
- apps = []
12
- Hbc.installed.each do |name|
10
+ def each_installed
11
+ Hbc.installed.each_with_index do |name, i|
13
12
  cask = Hbc.load name.to_s
14
- apps << {
13
+ yield({
15
14
  :cask => cask,
16
15
  :name => name.to_s,
17
16
  :installed => installed_versions(name)
18
- }
17
+ }, i)
19
18
  end
20
- apps
21
19
  end
22
20
 
23
21
  # Retrieves currently installed versions on the machine.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brew-cask-upgrade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - buo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2016-06-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A command line tool for upgrading every outdated apps installed by Homebrew
14
14
  Cask
@@ -18,7 +18,7 @@ executables:
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - .gitignore
21
+ - ".gitignore"
22
22
  - LICENSE
23
23
  - README.md
24
24
  - bin/brew-cask-upgrade
@@ -34,17 +34,17 @@ require_paths:
34
34
  - lib
35
35
  required_ruby_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - '>='
42
+ - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.0.14
47
+ rubygems_version: 2.5.0
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: A command line tool for Homebrew Cask