xcodeproj 0.4.0.rc4 → 0.4.0.rc5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/xcodeproj.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
- VERSION = '0.4.0.rc4'
2
+ VERSION = '0.4.0.rc5'
3
3
 
4
4
  class PlainInformative < StandardError
5
5
  end
@@ -18,7 +18,10 @@ module Xcodeproj
18
18
 
19
19
  # @return [PBXFileReference] the file that to build.
20
20
  #
21
- has_one :file_ref, [PBXFileReference, PBXVariantGroup, XCVersionGroup]
21
+ # @todo I think that is possible to add any kind of groups (for example
22
+ # folders linked to a path).
23
+ #
24
+ has_one :file_ref, [PBXFileReference, PBXVariantGroup, XCVersionGroup, PBXReferenceProxy]
22
25
 
23
26
  end
24
27
  end
@@ -164,8 +164,10 @@ module Xcodeproj
164
164
  #
165
165
  def remove_file_reference(file)
166
166
  build_file = files.find { |bf| bf.file_ref == file }
167
- build_file.file_ref = nil
168
- build_file.remove_from_project
167
+ if build_file
168
+ build_file.file_ref = nil
169
+ build_file.remove_from_project
170
+ end
169
171
  end
170
172
 
171
173
  # Removes a build file from the phase and clears its relationship to
@@ -134,14 +134,18 @@ module Xcodeproj
134
134
  return unless object
135
135
  acceptable = classes.find { |klass| object.class == klass || object.class < klass }
136
136
  if type == :simple
137
- raise "[Xcodeproj] Type checking error: '#{owner.isa}' expected '#{classes.inspect}' got '#{object.class}' for attribute: #{inspect}" unless acceptable
137
+ raise "[Xcodeproj] Type checking error: got `#{object.class}` for attribute: #{inspect}" unless acceptable
138
138
  else
139
- raise "[Xcodeproj] Type checking error: '#{owner.isa}' expected #{classes.map(&:isa)} got #{object.isa} for attribute: #{inspect}" unless acceptable
139
+ raise "[Xcodeproj] Type checking error: got `#{object.isa}` for attribute: #{inspect}" unless acceptable
140
140
  end
141
141
  end
142
142
 
143
143
  def inspect
144
- "#<name: '#{name}', type: '#{type}', classes: '#{classes}', owner class: '#{owner.isa}'>"
144
+ if type == :simple
145
+ "Attribute `#{plist_name}` (type: `#{type}`, classes: `#{classes}`, owner class: `#{owner.isa}`)"
146
+ else
147
+ "Attribute `#{plist_name}` (type: `#{type}`, classes: `#{classes.map(&:isa)}`, owner class: `#{owner.isa}`)"
148
+ end
145
149
  end
146
150
  end
147
151
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.rc4
4
+ version: 0.4.0.rc5
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-25 00:00:00.000000000 Z
12
+ date: 2012-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 1752387102011535008
105
+ hash: -933464580637891352
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements: