Class: Vendor::XCode::Proxy::PBXFileReference

Inherits:
Base
  • Object
show all
Defined in:
lib/vendor/xcode/proxy/pbx_file_reference.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #id, #parent

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attribute_name, generate_id, #group?, #initialize, #inspect, #method_missing, object_references, #read_attribute, reference, #respond_to?, #to_ascii_plist, #write_attribute

Constructor Details

This class inherits a constructor from Vendor::XCode::Proxy::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Vendor::XCode::Proxy::Base

Class Method Details

.file_type_from_extension(extension) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vendor/xcode/proxy/pbx_file_reference.rb', line 23

def self.file_type_from_extension(extension)
  case extension
    when /.(png|jpg)/ then "image.#{$1}"
    when ".h"         then "sourcecode.c.h"
    when ".m"         then "sourcecode.c.objc"
    when ".bundle"    then "wrapper.plug-in"
    when ".framework" then "wrapper.framework"
    when ".a"         then "archive.ar"
    when ".strings"   then "text.plist.strings"
    when ".plist"     then "text.plist.xml"
    when ".dylib"     then "compiled.mach-o.dylib"
    else "unknown"
  end
end

Instance Method Details

#file?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/vendor/xcode/proxy/pbx_file_reference.rb', line 7

def file?
  true
end

#full_pathObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vendor/xcode/proxy/pbx_file_reference.rb', line 11

def full_path
  parts = []
  current = self

  while current
    parts.push current.path if current.respond_to?(:path) && !current.path.nil?
    current = current.parent
  end

  parts.reverse.join("/")
end