<commit_before>require 'xcode/parsers/plutil_project_parser'
require 'xcode/resource'
require 'xcode/registry'

module Xcode
  
  #
  # The project is the representation of an Xcode Project folder, the `*.xcodeproj`,
  # folder that contains a number of workspace files and project files like
  # `project.pbxproj`. 
  # 
  # 
  # The Project represents encapsulates the an actual Resource that is ProjectReference
  # and other objects.
  # 
  class Project 
    
    # @return [String] the name of the project; This value is deteremined from the 
    #   first part of the Xcode project folder name (e.g. "TestProject.xcodeproj" 
    #   name is "TestProject")
    attr_reader :name
    
    # @return [String] the sdks for the project. This is specified during the project
    #   initialization. If none are provided this currently defaults to "iphoneos"
    attr_reader :sdk
    
    # @return [String] the expanded file path for the project. This is expanded from the
    #   file path specified during initialization.
    attr_reader :path
    
    # @return [Array<Scheme>] the schemes that are found within the project path.
    attr_reader :schemes
    
    # @return [Registry] the data that is parsed from the project.pbxproj, it is
    #   in most part a Hash with additional methods included to provide core
    #   functionality.
    attr_reader :registry
    
    #
    # Initialized with a specific path and sdk.
    # 
    # This initialization is not often used. Instead projects are generated
    # through the Xcode#project method.
    # 
    # @see Xcode
    #
    # @param [String] path of the project to open.
    # @param [String] sdk the sdk value of the project. This will default to 
    #   `iphoneos`.
    # 
    def initialize(path, sdk=nil)
      @sdk = sdk || "iphoneos"  # FIXME: should support OSX/simulator too
      @path = File.expand_path path
      @schemes = []
      @groups = []
      @name = File.basename(@path).gsub(/\.xcodeproj/,'')
      
      # Parse the Xcode project file and create the registry
      
      @registry = parse_pbxproj
      @project = Xcode::Resource.new @registry.root, @registry
      
      @schemes = parse_schemes
    end
    
    <commit_msg>Project returns a reference to the project object<commit_after>require 'xcode/parsers/plutil_project_parser'
require 'xcode/resource'
require 'xcode/registry'

module Xcode
  
  #
  # The project is the representation of an Xcode Project folder, the `*.xcodeproj`,
  # folder that contains a number of workspace files and project files like
  # `project.pbxproj`. 
  # 
  # 
  # The Project represents encapsulates the an actual Resource that is ProjectReference
  # and other objects.
  # 
  class Project 
    
    # @return [String] the name of the project; This value is deteremined from the 
    #   first part of the Xcode project folder name (e.g. "TestProject.xcodeproj" 
    #   name is "TestProject")
    attr_reader :name
    
    # @return [String] the sdks for the project. This is specified during the project
    #   initialization. If none are provided this currently defaults to "iphoneos"
    attr_reader :sdk
    
    # @return [String] the expanded file path for the project. This is expanded from the
    #   file path specified during initialization.
    attr_reader :path
    
    # @return [Array<Scheme>] the schemes that are found within the project path.
    attr_reader :schemes
    
    # @return [Registry] the data that is parsed from the project.pbxproj, it is
    #   in most part a Hash with additional methods included to provide core
    #   functionality.
    attr_reader :registry
    
    # @return [ProjectReference] the project object that is contained in the 
    #   project file that contains additional information
    attr_reader :project
    
    #
    # Initialized with a specific path and sdk.
    # 
    # This initialization is not often used. Instead projects are generated
    # through the Xcode#project method.
    # 
    # @see Xcode
    #
    # @param [String] path of the project to open.
    # @param [String] sdk the sdk value of the project. This will default to 
    #   `iphoneos`.
    # 
    def initialize(path, sdk=nil)
      @sdk = sdk || "iphoneos"  # FIXME: should support OSX/simulator too
      @path = File.expand_path path
      @schemes = []
      @groups = []
      @name = File.basename(@path).gsub(/\.xcodeproj/,'')
      
      # Parse the Xcode project file and create the registry
      
      @registry = parse_pbxproj
      @project = Xcode::Resource.new @registry.root, @registry
      
      @schemes = parse_schemes
    end
    
    
{'fraction_non_alphanumeric': 0.07377049180327869, 'fraction_numerical': 0.0, 'mean_word_length': 2.6743264659270998, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5284289', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1319, 'n_words': 513}