Sha256: 790570b3a2a92f38f2ea00f7273d35c31201fc97a632b80187becb856e01770c

Contents?: true

Size: 1.02 KB

Versions: 16

Compression:

Stored size: 1.02 KB

Contents

module Fission
  class Config
    attr_accessor :attributes

    CONF_FILE = File.expand_path '~/.fissionrc'

    def initialize
      @attributes = {}
      load_from_file

      if @attributes['vm_dir'].blank?
        @attributes['vm_dir'] = File.expand_path('~/Documents/Virtual Machines.localized/')
      end

      if File.exists?('/Library/Application Support/VMware Fusion/vmrun')
        @attributes['vmrun_bin'] = '/Library/Application Support/VMware Fusion/vmrun'
      else
        @attributes['vmrun_bin'] = '/Applications/VMware Fusion.app/Contents/Library/vmrun'
      end

      @attributes['vmrun_cmd'] = "#{@attributes['vmrun_bin'].gsub(' ', '\ ')} -T fusion"
      @attributes['plist_file'] = File.expand_path('~/Library/Preferences/com.vmware.fusion.plist')
      @attributes['gui_bin'] = File.expand_path('/Applications/VMware Fusion.app/Contents/MacOS/vmware')
    end

    private
    def load_from_file
      if File.file?(CONF_FILE)
        @attributes.merge!(YAML.load_file(CONF_FILE))
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
veewee-0.5.0.alpha4 lib/fission.old/config.rb
veewee-0.5.0.alpha3 lib/fission.old/config.rb
veewee-0.5.0.alpha2 lib/fission.old/config.rb
veewee-0.5.0.alpha1 lib/fission.old/config.rb
veewee-0.4.5.1 lib/fission.old/config.rb
veewee-0.4.5 lib/fission.old/config.rb
veewee-0.4.5.pre1 lib/fission.old/config.rb
veewee-0.4.4 lib/fission.old/config.rb
veewee-0.4.3 lib/fission.old/config.rb
veewee-0.4.2 lib/fission.old/config.rb
veewee-0.4.1 lib/fission.old/config.rb
veewee-0.4.0 lib/fission.old/config.rb
veewee-0.3.12 lib/fission.old/config.rb
veewee-0.3.11 lib/fission.old/config.rb
veewee-0.3.10 lib/fission.old/config.rb
veewee-0.3.9 lib/fission.old/config.rb