gym 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gym/detect_values.rb +1 -1
- data/lib/gym/project.rb +10 -5
- data/lib/gym/version.rb +1 -1
- 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: 8ce678cc45ab3fc3b06c8ff3fc4c793792359a9c
|
4
|
+
data.tar.gz: 913800242d81cc04089ec4d0e53a98a8d5034529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70df21737fac27d4cd0a31d5b1feac957898af2e7bf6a716c4aaedafc0649ef2a499abe219cd69901cfb75fb6e9c7f66d16ddbc339f935eb491a03b605034488
|
7
|
+
data.tar.gz: 4dfc77aea0be00fafbcf9389b1c81e42d14697249f7cd0bfb0358f45d2ac9fc878527643a4b04a409297de765f2c9705e35f9b37a9369ce528b0d5a9fe5245db
|
data/lib/gym/detect_values.rb
CHANGED
@@ -129,7 +129,7 @@ module Gym
|
|
129
129
|
# Is it an iOS device or a Mac?
|
130
130
|
def self.detect_platform
|
131
131
|
return if Gym.config[:destination]
|
132
|
-
platform = Gym.project.build_settings("PLATFORM_DISPLAY_NAME") || "iOS" # either `iOS` or `OS X`
|
132
|
+
platform = Gym.project.build_settings(key: "PLATFORM_DISPLAY_NAME") || "iOS" # either `iOS` or `OS X`
|
133
133
|
|
134
134
|
Gym.config[:destination] = "generic/platform=#{platform}"
|
135
135
|
end
|
data/lib/gym/project.rb
CHANGED
@@ -53,18 +53,21 @@ module Gym
|
|
53
53
|
def app_name
|
54
54
|
# WRAPPER_NAME: Example.app
|
55
55
|
# WRAPPER_SUFFIX: .app
|
56
|
-
name = build_settings("WRAPPER_NAME")
|
56
|
+
name = build_settings(key: "WRAPPER_NAME")
|
57
57
|
|
58
|
-
return name.gsub(build_settings("WRAPPER_SUFFIX"), "") if name
|
58
|
+
return name.gsub(build_settings(key: "WRAPPER_SUFFIX"), "") if name
|
59
59
|
nil
|
60
60
|
end
|
61
61
|
|
62
62
|
def mac?
|
63
|
-
|
63
|
+
!ios?
|
64
64
|
end
|
65
65
|
|
66
66
|
def ios?
|
67
|
-
|
67
|
+
# Some proects have different values... we have to look for all of them
|
68
|
+
return true if build_settings(key: "PLATFORM_NAME") == "iphoneos"
|
69
|
+
return true if build_settings(key: "PLATFORM_DISPLAY_NAME") == "iOS"
|
70
|
+
false
|
68
71
|
end
|
69
72
|
|
70
73
|
#####################################################
|
@@ -74,7 +77,7 @@ module Gym
|
|
74
77
|
# Get the build settings for our project
|
75
78
|
# this is used to properly get the DerivedData folder
|
76
79
|
# @param [String] The key of which we want the value for (e.g. "PRODUCT_NAME")
|
77
|
-
def build_settings(key)
|
80
|
+
def build_settings(key: nil, optional: true)
|
78
81
|
unless @build_settings
|
79
82
|
# We also need to pass the workspace and scheme to this command
|
80
83
|
command = "xcrun xcodebuild -showBuildSettings #{BuildCommandGenerator.project_path_array.join(' ')}"
|
@@ -86,6 +89,8 @@ module Gym
|
|
86
89
|
result = @build_settings.split("\n").find { |c| c.include? key }
|
87
90
|
return result.split(" = ").last
|
88
91
|
rescue => ex
|
92
|
+
return nil if optional # an optional value, we really don't care if something goes wrong
|
93
|
+
|
89
94
|
Helper.log.error caller.join("\n\t")
|
90
95
|
Helper.log.error "Could not fetch #{key} from project file: #{ex}"
|
91
96
|
end
|
data/lib/gym/version.rb
CHANGED