Sha256: fcf878d7beb1a7de527345615963f68af49c6e491fec565705a63a67a58f975a

Contents?: true

Size: 1.29 KB

Versions: 27

Compression:

Stored size: 1.29 KB

Contents

module FlashPlayer
  NAME    = 'flashplayer'
  VERSION = '11.1.102'

  class << self

    def home
      # NOTE: Look up the value every time,
      # this way we're not storing state globally
      # and the performance penalty is minimal...
      home_paths.each do |path|
        return path if File.exists?(path)
      end
      raise FlashPlayer::PathError.new('FlashPlayer unable to find home folder for your System')
    end

    def trust
      File.join home, '#Security', 'FlashPlayerTrust', 'sprout.cfg'
    end

    def flashlog
      File.join home, 'Logs', 'flashlog.txt'
    end

    private

    def system_home
      Sprout.current_system.home
    end

    def system_library
      Sprout.current_system.library
    end

    # Collection of the potential locations of the Flash Player Home
    # For each supported Platform, the first existing location
    # will be used.
    def home_paths
      [
        File.join(system_library, 'Preferences', 'Macromedia', 'Flash Player'),
        File.join(system_library, 'Application Support', 'Macromedia'),
        File.join(system_home, 'Application Data', 'Macromedia', 'Flash Player'),
        File.join(system_home, 'AppData', 'Roaming', 'Macromedia', 'Flash Player'),
        File.join(system_home, '.macromedia', 'Flash_Player')
      ]
    end

  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
h4oflashsdk-1.0.13 lib/flashplayer/module.rb
h4oflashsdk-1.0.12 lib/flashplayer/module.rb
h4oflashsdk-1.0.11 lib/flashplayer/module.rb
h4oflashsdk-1.0.10 lib/flashplayer/module.rb
h4oflashsdk-1.0.9 lib/flashplayer/module.rb
h4oflashsdk-1.0.8 lib/flashplayer/module.rb
h4oflashsdk-1.0.7 lib/flashplayer/module.rb
h4oflashsdk-1.0.6 lib/flashplayer/module.rb
h4oflashsdk-1.0.5 lib/flashplayer/module.rb
h4oflashsdk-1.0.4 lib/flashplayer/module.rb
h4oflashsdk-1.0.3 lib/flashplayer/module.rb
h4oflashsdk-1.0.2 lib/flashplayer/module.rb
h4oflashsdk-1.0.1 lib/flashplayer/module.rb
h4oflashsdk-1.0.0 lib/flashplayer/module.rb
flashsdk_sqe-0.0.14 lib/flashplayer/module.rb
flashsdk_sqe-0.0.13 lib/flashplayer/module.rb
flashsdk_sqe-0.0.12 lib/flashplayer/module.rb
flashsdk_sqe-0.0.11 lib/flashplayer/module.rb
flashsdk_sqe-0.0.10 lib/flashplayer/module.rb
flashsdk_sqe-0.0.9 lib/flashplayer/module.rb