Sha256: 9e8d7209cc19e05ff4267360484ad5d51bb6378a90eef706bb42f216e9416ce6

Contents?: true

Size: 1.32 KB

Versions: 1

Compression:

Stored size: 1.32 KB

Contents

#!/usr/bin/env ruby
# coding: utf-8

module Cuesmash

  #
  # Provides an object to get information about the ios app that is being built.
  #
  # @author [jarod]
  #
  class IosApp

    # Public: the path to the dir containing the built app i.e. /tmp/MyAppQWERQW/Build/Products/Debug-iphonesimulator/
    attr_reader :app_dir

    # Public: the full path including the built app i.e. /tmp/MyAppQWERQW/Build/Products/Debug-iphonesimulator/MyApp.app"
    attr_reader :app_path

    # Public: the app name i.e. MyApp.app
    attr_reader :app_name

    # Public: the xcode Derived Data temp directory
    attr_reader :tmp_dir

    #
    # Create a new App instance
    #
    # @param  file_name [String] The usually is the scheme of the xcode project
    #
    # @return [App] A app instance
    def initialize(file_name:, travis_build: false)
      @app_name = "#{file_name}" << ".app"
      @tmp_dir = Dir.mktmpdir(file_name)

      # if we are running this on travis then we want to build inside the project
      # dir (it's a VM so it gets cleaned up each run). Otherwise let's create
      # our own tmp dir for each build.
      if travis_build
        @app_dir = "./build/Release-iphonesimulator/"
      else
        @app_dir = "#{@tmp_dir}" << "/Release-iphonesimulator/"
      end
      @app_path = "#{@app_dir}" << "#{@app_name}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cuesmash-0.1.2 lib/cuesmash/iosapp.rb