asproject 0.1.34 → 0.1.35
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.
- data/lib/asproject/version.rb +1 -1
- data/lib/tasks/flash_log.rb +47 -0
- data/lib/tasks/flash_player.rb +103 -0
- data/lib/tasks/remote_file_task.rb +14 -0
- data/rakefile.rb +1 -1
- metadata +5 -3
data/lib/asproject/version.rb
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
require 'asproject'
|
|
3
|
+
|
|
4
|
+
module AsProject
|
|
5
|
+
class FlashLog
|
|
6
|
+
attr_accessor :version
|
|
7
|
+
|
|
8
|
+
def initialize
|
|
9
|
+
@path_finder = PathFinder.new
|
|
10
|
+
verify_config_file
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def get_file
|
|
14
|
+
return @path_finder.flash_player_log
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
private
|
|
18
|
+
def verify_config_file
|
|
19
|
+
config = @path_finder.flash_player_config
|
|
20
|
+
if(!File.exists?(config))
|
|
21
|
+
content = @path_finder.flash_player_config_content
|
|
22
|
+
write_config(config, content)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
def write_config(location, content)
|
|
28
|
+
puts <<EOF
|
|
29
|
+
|
|
30
|
+
Correctly configured mm.cfg file not found at: #{location}
|
|
31
|
+
|
|
32
|
+
This file is required in order to capture trace output.
|
|
33
|
+
|
|
34
|
+
Would you like this file created automatically? [Yn]
|
|
35
|
+
|
|
36
|
+
EOF
|
|
37
|
+
if($stdin.gets.chomp.downcase.index('y'))
|
|
38
|
+
File.open(location, 'w') do |f|
|
|
39
|
+
f.write(content)
|
|
40
|
+
end
|
|
41
|
+
puts ">> Created: " + File.expand_path(location)
|
|
42
|
+
else
|
|
43
|
+
raise BuildError.new("Unable to create mm.cfg file at: #{location}")
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
|
|
2
|
+
require File.dirname(__FILE__) + '/../asproject'
|
|
3
|
+
require File.dirname(__FILE__) + '/remote_file_task'
|
|
4
|
+
require File.dirname(__FILE__) + '/flash_log'
|
|
5
|
+
#require 'config/asclass_config'
|
|
6
|
+
#require 'tasks/flash_log'
|
|
7
|
+
#require 'asproject'
|
|
8
|
+
|
|
9
|
+
# Pull in the project-local config file
|
|
10
|
+
# if it exists...
|
|
11
|
+
if(File.exists?('script/asclass_config.rb'))
|
|
12
|
+
# require 'script/asclass_config'
|
|
13
|
+
# include Config
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
module AsProject
|
|
17
|
+
class FlashPlayerError < StandardError; end
|
|
18
|
+
|
|
19
|
+
class FlashPlayer < RemoteFileTask
|
|
20
|
+
|
|
21
|
+
attr_accessor :version,
|
|
22
|
+
:name,
|
|
23
|
+
:swf
|
|
24
|
+
|
|
25
|
+
def initialize(name=:flash_player)
|
|
26
|
+
@name = name
|
|
27
|
+
@version = 9
|
|
28
|
+
super(name)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def remote_task_name
|
|
32
|
+
return "flash_player-#{version}"
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
#TODO: Add urls and locations for versions and osx
|
|
36
|
+
def define_user_task
|
|
37
|
+
if(version == 7)
|
|
38
|
+
@win_url = nil
|
|
39
|
+
@win_extracted_file = nil
|
|
40
|
+
@osx_url = nil
|
|
41
|
+
@osx_extracted_file = nil
|
|
42
|
+
@unix_url = nil
|
|
43
|
+
@unix_extracted_file = nil
|
|
44
|
+
elsif(version == 8)
|
|
45
|
+
@win_url = "http://download.macromedia.com/pub/flashplayer/updaters/8/flash_player_update3_flash8_win.zip"
|
|
46
|
+
@win_extracted_file = "/Players/Debug/SAFlashPlayer.exe"
|
|
47
|
+
@osx_url = nil
|
|
48
|
+
@osx_extracted_file = nil
|
|
49
|
+
@unix_url = nil
|
|
50
|
+
@unix_extracted_file = nil
|
|
51
|
+
elsif(version == 9)
|
|
52
|
+
@win_url = nil
|
|
53
|
+
@win_extracted_file = nil
|
|
54
|
+
@osx_url = nil
|
|
55
|
+
@osx_extracted_file = nil
|
|
56
|
+
@unix_url = nil
|
|
57
|
+
@unix_extracted_file = nil
|
|
58
|
+
else
|
|
59
|
+
raise FlashPlayerError.new("It seems you are trying to use a Flash Player version (#{version}) that is not yet supported...")
|
|
60
|
+
end
|
|
61
|
+
super
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def define
|
|
65
|
+
super
|
|
66
|
+
|
|
67
|
+
desc "Run #{@swf} file using Flash Player #{version}"
|
|
68
|
+
task @name => [@swf]
|
|
69
|
+
|
|
70
|
+
task @name do
|
|
71
|
+
log_file = FlashLog.new.get_file
|
|
72
|
+
|
|
73
|
+
index = 0
|
|
74
|
+
File.open(log_file, 'w') do |f|
|
|
75
|
+
f.write('')
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
player_thread = Thread.new {
|
|
79
|
+
puts 'PLAYER THREAD with: ' + @swf
|
|
80
|
+
execute("./#{@swf}")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if(!File.exists?(log_file))
|
|
84
|
+
raise UsageError.new('Unable to find the trace output log file in the expected location: ' + log_file)
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
while(player_thread.alive?)
|
|
88
|
+
sleep(0.2)
|
|
89
|
+
incr = 0
|
|
90
|
+
|
|
91
|
+
File.open(log_file, "r").readlines.each do |line|
|
|
92
|
+
incr = incr + 1
|
|
93
|
+
if(incr > index)
|
|
94
|
+
puts "[trace] #{line}"
|
|
95
|
+
index = index + 1
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
@@ -50,12 +50,20 @@ module AsProject
|
|
|
50
50
|
@user_task
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
def execute(params)
|
|
54
|
+
puts 'REMOTE FILE TASK.execute'
|
|
55
|
+
user_task.execute(params)
|
|
56
|
+
end
|
|
57
|
+
|
|
53
58
|
def clean_path(path)
|
|
54
59
|
define_user_task
|
|
55
60
|
return user_task.clean_path(path)
|
|
56
61
|
end
|
|
57
62
|
end
|
|
58
63
|
|
|
64
|
+
###################################
|
|
65
|
+
# Concrete instances returned from
|
|
66
|
+
# User objects
|
|
59
67
|
class AbstractRemoteFileTask
|
|
60
68
|
attr_accessor :name,
|
|
61
69
|
:url,
|
|
@@ -218,6 +226,7 @@ module AsProject
|
|
|
218
226
|
# Sometimes Cygwin wants a './' prefix
|
|
219
227
|
# This method should be overridden in
|
|
220
228
|
# subclasses
|
|
229
|
+
puts 'executing user task: ' + 3.to_s
|
|
221
230
|
sh %{#{clean_path(extracted_file_path)} #{params}}
|
|
222
231
|
end
|
|
223
232
|
end
|
|
@@ -238,6 +247,11 @@ module AsProject
|
|
|
238
247
|
end
|
|
239
248
|
|
|
240
249
|
class CygwinRemoteFileTask < AbstractRemoteFileTask
|
|
250
|
+
|
|
251
|
+
def execute(params)
|
|
252
|
+
puts 'CYGWIN TASK EXECUTE with: ' + extracted_file_path
|
|
253
|
+
sh %{#{clean_path(extracted_file_path)} #{params}}
|
|
254
|
+
end
|
|
241
255
|
end
|
|
242
256
|
|
|
243
257
|
class OSXRemoteFileTask < AbstractRemoteFileTask
|
data/rakefile.rb
CHANGED
metadata
CHANGED
|
@@ -3,8 +3,8 @@ 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.
|
|
7
|
-
date: 2007-03-
|
|
6
|
+
version: 0.1.35
|
|
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:
|
|
10
10
|
- lib
|
|
@@ -59,6 +59,8 @@ files:
|
|
|
59
59
|
- lib/template_resolver.rb
|
|
60
60
|
- lib/test_suite_generator.rb
|
|
61
61
|
- lib/asproject/version.rb
|
|
62
|
+
- lib/tasks/flash_log.rb
|
|
63
|
+
- lib/tasks/flash_player.rb
|
|
62
64
|
- lib/tasks/hamtasc.rb
|
|
63
65
|
- lib/tasks/mtasc.rb
|
|
64
66
|
- lib/tasks/rake.rb
|
|
@@ -279,5 +281,5 @@ dependencies:
|
|
|
279
281
|
requirements:
|
|
280
282
|
- - ">="
|
|
281
283
|
- !ruby/object:Gem::Version
|
|
282
|
-
version: 0.
|
|
284
|
+
version: 0.9.1
|
|
283
285
|
version:
|