xctools 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/xctools/version.rb +1 -1
- data/lib/xctools/xcode_build.rb +13 -12
- 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: 399b80426b72d73d67481bd64c191994b48ff939
|
4
|
+
data.tar.gz: d3a8fd368655d30fe464701231c720ec6b3be4b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fe172117f53d2201b1bebd861cd6000286e66d86ef4bc14db6cfaf006b4e6457a11963c5515c43808f5c02b72643d28d8806f28b16bf5fb76dee434177ae5de
|
7
|
+
data.tar.gz: 0990c9335ee5c3eaa51953a00da5a151a9bb6dfd8fb03b0d735d1093dea7bf064d687506fd9f777e63ffba72589fc5dab385d22a356669ad2e30717a818a8431
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# XcTools
|
2
2
|
|
3
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/antlypls/xctools.svg?style=flat)](https://codeclimate.com/github/antlypls/xctools)
|
4
|
+
[![Build Status](http://img.shields.io/travis/antlypls/xctools.svg?style=flat)](https://travis-ci.org/antlypls/xctools)
|
5
|
+
[![Coverage Status](http://img.shields.io/coveralls/antlypls/xctools.svg?style=flat)](https://coveralls.io/r/antlypls/xctools)
|
6
|
+
|
3
7
|
Collection of helpers for parsing Xcode CLI tools output.
|
4
8
|
|
5
9
|
This is an extract from [ognivo gem](https://github.com/antlypls/ognivo).
|
data/lib/xctools/version.rb
CHANGED
data/lib/xctools/xcode_build.rb
CHANGED
@@ -21,12 +21,7 @@ module XcTools
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.info(*args)
|
24
|
-
|
25
|
-
cmd_args = (args + args_from_options(options)).join(' ')
|
26
|
-
output = `xcodebuild -list #{cmd_args} 2>&1`
|
27
|
-
fail Error, $1 if output =~ /^xcodebuild\: error\: (.+)$/
|
28
|
-
fail NilOutputError unless output =~ /\S/
|
29
|
-
|
24
|
+
output = execute_xcodebuild('-list', *args)
|
30
25
|
info = parse_info_output(output)
|
31
26
|
Info.new(info)
|
32
27
|
end
|
@@ -65,12 +60,7 @@ module XcTools
|
|
65
60
|
private_class_method :parse_info_line
|
66
61
|
|
67
62
|
def self.settings(*args)
|
68
|
-
|
69
|
-
cmd_args = (args + args_from_options(options)).join(' ')
|
70
|
-
output = `xcodebuild #{cmd_args} -showBuildSettings 2> /dev/null`
|
71
|
-
fail Error, $1 if output =~ /^xcodebuild\: error\: (.+)$/
|
72
|
-
fail NilOutputError unless output =~ /\S/
|
73
|
-
|
63
|
+
output = execute_xcodebuild('-showBuildSettings', *args)
|
74
64
|
settings = parse_settings_output(output)
|
75
65
|
Settings.new(settings)
|
76
66
|
end
|
@@ -106,6 +96,17 @@ module XcTools
|
|
106
96
|
$1 if output =~ /([\d+\.?]+)/
|
107
97
|
end
|
108
98
|
|
99
|
+
def self.execute_xcodebuild(*args)
|
100
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
101
|
+
cmd_args = (args + args_from_options(options)).join(' ')
|
102
|
+
output = `xcodebuild #{cmd_args} 2>&1`
|
103
|
+
fail Error, $1 if output =~ /^xcodebuild\: error\: (.+)$/
|
104
|
+
fail NilOutputError unless output =~ /\S/
|
105
|
+
|
106
|
+
output
|
107
|
+
end
|
108
|
+
private_class_method :execute_xcodebuild
|
109
|
+
|
109
110
|
def self.args_from_options(options = {})
|
110
111
|
options
|
111
112
|
.reject { |_, value| value.nil? }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xctools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anatoliy Plastinin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|