fruity_builder 1.0.0 → 1.0.1

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: 388eb38a0a12e97f3742704555ca19eaca117ab8
4
- data.tar.gz: 39cd6b97094a2b2d2ee8591f7981c25c047b4874
3
+ metadata.gz: 16412bb7e55a1c0f1872c37d1a63609ca8efdcf0
4
+ data.tar.gz: a63167548a0c1fecc2213a979f3b564568892b9f
5
5
  SHA512:
6
- metadata.gz: e7ad3b426b016bd595b0020523a4e93412f80d24376e3627b533b6ba79856594df5a17bdc928bfbe829b7a1c59a74ecaa6a25bcd467867c65aa6b0f1bdf7d92e
7
- data.tar.gz: 33eaacaca91a28b4819cf497280e0083df777a86e0fd991c46f6a658e02616fa2870a67e0094a137cdee82cd87f6dd8897f59e21085c18227cd9b92fc68de2f9
6
+ metadata.gz: d9050248a0edf8da4341c705518246c5598a515f8664e0ecc69d47ae923ce6ec34812521de8459d8e574838515b246052568dfc4665a4790e0953dddd5b0b06b
7
+ data.tar.gz: d57b536f65848d0aca184b6776435df42175a2b19a27da6aadaf80166f24e2e24bca64a9c4fde6c75e3d655d01a1497e49eb9e9f391c767e73cbbf7c412fdd3d
@@ -25,19 +25,16 @@ module FruityBuilder
25
25
  @path = path
26
26
  end
27
27
 
28
+ def has_project?
29
+ return true if get_projects.count > 0
30
+ false
31
+ end
32
+
28
33
  def project
29
- if @project.nil?
30
- if @path.scan(/.*xcodeproj$/).count > 0
31
- return @path
32
- end
33
- projects = Dir["#{@path}/**/*.xcodeproj"]
34
- projects = projects.select { |project| !project.include?('Pods')}
35
- raise HelperCommandError.new('Project not found') if projects.empty?
36
- raise HelperCommandError.new('Mulitple projects found, please specify one') if projects.count > 1
37
- project = projects.first
38
- @project = project
39
- end
40
- @project
34
+ projects = get_projects
35
+ raise HelperCommandError.new('Project not found') if projects.empty?
36
+ raise HelperCommandError.new('Mulitple projects found, please specify one') if projects.count > 1
37
+ @project = projects.first
41
38
  end
42
39
 
43
40
  def workspace
@@ -67,6 +64,21 @@ module FruityBuilder
67
64
  end
68
65
  @xcode
69
66
  end
67
+
68
+ private
69
+
70
+ def get_projects
71
+ if @project.nil?
72
+ if @path.scan(/.*xcodeproj$/).count > 0
73
+ @project = @path
74
+ return @path
75
+ end
76
+ projects = Dir["#{@path}/**/*.xcodeproj"]
77
+ projects.select { |project| !project.include?('Pods') }
78
+ else
79
+ @project
80
+ end
81
+ end
70
82
  end
71
83
  end
72
84
 
@@ -4,12 +4,16 @@ module FruityBuilder
4
4
  module IOS
5
5
  class Plistutil < Execution
6
6
 
7
- def self.get_bundle_id(options = {})
7
+ def self.get_xml(options = {})
8
8
  if options.key?(:file)
9
- xml = IO.read(options[:file])
9
+ IO.read(options[:file])
10
10
  elsif options.key?(:xml)
11
- xml = options[:xml]
11
+ options[:xml]
12
12
  end
13
+ end
14
+
15
+ def self.get_bundle_id(options = {})
16
+ xml = get_xml(options)
13
17
 
14
18
  raise PlistutilCommandError.new('No XML was passed') unless xml
15
19
 
@@ -20,11 +24,7 @@ module FruityBuilder
20
24
  end
21
25
 
22
26
  def self.replace_bundle_id(options = {})
23
- if options.key?(:file)
24
- xml = IO.read(options[:file])
25
- elsif options.key?(:xml)
26
- xml = options[:xml]
27
- end
27
+ xml = get_xml(options)
28
28
 
29
29
  raise PlistutilCommandError.new('No XML was passed') unless xml
30
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fruity_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-20 00:00:00.000000000 Z
12
+ date: 2016-02-03 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: iOS code signing utilities - used to replace bundle IDs, development
15
15
  teams and provisioning profiles programmatically