Sha256: 46188d7702944d519efe0a0c737825019e962b953fc3565ba54d527ac2a1022e

Contents?: true

Size: 716 Bytes

Versions: 11

Compression:

Stored size: 716 Bytes

Contents

module AsProject
  class FlashPlayerTrust
  
    def initialize(user, path)
      trust_file = user.asproject_player_trust
      if(!File.exists?(trust_file))
        FileUtils.touch(trust_file)
      end
      
      parts = path.split(File::SEPARATOR)
      if(parts.size == 1)
        path = File::SEPARATOR + path
      end
      
      if(!has_path?(trust_file, path))
        File.open(trust_file, 'a') do |f|
          f.puts path
        end
        Logger.puts ">> Added #{path} to Flash Player Trust file at: #{trust_file}"
      end
    end
    
    def has_path?(file, path)
      File.open(file, 'r') do |f|
        return (f.read.index(path))
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
asproject-0.1.118 lib/tasks/flash_player_trust.rb
asproject-0.1.60 lib/tasks/flash_player_trust.rb
asproject-0.1.68 lib/tasks/flash_player_trust.rb
asproject-0.1.69 lib/tasks/flash_player_trust.rb
asproject-0.1.71 lib/tasks/flash_player_trust.rb
asproject-0.1.74 lib/tasks/flash_player_trust.rb
asproject-0.1.75 lib/tasks/flash_player_trust.rb
asproject-0.1.80 lib/tasks/flash_player_trust.rb
asproject-0.1.84 lib/tasks/flash_player_trust.rb
asproject-0.1.89 lib/tasks/flash_player_trust.rb
asproject-0.1.92 lib/tasks/flash_player_trust.rb