aml 0.1.3.2 → 0.1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aml-kit +3 -0
- data/lib/aml-kit.rb +11 -0
- data/lib/aml-kit/Build.rb +55 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/css/bootstrap-theme.min.css +6 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/css/bootstrap.min.css +5 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/css/font-awesome.min.css +4 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/FontAwesome.otf +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.eot +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.svg +520 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.woff +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/index.aml +16 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/js/bootstrap.min.js +6 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/js/html5shiv.min.js +4 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/js/jquery.min.js +4 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/js/respond.min.js +5 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/mixin.aml +11 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/partial/footer.aml +17 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/partial/header.aml +20 -0
- data/lib/aml-kit/core/bootstrap/3.2.0/partial/navigation-top.aml +17 -0
- data/lib/aml-kit/core/foundation/5.3.1/css/foundation.min.css +1 -0
- data/lib/aml-kit/core/foundation/5.3.1/css/normalize.css +425 -0
- data/lib/aml-kit/core/foundation/5.3.1/index.aml +14 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation.min.js +10 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.abide.js +299 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.accordion.js +65 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.alert.js +43 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.clearing.js +542 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.dropdown.js +313 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.equalizer.js +74 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.interchange.js +344 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.joyride.js +846 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.js +613 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.magellan.js +180 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.offcanvas.js +108 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.orbit.js +472 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.reveal.js +437 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.slider.js +226 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.tab.js +167 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.tooltip.js +298 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.topbar.js +426 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/vendor/fastclick.js +9 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/vendor/jquery.cookie.js +8 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/vendor/jquery.js +26 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/vendor/modernizr.js +8 -0
- data/lib/aml-kit/core/foundation/5.3.1/js/vendor/placeholder.js +2 -0
- data/lib/aml-kit/core/foundation/5.3.1/partial/footer.aml +4 -0
- data/lib/aml-kit/core/foundation/5.3.1/partial/header.aml +9 -0
- data/lib/aml.rb +1 -1
- data/lib/aml/Compile.rb +15 -19
- data/lib/aml/Definition.rb +0 -1
- data/lib/aml/Line.rb +1 -1
- data/lib/aml/Prepare.rb +1 -2
- data/lib/aml/core/method.rb +42 -19
- metadata +59 -6
@@ -0,0 +1,8 @@
|
|
1
|
+
/*!
|
2
|
+
* Modernizr v2.8.2
|
3
|
+
* www.modernizr.com
|
4
|
+
*
|
5
|
+
* Copyright (c) Faruk Ates, Paul Irish, Alex Sexton
|
6
|
+
* Available under the BSD and MIT licenses: www.modernizr.com/license/
|
7
|
+
*/
|
8
|
+
window.Modernizr=function(a,b,c){function d(a){t.cssText=a}function e(a,b){return d(x.join(a+";")+(b||""))}function f(a,b){return typeof a===b}function g(a,b){return!!~(""+a).indexOf(b)}function h(a,b){for(var d in a){var e=a[d];if(!g(e,"-")&&t[e]!==c)return"pfx"==b?e:!0}return!1}function i(a,b,d){for(var e in a){var g=b[a[e]];if(g!==c)return d===!1?a[e]:f(g,"function")?g.bind(d||b):g}return!1}function j(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+z.join(d+" ")+d).split(" ");return f(b,"string")||f(b,"undefined")?h(e,b):(e=(a+" "+A.join(d+" ")+d).split(" "),i(e,b,c))}function k(){o.input=function(c){for(var d=0,e=c.length;e>d;d++)E[c[d]]=!!(c[d]in u);return E.list&&(E.list=!(!b.createElement("datalist")||!a.HTMLDataListElement)),E}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),o.inputtypes=function(a){for(var d,e,f,g=0,h=a.length;h>g;g++)u.setAttribute("type",e=a[g]),d="text"!==u.type,d&&(u.value=v,u.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(e)&&u.style.WebkitAppearance!==c?(q.appendChild(u),f=b.defaultView,d=f.getComputedStyle&&"textfield"!==f.getComputedStyle(u,null).WebkitAppearance&&0!==u.offsetHeight,q.removeChild(u)):/^(search|tel)$/.test(e)||(d=/^(url|email)$/.test(e)?u.checkValidity&&u.checkValidity()===!1:u.value!=v)),D[a[g]]=!!d;return D}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var l,m,n="2.8.2",o={},p=!0,q=b.documentElement,r="modernizr",s=b.createElement(r),t=s.style,u=b.createElement("input"),v=":)",w={}.toString,x=" -webkit- -moz- -o- -ms- ".split(" "),y="Webkit Moz O ms",z=y.split(" "),A=y.toLowerCase().split(" "),B={svg:"http://www.w3.org/2000/svg"},C={},D={},E={},F=[],G=F.slice,H=function(a,c,d,e){var f,g,h,i,j=b.createElement("div"),k=b.body,l=k||b.createElement("body");if(parseInt(d,10))for(;d--;)h=b.createElement("div"),h.id=e?e[d]:r+(d+1),j.appendChild(h);return f=["­",'<style id="s',r,'">',a,"</style>"].join(""),j.id=r,(k?j:l).innerHTML+=f,l.appendChild(j),k||(l.style.background="",l.style.overflow="hidden",i=q.style.overflow,q.style.overflow="hidden",q.appendChild(l)),g=c(j,a),k?j.parentNode.removeChild(j):(l.parentNode.removeChild(l),q.style.overflow=i),!!g},I=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b)&&c(b).matches||!1;var d;return H("@media "+b+" { #"+r+" { position: absolute; } }",function(b){d="absolute"==(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).position}),d},J=function(){function a(a,e){e=e||b.createElement(d[a]||"div"),a="on"+a;var g=a in e;return g||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(a,""),g=f(e[a],"function"),f(e[a],"undefined")||(e[a]=c),e.removeAttribute(a))),e=null,g}var d={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return a}(),K={}.hasOwnProperty;m=f(K,"undefined")||f(K.call,"undefined")?function(a,b){return b in a&&f(a.constructor.prototype[b],"undefined")}:function(a,b){return K.call(a,b)},Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=G.call(arguments,1),d=function(){if(this instanceof d){var e=function(){};e.prototype=b.prototype;var f=new e,g=b.apply(f,c.concat(G.call(arguments)));return Object(g)===g?g:f}return b.apply(a,c.concat(G.call(arguments)))};return d}),C.flexbox=function(){return j("flexWrap")},C.flexboxlegacy=function(){return j("boxDirection")},C.canvas=function(){var a=b.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))},C.canvastext=function(){return!(!o.canvas||!f(b.createElement("canvas").getContext("2d").fillText,"function"))},C.webgl=function(){return!!a.WebGLRenderingContext},C.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:H(["@media (",x.join("touch-enabled),("),r,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=9===a.offsetTop}),c},C.geolocation=function(){return"geolocation"in navigator},C.postmessage=function(){return!!a.postMessage},C.websqldatabase=function(){return!!a.openDatabase},C.indexedDB=function(){return!!j("indexedDB",a)},C.hashchange=function(){return J("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},C.history=function(){return!(!a.history||!history.pushState)},C.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},C.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},C.rgba=function(){return d("background-color:rgba(150,255,150,.5)"),g(t.backgroundColor,"rgba")},C.hsla=function(){return d("background-color:hsla(120,40%,100%,.5)"),g(t.backgroundColor,"rgba")||g(t.backgroundColor,"hsla")},C.multiplebgs=function(){return d("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(t.background)},C.backgroundsize=function(){return j("backgroundSize")},C.borderimage=function(){return j("borderImage")},C.borderradius=function(){return j("borderRadius")},C.boxshadow=function(){return j("boxShadow")},C.textshadow=function(){return""===b.createElement("div").style.textShadow},C.opacity=function(){return e("opacity:.55"),/^0.55$/.test(t.opacity)},C.cssanimations=function(){return j("animationName")},C.csscolumns=function(){return j("columnCount")},C.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return d((a+"-webkit- ".split(" ").join(b+a)+x.join(c+a)).slice(0,-a.length)),g(t.backgroundImage,"gradient")},C.cssreflections=function(){return j("boxReflect")},C.csstransforms=function(){return!!j("transform")},C.csstransforms3d=function(){var a=!!j("perspective");return a&&"webkitPerspective"in q.style&&H("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b){a=9===b.offsetLeft&&3===b.offsetHeight}),a},C.csstransitions=function(){return j("transition")},C.fontface=function(){var a;return H('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&0===g.indexOf(d.split(" ")[0])}),a},C.generatedcontent=function(){var a;return H(["#",r,"{font:0/0 a}#",r,':after{content:"',v,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},C.video=function(){var a=b.createElement("video"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,""))}catch(d){}return c},C.audio=function(){var a=b.createElement("audio"),c=!1;try{(c=!!a.canPlayType)&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(d){}return c},C.localstorage=function(){try{return localStorage.setItem(r,r),localStorage.removeItem(r),!0}catch(a){return!1}},C.sessionstorage=function(){try{return sessionStorage.setItem(r,r),sessionStorage.removeItem(r),!0}catch(a){return!1}},C.webworkers=function(){return!!a.Worker},C.applicationcache=function(){return!!a.applicationCache},C.svg=function(){return!!b.createElementNS&&!!b.createElementNS(B.svg,"svg").createSVGRect},C.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==B.svg},C.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(w.call(b.createElementNS(B.svg,"animate")))},C.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(w.call(b.createElementNS(B.svg,"clipPath")))};for(var L in C)m(C,L)&&(l=L.toLowerCase(),o[l]=C[L](),F.push((o[l]?"":"no-")+l));return o.input||k(),o.addTest=function(a,b){if("object"==typeof a)for(var d in a)m(a,d)&&o.addTest(d,a[d]);else{if(a=a.toLowerCase(),o[a]!==c)return o;b="function"==typeof b?b():b,"undefined"!=typeof p&&p&&(q.className+=" "+(b?"":"no-")+a),o[a]=b}return o},d(""),s=u=null,function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=s.elements;return"string"==typeof a?a.split(" "):a}function e(a){var b=r[a[p]];return b||(b={},q++,a[p]=q,r[q]=b),b}function f(a,c,d){if(c||(c=b),k)return c.createElement(a);d||(d=e(c));var f;return f=d.cache[a]?d.cache[a].cloneNode():o.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!f.canHaveChildren||n.test(a)||f.tagUrn?f:d.frag.appendChild(f)}function g(a,c){if(a||(a=b),k)return a.createDocumentFragment();c=c||e(a);for(var f=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)f.createElement(h[g]);return f}function h(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?f(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function i(a){a||(a=b);var d=e(a);return!s.shivCSS||j||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||h(a,d),a}var j,k,l="3.7.0",m=a.html5||{},n=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,o=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,p="_html5shiv",q=0,r={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",j="hidden"in a,k=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){j=!0,k=!0}}();var s={elements:m.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:l,shivCSS:m.shivCSS!==!1,supportsUnknownElements:k,shivMethods:m.shivMethods!==!1,type:"default",shivDocument:i,createElement:f,createDocumentFragment:g};a.html5=s,i(b)}(this,b),o._version=n,o._prefixes=x,o._domPrefixes=A,o._cssomPrefixes=z,o.mq=I,o.hasEvent=J,o.testProp=function(a){return h([a])},o.testAllProps=j,o.testStyles=H,o.prefixed=function(a,b,c){return b?j(a,b,c):j(a,"pfx")},q.className=q.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(p?" js "+F.join(" "):""),o}(this,this.document);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! http://mths.be/placeholder v2.0.8 by @mathias */
|
2
|
+
!function(a,b,c){function d(a){var b={},d=/^jQuery\d+$/;return c.each(a.attributes,function(a,c){c.specified&&!d.test(c.name)&&(b[c.name]=c.value)}),b}function e(a,b){var d=this,e=c(d);if(d.value==e.attr("placeholder")&&e.hasClass("placeholder"))if(e.data("placeholder-password")){if(e=e.hide().next().show().attr("id",e.removeAttr("id").data("placeholder-id")),a===!0)return e[0].value=b;e.focus()}else d.value="",e.removeClass("placeholder"),d==g()&&d.select()}function f(){var a,b=this,f=c(b),g=this.id;if(""==b.value){if("password"==b.type){if(!f.data("placeholder-textinput")){try{a=f.clone().attr({type:"text"})}catch(h){a=c("<input>").attr(c.extend(d(this),{type:"text"}))}a.removeAttr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",e),f.data({"placeholder-textinput":a,"placeholder-id":g}).before(a)}f=f.removeAttr("id").hide().prev().attr("id",g).show()}f.addClass("placeholder"),f[0].value=f.attr("placeholder")}else f.removeClass("placeholder")}function g(){try{return b.activeElement}catch(a){}}var h,i,j="[object OperaMini]"==Object.prototype.toString.call(a.operamini),k="placeholder"in b.createElement("input")&&!j,l="placeholder"in b.createElement("textarea")&&!j,m=c.fn,n=c.valHooks,o=c.propHooks;k&&l?(i=m.placeholder=function(){return this},i.input=i.textarea=!0):(i=m.placeholder=function(){var a=this;return a.filter((k?"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":e,"blur.placeholder":f}).data("placeholder-enabled",!0).trigger("blur.placeholder"),a},i.input=k,i.textarea=l,h={get:function(a){var b=c(a),d=b.data("placeholder-password");return d?d[0].value:b.data("placeholder-enabled")&&b.hasClass("placeholder")?"":a.value},set:function(a,b){var d=c(a),h=d.data("placeholder-password");return h?h[0].value=b:d.data("placeholder-enabled")?(""==b?(a.value=b,a!=g()&&f.call(a)):d.hasClass("placeholder")?e.call(a,!0,b)||(a.value=b):a.value=b,d):a.value=b}},k||(n.input=h,o.value=h),l||(n.textarea=h,o.value=h),c(function(){c(b).delegate("form","submit.placeholder",function(){var a=c(".placeholder",this).each(e);setTimeout(function(){a.each(f)},10)})}),c(a).bind("beforeunload.placeholder",function(){c(".placeholder").each(function(){this.value=""})}))}(this,document,jQuery);
|
data/lib/aml.rb
CHANGED
data/lib/aml/Compile.rb
CHANGED
@@ -17,9 +17,7 @@ class Compile
|
|
17
17
|
].each do |variable|
|
18
18
|
@prepare.cluster.variables['false'][variable[:name].to_s] = [{:number=>0, :value=>variable[:value].to_s}]
|
19
19
|
end
|
20
|
-
|
21
20
|
@log = []
|
22
|
-
|
23
21
|
@prepare.log.each do |log|
|
24
22
|
if log[:type] == "mixin"
|
25
23
|
@log << log if log[:bundle] != false
|
@@ -27,13 +25,10 @@ class Compile
|
|
27
25
|
@log << log
|
28
26
|
end
|
29
27
|
end
|
30
|
-
|
31
|
-
|
32
28
|
if @log.count == 0
|
33
29
|
process
|
34
30
|
@prepare.cluster.post_process
|
35
31
|
end
|
36
|
-
|
37
32
|
end
|
38
33
|
def log
|
39
34
|
@log
|
@@ -94,12 +89,12 @@ class Compile
|
|
94
89
|
line
|
95
90
|
end
|
96
91
|
|
97
|
-
def recursive_attribute_replace_method(attributes, line)
|
92
|
+
def recursive_attribute_replace_method(attributes, line, definition)
|
98
93
|
attributes.each do |attribute, value|
|
99
94
|
if value.is_a? Hash
|
100
|
-
value = recursive_attribute_replace_method(value, line)
|
95
|
+
value = recursive_attribute_replace_method(value, line, definition)
|
101
96
|
else
|
102
|
-
value = process_method_find(value.to_s, line)
|
97
|
+
value = process_method_find(value.to_s, line, definition)
|
103
98
|
end
|
104
99
|
attributes[attribute] = value
|
105
100
|
end
|
@@ -108,13 +103,13 @@ class Compile
|
|
108
103
|
|
109
104
|
def process_method_line(line, definition)
|
110
105
|
if line[:type] == :string
|
111
|
-
line[:value] = process_method_find(line[:value], line)
|
106
|
+
line[:value] = process_method_find(line[:value], line, definition)
|
112
107
|
parse = Parse.new(definition.self[:bundle])
|
113
108
|
line = parse.line("#{"\t" * line[:index]}#{line[:value]}",line[:number])
|
114
109
|
else
|
115
|
-
line[:text] = process_method_find(line[:text], line)
|
110
|
+
line[:text] = process_method_find(line[:text], line, definition)
|
116
111
|
if line.key? :attribute and line[:attribute].count > 0
|
117
|
-
line[:attribute] = recursive_attribute_replace_method(line[:attribute],line)
|
112
|
+
line[:attribute] = recursive_attribute_replace_method(line[:attribute], line, definition)
|
118
113
|
end
|
119
114
|
end
|
120
115
|
line
|
@@ -127,12 +122,12 @@ class Compile
|
|
127
122
|
string = process_variable_find(string, line, definition) if has_match?(string, regex)
|
128
123
|
return string
|
129
124
|
end
|
130
|
-
def process_method_find(string, line)
|
125
|
+
def process_method_find(string, line, definition)
|
131
126
|
regex = @inline.select{|k|k[:type] == :method}[0][:regex]
|
132
127
|
string = string.to_s.gsub(regex).each do
|
133
|
-
process_method_replace($1, $2, $3, line[:index])
|
128
|
+
process_method_replace($1, $2, $3, line[:index], definition)
|
134
129
|
end
|
135
|
-
string = process_method_find(string, line) if has_match?(string, regex)
|
130
|
+
string = process_method_find(string, line, definition) if has_match?(string, regex)
|
136
131
|
return string
|
137
132
|
end
|
138
133
|
def process_variable_replace(bundle, name, number, definition)
|
@@ -145,16 +140,17 @@ class Compile
|
|
145
140
|
return nil
|
146
141
|
end
|
147
142
|
end
|
148
|
-
def process_method_replace(bundle, name, attribute, index)
|
143
|
+
def process_method_replace(bundle, name, attribute, index, definition)
|
149
144
|
bundle = 'core' if bundle == nil
|
150
145
|
begin
|
151
|
-
file = bundle == 'core' ? File.join(File.dirname(File.expand_path(__FILE__)),'core','method.rb') : File.join(File.dirname(File.expand_path(definition.self[:file])),
|
146
|
+
file = bundle == 'core' ? File.join(File.dirname(File.expand_path(__FILE__)),'core','method.rb') : File.join(File.dirname(File.expand_path(definition.self[:file])),bundle,'method.rb')
|
152
147
|
Compile.class_eval File.read(file)
|
153
148
|
method_attribute = Line.new(bundle, :string, @inline.select{|k|k[:type] == :method}[0][:regex])
|
154
149
|
method_attribute = method_attribute.match?("::#{bundle}.#{name}{#{attribute}}", index)
|
150
|
+
method_attribute[:attribute] = {:value=>attribute.to_s} if method_attribute[:attribute].count == 0
|
155
151
|
attribute = method_attribute[:attribute]
|
156
152
|
Compile.const_get(bundle.split('-').map{|k|k.capitalize}.join).method(name).call(index, attribute)
|
157
|
-
rescue
|
153
|
+
rescue Exception => e
|
158
154
|
return nil
|
159
155
|
end
|
160
156
|
end
|
@@ -234,10 +230,10 @@ class Compile
|
|
234
230
|
end
|
235
231
|
end
|
236
232
|
def process_partial_find(line, offset, definition)
|
237
|
-
path = line[:bundle].to_s == false.to_s ? "
|
233
|
+
path = line[:bundle].to_s == false.to_s ? "" : line[:bundle].to_s
|
238
234
|
partial_number = line[:number]
|
239
235
|
patrial_attribute = line[:attribute]
|
240
|
-
partial = Definition.new(File.join(@argument.get('path'),path,line[:name]+'.aml'), line[:type].to_s, line[:bundle])
|
236
|
+
partial = Definition.new(File.join(@argument.get('path'),path, "partial", line[:name]+'.aml'), line[:type].to_s, line[:bundle])
|
241
237
|
partial.self[:hash].each_with_index do |line, index|
|
242
238
|
line[:number] = partial_number
|
243
239
|
line = process_attribute(line, {:attribute=>patrial_attribute}) if patrial_attribute.count > 0
|
data/lib/aml/Definition.rb
CHANGED
data/lib/aml/Line.rb
CHANGED
@@ -34,6 +34,7 @@ class Line
|
|
34
34
|
# bundle
|
35
35
|
line[:bundle] = @line[:bundle] if line.key? :bundle and line[:bundle].to_s.length == 0
|
36
36
|
if line[:type] == :mixin
|
37
|
+
line[:bundle] = 'false' if line[:bundle] == 'base'
|
37
38
|
line[:bundle] = 'core' and line[:name] = line[:name][1..-1] if line[:name][0] == '.'
|
38
39
|
elsif line[:type] == :method
|
39
40
|
line[:bundle] = 'core' if line[:bundle] == false
|
@@ -44,7 +45,6 @@ class Line
|
|
44
45
|
line[:attribute][:class] = line[:class].split('.').join(' ').strip!
|
45
46
|
line.delete(:class)
|
46
47
|
end
|
47
|
-
|
48
48
|
# close
|
49
49
|
line[:close] = %w(tag self none)[line[:close].to_s.length].to_sym if line.key? :close
|
50
50
|
# id
|
data/lib/aml/Prepare.rb
CHANGED
@@ -23,7 +23,7 @@ class Prepare
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
# Load Local File Mixin & Method
|
26
|
-
path =
|
26
|
+
path = File.join(File.dirname(file))
|
27
27
|
add_file(File.join(path,'mixin.aml'), 'mixin')
|
28
28
|
add_watch(File.join(path,'method.rb'), 'method')
|
29
29
|
# Load Only Requird Local Partials
|
@@ -32,7 +32,6 @@ class Prepare
|
|
32
32
|
end
|
33
33
|
# Load Local File
|
34
34
|
add_file(file,'base')
|
35
|
-
|
36
35
|
@watch.concat(@file)
|
37
36
|
process
|
38
37
|
end
|
data/lib/aml/core/method.rb
CHANGED
@@ -2,52 +2,75 @@ class Core
|
|
2
2
|
|
3
3
|
@words = %w[a ac accumsan adipiscing aenean aliquam aliquet amet ante arcu at auctor augue bibendum blandit commodo condimentum congue consectetur consequat convallis cras curabitur cursus dapibus diam dictum dictumst dignissim dis dolor donec dui duis egestas eget eleifend elementum elit enim erat eros est et etiam eu euismod facilisi facilisis fames faucibus felis fermentum feugiat fringilla fusce gravida habitasse hac hendrerit iaculis id imperdiet in integer interdum ipsum justo lacinia lacus laoreet lectus leo libero ligula lobortis lorem luctus maecenas magna magnis malesuada massa mattis mauris metus mi molestie mollis montes morbi mus nam nascetur natoque nec neque nibh nisi nisl non nulla nullam nunc odio orci ornare parturient pellentesque penatibus pharetra phasellus placerat platea porta porttitor posuere potenti praesent pretium primis proin pulvinar purus quam quis quisque rhoncus risus rutrum sagittis sapien scelerisque sed sem semper sit sociis sodales sollicitudin suscipit suspendisse tellus tempor tempus tincidunt tortor tristique turpis ullamcorper ultrices ultricies urna ut varius vehicula vel velit venenatis vestibulum vitae vivamus viverra volutpat vulputate werumensium xiphias]
|
4
4
|
|
5
|
-
def self.
|
5
|
+
def self.upcase(index=0, a={}, d={:value=>nil})
|
6
6
|
a = d.merge(a)
|
7
|
-
|
7
|
+
a[:value].to_s.upcase
|
8
8
|
end
|
9
9
|
|
10
|
-
def self.
|
10
|
+
def self.downcase(index=0, a={}, d={:value=>nil})
|
11
11
|
a = d.merge(a)
|
12
|
-
|
13
|
-
|
12
|
+
a[:value].to_s.downcase
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.swapcase(index=0, a={}, d={:value=>nil})
|
16
|
+
a = d.merge(a)
|
17
|
+
a[:value].to_s.swapcase
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.alphanumeric(index=0, a={}, d={:value=>nil,:replace=>' '})
|
21
|
+
a = d.merge(a)
|
22
|
+
self.downcase(index,{:value=>a[:value]}).gsub(/[^\w]/,a[:replace]).gsub(/#{a[:replace]}{2,}/,a[:replace]).gsub(/^#{a[:replace]}/,'').gsub(/#{a[:replace]}$/,'')
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.filename(index=0, a={}, d={:value=>nil,:replace=>'-'})
|
26
|
+
a = d.merge(a)
|
27
|
+
self.alphanumeric(index,{:value=>a[:value], :replace=>a[:replace]})
|
14
28
|
end
|
15
29
|
|
16
|
-
def self.
|
30
|
+
def self.randrange(index=0, a={}, d={:min=>'1', :max=>'10'})
|
17
31
|
a = d.merge(a)
|
18
|
-
|
32
|
+
rand(a[:min].to_i..a[:max].to_i)
|
19
33
|
end
|
20
34
|
|
21
|
-
def self.
|
35
|
+
def self.date(index=0, a={}, d={:format=>'%Y-%m-%d %H:%M:%S'})
|
22
36
|
a = d.merge(a)
|
23
|
-
|
37
|
+
time = Time.new
|
38
|
+
time.strftime(a[:format])
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.copyright(index=0, a={}, d={:value=>false})
|
42
|
+
a = d.merge(a)
|
43
|
+
string = '© ' + self.year
|
44
|
+
string += ' ' + a[:value].to_s if a[:value].to_s.length > 0
|
45
|
+
string
|
24
46
|
end
|
25
47
|
|
26
48
|
def self.year(index=0, a={})
|
27
|
-
|
49
|
+
self.date(index,{:format=>'%Y'})
|
28
50
|
end
|
29
51
|
|
30
|
-
def self.lorem(index=0, a={}, d={:paragraphs=>6, :words=>8, :
|
52
|
+
def self.lorem(index=0, a={}, d={:paragraphs=>6, :words=>8, :value=>nil,:capitalize=>true})
|
31
53
|
#Generate random copy based on en-us formats.
|
32
54
|
a = d.merge(a)
|
33
55
|
a[:paragraphs] = a[:paragraphs].to_i
|
34
56
|
a[:words] = a[:words].to_i
|
57
|
+
a[:value] = a[:value].to_s.strip == "" ? 'paragraph' : a[:value].downcase
|
35
58
|
string = ""
|
36
|
-
if a[:
|
59
|
+
if a[:value] == 'word'
|
37
60
|
string = self._random_word(a[:capitalize])
|
38
|
-
elsif a[:
|
61
|
+
elsif a[:value] == 'sentence'
|
39
62
|
string = self._random_sentence(a[:words])
|
40
|
-
elsif a[:
|
63
|
+
elsif a[:value] == 'paragraph'
|
41
64
|
string = self._random_paragraph(a[:paragraphs], a[:words])
|
42
|
-
elsif a[:
|
65
|
+
elsif a[:value] == 'title'
|
43
66
|
string = self._random_title(a[:words])
|
44
|
-
elsif a[:
|
67
|
+
elsif a[:value] == 'name'
|
45
68
|
string = self._random_name
|
46
|
-
elsif a[:
|
69
|
+
elsif a[:value] == 'address'
|
47
70
|
string = self._random_address
|
48
|
-
elsif a[:
|
71
|
+
elsif a[:value] == 'phone'
|
49
72
|
string = self._random_phone
|
50
|
-
elsif a[:
|
73
|
+
elsif a[:value] == 'email'
|
51
74
|
string = self._random_email
|
52
75
|
end
|
53
76
|
return string
|
metadata
CHANGED
@@ -1,35 +1,88 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.3.
|
4
|
+
version: 0.1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Esquivias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Abstract Markup Language is a robust and feature rich markup language
|
14
14
|
designed to avoid repetition and promote clear, well-indented markup.
|
15
15
|
email: daniel@abstractmarkup.com
|
16
16
|
executables:
|
17
17
|
- aml
|
18
|
+
- aml-kit
|
18
19
|
extensions: []
|
19
20
|
extra_rdoc_files: []
|
20
21
|
files:
|
21
22
|
- bin/aml
|
23
|
+
- bin/aml-kit
|
24
|
+
- lib/aml-kit.rb
|
25
|
+
- lib/aml-kit/Build.rb
|
26
|
+
- lib/aml-kit/core/bootstrap/3.2.0/css/bootstrap-theme.min.css
|
27
|
+
- lib/aml-kit/core/bootstrap/3.2.0/css/bootstrap.min.css
|
28
|
+
- lib/aml-kit/core/bootstrap/3.2.0/css/font-awesome.min.css
|
29
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/FontAwesome.otf
|
30
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.eot
|
31
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.svg
|
32
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.ttf
|
33
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/fontawesome-webfont.woff
|
34
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.eot
|
35
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.svg
|
36
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.ttf
|
37
|
+
- lib/aml-kit/core/bootstrap/3.2.0/fonts/glyphicons-halflings-regular.woff
|
38
|
+
- lib/aml-kit/core/bootstrap/3.2.0/index.aml
|
39
|
+
- lib/aml-kit/core/bootstrap/3.2.0/js/bootstrap.min.js
|
40
|
+
- lib/aml-kit/core/bootstrap/3.2.0/js/html5shiv.min.js
|
41
|
+
- lib/aml-kit/core/bootstrap/3.2.0/js/jquery.min.js
|
42
|
+
- lib/aml-kit/core/bootstrap/3.2.0/js/respond.min.js
|
43
|
+
- lib/aml-kit/core/bootstrap/3.2.0/mixin.aml
|
44
|
+
- lib/aml-kit/core/bootstrap/3.2.0/partial/footer.aml
|
45
|
+
- lib/aml-kit/core/bootstrap/3.2.0/partial/header.aml
|
46
|
+
- lib/aml-kit/core/bootstrap/3.2.0/partial/navigation-top.aml
|
47
|
+
- lib/aml-kit/core/foundation/5.3.1/css/foundation.min.css
|
48
|
+
- lib/aml-kit/core/foundation/5.3.1/css/normalize.css
|
49
|
+
- lib/aml-kit/core/foundation/5.3.1/index.aml
|
50
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation.min.js
|
51
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.abide.js
|
52
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.accordion.js
|
53
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.alert.js
|
54
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.clearing.js
|
55
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.dropdown.js
|
56
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.equalizer.js
|
57
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.interchange.js
|
58
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.joyride.js
|
59
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.js
|
60
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.magellan.js
|
61
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.offcanvas.js
|
62
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.orbit.js
|
63
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.reveal.js
|
64
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.slider.js
|
65
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.tab.js
|
66
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.tooltip.js
|
67
|
+
- lib/aml-kit/core/foundation/5.3.1/js/foundation/foundation.topbar.js
|
68
|
+
- lib/aml-kit/core/foundation/5.3.1/js/vendor/fastclick.js
|
69
|
+
- lib/aml-kit/core/foundation/5.3.1/js/vendor/jquery.cookie.js
|
70
|
+
- lib/aml-kit/core/foundation/5.3.1/js/vendor/jquery.js
|
71
|
+
- lib/aml-kit/core/foundation/5.3.1/js/vendor/modernizr.js
|
72
|
+
- lib/aml-kit/core/foundation/5.3.1/js/vendor/placeholder.js
|
73
|
+
- lib/aml-kit/core/foundation/5.3.1/partial/footer.aml
|
74
|
+
- lib/aml-kit/core/foundation/5.3.1/partial/header.aml
|
75
|
+
- lib/aml.rb
|
22
76
|
- lib/aml/Argument.rb
|
23
77
|
- lib/aml/Build.rb
|
24
78
|
- lib/aml/Cluster.rb
|
25
79
|
- lib/aml/Compile.rb
|
26
|
-
- lib/aml/core/method.rb
|
27
|
-
- lib/aml/core/mixin.aml
|
28
80
|
- lib/aml/Definition.rb
|
29
81
|
- lib/aml/Line.rb
|
30
82
|
- lib/aml/Parse.rb
|
31
83
|
- lib/aml/Prepare.rb
|
32
|
-
- lib/aml.rb
|
84
|
+
- lib/aml/core/method.rb
|
85
|
+
- lib/aml/core/mixin.aml
|
33
86
|
homepage: https://abstractmarkup.com
|
34
87
|
licenses:
|
35
88
|
- MIT
|
@@ -50,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
50
103
|
version: '0'
|
51
104
|
requirements: []
|
52
105
|
rubyforge_project:
|
53
|
-
rubygems_version: 2.0
|
106
|
+
rubygems_version: 2.3.0
|
54
107
|
signing_key:
|
55
108
|
specification_version: 4
|
56
109
|
summary: Abstract Markup Language
|