xcodeproj 0.20.0 → 0.20.1

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: 52c251c9a9b1362652e5dc8ea5c23901b8c0327e
4
- data.tar.gz: 56c1bfb43c09840aa85c5cff8655be63de176207
3
+ metadata.gz: 0d12a2179ece4dba969c51ec942f973f8bc1799f
4
+ data.tar.gz: f0fe24105ea6ec46bcd86ff7720fffa729a138f5
5
5
  SHA512:
6
- metadata.gz: 83d70e140a46ad9f7418ec5ca2587d0878c63ae67a0dcd51eb210fc1f271dd472690af92ffe579892fd405b5ee604500e582cd2950a2c83b5a342f5769a7fc85
7
- data.tar.gz: 0b18b6ca17245519fcfa4955596c0163c5390db3f89a9d51a292ec21cad7a4d71c2374d70625fd67d549d77fac39b72cb2222bca637909d437c4e090828c9140
6
+ metadata.gz: 0ce5a3f083f0e275c50a30ad8e8fe11234011d8964d5bfcdc1493378407ee0113a7723e6de7604d42ac8b889df7dd89db0e7b342996739a72dafe7891e08110c
7
+ data.tar.gz: d5877614b4ff849ec9655a610a68b1d4477aeb62be1791c5a87f95bba7a05afa3a8471e7f9070754480c4e6acf2fa6ac7f83c2c6c7d3bb7a4ad16e0c770a0c89
@@ -1,5 +1,5 @@
1
1
  module Xcodeproj
2
2
  # The version of the xcodeproj gem.
3
3
  #
4
- VERSION = '0.20.0' unless defined? Xcodeproj::VERSION
4
+ VERSION = '0.20.1' unless defined? Xcodeproj::VERSION
5
5
  end
@@ -310,10 +310,13 @@ module CoreFoundation
310
310
  # This pointer will assign `CFRelease` as the free function when
311
311
  # dereferencing the pointer.
312
312
  #
313
+ # @note This means that the object will *not* be released if it's not
314
+ # dereferenced, but that would be a leak anyways, so be sure to do so.
315
+ #
313
316
  def self.CFTypeRefPointer
314
317
  pointer = Fiddle::Pointer.malloc(Fiddle::SIZEOF_INTPTR_T, free_function)
315
318
  def pointer.ptr
316
- CFAutoRelease(super)
319
+ ::CoreFoundation.CFAutoRelease(super)
317
320
  end
318
321
  pointer
319
322
  end
@@ -54,7 +54,7 @@ module Xcodeproj
54
54
  # attribute.plist_name #=> projectRoot
55
55
  #
56
56
  def plist_name
57
- CaseConverter.convert_to_plist(name, :lower)
57
+ @plist_name ||= CaseConverter.convert_to_plist(name, :lower)
58
58
  end
59
59
 
60
60
  # @return [Array<Class>] the list of the classes accepted by the
@@ -19,7 +19,9 @@ module Xcodeproj
19
19
  command = "xcproj --project \"#{path}\" touch"
20
20
  success, output = execute(command)
21
21
  unless success
22
- message = "xcproj failed to touch the project. Check whether you installation of xcproj is functional.\n\n"
22
+ message = 'The `xcproj` tool has failed to touch the project. ' \
23
+ 'Check whether your installation of `xcproj` is ' \
24
+ "functional.\n\n"
23
25
  message << command << "\n"
24
26
  message << output
25
27
  UI.warn(message)
@@ -115,13 +115,38 @@ module Xcodeproj
115
115
  #
116
116
  attr_reader :root_object
117
117
 
118
+ # A fast way to see if two {Project} instances refer to the same projects on
119
+ # disk. Use this over {#eql?} when you do not need to compare the full data.
120
+ #
121
+ # This shallow comparison was chosen as the (common) `==` implementation,
122
+ # because it was too easy to introduce changes into the Xcodeproj code-base
123
+ # that were slower than O(1).
124
+ #
125
+ # @return [Boolean] whether or not the two `Project` instances refer to the
126
+ # same projects on disk, determined solely by {#path} and
127
+ # `root_object.uuid` equality.
128
+ #
129
+ # @todo If ever needed, we could also compare `uuids.sort` instead.
130
+ #
131
+ def ==(other)
132
+ other && path == other.path && root_object.uuid == other.root_object.uuid
133
+ end
134
+
118
135
  # Compares the project to another one, or to a plist representation.
119
136
  #
137
+ # @note This operation can be extremely expensive, because it converts a
138
+ # `Project` instance to a hash, and should _only_ ever be used to
139
+ # determine wether or not the data contents of two `Project` instances
140
+ # are completely equal.
141
+ #
142
+ # To simply determine wether or not two {Project} instances refer to
143
+ # the same projects on disk, use the {#==} method instead.
144
+ #
120
145
  # @param [#to_hash] other the object to compare.
121
146
  #
122
147
  # @return [Boolean] whether the project is equivalent to the given object.
123
148
  #
124
- def ==(other)
149
+ def eql?(other)
125
150
  other.respond_to?(:to_hash) && to_hash == other.to_hash
126
151
  end
127
152
 
@@ -131,9 +156,9 @@ module Xcodeproj
131
156
 
132
157
  alias_method :inspect, :to_s
133
158
 
134
- # @return [Bool] Whether the xcproj conversion should be disabled. The
135
- # conversion can be disable also via the
136
- # `XCODEPROJ_DISABLE_XCPROJ` environment variable.
159
+ # @return [Boolean] Whether the `xcproj` conversion should be disabled. The
160
+ # conversion can also be disabled via the `XCODEPROJ_DISABLE_XCPROJ`
161
+ # environment variable.
137
162
  #
138
163
  attr_accessor :disable_xcproj
139
164
  def disable_xcproj?
@@ -174,9 +199,8 @@ module Xcodeproj
174
199
  def initialize_from_file
175
200
  pbxproj_path = path + 'project.pbxproj'
176
201
  plist = Xcodeproj.read_plist(pbxproj_path.to_s)
177
- root_object_uuid = plist['rootObject']
178
202
  root_object.remove_referrer(self) if root_object
179
- @root_object = new_from_plist(root_object_uuid, plist['objects'], self)
203
+ @root_object = new_from_plist(plist['rootObject'], plist['objects'], self)
180
204
  @archive_version = plist['archiveVersion']
181
205
  @object_version = plist['objectVersion']
182
206
  @classes = plist['classes']
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcodeproj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.20.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-26 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.0'
19
+ version: '3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.0'
26
+ version: '3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: colored
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.2'
41
41
  description: Xcodeproj lets you create and modify Xcode projects from Ruby. Script
@@ -100,12 +100,12 @@ require_paths:
100
100
  - lib
101
101
  required_ruby_version: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - ">="
104
104
  - !ruby/object:Gem::Version
105
105
  version: 2.0.0
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []