xcodeproj 1.0.0.beta.3 → 1.0.0.beta.4

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: cf70f4fc8e04d6af3a40180f46b7f5ace1cfa3ad
4
- data.tar.gz: b5f8718dde0f983d624b6533f535e3b424ef91da
3
+ metadata.gz: b5365dce5249a3e06f6eeadfc7c4fb00242228b9
4
+ data.tar.gz: 5f931366bea51e6fd3a6a76f7f313ac7df39f888
5
5
  SHA512:
6
- metadata.gz: 1f37da28af86418f4b9cf4d3d7667b8cb17daa021541f116fa4049c269465d7469ff44cdd4b2097d8252885767aea80714a1ad5eab758249839474a62293bd4e
7
- data.tar.gz: 5e707785dd45fdea7886a2ccce890f6f4d2c982eaa438c4917c0ae37899beb5a221a5941a4f4ac1c913d2a4cf92834742a2656f0d98677a25791e0df61030b9c
6
+ metadata.gz: 1a0e3e88d47c4cf489301a2d8bb66c09727d4664bc725581efea2b7eac97d6702c8b53c8a1819f6bab3065696aaf5b6472c363182bf2ab7f74d7d645164ea625
7
+ data.tar.gz: 0c95879d61ef84e23d52ecc882e5c7e294c58c7238234cec1b0e6cc77ba797776156d1f80b4dead5a316ed8099f77e8212f9ed9014f202969c0ef50d27d30c88
@@ -47,15 +47,15 @@ module Xcodeproj
47
47
  options[:key_2] ||= 'value_2'
48
48
  options[:id_key] ||= nil
49
49
 
50
- if value_1.class == value_2.class
51
- method = case value_1
50
+ method = if value_1.class == value_2.class
51
+ case value_1
52
52
  when Hash then :hash_diff
53
53
  when Array then :array_diff
54
54
  else :generic_diff
55
55
  end
56
- else
57
- method = :generic_diff
58
- end
56
+ else
57
+ :generic_diff
58
+ end
59
59
  send(method, value_1, value_2, options)
60
60
  end
61
61
 
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '1.0.0.beta.3'.freeze unless defined? Xcodeproj::VERSION
4
+ VERSION = '1.0.0.beta.4'.freeze unless defined? Xcodeproj::VERSION
5
5
  end
@@ -63,7 +63,7 @@ module Xcodeproj
63
63
  @uuid = uuid
64
64
  @isa = self.class.isa
65
65
  @referrers = []
66
- unless @isa.match(/^(PBX|XC)/)
66
+ unless @isa =~ /^(PBX|XC)/
67
67
  raise "[Xcodeproj] Attempt to initialize an abstract class (#{self.class})."
68
68
  end
69
69
  end
@@ -46,12 +46,40 @@ module Xcodeproj
46
46
  #
47
47
  attribute :output_files, Array
48
48
 
49
+ # @return [ObjectList<String>] the compiler flags used when creating the
50
+ # respective output files.
51
+ #
52
+ attribute :output_files_compiler_flags, Array
53
+
49
54
  # @return [String] the content of the script to use for the build rule.
50
55
  #
51
56
  # @note This attribute is present if the #{#compiler_spec} is
52
57
  # `com.apple.compilers.proxy.script`
53
58
  #
54
59
  attribute :script, String
60
+
61
+ # @!group Helpers
62
+
63
+ # Adds an output file with the specified compiler flags.
64
+ #
65
+ # @param [PBXFileReference] file the file to add.
66
+ #
67
+ # @param [String] compiler_flags the compiler flags for the file.
68
+ #
69
+ # @return [Void]
70
+ #
71
+ def add_output_file(file, compiler_flags = '')
72
+ (self.output_files ||= []) << file
73
+ (self.output_files_compiler_flags ||= []) << compiler_flags
74
+ end
75
+
76
+ # @return [Array<[PBXFileReference, String]>]
77
+ # An array containing tuples of output files and their compiler
78
+ # flags.
79
+ #
80
+ def output_files_and_flags
81
+ (output_files || []).zip(output_files_compiler_flags || [])
82
+ end
55
83
  end
56
84
  end
57
85
  end
@@ -300,11 +300,11 @@ module Xcodeproj
300
300
  # scheme.save_as('path/to/Project.xcodeproj') #=> true
301
301
  #
302
302
  def save_as(project_path, name, shared = true)
303
- if shared
304
- scheme_folder_path = self.class.shared_data_dir(project_path)
305
- else
306
- scheme_folder_path = self.class.user_data_dir(project_path)
307
- end
303
+ scheme_folder_path = if shared
304
+ self.class.shared_data_dir(project_path)
305
+ else
306
+ self.class.user_data_dir(project_path)
307
+ end
308
308
  scheme_folder_path.mkpath
309
309
  scheme_path = scheme_folder_path + "#{name}.xcscheme"
310
310
  File.open(scheme_path, 'w') do |f|
@@ -109,11 +109,11 @@ module Xcodeproj
109
109
  @xml_element.attributes['key'] = node_or_variable[:key]
110
110
  @xml_element.attributes['value'] = node_or_variable[:value]
111
111
 
112
- if node_or_variable.key?(:enabled)
113
- @xml_element.attributes['isEnabled'] = bool_to_string(node_or_variable[:enabled])
114
- else
115
- @xml_element.attributes['isEnabled'] = bool_to_string(true)
116
- end
112
+ @xml_element.attributes['isEnabled'] = if node_or_variable.key?(:enabled)
113
+ bool_to_string(node_or_variable[:enabled])
114
+ else
115
+ bool_to_string(true)
116
+ end
117
117
  end
118
118
  end
119
119
 
@@ -76,10 +76,9 @@ module Xcodeproj
76
76
  when 'absolute'
77
77
  File.expand_path(path)
78
78
  when 'developer'
79
- raise 'Developer workspace file reference type is not yet ' \
80
- "#{self}"
79
+ raise "Developer workspace file reference type is not yet supported (#{path})"
81
80
  else
82
- raise "Unsupported workspace file reference type #{type}"
81
+ raise "Unsupported workspace file reference type `#{type}`"
83
82
  end
84
83
  end
85
84
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.3
4
+ version: 1.0.0.beta.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  version: '0'
149
149
  requirements: []
150
150
  rubyforge_project:
151
- rubygems_version: 2.5.2
151
+ rubygems_version: 2.6.3
152
152
  signing_key:
153
153
  specification_version: 3
154
154
  summary: Create and modify Xcode projects from Ruby.