update_xcode_plugins 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bundle.rb +4 -0
- data/lib/version.rb +1 -1
- data/lib/xcode.rb +15 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e767ffabb5cb7dccc100ddcff7e365b56636560
|
4
|
+
data.tar.gz: a2dd49cef48631bbedb9cfee67f356345bd8e9f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fe9940f35a7b2f5046fa0f798755ae8605ad5fbb1d8fd95b437d5d348ac1ef422ad0674c0558a9991eef5e8dd27f3d04c85def87955c417afce88b055f943ce
|
7
|
+
data.tar.gz: 653ee6beb3b56b8905b89cb534e828dee0f6a1947a900629428ff57b92f46ea11d72b05f23cce0596faf393aa56700e9154338086dc0291811c772ad552e7d2d
|
data/lib/bundle.rb
CHANGED
data/lib/version.rb
CHANGED
data/lib/xcode.rb
CHANGED
@@ -3,9 +3,20 @@ require_relative 'bundle'
|
|
3
3
|
class Xcode < Bundle
|
4
4
|
attr_accessor :signed
|
5
5
|
|
6
|
+
# Hardcoded paths in case mdfind is not working because Spotlight is disabled
|
7
|
+
DEFAULT_XCODE_PATHS = [
|
8
|
+
"/Applications/Xcode.app",
|
9
|
+
"/Applications/Xcode-beta.app",
|
10
|
+
"/Applications/Xcode-unsigned.app"
|
11
|
+
]
|
12
|
+
|
13
|
+
XCODE_BUNDLE_IDENTIFIER = "com.apple.dt.Xcode"
|
14
|
+
|
6
15
|
def self.find_xcodes
|
7
|
-
output = `mdfind kMDItemCFBundleIdentifier = "
|
8
|
-
output.lines
|
16
|
+
output = `mdfind kMDItemCFBundleIdentifier = "#{XCODE_BUNDLE_IDENTIFIER}"`
|
17
|
+
paths = output.lines + DEFAULT_XCODE_PATHS
|
18
|
+
|
19
|
+
paths.map(&:strip).uniq.collect do |xcode_path|
|
9
20
|
Xcode.from_bundle(xcode_path)
|
10
21
|
end.compact.keep_if(&:valid?)
|
11
22
|
end
|
@@ -18,8 +29,9 @@ class Xcode < Bundle
|
|
18
29
|
def valid?
|
19
30
|
is_app = path.end_with?('.app')
|
20
31
|
has_info = File.exist?(info_path)
|
32
|
+
return false unless is_app && has_info
|
21
33
|
|
22
|
-
|
34
|
+
bundle_identifier == XCODE_BUNDLE_IDENTIFIER
|
23
35
|
end
|
24
36
|
|
25
37
|
def signed?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: update_xcode_plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mahdi Bchetnia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|