guardian-angel 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/guardian-angel +0 -1
- data/lib/ga_loader.rb +23 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e448d846f7832faaf993bc66da560f47df9f9e7
|
4
|
+
data.tar.gz: 7ee0374d51306fcba167848fcec8adf014e7cdca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25fc3c497a2a8f6ef1b36aeb962deea5343b4da4294e0b7fcc9e076e64866751e9d489306e278fedf7e64953f7785cc662570fc61b4da0a43dade895eb394241
|
7
|
+
data.tar.gz: ab080ed038aea304e99ee068414c7315193b58d69074ccc2e273dd48bb8b5e0c4471c4f331ffba64acb803ce4a33f07dc332b0f271b341cd98447c2691312a9e
|
data/bin/guardian-angel
CHANGED
data/lib/ga_loader.rb
CHANGED
@@ -30,14 +30,24 @@ class GALoader
|
|
30
30
|
|
31
31
|
# Returns a possible workspace, in case one is not provided in the configuration
|
32
32
|
#
|
33
|
-
# @note this searches only in the
|
33
|
+
# @note this searches only in the top level directory
|
34
34
|
def self.findWorkspace
|
35
|
-
workspace =
|
35
|
+
workspace = `find . -maxdepth 1 -name '*.xcworkspace'`
|
36
36
|
return nil if workspace.empty?
|
37
37
|
|
38
38
|
return File.basename(workspace, ".*")
|
39
39
|
end
|
40
40
|
|
41
|
+
# Returns a possible project, in case one is not provided in the configuration
|
42
|
+
#
|
43
|
+
# @note this searches only in the top level directory
|
44
|
+
def self.findProject
|
45
|
+
project = `find . -maxdepth 1 -name '*.xcodeproj'`
|
46
|
+
return nil if project.empty?
|
47
|
+
|
48
|
+
return File.basename(project, ".*")
|
49
|
+
end
|
50
|
+
|
41
51
|
# Validates a given configuration
|
42
52
|
#
|
43
53
|
# @param configuration [GAConfiguration] the configuration to validate
|
@@ -51,13 +61,20 @@ class GALoader
|
|
51
61
|
|
52
62
|
if !possibleWorkspace
|
53
63
|
if configuration.project.nil?
|
54
|
-
|
55
|
-
|
56
|
-
|
64
|
+
possibleProject = findProject()
|
65
|
+
|
66
|
+
if !possibleProject
|
67
|
+
GALogger.log("workspace or project was not specified, exiting", :Error)
|
68
|
+
outputSampleConfiguration()
|
69
|
+
abort
|
70
|
+
else
|
71
|
+
configurationMerge = GAConfiguration.new(GAConfiguration::GAConfigurationProject => possibleProject)
|
72
|
+
end
|
57
73
|
end
|
74
|
+
else
|
75
|
+
configurationMerge = GAConfiguration.new(GAConfiguration::GAConfigurationWorkspace => possibleWorkspace)
|
58
76
|
end
|
59
77
|
|
60
|
-
configurationMerge = GAConfiguration.new(GAConfiguration::GAConfigurationWorkspace => possibleWorkspace)
|
61
78
|
configuration = configuration.merge(configurationMerge)
|
62
79
|
end
|
63
80
|
|