fluby 0.6.1 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/fluby.rb +6 -9
- data/lib/templates/Rakefile +44 -5
- data/lib/templates/project.rxml +8 -0
- data/lib/templates/swfobject.js +1 -223
- metadata +15 -16
- data/Rakefile +0 -71
data/lib/fluby.rb
CHANGED
@@ -3,7 +3,7 @@ require "fileutils"
|
|
3
3
|
|
4
4
|
module Fluby
|
5
5
|
NAME = 'fluby'
|
6
|
-
VERSION = '0.6.
|
6
|
+
VERSION = '0.6.6'
|
7
7
|
|
8
8
|
COLORS = {
|
9
9
|
:black => "\033[0;30m",
|
@@ -32,9 +32,9 @@ module Fluby
|
|
32
32
|
if File.exist? @project_folder
|
33
33
|
puts "#{COLORS[:red]}Folder #{@project_name} already exists,"
|
34
34
|
puts "#{COLORS[:red]}please choose a different name for your project"
|
35
|
-
|
35
|
+
raise RuntimeError
|
36
36
|
end
|
37
|
-
FileUtils.mkdir [@project_folder,"#{@project_folder}/deploy","#{@project_folder}/assets","#{@project_folder}/script"]
|
37
|
+
FileUtils.mkdir [@project_folder,"#{@project_folder}/deploy","#{@project_folder}/assets","#{@project_folder}/script"], :verbose => false
|
38
38
|
|
39
39
|
# Make files
|
40
40
|
["Rakefile","README"].each do |file|
|
@@ -44,7 +44,7 @@ module Fluby
|
|
44
44
|
# Static Templates
|
45
45
|
copy_template "index.rhtml"
|
46
46
|
copy_template "project.rxml", "#{@project_name}.rxml"
|
47
|
-
copy_template "swfobject.js", "
|
47
|
+
copy_template "swfobject.js", "assets/swfobject.js"
|
48
48
|
|
49
49
|
# Main Class
|
50
50
|
render_template "ASClass.as", "#{@project_name}.as"
|
@@ -53,16 +53,13 @@ module Fluby
|
|
53
53
|
render_template "generate", "script/generate"
|
54
54
|
%x(chmod 755 "#{@project_folder}/script/generate")
|
55
55
|
|
56
|
-
if in_textmate?
|
57
|
-
puts "Oh, my, what a nice editor you're using"
|
58
|
-
end
|
59
56
|
end
|
60
57
|
|
61
58
|
def self.copy_template source, destination=nil
|
62
59
|
if destination.nil?
|
63
60
|
destination = source
|
64
61
|
end
|
65
|
-
FileUtils.cp "#{File.dirname(__FILE__)}/templates/#{source}", "#{@project_folder}/#{destination}"
|
62
|
+
FileUtils.cp "#{File.dirname(__FILE__)}/templates/#{source}", "#{@project_folder}/#{destination}", :verbose => false
|
66
63
|
log "create", "#{@project_name}/#{destination}"
|
67
64
|
end
|
68
65
|
|
@@ -109,7 +106,7 @@ module Fluby
|
|
109
106
|
target_file = name.split(".").join("/") + ".as".to_s
|
110
107
|
if File.exist?(target_file)
|
111
108
|
log "alert", "File #{target_file} already exists!"
|
112
|
-
|
109
|
+
raise RuntimeError
|
113
110
|
end
|
114
111
|
FileUtils.mkdir_p target_path unless File.exist? target_path
|
115
112
|
@classpath = target_path.split("/").join(".")
|
data/lib/templates/Rakefile
CHANGED
@@ -23,7 +23,13 @@ def render_template(file)
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
task :
|
26
|
+
task :assets do
|
27
|
+
Dir.glob(['assets/*.js','assets/*.xml']).each do |file|
|
28
|
+
cp file, "deploy/#{File.basename(file)}", :verbose => true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
task :compile => [:assets] do
|
27
33
|
if @nodebug
|
28
34
|
puts "Trace disabled"
|
29
35
|
trace = " -trace no"
|
@@ -68,6 +74,28 @@ task :nodebug do
|
|
68
74
|
@nodebug = true
|
69
75
|
end
|
70
76
|
|
77
|
+
task :monitor do
|
78
|
+
command = "rake"
|
79
|
+
files = {}
|
80
|
+
|
81
|
+
Dir["*.as","*.rxml","*.rhtml","Rakefile"].each { |file|
|
82
|
+
files[file] = File.mtime(file)
|
83
|
+
}
|
84
|
+
|
85
|
+
loop do
|
86
|
+
sleep 1
|
87
|
+
changed_file, last_changed = files.find { |file, last_changed|
|
88
|
+
File.mtime(file) > last_changed
|
89
|
+
}
|
90
|
+
if changed_file
|
91
|
+
files[changed_file] = File.mtime(changed_file)
|
92
|
+
puts "=> #{changed_file} changed, running #{command}"
|
93
|
+
system(command)
|
94
|
+
puts "=> done"
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
71
99
|
<% if Fluby.is_mac? %>
|
72
100
|
desc "Test the SWF file in your default browser"
|
73
101
|
task :test => [:compile] do
|
@@ -75,14 +103,25 @@ task :test => [:compile] do
|
|
75
103
|
end
|
76
104
|
<% end %>
|
77
105
|
|
106
|
+
desc "Install debug support files"
|
107
|
+
task :setup_debug do
|
108
|
+
debug_cfg_file = "/Library/Application\ Support/Macromedia/mm.cfg"
|
109
|
+
%x(touch "#{debug_cfg_file}")
|
110
|
+
File.open(debug_cfg_file,"w") do |f|
|
111
|
+
f <<-EOF
|
112
|
+
ErrorReportingEnable=1
|
113
|
+
TraceOutputFileEnable=1
|
114
|
+
EOF
|
115
|
+
end unless File.exist?(debug_cfg_file)
|
116
|
+
%x(touch "$HOME/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt")
|
117
|
+
end
|
118
|
+
|
78
119
|
<% if Fluby.has_growl? %>
|
79
120
|
desc "Build a release version of <%= @project_name %> (with trace() disabled)"
|
80
|
-
task :release => [:nodebug,:compile,:notify]
|
81
|
-
|
121
|
+
task :release => [:nodebug,:compile,:pack,:notify]
|
82
122
|
task :default => [:compile,:notify,:test]
|
83
123
|
<% else %>
|
84
124
|
desc "Build a release version of <%= @project_name %> (with trace() disabled)"
|
85
|
-
task :release => [:nodebug,:compile]
|
86
|
-
|
125
|
+
task :release => [:nodebug,:compile,:pack]
|
87
126
|
task :default => [:compile,:test]
|
88
127
|
<% end %>
|
data/lib/templates/project.rxml
CHANGED
@@ -9,6 +9,14 @@
|
|
9
9
|
<% Dir["assets/*.ttf"].each do |file| %>
|
10
10
|
<font id="<%= File.basename(file,'.ttf') %>" import="<%= file %>" name="<%= File.basename(file,'.ttf').split('-')[0] %>" glyphs="abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ01234567890,.-_¡!áéíóúÁÉÍÓÚüÜ\/• :;()¿?<>" />
|
11
11
|
<% end %>
|
12
|
+
<!--
|
13
|
+
<clip id="VideoDisplay">
|
14
|
+
<frame>
|
15
|
+
<video id="vid" width="240" height="180" smoothing="3" />
|
16
|
+
<place id="vid" name="vid" />
|
17
|
+
</frame>
|
18
|
+
</clip>
|
19
|
+
-->
|
12
20
|
</library>
|
13
21
|
</frame>
|
14
22
|
</movie>
|
data/lib/templates/swfobject.js
CHANGED
@@ -5,226 +5,4 @@
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license.php
|
6
6
|
*
|
7
7
|
*/
|
8
|
-
if(typeof deconcept == "undefined") var deconcept = {};
|
9
|
-
if(typeof deconcept.util == "undefined") deconcept.util = {};
|
10
|
-
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = {};
|
11
|
-
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
|
12
|
-
if (!document.getElementById) { return; }
|
13
|
-
this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
|
14
|
-
this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
|
15
|
-
this.params = {};
|
16
|
-
this.variables = {};
|
17
|
-
this.attributes = [];
|
18
|
-
if(swf) { this.setAttribute('swf', swf); }
|
19
|
-
if(id) { this.setAttribute('id', id); }
|
20
|
-
if(w) { this.setAttribute('width', w); }
|
21
|
-
if(h) { this.setAttribute('height', h); }
|
22
|
-
if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
|
23
|
-
this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
|
24
|
-
if (!window.opera && document.all && this.installedVer.major > 7) {
|
25
|
-
// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
|
26
|
-
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
|
27
|
-
if (!deconcept.unloadSet) {
|
28
|
-
deconcept.SWFObjectUtil.prepUnload = function() {
|
29
|
-
__flash_unloadHandler = function(){};
|
30
|
-
__flash_savedUnloadHandler = function(){};
|
31
|
-
window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
|
32
|
-
}
|
33
|
-
window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
|
34
|
-
deconcept.unloadSet = true;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
if(c) { this.addParam('bgcolor', c); }
|
38
|
-
var q = quality ? quality : 'high';
|
39
|
-
this.addParam('quality', q);
|
40
|
-
this.setAttribute('useExpressInstall', false);
|
41
|
-
this.setAttribute('doExpressInstall', false);
|
42
|
-
var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
|
43
|
-
this.setAttribute('xiRedirectUrl', xir);
|
44
|
-
this.setAttribute('redirectUrl', '');
|
45
|
-
if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
|
46
|
-
}
|
47
|
-
deconcept.SWFObject.prototype = {
|
48
|
-
useExpressInstall: function(path) {
|
49
|
-
this.xiSWFPath = !path ? "expressinstall.swf" : path;
|
50
|
-
this.setAttribute('useExpressInstall', true);
|
51
|
-
},
|
52
|
-
setAttribute: function(name, value){
|
53
|
-
this.attributes[name] = value;
|
54
|
-
},
|
55
|
-
getAttribute: function(name){
|
56
|
-
return this.attributes[name] || "";
|
57
|
-
},
|
58
|
-
addParam: function(name, value){
|
59
|
-
this.params[name] = value;
|
60
|
-
},
|
61
|
-
getParams: function(){
|
62
|
-
return this.params;
|
63
|
-
},
|
64
|
-
addVariable: function(name, value){
|
65
|
-
this.variables[name] = value;
|
66
|
-
},
|
67
|
-
getVariable: function(name){
|
68
|
-
return this.variables[name] || "";
|
69
|
-
},
|
70
|
-
getVariables: function(){
|
71
|
-
return this.variables;
|
72
|
-
},
|
73
|
-
getVariablePairs: function(){
|
74
|
-
var variablePairs = [];
|
75
|
-
var key;
|
76
|
-
var variables = this.getVariables();
|
77
|
-
for(key in variables){
|
78
|
-
variablePairs[variablePairs.length] = key +"="+ variables[key];
|
79
|
-
}
|
80
|
-
return variablePairs;
|
81
|
-
},
|
82
|
-
getSWFHTML: function() {
|
83
|
-
var swfNode = "";
|
84
|
-
if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
|
85
|
-
if (this.getAttribute("doExpressInstall")) {
|
86
|
-
this.addVariable("MMplayerType", "PlugIn");
|
87
|
-
this.setAttribute('swf', this.xiSWFPath);
|
88
|
-
}
|
89
|
-
swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'"';
|
90
|
-
swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
|
91
|
-
var params = this.getParams();
|
92
|
-
for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
|
93
|
-
var pairs = this.getVariablePairs().join("&");
|
94
|
-
if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
|
95
|
-
swfNode += '/>';
|
96
|
-
} else { // PC IE
|
97
|
-
if (this.getAttribute("doExpressInstall")) {
|
98
|
-
this.addVariable("MMplayerType", "ActiveX");
|
99
|
-
this.setAttribute('swf', this.xiSWFPath);
|
100
|
-
}
|
101
|
-
swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ (this.getAttribute('style') || "") +'">';
|
102
|
-
swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
|
103
|
-
var params = this.getParams();
|
104
|
-
for(var key in params) {
|
105
|
-
swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
|
106
|
-
}
|
107
|
-
var pairs = this.getVariablePairs().join("&");
|
108
|
-
if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
|
109
|
-
swfNode += "</object>";
|
110
|
-
}
|
111
|
-
return swfNode;
|
112
|
-
},
|
113
|
-
write: function(elementId){
|
114
|
-
if(this.getAttribute('useExpressInstall')) {
|
115
|
-
// check to see if we need to do an express install
|
116
|
-
var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
|
117
|
-
if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
|
118
|
-
this.setAttribute('doExpressInstall', true);
|
119
|
-
this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
|
120
|
-
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
|
121
|
-
this.addVariable("MMdoctitle", document.title);
|
122
|
-
}
|
123
|
-
}
|
124
|
-
if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
|
125
|
-
var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
|
126
|
-
n.innerHTML = this.getSWFHTML();
|
127
|
-
return true;
|
128
|
-
}else{
|
129
|
-
if(this.getAttribute('redirectUrl') != "") {
|
130
|
-
document.location.replace(this.getAttribute('redirectUrl'));
|
131
|
-
}
|
132
|
-
}
|
133
|
-
return false;
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
/* ---- detection functions ---- */
|
138
|
-
deconcept.SWFObjectUtil.getPlayerVersion = function(){
|
139
|
-
var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
|
140
|
-
if(navigator.plugins && navigator.mimeTypes.length){
|
141
|
-
var x = navigator.plugins["Shockwave Flash"];
|
142
|
-
if(x && x.description) {
|
143
|
-
PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
|
144
|
-
}
|
145
|
-
}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
|
146
|
-
var axo = 1;
|
147
|
-
var counter = 3;
|
148
|
-
while(axo) {
|
149
|
-
try {
|
150
|
-
counter++;
|
151
|
-
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
|
152
|
-
// document.write("player v: "+ counter);
|
153
|
-
PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
|
154
|
-
} catch (e) {
|
155
|
-
axo = null;
|
156
|
-
}
|
157
|
-
}
|
158
|
-
} else { // Win IE (non mobile)
|
159
|
-
// do minor version lookup in IE, but avoid fp6 crashing issues
|
160
|
-
// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
|
161
|
-
try{
|
162
|
-
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
|
163
|
-
}catch(e){
|
164
|
-
try {
|
165
|
-
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
|
166
|
-
PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
|
167
|
-
axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
|
168
|
-
} catch(e) {
|
169
|
-
if (PlayerVersion.major == 6) {
|
170
|
-
return PlayerVersion;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
try {
|
174
|
-
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
|
175
|
-
} catch(e) {}
|
176
|
-
}
|
177
|
-
if (axo != null) {
|
178
|
-
PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
|
179
|
-
}
|
180
|
-
}
|
181
|
-
return PlayerVersion;
|
182
|
-
}
|
183
|
-
deconcept.PlayerVersion = function(arrVersion){
|
184
|
-
this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
|
185
|
-
this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
|
186
|
-
this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
|
187
|
-
}
|
188
|
-
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
|
189
|
-
if(this.major < fv.major) return false;
|
190
|
-
if(this.major > fv.major) return true;
|
191
|
-
if(this.minor < fv.minor) return false;
|
192
|
-
if(this.minor > fv.minor) return true;
|
193
|
-
if(this.rev < fv.rev) return false;
|
194
|
-
return true;
|
195
|
-
}
|
196
|
-
/* ---- get value of query string param ---- */
|
197
|
-
deconcept.util = {
|
198
|
-
getRequestParameter: function(param) {
|
199
|
-
var q = document.location.search || document.location.hash;
|
200
|
-
if (param == null) { return q; }
|
201
|
-
if(q) {
|
202
|
-
var pairs = q.substring(1).split("&");
|
203
|
-
for (var i=0; i < pairs.length; i++) {
|
204
|
-
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
|
205
|
-
return pairs[i].substring((pairs[i].indexOf("=")+1));
|
206
|
-
}
|
207
|
-
}
|
208
|
-
}
|
209
|
-
return "";
|
210
|
-
}
|
211
|
-
}
|
212
|
-
/* fix for video streaming bug */
|
213
|
-
deconcept.SWFObjectUtil.cleanupSWFs = function() {
|
214
|
-
var objects = document.getElementsByTagName("OBJECT");
|
215
|
-
for (var i = objects.length - 1; i >= 0; i--) {
|
216
|
-
objects[i].style.display = 'none';
|
217
|
-
for (var x in objects[i]) {
|
218
|
-
if (typeof objects[i][x] == 'function') {
|
219
|
-
objects[i][x] = function(){};
|
220
|
-
}
|
221
|
-
}
|
222
|
-
}
|
223
|
-
}
|
224
|
-
/* add document.getElementById if needed (mobile IE < 5) */
|
225
|
-
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}
|
226
|
-
|
227
|
-
/* add some aliases for ease of use/backwards compatibility */
|
228
|
-
var getQueryParamValue = deconcept.util.getRequestParameter;
|
229
|
-
var FlashObject = deconcept.SWFObject; // for legacy support
|
230
|
-
var SWFObject = deconcept.SWFObject;
|
8
|
+
if(typeof deconcept=="undefined"){var deconcept={};}if(typeof deconcept.util=="undefined"){deconcept.util={};}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil={};}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params={};this.variables={};this.attributes=[];if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10]||"";},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15]||"";},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=[];var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+(this.getAttribute("style")||"")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Ale Mu\xC3\xB1oz"
|
@@ -9,12 +9,12 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-10-11 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description: A simple command to create an empty project for MTASC + SWFMILL + Rake
|
17
|
-
email:
|
16
|
+
description: A simple command to create an empty ActionScript project for MTASC + SWFMILL + Rake
|
17
|
+
email: bomberstudios@gmail.com
|
18
18
|
executables:
|
19
19
|
- fluby
|
20
20
|
extensions: []
|
@@ -23,23 +23,22 @@ extra_rdoc_files: []
|
|
23
23
|
|
24
24
|
files:
|
25
25
|
- README.mdown
|
26
|
-
- Rakefile
|
27
26
|
- bin/fluby
|
28
27
|
- lib/fluby.rb
|
29
|
-
- lib/templates
|
30
28
|
- lib/templates/ASClass.as
|
31
|
-
- lib/templates/generate
|
32
|
-
- lib/templates/generators
|
33
|
-
- lib/templates/generators/class
|
34
|
-
- lib/templates/generators/delegate
|
35
|
-
- lib/templates/generators/xml_loader
|
36
29
|
- lib/templates/index.rhtml
|
37
30
|
- lib/templates/project.rxml
|
38
31
|
- lib/templates/Rakefile
|
39
32
|
- lib/templates/README
|
40
33
|
- lib/templates/swfobject.js
|
41
|
-
|
42
|
-
|
34
|
+
- lib/templates/generate
|
35
|
+
- lib/templates/generators/class
|
36
|
+
- lib/templates/generators/delegate
|
37
|
+
- lib/templates/generators/xml_loader
|
38
|
+
has_rdoc: true
|
39
|
+
homepage: http://github.com/bomberstudios/fluby/
|
40
|
+
licenses: []
|
41
|
+
|
43
42
|
post_install_message:
|
44
43
|
rdoc_options: []
|
45
44
|
|
@@ -60,9 +59,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
59
|
requirements: []
|
61
60
|
|
62
61
|
rubyforge_project: fluby
|
63
|
-
rubygems_version: 1.3.
|
62
|
+
rubygems_version: 1.3.5
|
64
63
|
signing_key:
|
65
|
-
specification_version:
|
66
|
-
summary:
|
64
|
+
specification_version: 3
|
65
|
+
summary: MTASC + SWFMILL + Rake helper
|
67
66
|
test_files: []
|
68
67
|
|
data/Rakefile
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
##### Requirements
|
2
|
-
|
3
|
-
require 'rake'
|
4
|
-
|
5
|
-
require 'rake/clean'
|
6
|
-
require 'rake/gempackagetask'
|
7
|
-
require 'rake/testtask'
|
8
|
-
|
9
|
-
require File.dirname(__FILE__) + '/lib/fluby.rb'
|
10
|
-
|
11
|
-
##### Cleaning
|
12
|
-
CLEAN.include [ 'tmp', 'test/fixtures/*/output/*', 'test/fixtures/*/tmp' ]
|
13
|
-
CLOBBER.include [ 'pkg' ]
|
14
|
-
|
15
|
-
##### Packaging
|
16
|
-
spec = Gem::Specification.new do |s|
|
17
|
-
s.name = Fluby::NAME
|
18
|
-
s.version = Fluby::VERSION
|
19
|
-
s.platform = Gem::Platform::RUBY
|
20
|
-
s.summary = 'A simple command to create an empty project for MTASC + SWFMILL + Rake'
|
21
|
-
s.description = s.summary
|
22
|
-
s.homepage = 'http://fluby.googlecode.com/'
|
23
|
-
s.author = 'Ale Muñoz'
|
24
|
-
s.email = 'ale@bomberstudios.com'
|
25
|
-
|
26
|
-
s.rubyforge_project = 'fluby'
|
27
|
-
|
28
|
-
s.required_ruby_version = '>= 1.8.5'
|
29
|
-
|
30
|
-
s.has_rdoc = false
|
31
|
-
s.files = FileList.new("README.mdown","Rakefile","bin/**/*","lib/**/*").to_a
|
32
|
-
s.executables = [ 'fluby' ]
|
33
|
-
s.require_path = 'lib'
|
34
|
-
s.bindir = 'bin'
|
35
|
-
end
|
36
|
-
|
37
|
-
Rake::GemPackageTask.new(spec) { |task| }
|
38
|
-
|
39
|
-
task :install do
|
40
|
-
if RUBY_PLATFORM =~ /mswin32/
|
41
|
-
system('cmd.exe /c rake package')
|
42
|
-
system("cmd.exe /c gem install pkg/#{Fluby::NAME}-#{Fluby::VERSION}")
|
43
|
-
else
|
44
|
-
system('rake package')
|
45
|
-
system("sudo gem install pkg/#{Fluby::NAME}-#{Fluby::VERSION}")
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
task :uninstall do
|
50
|
-
sh %{sudo gem uninstall #{Fluby::NAME}}
|
51
|
-
end
|
52
|
-
|
53
|
-
### Testing
|
54
|
-
|
55
|
-
Rake::TestTask.new(:test) do |test|
|
56
|
-
test.test_files = Dir['test/test_*.rb']
|
57
|
-
end
|
58
|
-
|
59
|
-
task :github do
|
60
|
-
require 'rubygems/specification'
|
61
|
-
data = File.read('fluby.gemspec')
|
62
|
-
github_spec = nil
|
63
|
-
Thread.new { github_spec = eval("$SAFE = 3\n#{data}") }.join
|
64
|
-
puts github_spec
|
65
|
-
end
|
66
|
-
|
67
|
-
task :test do
|
68
|
-
%x(ruby test/test_fluby.rb)
|
69
|
-
end
|
70
|
-
|
71
|
-
task :default => [ :test ]
|