Sha256: bac5467036057a3dbe2bc88e40f48239fd76c01ab0d3cf4d1b4265abd4f71ac6

Contents?: true

Size: 879 Bytes

Versions: 2

Compression:

Stored size: 879 Bytes

Contents

require 'skippy/os/common'
require 'skippy/sketchup/app'

class Skippy::OSMac < Skippy::OSCommon

  # @param [String] executable_path
  def launch_app(executable_path, *args)
    command = %(open -a "#{executable_path}")
    unless args.empty?
      command << " --args #{args.join(' ')}"
    end
    execute_command(command)
  end

  def sketchup_apps
    apps = []
    pattern = '/Applications/SketchUp */'
    Dir.glob(pattern) { |path|
      app = File.join(path, 'SketchUp.app')
      debug_lib = File.join(app, 'Contents/Frameworks/SURubyDebugger.dylib')
      version = File.basename(path).match(/[0-9.]+$/)[0].to_i
      apps << Skippy::SketchUpApp.from_hash(
        executable: app,
        version: version,
        can_debug: File.exist?(debug_lib),
        is64bit: version > 2015
      )
    }
    apps.sort_by(&:version)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
skippy-0.4.2.a lib/skippy/os/mac.rb
skippy-0.4.1.a lib/skippy/os/mac.rb