asproject 0.1.40 → 0.1.41

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.
@@ -30,6 +30,7 @@ require 'tasks/remote_file_task'
30
30
  require 'tasks/flash_log'
31
31
  require 'tasks/mtasc'
32
32
  require 'tasks/hamtasc'
33
+ require 'tasks/flash_player_trust'
33
34
  require 'tasks/flash_player'
34
35
  require 'tasks/swfmill_input_resolver'
35
36
  require 'tasks/swfmill_input'
@@ -2,7 +2,7 @@ module AsProject
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 40
5
+ TINY = 41
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -34,6 +34,10 @@ module AsProject
34
34
  return @user.flash_player_trust
35
35
  end
36
36
 
37
+ def asproject_player_trust
38
+ return @user.asproject_player_trust
39
+ end
40
+
37
41
  def remote_file_task(name, task)
38
42
  return @user.remote_file_task(name, task)
39
43
  end
@@ -43,6 +47,10 @@ module AsProject
43
47
  return File.expand_path(parent)
44
48
  end
45
49
 
50
+ def user
51
+ return @user
52
+ end
53
+
46
54
  def user_library
47
55
  return @user.library
48
56
  end
@@ -315,6 +323,17 @@ EOF
315
323
  raise UsageError.new('Not sure where flash_player_home should be on systems other than Win/Mac - please let us know so that we can update this script...')
316
324
  end
317
325
 
326
+ def flash_player_trust
327
+ return File.join(flash_player_home, '#Security', 'FlashPlayerTrust')
328
+ end
329
+
330
+ def asproject_player_trust
331
+ if(!File.exists?(flash_player_trust))
332
+ raise UsageError.new('Could not find the main Flash Player Trust folder at: ' + flash_player_trust)
333
+ end
334
+ return File.join(flash_player_trust, 'asproject.cfg')
335
+ end
336
+
318
337
  def file_exists?(file)
319
338
  return File.exists?(file)
320
339
  end
@@ -414,10 +433,6 @@ EOF
414
433
  return File.join(asproject_home, 'players', 'FlashPlayer' + version.to_s + '.exe')
415
434
  end
416
435
 
417
- def flash_player_trust
418
- return File.join(flash_player_home, '#Security', 'FlashPlayerTrust')
419
- end
420
-
421
436
  def library
422
437
  # For some reason, my homepath returns inside 'My Documents'...
423
438
  application_data = File.join(home, @@LOCAL_SETTINGS, @@APPLICATION_DATA)
@@ -63,6 +63,13 @@ module AsProject
63
63
  task @name do
64
64
  log_file = FlashLog.new.get_file
65
65
 
66
+ begin
67
+ # Don't let trust file failures break other features...
68
+ FlashPlayerTrust.new(user, File.dirname(@swf))
69
+ rescue
70
+ puts 'Warning, was unable to update the FlashPlayerTrust file'
71
+ end
72
+
66
73
  index = 0
67
74
  File.open(log_file, 'w') do |f|
68
75
  f.write('')
@@ -0,0 +1,30 @@
1
+
2
+ module AsProject
3
+ class FlashPlayerTrust
4
+
5
+ def initialize(user, path)
6
+ trust_file = user.asproject_player_trust
7
+ if(!File.exists?(trust_file))
8
+ FileUtils.touch(trust_file)
9
+ end
10
+
11
+ parts = path.split(File::SEPARATOR)
12
+ if(parts.size == 1)
13
+ path = File::SEPARATOR + path
14
+ end
15
+
16
+ if(!has_path?(trust_file, path))
17
+ File.open(trust_file, 'a') do |f|
18
+ f.puts path
19
+ end
20
+ puts ">> Added #{path} to Flash Player Trust file at: #{trust_file}"
21
+ end
22
+ end
23
+
24
+ def has_path?(file, path)
25
+ File.open(file, 'r') do |f|
26
+ return (f.read.index(path))
27
+ end
28
+ end
29
+ end
30
+ end
@@ -34,13 +34,18 @@ module AsProject
34
34
  define_user_task
35
35
  self
36
36
  end
37
+
38
+ def user
39
+ return @user
40
+ end
37
41
 
38
42
  def define_user_task
39
43
  if(@user_task.nil?)
40
44
  if(remote_task_name.nil?)
41
45
  raise UsageError.new('RemoteFileTask created without a remote_task_name value...')
42
46
  end
43
- @user_task = PathFinder.new().remote_file_task(remote_task_name, self)
47
+ @user = PathFinder.new().user
48
+ @user_task = @user.remote_file_task(remote_task_name, self)
44
49
  task name => remote_task_name
45
50
  end
46
51
  @user_task
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: asproject
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.40
6
+ version: 0.1.41
7
7
  date: 2007-03-04 00:00:00 -08:00
8
8
  summary: AsProject is a tool set that simplifies the process of beginning and growing a new ActionScript project.
9
9
  require_paths:
@@ -61,6 +61,7 @@ files:
61
61
  - lib/asproject/version.rb
62
62
  - lib/tasks/flash_log.rb
63
63
  - lib/tasks/flash_player.rb
64
+ - lib/tasks/flash_player_trust.rb
64
65
  - lib/tasks/hamtasc.rb
65
66
  - lib/tasks/mtasc.rb
66
67
  - lib/tasks/remote_file_task.rb