wunderbar 0.19.2 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/wunderbar/angularjs.rb +13 -0
- data/lib/wunderbar/bootstrap/theme.rb +5 -0
- data/lib/wunderbar/bootstrap.rb +7 -0
- data/lib/wunderbar/cssproxy.rb +14 -2
- data/lib/wunderbar/script.rb +9 -1
- data/lib/wunderbar/sinatra.rb +6 -0
- data/lib/wunderbar/vendor/angular-resource.min.js +9 -8
- data/lib/wunderbar/vendor/angular-route.min.js +10 -10
- data/lib/wunderbar/vendor/angular.min.js +197 -196
- data/lib/wunderbar/vendor/bootstrap-theme.min.css +7 -0
- data/lib/wunderbar/vendor/bootstrap.min.css +7 -0
- data/lib/wunderbar/vendor/bootstrap.min.js +7 -0
- data/lib/wunderbar/version.rb +2 -2
- data/wunderbar.gemspec +3 -3
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2M4ZjRjOWU4YmY0NjlmYzU2MzA3ZmFhYzczNWEzNmU0MmY2MmY4YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzQyNzI2MWNmMzJjYTFiZDE5MWFkYWYxOWY2ODI3NGFlZjc0MTYwZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjFkYzZmOWRlZGE0ZTIxYzM1ZDgxNjFhZWRkOTEwMTBjNTNlYzNhYjQ5ZjQ0
|
10
|
+
NGI0NGIyMmQzODUxODUwNjY2NjExYjM0NjE5NTc2MWQ4NTY3MDY5YTViYmVh
|
11
|
+
NjFkYTVkMGQwM2MzODJlNjgxYjQwODU3ZDkwYjU0Nzc1ZDYzNDM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTBjZWZhY2U5M2VhZDQ0ODM2N2Y1ZGVjZDUyMzQ0ZTgyYWJmYzI5ZTNiZjI2
|
14
|
+
ODI1MTRjMDVmMTI3MWNmYmQ2ZTQ3MjRmMzRhNDUzOTIyZTJlMzFhNGIzZWQ1
|
15
|
+
Y2UyMDg5OTI0ZTFmY2E3M2I4ZTdhMDMzYWRjYWU1ODMwYTFiNjE=
|
data/lib/wunderbar/angularjs.rb
CHANGED
@@ -4,3 +4,16 @@ require 'ruby2js/filter/angularrb'
|
|
4
4
|
source = File.expand_path('../vendor/angular.min.js', __FILE__)
|
5
5
|
|
6
6
|
Wunderbar::Asset.script :name => 'angular-min.js', :file => source
|
7
|
+
|
8
|
+
module Wunderbar
|
9
|
+
class HtmlMarkup
|
10
|
+
def _ng_template(attrs={}, &block)
|
11
|
+
if attrs.empty? and not block
|
12
|
+
proxiable_tag! :ng_template
|
13
|
+
else
|
14
|
+
attrs[:type] ||= 'text/ng-template'
|
15
|
+
tag! :script, attrs, &block
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
require 'wunderbar/jquery'
|
2
|
+
|
3
|
+
source = File.expand_path('../vendor/bootstrap.min.js', __FILE__)
|
4
|
+
Wunderbar::Asset.script name: 'bootstrap-min.js', file: source
|
5
|
+
|
6
|
+
source = File.expand_path('../vendor/bootstrap.min.css', __FILE__)
|
7
|
+
Wunderbar::Asset.css name: 'bootstrap-min.css', file: source
|
data/lib/wunderbar/cssproxy.rb
CHANGED
@@ -30,13 +30,25 @@ module Wunderbar
|
|
30
30
|
attrs[:class] = id_or_class
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
if args.last.respond_to? :to_hash
|
34
|
+
hash = args.pop.to_hash
|
35
|
+
if attrs[:class] and hash[:class]
|
36
|
+
hash[:class] = "#{attrs[:class]} #{hash[:class]}"
|
37
|
+
end
|
38
|
+
attrs.merge! hash
|
39
|
+
end
|
34
40
|
args.push(attrs)
|
35
41
|
|
36
42
|
@node.parent.children.delete(@node)
|
37
43
|
|
38
44
|
if empty and not block
|
39
|
-
@builder.proxiable_tag! @node.name, *args
|
45
|
+
proxy = @builder.proxiable_tag! @node.name, *args
|
46
|
+
if SpacedNode === @node
|
47
|
+
class << proxy.node?; include SpacedNode; end
|
48
|
+
elsif CompactNode === @node
|
49
|
+
class << proxy.node?; include CompactNode; end
|
50
|
+
end
|
51
|
+
proxy
|
40
52
|
elsif SpacedNode === @node
|
41
53
|
@builder.__send__ "_#{@node.name}_", *args, &block
|
42
54
|
elsif CompactNode === @node and @node.name != :pre
|
data/lib/wunderbar/script.rb
CHANGED
@@ -64,6 +64,10 @@ module Wunderbar
|
|
64
64
|
rescue ::Exception => exception
|
65
65
|
headers['status'] = "500 Internal Server Error"
|
66
66
|
output = "// Internal Server Error\n#{exception}\n"
|
67
|
+
exception.backtrace.each do |frame|
|
68
|
+
next if CALLERS_TO_IGNORE.any? {|re| frame =~ re}
|
69
|
+
output += " #{frame}\n"
|
70
|
+
end
|
67
71
|
end
|
68
72
|
|
69
73
|
out?(scope, headers) { output }
|
@@ -86,7 +90,11 @@ module Wunderbar
|
|
86
90
|
"\n#{exception}\n"
|
87
91
|
rescue Exception => exception
|
88
92
|
scope.response.status = 500
|
89
|
-
"// Internal Server Error\n#{exception}\n"
|
93
|
+
output = "// Internal Server Error\n#{exception}\n"
|
94
|
+
exception.backtrace.each do |frame|
|
95
|
+
next if CALLERS_TO_IGNORE.any? {|re| frame =~ re}
|
96
|
+
output += " #{frame}\n"
|
97
|
+
end
|
90
98
|
end
|
91
99
|
end
|
92
100
|
end
|
data/lib/wunderbar/sinatra.rb
CHANGED
@@ -184,6 +184,12 @@ module Wunderbar
|
|
184
184
|
end
|
185
185
|
|
186
186
|
SinatraHelpers.send :define_method, language.ext do |*args, &block|
|
187
|
+
# parse json
|
188
|
+
if env['CONTENT_TYPE'] =~ /^\w+\/json/
|
189
|
+
json = JSON.parse(env['rack.input'].read)
|
190
|
+
@params.merge! json if Hash === json
|
191
|
+
end
|
192
|
+
|
187
193
|
Wunderbar::Template.locals(self, args)
|
188
194
|
if Hash === args.last and args.last[:locals]
|
189
195
|
@params.each do |name, value|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
3
|
-
(c) 2010-
|
2
|
+
AngularJS v1.2.6
|
3
|
+
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(H,
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
c,
|
6
|
+
(function(H,a,A){'use strict';function D(p,g){g=g||{};a.forEach(g,function(a,c){delete g[c]});for(var c in p)p.hasOwnProperty(c)&&("$"!==c.charAt(0)&&"$"!==c.charAt(1))&&(g[c]=p[c]);return g}var v=a.$$minErr("$resource"),C=/^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/;a.module("ngResource",["ng"]).factory("$resource",["$http","$q",function(p,g){function c(a,c){this.template=a;this.defaults=c||{};this.urlParams={}}function t(n,w,l){function r(h,d){var e={};d=x({},w,d);s(d,function(b,d){u(b)&&(b=b());var k;if(b&&
|
7
|
+
b.charAt&&"@"==b.charAt(0)){k=h;var a=b.substr(1);if(null==a||""===a||"hasOwnProperty"===a||!C.test("."+a))throw v("badmember",a);for(var a=a.split("."),f=0,c=a.length;f<c&&k!==A;f++){var g=a[f];k=null!==k?k[g]:A}}else k=b;e[d]=k});return e}function e(a){return a.resource}function f(a){D(a||{},this)}var F=new c(n);l=x({},B,l);s(l,function(h,d){var c=/^(POST|PUT|PATCH)$/i.test(h.method);f[d]=function(b,d,k,w){var q={},n,l,y;switch(arguments.length){case 4:y=w,l=k;case 3:case 2:if(u(d)){if(u(b)){l=
|
8
|
+
b;y=d;break}l=d;y=k}else{q=b;n=d;l=k;break}case 1:u(b)?l=b:c?n=b:q=b;break;case 0:break;default:throw v("badargs",arguments.length);}var t=this instanceof f,m=t?n:h.isArray?[]:new f(n),z={},B=h.interceptor&&h.interceptor.response||e,C=h.interceptor&&h.interceptor.responseError||A;s(h,function(a,b){"params"!=b&&("isArray"!=b&&"interceptor"!=b)&&(z[b]=G(a))});c&&(z.data=n);F.setUrlParams(z,x({},r(n,h.params||{}),q),h.url);q=p(z).then(function(b){var d=b.data,k=m.$promise;if(d){if(a.isArray(d)!==!!h.isArray)throw v("badcfg",
|
9
|
+
h.isArray?"array":"object",a.isArray(d)?"array":"object");h.isArray?(m.length=0,s(d,function(b){m.push(new f(b))})):(D(d,m),m.$promise=k)}m.$resolved=!0;b.resource=m;return b},function(b){m.$resolved=!0;(y||E)(b);return g.reject(b)});q=q.then(function(b){var a=B(b);(l||E)(a,b.headers);return a},C);return t?q:(m.$promise=q,m.$resolved=!1,m)};f.prototype["$"+d]=function(b,a,k){u(b)&&(k=a,a=b,b={});b=f[d].call(this,b,this,a,k);return b.$promise||b}});f.bind=function(a){return t(n,x({},w,a),l)};return f}
|
10
|
+
var B={get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}},E=a.noop,s=a.forEach,x=a.extend,G=a.copy,u=a.isFunction;c.prototype={setUrlParams:function(c,g,l){var r=this,e=l||r.template,f,p,h=r.urlParams={};s(e.split(/\W/),function(a){if("hasOwnProperty"===a)throw v("badname");!/^\d+$/.test(a)&&(a&&RegExp("(^|[^\\\\]):"+a+"(\\W|$)").test(e))&&(h[a]=!0)});e=e.replace(/\\:/g,":");g=g||{};s(r.urlParams,function(d,c){f=g.hasOwnProperty(c)?
|
11
|
+
g[c]:r.defaults[c];a.isDefined(f)&&null!==f?(p=encodeURIComponent(f).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),e=e.replace(RegExp(":"+c+"(\\W|$)","g"),p+"$1")):e=e.replace(RegExp("(/?):"+c+"(\\W|$)","g"),function(a,c,d){return"/"==d.charAt(0)?d:c+d})});e=e.replace(/\/+$/,"");e=e.replace(/\/\.(?=\w+($|\?))/,".");c.url=e.replace(/\/\\\./,"/.");s(g,function(a,e){r.urlParams[e]||
|
12
|
+
(c.params=c.params||{},c.params[e]=a)})}};return t}])})(window,window.angular);
|
12
13
|
//# sourceMappingURL=angular-resource.min.js.map
|
@@ -1,14 +1,14 @@
|
|
1
1
|
/*
|
2
|
-
AngularJS v1.2.
|
3
|
-
(c) 2010-
|
2
|
+
AngularJS v1.2.6
|
3
|
+
(c) 2010-2014 Google, Inc. http://angularjs.org
|
4
4
|
License: MIT
|
5
5
|
*/
|
6
|
-
(function(
|
7
|
-
f);
|
8
|
-
"\\$1").replace(/(\/)?:(\w+)([\?|\*])?/g,function(a,
|
9
|
-
a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"$animate"]})(window,window.angular);
|
6
|
+
(function(h,e,A){'use strict';function u(w,q,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,n){function y(){l&&(l.$destroy(),l=null);g&&(k.leave(g),g=null)}function v(){var b=w.current&&w.current.locals;if(b&&b.$template){var b=a.$new(),f=w.current;g=n(b,function(d){k.enter(d,null,g||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||q()});y()});l=f.scope=b;l.$emit("$viewContentLoaded");l.$eval(h)}else y()}var l,g,t=b.autoscroll,h=b.onload||"";a.$on("$routeChangeSuccess",
|
7
|
+
v);v()}}}function z(e,h,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var n=e(c.contents());b.controller&&(f.$scope=a,f=h(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));n(a)}}}h=e.module("ngRoute",["ng"]).provider("$route",function(){function h(a,c){return e.extend(new (e.extend(function(){},{prototype:a})),c)}function q(a,e){var b=e.caseInsensitiveMatch,
|
8
|
+
f={originalPath:a,regexp:a},h=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?|\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;h.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&q(a,c));if(a){var b="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";k[b]=e.extend({redirectTo:a},
|
9
|
+
q(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,n,q,v,l){function g(){var d=t(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!x)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)x=!1,a.$broadcast("$routeChangeStart",d,m),(r.current=d)&&d.redirectTo&&(e.isString(d.redirectTo)?
|
10
|
+
c.path(u(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?n.get(d):n.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=l.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl=b,c=q.get(b,{cache:v}).then(function(a){return a.data})));
|
11
|
+
e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function t(){var a,b;e.forEach(k,function(f,k){var p;if(p=!b){var s=c.path();p=f.keys;var l={};if(f.regexp)if(s=f.regexp.exec(s)){for(var g=1,q=s.length;g<q;++g){var n=p[g-1],r="string"==typeof s[g]?decodeURIComponent(s[g]):s[g];n&&r&&(l[n.name]=r)}p=l}else p=null;else p=null;
|
12
|
+
p=a=p}p&&(b=h(f,{params:e.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||k[null]&&h(k[null],{params:{},pathParams:{}})}function u(a,c){var b=[];e.forEach((a||"").split(":"),function(a,d){if(0===d)b.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];b.push(c[f]);b.push(e[2]||"");delete c[f]}});return b.join("")}var x=!1,r={routes:k,reload:function(){x=!0;a.$evalAsync(g)}};a.$on("$locationChangeSuccess",g);return r}]});h.provider("$routeParams",function(){this.$get=function(){return{}}});
|
13
|
+
h.directive("ngView",u);h.directive("ngView",z);u.$inject=["$route","$anchorScroll","$animate"];z.$inject=["$compile","$controller","$route"]})(window,window.angular);
|
14
14
|
//# sourceMappingURL=angular-route.min.js.map
|