ruhoh 2.1 → 2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/Gemfile +7 -2
  2. data/README.md +50 -7
  3. data/Rakefile +1 -9
  4. data/cucumber.yml +1 -0
  5. data/features/categories.feature +38 -0
  6. data/features/conversion.feature +35 -0
  7. data/features/data.feature +32 -0
  8. data/features/drafts.feature +21 -0
  9. data/features/javascripts.feature +42 -0
  10. data/features/layouts.feature +41 -0
  11. data/features/pagination.feature +55 -0
  12. data/features/partials.feature +13 -0
  13. data/features/permalinks.feature +118 -0
  14. data/features/step_defs.rb +70 -0
  15. data/features/stylesheets.feature +42 -0
  16. data/features/summary.feature +119 -0
  17. data/features/support/env.rb +8 -0
  18. data/features/support/helpers.rb +74 -0
  19. data/features/tags.feature +39 -0
  20. data/features/themes.feature +0 -0
  21. data/features/widgets/google_prettify.feature +12 -0
  22. data/features/widgets/syntax.feature +35 -0
  23. data/features/widgets/widgets.feature +83 -0
  24. data/history.json +23 -0
  25. data/lib/ruhoh/base/model.rb +29 -9
  26. data/lib/ruhoh/base/model_view.rb +64 -32
  27. data/lib/ruhoh/programs/watch.rb +1 -0
  28. data/lib/ruhoh/resources/pages/collection.rb +2 -1
  29. data/lib/ruhoh/resources/pages/collection_view.rb +9 -7
  30. data/lib/ruhoh/resources/pages/previewer.rb +11 -10
  31. data/lib/ruhoh/resources/widgets/collection_view.rb +2 -4
  32. data/lib/ruhoh/resources/widgets/compiler.rb +19 -3
  33. data/lib/ruhoh/version.rb +1 -1
  34. data/ruhoh.gemspec +4 -0
  35. data/system/plugins/sprockets/compiler.rb +38 -0
  36. data/system/plugins/sprockets/javascripts/compiler.rb +3 -24
  37. data/system/plugins/sprockets/javascripts/previewer.rb +4 -12
  38. data/system/plugins/sprockets/previewer.rb +17 -0
  39. data/system/plugins/sprockets/stylesheets/compiler.rb +2 -25
  40. data/system/plugins/sprockets/stylesheets/previewer.rb +3 -12
  41. data/system/widgets/analytics/google.html +14 -6
  42. data/system/widgets/google_prettify/default.html +1 -1
  43. data/system/widgets/syntax/javascripts/prettify.js +30 -0
  44. data/system/widgets/syntax/prettify.html +18 -0
  45. metadata +80 -5
  46. data/spec/spec_helper.rb +0 -29
  47. data/spec/support/shared_contexts.rb +0 -25
@@ -1,17 +1,9 @@
1
- require 'sprockets'
1
+ require File.join(File.dirname(__FILE__), '..', 'previewer.rb')
2
2
  module Ruhoh::Resources::Javascripts
3
3
  class Previewer
4
- extend Forwardable
5
-
6
- def_instance_delegator :@environment, :call
7
-
4
+ include Ruhoh::SprocketsPlugin::Previewer
8
5
  def initialize(ruhoh)
9
- environment = Sprockets::Environment.new
10
- collection = ruhoh.collection('javascripts')
11
- collection.paths.reverse.each do |path|
12
- environment.append_path(path)
13
- end
14
- @environment = environment
6
+ super(ruhoh.collection('javascripts'))
15
7
  end
16
8
  end
17
- end
9
+ end
@@ -0,0 +1,17 @@
1
+ require 'sprockets'
2
+ require 'forwardable'
3
+
4
+ module Ruhoh::SprocketsPlugin
5
+ module Previewer
6
+ extend Forwardable
7
+ def_instance_delegator :@environment, :call
8
+
9
+ def initialize(collection)
10
+ environment = Sprockets::Environment.new
11
+ collection.paths.reverse.each do |path|
12
+ environment.append_path(path)
13
+ end
14
+ @environment = environment
15
+ end
16
+ end
17
+ end
@@ -1,26 +1,3 @@
1
- require 'sprockets'
2
- module Ruhoh::Resources::Stylesheets
3
- class Compiler
4
- include Ruhoh::Base::Compilable
5
-
6
- def run
7
- Ruhoh::Friend.say { cyan "Stylesheets: (using sprockets)" }
8
- env = Sprockets::Environment.new
9
- env.logger = Logger.new(STDOUT)
10
- @collection.paths.reverse.each do |h|
11
- env.append_path(File.join(h["path"], @collection.resource_name))
12
- end
13
-
14
- compiled_path = Ruhoh::Utils.url_to_path(@collection.url_endpoint, @ruhoh.paths.compiled)
15
- FileUtils.mkdir_p compiled_path
16
-
17
- manifest = Sprockets::Manifest.new(env, compiled_path)
18
- assets = @collection.files.values.map{ |p| p["id"] }
19
- puts assets.inspect
20
- manifest.compile(assets)
21
-
22
- # Update the stylesheet paths to the digest format:
23
- @collection._cache.merge!(manifest.assets)
24
- end
25
- end
1
+ class Ruhoh::Resources::Stylesheets::Compiler
2
+ include Ruhoh::SprocketsPlugin::Compiler
26
3
  end
@@ -1,17 +1,8 @@
1
- require 'sprockets'
2
1
  module Ruhoh::Resources::Stylesheets
3
2
  class Previewer
4
- extend Forwardable
5
-
6
- def_instance_delegator :@environment, :call
7
-
3
+ include Ruhoh::SprocketsPlugin::Previewer
8
4
  def initialize(ruhoh)
9
- environment = Sprockets::Environment.new
10
- collection = ruhoh.collection('stylesheets')
11
- collection.paths.reverse.each do |path|
12
- environment.append_path(path)
13
- end
14
- @environment = environment
5
+ super(ruhoh.collection('stylesheets'))
15
6
  end
16
7
  end
17
- end
8
+ end
@@ -2,9 +2,17 @@
2
2
  tracking_id : 'UA-123-12'
3
3
  ---
4
4
 
5
- <script>
6
- var _gaq=[['_setAccount','{{ this_config.tracking_id }}'],['_trackPageview']];
7
- (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
8
- g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
9
- s.parentNode.insertBefore(g,s)}(document,'script'));
10
- </script>
5
+ <script type="text/javascript">
6
+
7
+ var _gaq = _gaq || [];
8
+ _gaq.push(['_setAccount', '{{ this_config.tracking_id }}']);
9
+ _gaq.push(['_trackPageview']);
10
+
11
+ (function() {
12
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
13
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
14
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
15
+ })();
16
+
17
+ </script>
18
+
@@ -11,4 +11,4 @@ linenums : true
11
11
  }
12
12
  prettyPrint();
13
13
  </script>
14
- <!-- end Google Prettify -->
14
+ <!-- end Google Prettify -->
@@ -0,0 +1,30 @@
1
+ !function(){var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2
+ (function(){function S(a){function d(e){var b=e.charCodeAt(0);if(b!==92)return b;var a=e.charAt(1);return(b=r[a])?b:"0"<=a&&a<="7"?parseInt(e.substring(1),8):a==="u"||a==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function g(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);return e==="\\"||e==="-"||e==="]"||e==="^"?"\\"+e:e}function b(e){var b=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],a=
3
+ b[0]==="^",c=["["];a&&c.push("^");for(var a=a?1:0,f=b.length;a<f;++a){var h=b[a];if(/\\[bdsw]/i.test(h))c.push(h);else{var h=d(h),l;a+2<f&&"-"===b[a+1]?(l=d(b[a+2]),a+=2):l=h;e.push([h,l]);l<65||h>122||(l<65||h>90||e.push([Math.max(65,h)|32,Math.min(l,90)|32]),l<97||h>122||e.push([Math.max(97,h)&-33,Math.min(l,122)&-33]))}}e.sort(function(e,a){return e[0]-a[0]||a[1]-e[1]});b=[];f=[];for(a=0;a<e.length;++a)h=e[a],h[0]<=f[1]+1?f[1]=Math.max(f[1],h[1]):b.push(f=h);for(a=0;a<b.length;++a)h=b[a],c.push(g(h[0])),
4
+ h[1]>h[0]&&(h[1]+1>h[0]&&c.push("-"),c.push(g(h[1])));c.push("]");return c.join("")}function s(e){for(var a=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),c=a.length,d=[],f=0,h=0;f<c;++f){var l=a[f];l==="("?++h:"\\"===l.charAt(0)&&(l=+l.substring(1))&&(l<=h?d[l]=-1:a[f]=g(l))}for(f=1;f<d.length;++f)-1===d[f]&&(d[f]=++x);for(h=f=0;f<c;++f)l=a[f],l==="("?(++h,d[h]||(a[f]="(?:")):"\\"===l.charAt(0)&&(l=+l.substring(1))&&l<=h&&
5
+ (a[f]="\\"+d[l]);for(f=0;f<c;++f)"^"===a[f]&&"^"!==a[f+1]&&(a[f]="");if(e.ignoreCase&&m)for(f=0;f<c;++f)l=a[f],e=l.charAt(0),l.length>=2&&e==="["?a[f]=b(l):e!=="\\"&&(a[f]=l.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return a.join("")}for(var x=0,m=!1,j=!1,k=0,c=a.length;k<c;++k){var i=a[k];if(i.ignoreCase)j=!0;else if(/[a-z]/i.test(i.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){m=!0;j=!1;break}}for(var r={b:8,t:9,n:10,v:11,
6
+ f:12,r:13},n=[],k=0,c=a.length;k<c;++k){i=a[k];if(i.global||i.multiline)throw Error(""+i);n.push("(?:"+s(i)+")")}return RegExp(n.join("|"),j?"gi":"g")}function T(a,d){function g(a){var c=a.nodeType;if(c==1){if(!b.test(a.className)){for(c=a.firstChild;c;c=c.nextSibling)g(c);c=a.nodeName.toLowerCase();if("br"===c||"li"===c)s[j]="\n",m[j<<1]=x++,m[j++<<1|1]=a}}else if(c==3||c==4)c=a.nodeValue,c.length&&(c=d?c.replace(/\r\n?/g,"\n"):c.replace(/[\t\n\r ]+/g," "),s[j]=c,m[j<<1]=x,x+=c.length,m[j++<<1|1]=
7
+ a)}var b=/(?:^|\s)nocode(?:\s|$)/,s=[],x=0,m=[],j=0;g(a);return{a:s.join("").replace(/\n$/,""),d:m}}function H(a,d,g,b){d&&(a={a:d,e:a},g(a),b.push.apply(b,a.g))}function U(a){for(var d=void 0,g=a.firstChild;g;g=g.nextSibling)var b=g.nodeType,d=b===1?d?a:g:b===3?V.test(g.nodeValue)?a:d:d;return d===a?void 0:d}function C(a,d){function g(a){for(var j=a.e,k=[j,"pln"],c=0,i=a.a.match(s)||[],r={},n=0,e=i.length;n<e;++n){var z=i[n],w=r[z],t=void 0,f;if(typeof w==="string")f=!1;else{var h=b[z.charAt(0)];
8
+ if(h)t=z.match(h[1]),w=h[0];else{for(f=0;f<x;++f)if(h=d[f],t=z.match(h[1])){w=h[0];break}t||(w="pln")}if((f=w.length>=5&&"lang-"===w.substring(0,5))&&!(t&&typeof t[1]==="string"))f=!1,w="src";f||(r[z]=w)}h=c;c+=z.length;if(f){f=t[1];var l=z.indexOf(f),B=l+f.length;t[2]&&(B=z.length-t[2].length,l=B-f.length);w=w.substring(5);H(j+h,z.substring(0,l),g,k);H(j+h+l,f,I(w,f),k);H(j+h+B,z.substring(B),g,k)}else k.push(j+h,w)}a.g=k}var b={},s;(function(){for(var g=a.concat(d),j=[],k={},c=0,i=g.length;c<i;++c){var r=
9
+ g[c],n=r[3];if(n)for(var e=n.length;--e>=0;)b[n.charAt(e)]=r;r=r[1];n=""+r;k.hasOwnProperty(n)||(j.push(r),k[n]=q)}j.push(/[\S\s]/);s=S(j)})();var x=d.length;return g}function v(a){var d=[],g=[];a.tripleQuotedStrings?d.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?d.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10
+ q,"'\"`"]):d.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&g.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var b=a.hashComments;b&&(a.cStyleComments?(b>1?d.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):d.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),g.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,q])):d.push(["com",
11
+ /^#[^\n\r]*/,q,"#"]));a.cStyleComments&&(g.push(["com",/^\/\/[^\n\r]*/,q]),g.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));if(b=a.regexLiterals){var s=(b=b>1?"":"\n\r")?".":"[\\S\\s]";g.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+("/(?=[^/*"+b+"])(?:[^/\\x5B\\x5C"+b+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+b+"]|\\x5C"+
12
+ s+")*(?:\\x5D|$))+/")+")")])}(b=a.types)&&g.push(["typ",b]);b=(""+a.keywords).replace(/^ | $/g,"");b.length&&g.push(["kwd",RegExp("^(?:"+b.replace(/[\s,]+/g,"|")+")\\b"),q]);d.push(["pln",/^\s+/,q," \r\n\t\u00a0"]);b="^.[^\\s\\w.$@'\"`/\\\\]*";a.regexLiterals&&(b+="(?!s*/)");g.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,
13
+ q],["pun",RegExp(b),q]);return C(d,g)}function J(a,d,g){function b(a){var c=a.nodeType;if(c==1&&!x.test(a.className))if("br"===a.nodeName)s(a),a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)b(a);else if((c==3||c==4)&&g){var d=a.nodeValue,i=d.match(m);if(i)c=d.substring(0,i.index),a.nodeValue=c,(d=d.substring(i.index+i[0].length))&&a.parentNode.insertBefore(j.createTextNode(d),a.nextSibling),s(a),c||a.parentNode.removeChild(a)}}function s(a){function b(a,c){var d=
14
+ c?a.cloneNode(!1):a,e=a.parentNode;if(e){var e=b(e,1),g=a.nextSibling;e.appendChild(d);for(var i=g;i;i=g)g=i.nextSibling,e.appendChild(i)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),d;(d=a.parentNode)&&d.nodeType===1;)a=d;c.push(a)}for(var x=/(?:^|\s)nocode(?:\s|$)/,m=/\r\n?|\n/,j=a.ownerDocument,k=j.createElement("li");a.firstChild;)k.appendChild(a.firstChild);for(var c=[k],i=0;i<c.length;++i)b(c[i]);d===(d|0)&&c[0].setAttribute("value",d);var r=j.createElement("ol");
15
+ r.className="linenums";for(var d=Math.max(0,d-1|0)||0,i=0,n=c.length;i<n;++i)k=c[i],k.className="L"+(i+d)%10,k.firstChild||k.appendChild(j.createTextNode("\u00a0")),r.appendChild(k);a.appendChild(r)}function p(a,d){for(var g=d.length;--g>=0;){var b=d[g];F.hasOwnProperty(b)?D.console&&console.warn("cannot override language handler %s",b):F[b]=a}}function I(a,d){if(!a||!F.hasOwnProperty(a))a=/^\s*</.test(d)?"default-markup":"default-code";return F[a]}function K(a){var d=a.h;try{var g=T(a.c,a.i),b=g.a;
16
+ a.a=b;a.d=g.d;a.e=0;I(d,b)(a);var s=/\bMSIE\s(\d+)/.exec(navigator.userAgent),s=s&&+s[1]<=8,d=/\n/g,x=a.a,m=x.length,g=0,j=a.d,k=j.length,b=0,c=a.g,i=c.length,r=0;c[i]=m;var n,e;for(e=n=0;e<i;)c[e]!==c[e+2]?(c[n++]=c[e++],c[n++]=c[e++]):e+=2;i=n;for(e=n=0;e<i;){for(var p=c[e],w=c[e+1],t=e+2;t+2<=i&&c[t+1]===w;)t+=2;c[n++]=p;c[n++]=w;e=t}c.length=n;var f=a.c,h;if(f)h=f.style.display,f.style.display="none";try{for(;b<k;){var l=j[b+2]||m,B=c[r+2]||m,t=Math.min(l,B),A=j[b+1],G;if(A.nodeType!==1&&(G=x.substring(g,
17
+ t))){s&&(G=G.replace(d,"\r"));A.nodeValue=G;var L=A.ownerDocument,o=L.createElement("span");o.className=c[r+1];var v=A.parentNode;v.replaceChild(o,A);o.appendChild(A);g<l&&(j[b+1]=A=L.createTextNode(x.substring(t,l)),v.insertBefore(A,o.nextSibling))}g=t;g>=l&&(b+=2);g>=B&&(r+=2)}}finally{if(f)f.style.display=h}}catch(u){D.console&&console.log(u&&u.stack||u)}}var D=window,y=["break,continue,do,else,for,if,return,while"],E=[[y,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18
+ "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],M=[E,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],N=[E,"abstract,assert,boolean,byte,extends,final,finally,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],
19
+ O=[N,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],E=[E,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],P=[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"],
20
+ Q=[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"],W=[y,"as,assert,const,copy,drop,enum,extern,fail,false,fn,impl,let,log,loop,match,mod,move,mut,priv,pub,pure,ref,self,static,struct,true,trait,type,unsafe,use"],y=[y,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,
21
+ V=/\S/,X=v({keywords:[M,O,E,"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",P,Q,y],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),F={};p(X,["default-code"]);p(C([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",
22
+ /^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);p(C([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],
23
+ ["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);p(C([],[["atv",/^[\S\s]+/]]),["uq.val"]);p(v({keywords:M,hashComments:!0,cStyleComments:!0,types:R}),["c","cc","cpp","cxx","cyc","m"]);p(v({keywords:"null,true,false"}),["json"]);p(v({keywords:O,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:R}),
24
+ ["cs"]);p(v({keywords:N,cStyleComments:!0}),["java"]);p(v({keywords:y,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]);p(v({keywords:P,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]);p(v({keywords:"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",hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]);p(v({keywords:Q,
25
+ hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]);p(v({keywords:E,cStyleComments:!0,regexLiterals:!0}),["javascript","js"]);p(v({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);p(v({keywords:W,cStyleComments:!0,multilineStrings:!0}),["rc","rs","rust"]);
26
+ p(C([],[["str",/^[\S\s]+/]]),["regex"]);var Y=D.PR={createSimpleLexer:C,registerLangHandler:p,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:D.prettyPrintOne=function(a,d,g){var b=document.createElement("div");b.innerHTML="<pre>"+a+"</pre>";b=b.firstChild;g&&J(b,g,!0);K({h:d,j:g,c:b,i:1});
27
+ return b.innerHTML},prettyPrint:D.prettyPrint=function(a,d){function g(){for(var b=D.PR_SHOULD_USE_CONTINUATION?c.now()+250:Infinity;i<p.length&&c.now()<b;i++){for(var d=p[i],j=h,k=d;k=k.previousSibling;){var m=k.nodeType,o=(m===7||m===8)&&k.nodeValue;if(o?!/^\??prettify\b/.test(o):m!==3||/\S/.test(k.nodeValue))break;if(o){j={};o.replace(/\b(\w+)=([\w%+\-.:]+)/g,function(a,b,c){j[b]=c});break}}k=d.className;if((j!==h||e.test(k))&&!v.test(k)){m=!1;for(o=d.parentNode;o;o=o.parentNode)if(f.test(o.tagName)&&
28
+ o.className&&e.test(o.className)){m=!0;break}if(!m){d.className+=" prettyprinted";m=j.lang;if(!m){var m=k.match(n),y;if(!m&&(y=U(d))&&t.test(y.tagName))m=y.className.match(n);m&&(m=m[1])}if(w.test(d.tagName))o=1;else var o=d.currentStyle,u=s.defaultView,o=(o=o?o.whiteSpace:u&&u.getComputedStyle?u.getComputedStyle(d,q).getPropertyValue("white-space"):0)&&"pre"===o.substring(0,3);u=j.linenums;if(!(u=u==="true"||+u))u=(u=k.match(/\blinenums\b(?::(\d+))?/))?u[1]&&u[1].length?+u[1]:!0:!1;u&&J(d,u,o);r=
29
+ {h:m,c:d,j:u,i:o};K(r)}}}i<p.length?setTimeout(g,250):"function"===typeof a&&a()}for(var b=d||document.body,s=b.ownerDocument||document,b=[b.getElementsByTagName("pre"),b.getElementsByTagName("code"),b.getElementsByTagName("xmp")],p=[],m=0;m<b.length;++m)for(var j=0,k=b[m].length;j<k;++j)p.push(b[m][j]);var b=q,c=Date;c.now||(c={now:function(){return+new Date}});var i=0,r,n=/\blang(?:uage)?-([\w.]+)(?!\S)/,e=/\bprettyprint\b/,v=/\bprettyprinted\b/,w=/pre|xmp/i,t=/^code$/i,f=/^(?:pre|code|xmp)$/i,
30
+ h={};g()}};typeof define==="function"&&define.amd&&define("google-code-prettify",[],function(){return Y})})();}()
@@ -0,0 +1,18 @@
1
+ ---
2
+ linenums : true
3
+ cdn:
4
+ enable: false
5
+ path: "http://cdnjs.cloudflare.com/ajax/libs/prettify/188.0.0/prettify.js"
6
+ ---
7
+
8
+ <!-- Google Prettify -->
9
+ {{# this_config.cdn.enable }}enabled:<script src="{{ this_config.cdn.path }}"></script>{{/ this_config.cdn.enable }}
10
+ {{^ this_config.cdn.enable }}<script src="{{this_path}}/javascripts/prettify.js"></script>{{/ this_config.cdn.enable }}
11
+ <script>
12
+ var pres = document.getElementsByTagName("pre");
13
+ for (var i=0; i < pres.length; ++i) {
14
+ pres[i].className = "prettyprint {{# this_config.linenums }}linenums{{/this_config.linenums}}";
15
+ }
16
+ prettyPrint();
17
+ </script>
18
+ <!-- end Google Prettify -->
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruhoh
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.1'
4
+ version: '2.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-19 00:00:00.000000000 Z
12
+ date: 2013-06-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -91,6 +91,54 @@ dependencies:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
93
  version: '1.5'
94
+ - !ruby/object:Gem::Dependency
95
+ name: cucumber
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: capybara
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: rspec-expectations
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
94
142
  description: Ruhoh is a Universal API for your static blog.
95
143
  email: plusjade@gmail.com
96
144
  executables:
@@ -102,6 +150,26 @@ files:
102
150
  - README.md
103
151
  - Rakefile
104
152
  - bin/ruhoh
153
+ - cucumber.yml
154
+ - features/categories.feature
155
+ - features/conversion.feature
156
+ - features/data.feature
157
+ - features/drafts.feature
158
+ - features/javascripts.feature
159
+ - features/layouts.feature
160
+ - features/pagination.feature
161
+ - features/partials.feature
162
+ - features/permalinks.feature
163
+ - features/step_defs.rb
164
+ - features/stylesheets.feature
165
+ - features/summary.feature
166
+ - features/support/env.rb
167
+ - features/support/helpers.rb
168
+ - features/tags.feature
169
+ - features/themes.feature
170
+ - features/widgets/google_prettify.feature
171
+ - features/widgets/syntax.feature
172
+ - features/widgets/widgets.feature
105
173
  - history.json
106
174
  - lib/ruhoh.rb
107
175
  - lib/ruhoh/base/collection.rb
@@ -159,8 +227,6 @@ files:
159
227
  - lib/ruhoh/views/master_view.rb
160
228
  - lib/ruhoh/views/rmustache.rb
161
229
  - ruhoh.gemspec
162
- - spec/spec_helper.rb
163
- - spec/support/shared_contexts.rb
164
230
  - system/_scaffold.html
165
231
  - system/dash/index.html
166
232
  - system/layouts/_scaffold.html
@@ -171,8 +237,10 @@ files:
171
237
  - system/partials/posts_list.html
172
238
  - system/partials/posts_summary.html
173
239
  - system/partials/tags_list.html
240
+ - system/plugins/sprockets/compiler.rb
174
241
  - system/plugins/sprockets/javascripts/compiler.rb
175
242
  - system/plugins/sprockets/javascripts/previewer.rb
243
+ - system/plugins/sprockets/previewer.rb
176
244
  - system/plugins/sprockets/stylesheets/compiler.rb
177
245
  - system/plugins/sprockets/stylesheets/previewer.rb
178
246
  - system/widgets/analytics/getclicky.html
@@ -182,6 +250,8 @@ files:
182
250
  - system/widgets/comments/intensedebate.html
183
251
  - system/widgets/comments/livefyre.html
184
252
  - system/widgets/google_prettify/default.html
253
+ - system/widgets/syntax/javascripts/prettify.js
254
+ - system/widgets/syntax/prettify.html
185
255
  homepage: http://github.com/ruhoh/ruhoh.rb
186
256
  licenses:
187
257
  - http://www.opensource.org/licenses/MIT
@@ -195,12 +265,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
265
  - - ! '>='
196
266
  - !ruby/object:Gem::Version
197
267
  version: '0'
268
+ segments:
269
+ - 0
270
+ hash: 3919672923865862161
198
271
  required_rubygems_version: !ruby/object:Gem::Requirement
199
272
  none: false
200
273
  requirements:
201
274
  - - ! '>='
202
275
  - !ruby/object:Gem::Version
203
276
  version: '0'
277
+ segments:
278
+ - 0
279
+ hash: 3919672923865862161
204
280
  requirements: []
205
281
  rubyforge_project:
206
282
  rubygems_version: 1.8.24
@@ -208,4 +284,3 @@ signing_key:
208
284
  specification_version: 3
209
285
  summary: Ruby based library to process your Ruhoh static blog.
210
286
  test_files: []
211
- has_rdoc:
data/spec/spec_helper.rb DELETED
@@ -1,29 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
-
11
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
12
- $LOAD_PATH.unshift(File.dirname(__FILE__))
13
- require 'ruhoh'
14
-
15
- Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each {|f| require f}
16
-
17
- # Full path to mock blog directory
18
- SampleSitePath = File.expand_path(File.join(File.dirname(__FILE__), '..', '__tmp'))
19
-
20
- RSpec.configure do |config|
21
- config.before(:each){
22
- FileUtils.remove_dir(SampleSitePath,1) if Dir.exists? SampleSitePath
23
- }
24
- config.after(:each) do
25
- # Reset all configuration variables after each test.
26
- #Ruhoh.reset
27
- FileUtils.remove_dir(SampleSitePath,1) if Dir.exists? SampleSitePath
28
- end
29
- end
@@ -1,25 +0,0 @@
1
- shared_context 'write_default_theme' do
2
- before(:each) do
3
- Dir.mkdir SampleSitePath
4
- theme = "twitter"
5
- # Create base config.yml + base theme
6
- File.open(File.join(SampleSitePath, "config.yml"), "w+") { |file|
7
- file.puts <<-TEXT
8
- ---
9
- theme: '#{theme}'
10
- ---
11
- TEXT
12
- }
13
- theme_dir = File.join(SampleSitePath, theme)
14
- FileUtils.makedirs theme_dir
15
- end
16
- end
17
-
18
- shared_context 'default_setup' do
19
- before(:each) do
20
- @ruhoh = Ruhoh.new
21
- @ruhoh.setup(:source => SampleSitePath)
22
- @ruhoh.setup_paths
23
- @ruhoh.setup_urls
24
- end
25
- end