Sha256: bbfc4523a32e0db9433933eb66d85d2873bf2fce9d48212b5aa41da3458a1a74

Contents?: true

Size: 929 Bytes

Versions: 2

Compression:

Stored size: 929 Bytes

Contents

# frozen_string_literal: true

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 = sketchup_version_from_path(path)
      next unless version

      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.5.2.a lib/skippy/os/mac.rb
skippy-0.5.1.a lib/skippy/os/mac.rb