xctools 0.0.1 → 0.0.2

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: ec3323bd32436ef729ee18fac50e286da1c13e7e
4
- data.tar.gz: 4a675015897e2abb5a160442489d8a2f5455befc
3
+ metadata.gz: 399b80426b72d73d67481bd64c191994b48ff939
4
+ data.tar.gz: d3a8fd368655d30fe464701231c720ec6b3be4b2
5
5
  SHA512:
6
- metadata.gz: 9fdef60736a7653364ae3f244795650ecc960bd38caddcfe467a3d17d65abab48effceec2b42ec4b68e65516f0f48dd479c4902f98dda24937a99a120839091e
7
- data.tar.gz: 0bacc039a0914c45d2230b91baf9ae7365eeafa4140489d4721a27b42a0023f271c9718d78bd369e1d7be96b203b5b9f0e5696a77958e2d9c3b82a861533c92e
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).
@@ -1,3 +1,3 @@
1
1
  module XcTools
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -21,12 +21,7 @@ module XcTools
21
21
  end
22
22
 
23
23
  def self.info(*args)
24
- options = args.last.is_a?(Hash) ? args.pop : {}
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
- options = args.last.is_a?(Hash) ? args.pop : {}
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.1
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-14 00:00:00.000000000 Z
11
+ date: 2014-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler