brew-cask-upgrade 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/LICENSE +21 -0
- data/README.md +1 -0
- data/bin/brew-cask-upgrade +17 -0
- data/brew-cask-upgrade.gemspec +15 -0
- data/lib/brew-cask-upgrade.rb +26 -0
- metadata +51 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1707aea53b64ba4085b3b9e78d5ad0309cd8db84
|
4
|
+
data.tar.gz: 5fd6e9551725054f979e61b4e581a820b79c0dc6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ba9351fe30a6ac3e7cd5347b6da955dc20a96d3e9216a8a5e4025050ec02bee8b1a930b40713512f31ed261b61279c08e225ccc4e4b233167db046c2197680b6
|
7
|
+
data.tar.gz: e246f51dab58d6ae5483eab378ce46ffd9156f8ab4d3cdf0cec03c9863e280909f5ef516537eb6f48ecb285e8970217a6b3b5d2a819f5bcaaa96fb2b8a01a8c6
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 buo
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# brew-cask-upgrade
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
5
|
+
require 'brew-cask-upgrade'
|
6
|
+
|
7
|
+
installed.each do |app|
|
8
|
+
if app[:installed].include? app[:cask].version.to_s
|
9
|
+
puts "#{app[:name]}: up to date"
|
10
|
+
else
|
11
|
+
puts "Upgrading #{app[:name]} #{app[:installed]} -> #{app[:cask].version}"
|
12
|
+
system "brew cask install #{app[:name]} --force"
|
13
|
+
installed.each do |version|
|
14
|
+
system "rm -rf /opt/homebrew-cask/Caskroom/#{app[:name]}/#{version}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "brew-cask-upgrade"
|
3
|
+
s.version = "0.1.0"
|
4
|
+
s.date = "2015-11-06"
|
5
|
+
s.summary = "A command line tool for Homebrew Cask"
|
6
|
+
s.description = "A command line tool for upgrading every outdated apps installed by Homebrew Cask"
|
7
|
+
s.authors = ["buo"]
|
8
|
+
s.email = "buo@users.noreply.github.com"
|
9
|
+
s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
10
|
+
s.homepage = "https://github.com/buo/brew-cask-upgrade"
|
11
|
+
s.license = "MIT"
|
12
|
+
|
13
|
+
s.bindir = "bin"
|
14
|
+
s.executables = %w(brew-cask-upgrade)
|
15
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
BREW_HOME = `brew --repository`.strip
|
2
|
+
CASK_HOME = "#{BREW_HOME}/Library/Taps/caskroom/homebrew-cask"
|
3
|
+
$LOAD_PATH.unshift("#{CASK_HOME}/lib")
|
4
|
+
|
5
|
+
require 'vendor/homebrew-fork/global'
|
6
|
+
require 'hbc'
|
7
|
+
|
8
|
+
CASKROOM = "/opt/homebrew-cask/Caskroom"
|
9
|
+
|
10
|
+
def installed
|
11
|
+
apps = []
|
12
|
+
Hbc.installed.each do |name|
|
13
|
+
cask = Hbc.load name.to_s
|
14
|
+
apps << {
|
15
|
+
:cask => cask,
|
16
|
+
:name => name.to_s,
|
17
|
+
:installed => installed_versions(name)
|
18
|
+
}
|
19
|
+
end
|
20
|
+
apps
|
21
|
+
end
|
22
|
+
|
23
|
+
# Retrieves currently installed versions on the machine.
|
24
|
+
def installed_versions(name)
|
25
|
+
Dir["#{CASKROOM}/#{name}/*"].map { |e| File.basename e }
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: brew-cask-upgrade
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- buo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-06 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A command line tool for upgrading every outdated apps installed by Homebrew
|
14
|
+
Cask
|
15
|
+
email: buo@users.noreply.github.com
|
16
|
+
executables:
|
17
|
+
- brew-cask-upgrade
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- LICENSE
|
23
|
+
- README.md
|
24
|
+
- bin/brew-cask-upgrade
|
25
|
+
- brew-cask-upgrade.gemspec
|
26
|
+
- lib/brew-cask-upgrade.rb
|
27
|
+
homepage: https://github.com/buo/brew-cask-upgrade
|
28
|
+
licenses:
|
29
|
+
- MIT
|
30
|
+
metadata: {}
|
31
|
+
post_install_message:
|
32
|
+
rdoc_options: []
|
33
|
+
require_paths:
|
34
|
+
- lib
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
requirements: []
|
46
|
+
rubyforge_project:
|
47
|
+
rubygems_version: 2.0.14
|
48
|
+
signing_key:
|
49
|
+
specification_version: 4
|
50
|
+
summary: A command line tool for Homebrew Cask
|
51
|
+
test_files: []
|