Class: Sprout::FlashPlayerTrust
- Inherits:
-
Object
- Object
- Sprout::FlashPlayerTrust
- Defined in:
- lib/sprout/flash_player_task.rb
Overview
FlashPlayerTrust Class
Instance Method Summary collapse
- #has_path?(file, path) ⇒ Boolean
-
#initialize(path) ⇒ FlashPlayerTrust
constructor
A new instance of FlashPlayerTrust.
Constructor Details
#initialize(path) ⇒ FlashPlayerTrust
Returns a new instance of FlashPlayerTrust.
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/sprout/flash_player_task.rb', line 289 def initialize(path) trust_file = FlashPlayerTask.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 Log.puts ">> Added #{path} to Flash Player Trust file at: #{trust_file}" end end |
Instance Method Details
#has_path?(file, path) ⇒ Boolean
308 309 310 311 312 |
# File 'lib/sprout/flash_player_task.rb', line 308 def has_path?(file, path) File.open(file, 'r') do |f| return (f.read.index(path)) end end |