bomberstudios-fluby 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
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.3'
6
+ VERSION = '0.6.4'
7
7
 
8
8
  COLORS = {
9
9
  :black => "\033[0;30m",
@@ -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", "deploy/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"
@@ -23,7 +23,13 @@ def render_template(file)
23
23
  end
24
24
  end
25
25
 
26
- task :compile do
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"
@@ -99,12 +105,10 @@ end
99
105
 
100
106
  <% if Fluby.has_growl? %>
101
107
  desc "Build a release version of <%= @project_name %> (with trace() disabled)"
102
- task :release => [:nodebug,:compile,:notify]
103
-
108
+ task :release => [:nodebug,:compile,:pack,:notify]
104
109
  task :default => [:compile,:notify,:test]
105
110
  <% else %>
106
111
  desc "Build a release version of <%= @project_name %> (with trace() disabled)"
107
- task :release => [:nodebug,:compile]
108
-
109
- task :default => [:compile]
112
+ task :release => [:nodebug,:compile,:pack]
113
+ task :default => [:compile,:test]
110
114
  <% end %>
@@ -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,.-_¡!áéíóúÁÉÍÓÚüÜ\/• :;()¿?&lt;&gt;" />
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>
@@ -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: bomberstudios-fluby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Ale Mu\xC3\xB1oz"
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-27 00:00:00 -07:00
12
+ date: 2009-04-08 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15