helium 0.1.0
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/History.txt +5 -0
- data/LICENCE +339 -0
- data/Manifest.txt +35 -0
- data/README.txt +266 -0
- data/Rakefile +12 -0
- data/bin/he +126 -0
- data/lib/helium.rb +50 -0
- data/lib/helium/configurable.rb +26 -0
- data/lib/helium/deployer.rb +216 -0
- data/lib/helium/generator.rb +69 -0
- data/lib/helium/jake.rb +73 -0
- data/lib/helium/logger.rb +15 -0
- data/lib/helium/trie.rb +59 -0
- data/lib/helium/views/deploy.erb +13 -0
- data/lib/helium/views/edit.erb +11 -0
- data/lib/helium/views/index.erb +67 -0
- data/lib/helium/views/layout.erb +60 -0
- data/lib/helium/views/missing.erb +6 -0
- data/lib/helium/web.rb +119 -0
- data/lib/helium/web_helpers.rb +65 -0
- data/templates/packages.js.erb +126 -0
- data/templates/project/.gitignore +4 -0
- data/templates/project/Jakefile +3 -0
- data/templates/project/jake.yml.erb +23 -0
- data/templates/project/source/__name__.js.erb +14 -0
- data/templates/project/test/index.html.erb +29 -0
- data/templates/web/config.ru +11 -0
- data/templates/web/custom.js +37 -0
- data/templates/web/deploy.yml +8 -0
- data/templates/web/public/prettify.css +6 -0
- data/templates/web/public/prettify.js +23 -0
- data/templates/web/public/style.css +40 -0
- data/test/deploy.yml +8 -0
- data/test/index.html +50 -0
- data/test/test_helium.rb +21 -0
- metadata +160 -0
@@ -0,0 +1,126 @@
|
|
1
|
+
<% if @domain -%>
|
2
|
+
(function() {
|
3
|
+
var protocol = ("https:" == document.location.protocol) ? "https:" : "http:";
|
4
|
+
window.JSCLASS_PATH = window.JSCLASS_PATH ||
|
5
|
+
protocol + "//<%= @domain %>/<%= WEB_ROOT %><%= File.dirname(@js_loader.sub(static_dir, '')) %>";
|
6
|
+
})();
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%= File.read(@js_loader) %>
|
10
|
+
|
11
|
+
|
12
|
+
/**
|
13
|
+
* JavaScript package manifest, generated <%= Time.now %>
|
14
|
+
* Requires JS.Class package manager: http://jsclass.jcoglan.com/packages.html
|
15
|
+
*
|
16
|
+
* Usage: place the following in the HEAD of your HTML pages,
|
17
|
+
* then use the `require()` function to load objects on demand.
|
18
|
+
*
|
19
|
+
* <!-- Step 1. Load JS.Class and the package listing -->
|
20
|
+
* <script type="text/javascript" src="http://<%= @domain || 'js.example.com' %>/<%= WEB_ROOT %>/<%= PACKAGES_MIN %>"></script>
|
21
|
+
*
|
22
|
+
* <!-- Step 2. Declare which branches to use -->
|
23
|
+
* <script type="text/javascript">
|
24
|
+
* Helium.use('yui', '2.7.0');
|
25
|
+
* Helium.use('ojay', '0.4.1');
|
26
|
+
* </script>
|
27
|
+
**/
|
28
|
+
JS.Packages(function() { with(this) {
|
29
|
+
|
30
|
+
<% if @custom -%>
|
31
|
+
/*--- User-defined loader functions ------------------------------*/
|
32
|
+
|
33
|
+
<%= @custom -%>
|
34
|
+
|
35
|
+
/*----------------------------------------------------------------*/
|
36
|
+
<% end -%>
|
37
|
+
|
38
|
+
var BRANCHES = {}, manifest, pathname;
|
39
|
+
|
40
|
+
<% @tree.each_child do |project, branches| -%>
|
41
|
+
|
42
|
+
BRANCHES['<%= project %>'] = {};
|
43
|
+
<% branches.each_child do |branch, files| -%>
|
44
|
+
<% next unless has_manifest?(files) -%>
|
45
|
+
|
46
|
+
manifest = (BRANCHES['<%= project %>']['<%= branch %>'] = { c: '<%= files.value %>', f: {} }).f;
|
47
|
+
<% files.each do |path, config| -%>
|
48
|
+
<% next unless has_manifest?(config) -%>
|
49
|
+
|
50
|
+
/**
|
51
|
+
* Manifest for project '<%= project %>', branch '<%= branch %>'
|
52
|
+
* File: '<%= path.first %>'
|
53
|
+
**/
|
54
|
+
pathname = manifest['<%= path.first %>'] = {};
|
55
|
+
pathname.p = <%= (config[:provides] || []).inspect %>;
|
56
|
+
pathname.r = <%= (config[:requires] || []).inspect %>;
|
57
|
+
pathname.u = <%= (config[:uses] || []).inspect %>;
|
58
|
+
<% end -%>
|
59
|
+
<% end -%>
|
60
|
+
<% end -%>
|
61
|
+
|
62
|
+
/**
|
63
|
+
* log(message) -> undefined
|
64
|
+
* - message (String)
|
65
|
+
*
|
66
|
+
* Prints configuration notices to the console for debugging
|
67
|
+
**/
|
68
|
+
var log = function(string) {
|
69
|
+
if (!window.console) return;
|
70
|
+
console.info ? console.info(string)
|
71
|
+
: console.log(string);
|
72
|
+
};
|
73
|
+
|
74
|
+
window.Helium = window.Helium || {};
|
75
|
+
|
76
|
+
<% if @domain -%>
|
77
|
+
var protocol = ("https:" == document.location.protocol) ? "https:" : "http:";
|
78
|
+
Helium.PATH = protocol + "//<%= @domain %>/<%= WEB_ROOT %>";
|
79
|
+
<% end -%>
|
80
|
+
|
81
|
+
/**
|
82
|
+
* Helium.use(project, branch) -> undefined
|
83
|
+
* - project (String)
|
84
|
+
* - branch (String)
|
85
|
+
*
|
86
|
+
* Selects a branch to use from a project, and adds the manifest for the given
|
87
|
+
* branch to the JS.Class package registry. This does not load any extra
|
88
|
+
* JavaScript files, it simply tells JS.Class which files to use when that
|
89
|
+
* project's objects are required.
|
90
|
+
*
|
91
|
+
* The Helium.PATH variable *must* be set before calling this function so
|
92
|
+
* we can set the full path to the files in the given branch.
|
93
|
+
**/
|
94
|
+
Helium.use = function(project, branch) {
|
95
|
+
if (!this.PATH) throw "Please set Helium.PATH before specifying branches";
|
96
|
+
|
97
|
+
var projectBranches = BRANCHES[project];
|
98
|
+
if (!projectBranches) throw "Could not find project '" + project + "'";
|
99
|
+
|
100
|
+
if (typeof projectBranches === "string")
|
101
|
+
throw "Project '" + project + "' is already using branch '" + projectBranches + "'";
|
102
|
+
|
103
|
+
var pkg = projectBranches[branch];
|
104
|
+
if (!pkg) throw "Could not find branch '" + branch + "' of project '" + project + "'";
|
105
|
+
|
106
|
+
log("Using '" + project + "', version: '" + branch + "'");
|
107
|
+
BRANCHES[project] = branch;
|
108
|
+
|
109
|
+
var commit = pkg.c,
|
110
|
+
files = pkg.f,
|
111
|
+
path, config, builder;
|
112
|
+
|
113
|
+
for (path in files) {
|
114
|
+
if (!files.hasOwnProperty(path)) continue;
|
115
|
+
|
116
|
+
config = files[path];
|
117
|
+
builder = file([this.PATH, project, commit].join('/') + path);
|
118
|
+
builder.provides.apply(builder, config.p);
|
119
|
+
builder.requires.apply(builder, config.r);
|
120
|
+
builder.uses.apply(builder, config.u);
|
121
|
+
}
|
122
|
+
};
|
123
|
+
|
124
|
+
/*--- end JS.Packages block ---*/
|
125
|
+
}});
|
126
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
source_directory: source
|
3
|
+
build_directory: build
|
4
|
+
layout: together
|
5
|
+
|
6
|
+
builds:
|
7
|
+
src:
|
8
|
+
packer: false
|
9
|
+
suffix: false
|
10
|
+
min:
|
11
|
+
shrink_vars: true
|
12
|
+
private: false
|
13
|
+
|
14
|
+
packages:
|
15
|
+
<%= @name %>:
|
16
|
+
files:
|
17
|
+
- <%= @name %>
|
18
|
+
meta:
|
19
|
+
requires:
|
20
|
+
- JS.Class
|
21
|
+
provides:
|
22
|
+
- <%= camelize(@name) %>
|
23
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
5
|
+
<title><%= camelize(@name) %> Tests</title>
|
6
|
+
|
7
|
+
<!-- FIXME replace example.com with your Helium server -->
|
8
|
+
<script src="http://example.com/<%= WEB_ROOT %>/<%= PACKAGES_MIN %>" type="text/javascript"></script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
// FIXME declare which remote branches to use
|
12
|
+
// Helium.use('yui', '2.7.0');
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<!-- Package file for <%= @name %> (run `jake` to generate this) -->
|
16
|
+
<script src="./packages.js" type="text/javascript"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<script type="text/javascript">
|
21
|
+
require('<%= camelize(@name) %>', function() {
|
22
|
+
|
23
|
+
// FIXME write some tests
|
24
|
+
alert('Version: ' + <%= camelize(@name) %>.VERSION);
|
25
|
+
});
|
26
|
+
</script>
|
27
|
+
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/**
|
2
|
+
* Loads the `_gat` object for Google Analytics
|
3
|
+
**/
|
4
|
+
var gaJsHost = ('https:' == document.location.protocol) ? 'https://ssl.' : 'http://www.';
|
5
|
+
file(gaJsHost + 'google-analytics.com/ga.js')
|
6
|
+
.provides('_gat');
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Loads a `pageTracker` object for making Analytics API calls.
|
10
|
+
* Requires `Helium.GOOGLE_ANALYTICS_ID` to be set.
|
11
|
+
**/
|
12
|
+
loader(function(cb) {
|
13
|
+
try {
|
14
|
+
window.pageTracker = _gat._getTracker(Helium.GOOGLE_ANALYTICS_ID);
|
15
|
+
} catch (err) {}
|
16
|
+
}) .provides('pageTracker')
|
17
|
+
.requires('_gat');
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Loads the `google.load` function, required to load other
|
21
|
+
* parts of the Google API. Requires `Helium.GOOGLE_API_KEY`
|
22
|
+
* to be set beforehand.
|
23
|
+
**/
|
24
|
+
loader(function(cb) {
|
25
|
+
var url = 'http://www.google.com/jsapi?key=' + Helium.GOOGLE_API_KEY;
|
26
|
+
load(url, cb);
|
27
|
+
}) .provides('google.load');
|
28
|
+
|
29
|
+
/**
|
30
|
+
* Loads the Google Maps API. Requires `Helium.GOOGLE_API_KEY`
|
31
|
+
* to be set beforehand.
|
32
|
+
**/
|
33
|
+
loader(function(cb) { google.load('maps', '2.x', {callback: cb}) })
|
34
|
+
.provides('GMap2', 'GClientGeocoder',
|
35
|
+
'GEvent', 'GLatLng', 'GMarker')
|
36
|
+
.requires('google.load');
|
37
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/* Defaults */
|
2
|
+
.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun{color:#660}.pln{color:#000}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec{color:#606}@media print{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun{color:#440}.pln{color:#000}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}
|
3
|
+
|
4
|
+
/* Overrides */
|
5
|
+
.str{color:#d14}.kwd{color:#000;font-weight:bold}.com{color:#998;font-style:italic}.typ{color:#458}.lit{color:#099}.pun{color:#666}.pln{color:#000}.tag{color:#000080}.atn{color:#008080}.atv{color:#008080}.dec{color:#000;font-weight:bold}
|
6
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
function H(){var x=navigator&&navigator.userAgent&&/\bMSIE 6\./.test(navigator.userAgent);H=function(){return x};return x}(function(){function x(b){b=b.split(/ /g);var a={};for(var c=b.length;--c>=0;){var d=b[c];if(d)a[d]=null}return a}var y="break continue do else for if return while ",U=y+"auto case char const default double enum extern float goto int long register short signed sizeof static struct switch typedef union unsigned void volatile ",D=U+"catch class delete false import new operator private protected public this throw true try ",
|
2
|
+
I=D+"alignof align_union asm axiom bool concept concept_map const_cast constexpr decltype dynamic_cast explicit export friend inline late_check mutable namespace nullptr reinterpret_cast static_assert static_cast template typeid typename typeof using virtual wchar_t where ",J=D+"boolean byte extends final finally implements import instanceof null native package strictfp super synchronized throws transient ",V=J+"as base by checked decimal delegate descending event fixed foreach from group implicit in interface internal into is lock object out override orderby params readonly ref sbyte sealed stackalloc string select uint ulong unchecked unsafe ushort var ",
|
3
|
+
K=D+"debugger eval export function get null set undefined var with Infinity NaN ",L="caller delete die do dump elsif eval exit foreach for goto if import last local my next no our print package redo require sub undef unless until use wantarray while BEGIN END ",M=y+"and as assert class def del elif except exec finally from global import in is lambda nonlocal not or pass print raise try with yield False True None ",N=y+"alias and begin case class def defined elsif end ensure false in module next nil not or redo rescue retry self super then true undef unless until when yield BEGIN END ",
|
4
|
+
O=y+"case done elif esac eval fi function in local set then until ",W=I+V+K+L+M+N+O;function X(b){return b>="a"&&b<="z"||b>="A"&&b<="Z"}function u(b,a,c,d){b.unshift(c,d||0);try{a.splice.apply(a,b)}finally{b.splice(0,2)}}var Y=(function(){var b=["!","!=","!==","#","%","%=","&","&&","&&=","&=","(","*","*=","+=",",","-=","->","/","/=",":","::",";","<","<<","<<=","<=","=","==","===",">",">=",">>",">>=",">>>",">>>=","?","@","[","^","^=","^^","^^=","{","|","|=","||","||=","~","break","case","continue",
|
5
|
+
"delete","do","else","finally","instanceof","return","throw","try","typeof"],a="(?:(?:(?:^|[^0-9.])\\.{1,3})|(?:(?:^|[^\\+])\\+)|(?:(?:^|[^\\-])-)";for(var c=0;c<b.length;++c){var d=b[c];a+=X(d.charAt(0))?"|\\b"+d:"|"+d.replace(/([^=<>:&])/g,"\\$1")}a+="|^)\\s*$";return new RegExp(a)})(),P=/&/g,Q=/</g,R=/>/g,Z=/\"/g;function $(b){return b.replace(P,"&").replace(Q,"<").replace(R,">").replace(Z,""")}function E(b){return b.replace(P,"&").replace(Q,"<").replace(R,">")}var aa=
|
6
|
+
/</g,ba=/>/g,ca=/'/g,da=/"/g,ea=/&/g,fa=/ /g;function ga(b){var a=b.indexOf("&");if(a<0)return b;for(--a;(a=b.indexOf("&#",a+1))>=0;){var c=b.indexOf(";",a);if(c>=0){var d=b.substring(a+3,c),g=10;if(d&&d.charAt(0)==="x"){d=d.substring(1);g=16}var e=parseInt(d,g);if(!isNaN(e))b=b.substring(0,a)+String.fromCharCode(e)+b.substring(c+1)}}return b.replace(aa,"<").replace(ba,">").replace(ca,"'").replace(da,'"').replace(ea,"&").replace(fa," ")}function S(b){return"XMP"===b.tagName}
|
7
|
+
function z(b,a){switch(b.nodeType){case 1:var c=b.tagName.toLowerCase();a.push("<",c);for(var d=0;d<b.attributes.length;++d){var g=b.attributes[d];if(!g.specified)continue;a.push(" ");z(g,a)}a.push(">");for(var e=b.firstChild;e;e=e.nextSibling)z(e,a);if(b.firstChild||!/^(?:br|link|img)$/.test(c))a.push("</",c,">");break;case 2:a.push(b.name.toLowerCase(),'="',$(b.value),'"');break;case 3:case 4:a.push(E(b.nodeValue));break}}var F=null;function ha(b){if(null===F){var a=document.createElement("PRE");
|
8
|
+
a.appendChild(document.createTextNode('<!DOCTYPE foo PUBLIC "foo bar">\n<foo />'));F=!/</.test(a.innerHTML)}if(F){var c=b.innerHTML;if(S(b))c=E(c);return c}var d=[];for(var g=b.firstChild;g;g=g.nextSibling)z(g,d);return d.join("")}function ia(b){var a=0;return function(c){var d=null,g=0;for(var e=0,h=c.length;e<h;++e){var f=c.charAt(e);switch(f){case "\t":if(!d)d=[];d.push(c.substring(g,e));var i=b-a%b;a+=i;for(;i>=0;i-=" ".length)d.push(" ".substring(0,i));g=e+1;break;
|
9
|
+
case "\n":a=0;break;default:++a}}if(!d)return c;d.push(c.substring(g));return d.join("")}}var ja=/(?:[^<]+|<!--[\s\S]*?--\>|<!\[CDATA\[([\s\S]*?)\]\]>|<\/?[a-zA-Z][^>]*>|<)/g,ka=/^<!--/,la=/^<\[CDATA\[/,ma=/^<br\b/i;function na(b){var a=b.match(ja),c=[],d=0,g=[];if(a)for(var e=0,h=a.length;e<h;++e){var f=a[e];if(f.length>1&&f.charAt(0)==="<"){if(ka.test(f))continue;if(la.test(f)){c.push(f.substring(9,f.length-3));d+=f.length-12}else if(ma.test(f)){c.push("\n");++d}else g.push(d,f)}else{var i=ga(f);
|
10
|
+
c.push(i);d+=i.length}}return{source:c.join(""),tags:g}}function v(b,a){var c={};(function(){var g=b.concat(a);for(var e=g.length;--e>=0;){var h=g[e],f=h[3];if(f)for(var i=f.length;--i>=0;)c[f.charAt(i)]=h}})();var d=a.length;return function(g,e){e=e||0;var h=[e,"pln"],f="",i=0,j=g;while(j.length){var o,m=null,k,l=c[j.charAt(0)];if(l){k=j.match(l[1]);m=k[0];o=l[0]}else{for(var n=0;n<d;++n){l=a[n];var p=l[2];if(p&&!p.test(f))continue;k=j.match(l[1]);if(k){m=k[0];o=l[0];break}}if(!m){o="pln";m=j.substring(0,
|
11
|
+
1)}}h.push(e+i,o);i+=m.length;j=j.substring(m.length);if(o!=="com"&&/\S/.test(m))f=m}return h}}var oa=v([],[["pln",/^[^<]+/,null],["dec",/^<!\w[^>]*(?:>|$)/,null],["com",/^<!--[\s\S]*?(?:--\>|$)/,null],["src",/^<\?[\s\S]*?(?:\?>|$)/,null],["src",/^<%[\s\S]*?(?:%>|$)/,null],["src",/^<(script|style|xmp)\b[^>]*>[\s\S]*?<\/\1\b[^>]*>/i,null],["tag",/^<\/?\w[^<>]*>/,null]]);function pa(b){var a=oa(b);for(var c=0;c<a.length;c+=2)if(a[c+1]==="src"){var d,g;d=a[c];g=c+2<a.length?a[c+2]:b.length;var e=b.substring(d,
|
12
|
+
g),h=e.match(/^(<[^>]*>)([\s\S]*)(<\/[^>]*>)$/);if(h)a.splice(c,2,d,"tag",d+h[1].length,"src",d+h[1].length+(h[2]||"").length,"tag")}return a}var qa=v([["atv",/^\'[^\']*(?:\'|$)/,null,"'"],["atv",/^\"[^\"]*(?:\"|$)/,null,'"'],["pun",/^[<>\/=]+/,null,"<>/="]],[["tag",/^[\w:\-]+/,/^</],["atv",/^[\w\-]+/,/^=/],["atn",/^[\w:\-]+/,null],["pln",/^\s+/,null," \t\r\n"]]);function ra(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d==="tag"){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=b.substring(g,
|
13
|
+
e),f=qa(h,g);u(f,a,c,2);c+=f.length-2}}return a}function r(b){var a=[],c=[];if(b.tripleQuotedStrings)a.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]);else if(b.multiLineStrings)a.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]);else a.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
|
14
|
+
null,"\"'"]);c.push(["pln",/^(?:[^\'\"\`\/\#]+)/,null," \r\n"]);if(b.hashComments)a.push(["com",/^#[^\r\n]*/,null,"#"]);if(b.cStyleComments)c.push(["com",/^\/\/[^\r\n]*/,null]);if(b.regexLiterals)c.push(["str",/^\/(?:[^\\\*\/\[]|\\[\s\S]|\[(?:[^\]\\]|\\.)*(?:\]|$))+(?:\/|$)/,Y]);if(b.cStyleComments)c.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]);var d=x(b.keywords);b=null;var g=v(a,c),e=v([],[["pln",/^\s+/,null," \r\n"],["pln",/^[a-z_$@][a-z_$@0-9]*/i,null],["lit",/^0x[a-f0-9]+[a-z]/i,null],["lit",
|
15
|
+
/^(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?[a-z]*/i,null,"123456789"],["pun",/^[^\s\w\.$@]+/,null]]);function h(f,i){for(var j=0;j<i.length;j+=2){var o=i[j+1];if(o==="pln"){var m,k,l,n;m=i[j];k=j+2<i.length?i[j+2]:f.length;l=f.substring(m,k);n=e(l,m);for(var p=0,t=n.length;p<t;p+=2){var w=n[p+1];if(w==="pln"){var A=n[p],B=p+2<t?n[p+2]:l.length,s=f.substring(A,B);if(s===".")n[p+1]="pun";else if(s in d)n[p+1]="kwd";else if(/^@?[A-Z][A-Z$]*[a-z][A-Za-z$]*$/.test(s))n[p+1]=s.charAt(0)==="@"?"lit":
|
16
|
+
"typ"}}u(n,i,j,2);j+=n.length-2}}return i}return function(f){var i=g(f);i=h(f,i);return i}}var G=r({keywords:W,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function sa(b,a){for(var c=0;c<a.length;c+=2){var d=a[c+1];if(d==="src"){var g,e;g=a[c];e=c+2<a.length?a[c+2]:b.length;var h=G(b.substring(g,e));for(var f=0,i=h.length;f<i;f+=2)h[f]+=g;u(h,a,c,2);c+=h.length-2}}return a}function ta(b,a){var c=false;for(var d=0;d<a.length;d+=2){var g=a[d+1],e,h;if(g==="atn"){e=
|
17
|
+
a[d];h=d+2<a.length?a[d+2]:b.length;c=/^on|^style$/i.test(b.substring(e,h))}else if(g==="atv"){if(c){e=a[d];h=d+2<a.length?a[d+2]:b.length;var f=b.substring(e,h),i=f.length,j=i>=2&&/^[\"\']/.test(f)&&f.charAt(0)===f.charAt(i-1),o,m,k;if(j){m=e+1;k=h-1;o=f}else{m=e+1;k=h-1;o=f.substring(1,f.length-1)}var l=G(o);for(var n=0,p=l.length;n<p;n+=2)l[n]+=m;if(j){l.push(k,"atv");u(l,a,d+2,0)}else u(l,a,d,2)}c=false}}return a}function ua(b){var a=pa(b);a=ra(b,a);a=sa(b,a);a=ta(b,a);return a}function va(b,
|
18
|
+
a,c){var d=[],g=0,e=null,h=null,f=0,i=0,j=ia(8);function o(k){if(k>g){if(e&&e!==h){d.push("</span>");e=null}if(!e&&h){e=h;d.push('<span class="',e,'">')}var l=E(j(b.substring(g,k))).replace(/(\r\n?|\n| ) /g,"$1 ").replace(/\r\n?|\n/g,"<br />");d.push(l);g=k}}while(true){var m;m=f<a.length?(i<c.length?a[f]<=c[i]:true):false;if(m){o(a[f]);if(e){d.push("</span>");e=null}d.push(a[f+1]);f+=2}else if(i<c.length){o(c[i]);h=c[i+1];i+=2}else break}o(b.length);if(e)d.push("</span>");return d.join("")}
|
19
|
+
var C={};function q(b,a){for(var c=a.length;--c>=0;){var d=a[c];if(!C.hasOwnProperty(d))C[d]=b;else if("console"in window)console.log("cannot override language handler %s",d)}}q(G,["default-code"]);q(ua,["default-markup","html","htm","xhtml","xml","xsl"]);q(r({keywords:I,hashComments:true,cStyleComments:true}),["c","cc","cpp","cs","cxx","cyc"]);q(r({keywords:J,cStyleComments:true}),["java"]);q(r({keywords:O,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);q(r({keywords:M,hashComments:true,
|
20
|
+
multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);q(r({keywords:L,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);q(r({keywords:N,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);q(r({keywords:K,cStyleComments:true,regexLiterals:true}),["js"]);function T(b,a){try{var c=na(b),d=c.source,g=c.tags;if(!C.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";var e=C[a].call({},d);return va(d,g,e)}catch(h){if("console"in window){console.log(h);
|
21
|
+
console.trace()}return b}}function wa(b){var a=H(),c=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],d=[];for(var g=0;g<c.length;++g)for(var e=0;e<c[g].length;++e)d.push(c[g][e]);c=null;var h=0;function f(){var i=(new Date).getTime()+250;for(;h<d.length&&(new Date).getTime()<i;h++){var j=d[h];if(j.className&&j.className.indexOf("prettyprint")>=0){var o=j.className.match(/\blang-(\w+)\b/);if(o)o=o[1];var m=false;for(var k=j.parentNode;k;k=
|
22
|
+
k.parentNode)if((k.tagName==="pre"||k.tagName==="code"||k.tagName==="xmp")&&k.className&&k.className.indexOf("prettyprint")>=0){m=true;break}if(!m){var l=ha(j);l=l.replace(/(?:\r\n?|\n)$/,"");var n=T(l,o);if(!S(j))j.innerHTML=n;else{var p=document.createElement("PRE");for(var t=0;t<j.attributes.length;++t){var w=j.attributes[t];if(w.specified)p.setAttribute(w.name,w.value)}p.innerHTML=n;j.parentNode.replaceChild(p,j);p=j}if(a&&j.tagName==="PRE"){var A=j.getElementsByTagName("br");for(var B=A.length;--B>=
|
23
|
+
0;){var s=A[B];s.parentNode.replaceChild(document.createTextNode("\r\n"),s)}}}}}if(h<d.length)setTimeout(f,250);else if(b)b()}f()}window.PR_normalizedHtml=z;window.prettyPrintOne=T;window.prettyPrint=wa;window.PR={createSimpleLexer:v,registerLangHandler:q,sourceDecorator:r,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
@@ -0,0 +1,40 @@
|
|
1
|
+
body { font: 16px/1.5 Georgia, Times New Roman, serif; background: #f0f0f0; color: #000; margin: 0; padding: 0; text-align: center; }
|
2
|
+
.container { background: #fff; text-align: left; margin: 0 auto; padding: 80px 48px 0; width: 860px; }
|
3
|
+
|
4
|
+
p { margin: 1.5em 0; }
|
5
|
+
.clear { clear: both; font-size: 0; height: 0; overflow: hidden; }
|
6
|
+
a { background: #62afcd; color: #fff; text-decoration: none; }
|
7
|
+
code { font-size: 80%; }
|
8
|
+
pre { font-size: 70%; font-family: Monaco, Consolas, Lucida Console, monospace; padding: 0 24px; }
|
9
|
+
|
10
|
+
.logo { font-weight: bold; font-family: Helvetica, Arial, sans-serif; letter-spacing: -0.08em; }
|
11
|
+
.logo .symbol { font-style: italic; font-weight: normal; font-family: Georgia, Times New Roman, serif; padding-right: 0.06em; }
|
12
|
+
.error { background: #fee; border: 1px solid #900; color: #900; padding: 12px; font: bold 13px Helvetica, Arial, sans-serif; }
|
13
|
+
|
14
|
+
.header { border-bottom: 1px solid #ccc; margin: 0 -48px; padding: 0 48px; }
|
15
|
+
|
16
|
+
h1 { margin: 0 0 24px -48px; _margin-left: -24px; float: left; width: 328px; }
|
17
|
+
h1 a { font-size: 72px; background: #c4e510; color: #fff; text-decoration: none; display: block; padding: 0 24px 0 48px; }
|
18
|
+
h1 .tagline { font-style: italic; font-weight: normal; font-size: 14px; display: block; padding: 8px 24px 0 48px; }
|
19
|
+
|
20
|
+
.navigation { float: left; margin: 0; padding: 0; }
|
21
|
+
.navigation li { list-style: none; float: left; margin: 0 0 0 60px; _margin: 0 0 0 30px; padding: 0; width: 220px; }
|
22
|
+
.navigation h3 { margin: 0; padding: 0; }
|
23
|
+
.navigation a { font: 16px Helvetica, Arial, sans-serif; padding: 0 8px; }
|
24
|
+
.navigation p { font-size: 90%; color: #444; margin: 0.4em 0; }
|
25
|
+
|
26
|
+
form { clear: left; float: left; width: 220px; margin: 24px 60px 24px 0; }
|
27
|
+
form ul { margin: 0; padding: 0; }
|
28
|
+
form li { margin: 0 0 4px; padding: 4px 8px; list-style: none; background: #4d6f9f; color: #fff; }
|
29
|
+
|
30
|
+
.main { float: left; width: 580px; padding: 24px 0; }
|
31
|
+
h2 { font-size: 150%; font-weight: normal; margin: 0 0 24px; }
|
32
|
+
.logs { font-size: 80%; font-family: Helvetica, Arial, sans-serif; }
|
33
|
+
.logs li { margin-bottom: 1em; }
|
34
|
+
|
35
|
+
.main form { margin: 0; }
|
36
|
+
.main textarea { width: 576px; height: 300px; font: 0.8em Monaco, Consolas, Lucida Console, monospace; }
|
37
|
+
|
38
|
+
.footer { clear: both; border-top: 1px solid #ccc; margin: 24px -48px; _margin: 12px -48px; padding: 24px 48px 80px 328px; font-size: 90%; position: relative; zoom: 1; }
|
39
|
+
.footer .logo { position: absolute; left: 48px; top: 20px; margin: 0; font-size: 120%; color: #888; }
|
40
|
+
|
data/test/deploy.yml
ADDED
data/test/index.html
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
6
|
+
<title>Package loader test</title>
|
7
|
+
|
8
|
+
<!-- Setup: run deployment service on port 9292, serve this file from localhost:8000. -->
|
9
|
+
|
10
|
+
<!-- Step 1. Load the JS.Class loader and the package config -->
|
11
|
+
<script src="http://localhost:9292/js/helium.js" type="text/javascript"></script>
|
12
|
+
|
13
|
+
<!-- Step 2. Add data required by the package manager -->
|
14
|
+
<script type="text/javascript">
|
15
|
+
// http://localhost:8000
|
16
|
+
Helium.GOOGLE_API_KEY = 'ABQIAAAArVbgzt5nxAQAZ_iB_77caBQCULP4XOMyhPd8d_NrQQEO8sT8XBTzVWhRwEDkVfNsvzo8bf4ntGV4ZQ';
|
17
|
+
|
18
|
+
// http://10.0.2.2:8000
|
19
|
+
// Helium.GOOGLE_API_KEY = 'ABQIAAAArVbgzt5nxAQAZ_iB_77caBR-5oywdloojr3wCGctvtY4YLrIFxTp2Uv8Tzdhpc707bQaOPGPEQ3PzA';
|
20
|
+
|
21
|
+
Helium.use('yui', '2.7.0');
|
22
|
+
Helium.use('ojay', 'master');
|
23
|
+
Helium.use('panel', 'master');
|
24
|
+
</script>
|
25
|
+
|
26
|
+
<style type="text/css" media="screen">
|
27
|
+
.overlay-container { background: #f2e697; }
|
28
|
+
.overlay-content { font: 96px Helvetica, Arial, sans-serif; padding: 24px; }
|
29
|
+
.close-button { position: absolute; top: 8px; right: 8px; font: bold 12px Helvetic, Arial, sans-serif; cursor: pointer; text-transform: uppercase; }
|
30
|
+
</style>
|
31
|
+
|
32
|
+
<script type="text/javascript">
|
33
|
+
|
34
|
+
// Load and use some libraries
|
35
|
+
|
36
|
+
require('GMap2');
|
37
|
+
|
38
|
+
require('PanelOverlay', function() {
|
39
|
+
var overlay = new PanelOverlay({width: 300, height: 200});
|
40
|
+
|
41
|
+
overlay.setContent('Hello, world!')
|
42
|
+
.fitToContent()
|
43
|
+
.center()
|
44
|
+
.show('zoom');
|
45
|
+
});
|
46
|
+
|
47
|
+
</script>
|
48
|
+
</head>
|
49
|
+
</html>
|
50
|
+
|
data/test/test_helium.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require "test/unit"
|
2
|
+
require "helium"
|
3
|
+
require "fileutils"
|
4
|
+
|
5
|
+
ROOT = File.dirname(__FILE__)
|
6
|
+
|
7
|
+
class TestHelium < Test::Unit::TestCase
|
8
|
+
def setup
|
9
|
+
FileUtils.rm_rf(ROOT + '/output')
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_build
|
13
|
+
deploy = Helium::Deployer.new(ROOT, 'output', :domain => 'helium.example.com')
|
14
|
+
deploy.add_observer(self)
|
15
|
+
deploy.run!
|
16
|
+
end
|
17
|
+
|
18
|
+
def update(type, message)
|
19
|
+
puts "**** [LOG] #{ message }"
|
20
|
+
end
|
21
|
+
end
|
metadata
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: helium
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- James Coglan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-11-02 00:00:00 +00:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: grit
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: jake
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.1
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: packr
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "3.1"
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: oyster
|
47
|
+
type: :runtime
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.9.3
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sinatra
|
57
|
+
type: :runtime
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 0.9.4
|
64
|
+
version:
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rack
|
67
|
+
type: :runtime
|
68
|
+
version_requirement:
|
69
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: "1.0"
|
74
|
+
version:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: hoe
|
77
|
+
type: :development
|
78
|
+
version_requirement:
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 2.3.3
|
84
|
+
version:
|
85
|
+
description: ""
|
86
|
+
email:
|
87
|
+
- james.coglan@othermedia.com
|
88
|
+
executables:
|
89
|
+
- he
|
90
|
+
extensions: []
|
91
|
+
|
92
|
+
extra_rdoc_files:
|
93
|
+
- History.txt
|
94
|
+
- Manifest.txt
|
95
|
+
- README.txt
|
96
|
+
files:
|
97
|
+
- History.txt
|
98
|
+
- LICENCE
|
99
|
+
- Manifest.txt
|
100
|
+
- README.txt
|
101
|
+
- Rakefile
|
102
|
+
- bin/he
|
103
|
+
- lib/helium.rb
|
104
|
+
- lib/helium/configurable.rb
|
105
|
+
- lib/helium/deployer.rb
|
106
|
+
- lib/helium/generator.rb
|
107
|
+
- lib/helium/jake.rb
|
108
|
+
- lib/helium/logger.rb
|
109
|
+
- lib/helium/trie.rb
|
110
|
+
- lib/helium/web.rb
|
111
|
+
- lib/helium/web_helpers.rb
|
112
|
+
- lib/helium/views/deploy.erb
|
113
|
+
- lib/helium/views/edit.erb
|
114
|
+
- lib/helium/views/index.erb
|
115
|
+
- lib/helium/views/layout.erb
|
116
|
+
- lib/helium/views/missing.erb
|
117
|
+
- templates/packages.js.erb
|
118
|
+
- templates/project/.gitignore
|
119
|
+
- templates/project/jake.yml.erb
|
120
|
+
- templates/project/Jakefile
|
121
|
+
- templates/project/source/__name__.js.erb
|
122
|
+
- templates/project/test/index.html.erb
|
123
|
+
- templates/web/config.ru
|
124
|
+
- templates/web/deploy.yml
|
125
|
+
- templates/web/custom.js
|
126
|
+
- templates/web/public/prettify.css
|
127
|
+
- templates/web/public/prettify.js
|
128
|
+
- templates/web/public/style.css
|
129
|
+
- test/test_helium.rb
|
130
|
+
- test/deploy.yml
|
131
|
+
- test/index.html
|
132
|
+
has_rdoc: true
|
133
|
+
homepage: http://github.com/othermedia/helium
|
134
|
+
post_install_message:
|
135
|
+
rdoc_options:
|
136
|
+
- --main
|
137
|
+
- README.txt
|
138
|
+
require_paths:
|
139
|
+
- lib
|
140
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: "0"
|
145
|
+
version:
|
146
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: "0"
|
151
|
+
version:
|
152
|
+
requirements: []
|
153
|
+
|
154
|
+
rubyforge_project: helium
|
155
|
+
rubygems_version: 1.3.1
|
156
|
+
signing_key:
|
157
|
+
specification_version: 2
|
158
|
+
summary: ""
|
159
|
+
test_files:
|
160
|
+
- test/test_helium.rb
|