sprout-flashplayer-bundle 10.22.6 → 10.22.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ module Sprout
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 10
5
5
  MINOR = 22
6
- TINY = 6
6
+ TINY = 7
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  MAJOR_MINOR = [MAJOR, MINOR].join('.')
@@ -217,7 +217,8 @@ module Sprout
217
217
 
218
218
  # Don't let trust or log file failures break other features...
219
219
  begin
220
- log_file = FlashPlayerConfig.new().log
220
+ config = FlashPlayerConfig.new
221
+ log_file = config.log_file
221
222
  FlashPlayerTrust.new(File.expand_path(File.dirname(swf)))
222
223
 
223
224
  if(File.exists?(log_file))
@@ -365,20 +366,8 @@ module Sprout
365
366
 
366
367
  @@file_name = 'mm.cfg'
367
368
 
368
- def initialize
369
- osx_fp9 = File.join(User.library, 'Application Support', 'Macromedia')
370
- if(FlashPlayerTask.home == osx_fp9)
371
- @config = File.join(osx_fp9, @@file_name)
372
- else
373
- @config = File.join(User.home, @@file_name)
374
- end
375
-
376
- if(!File.exists?(@config))
377
- write_config(@config, content)
378
- end
379
- end
380
-
381
- def log
369
+ def log_file
370
+ create_config_file
382
371
  path = File.join(FlashPlayerTask.home, 'Logs', 'flashlog.txt')
383
372
  if(User.new().is_a?(CygwinUser))
384
373
  parts = path.split("/")
@@ -395,17 +384,42 @@ module Sprout
395
384
  return path
396
385
  end
397
386
 
398
- def content
387
+ def content(file)
399
388
  return <<EOF
400
389
  ErrorReportingEnable=1
401
390
  MaxWarnings=0
402
391
  TraceOutputEnable=1
403
- TraceOutputFileName=#{log}
392
+ TraceOutputFileName=#{file}
404
393
  EOF
405
394
  end
406
395
 
396
+ def create_config_file
397
+ path = config_path
398
+
399
+ if(file_blank?(path))
400
+ write_config(path, content(path))
401
+ end
402
+
403
+ path
404
+ end
405
+
407
406
  private
408
- def write_config(location, content)
407
+
408
+ def file_blank?(file)
409
+ !File.exists?(file) || File.read(file).empty?
410
+ end
411
+
412
+ def config_path
413
+ osx_fp9 = File.join(User.library, 'Application Support', 'Macromedia')
414
+ if(FlashPlayerTask.home == osx_fp9)
415
+ path = File.join(osx_fp9, @@file_name)
416
+ else
417
+ path = File.join(User.home, @@file_name)
418
+ end
419
+ path
420
+ end
421
+
422
+ def user_confirmation?(location)
409
423
  puts <<EOF
410
424
 
411
425
  Correctly configured mm.cfg file not found at: #{location}
@@ -416,7 +430,11 @@ Would you like this file created automatically? [Yn]
416
430
 
417
431
  EOF
418
432
  answer = $stdin.gets.chomp.downcase
419
- if(answer == 'y' || answer == '')
433
+ return (answer == 'y' || answer == '')
434
+ end
435
+
436
+ def write_config(location, content)
437
+ if(user_confirmation?(location))
420
438
  File.open(location, 'w') do |f|
421
439
  f.write(content)
422
440
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprout-flashplayer-bundle
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.22.6
4
+ version: 10.22.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pattern Park
@@ -9,7 +9,7 @@ autorequire: sprout/flashplayer
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-28 00:00:00 -04:00
12
+ date: 2010-02-15 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency