gym 0.4.1 → 0.4.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: f1528c03631780f4a91a2d4c7a8df2f3c7083234
4
- data.tar.gz: bf38454fce0dc5e5937faac893f3074662be5d3c
3
+ metadata.gz: 8ce678cc45ab3fc3b06c8ff3fc4c793792359a9c
4
+ data.tar.gz: 913800242d81cc04089ec4d0e53a98a8d5034529
5
5
  SHA512:
6
- metadata.gz: dddf3ca3f386cb1dedef100913f897ed3b618d6257e1dd48493f4ea3943f9fa0cdcc9343dfb69f92cd79f95255c56aaa413d3cf84a376b8c5948cf15547e662c
7
- data.tar.gz: f0f21347d00e1ccf9d8e612a8fc42b6706c9a817a00e719e7d82543c4a365d1686eb00e49f3eeb7179bc93335298b74378d728896ea634e06de1f6d9d3569ee3
6
+ metadata.gz: 70df21737fac27d4cd0a31d5b1feac957898af2e7bf6a716c4aaedafc0649ef2a499abe219cd69901cfb75fb6e9c7f66d16ddbc339f935eb491a03b605034488
7
+ data.tar.gz: 4dfc77aea0be00fafbcf9389b1c81e42d14697249f7cd0bfb0358f45d2ac9fc878527643a4b04a409297de765f2c9705e35f9b37a9369ce528b0d5a9fe5245db
@@ -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
@@ -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
- build_settings("PLATFORM_DISPLAY_NAME") == "OS X"
63
+ !ios?
64
64
  end
65
65
 
66
66
  def ios?
67
- build_settings("PLATFORM_DISPLAY_NAME") == "iOS"
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
@@ -1,4 +1,4 @@
1
1
  module Gym
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  DESCRIPTION = "Building your iOS apps has never been easier"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gym
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause