appetizer-ui 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- // Underscore.js 1.2.3
2
- // (c) 2009-2011 Jeremy Ashkenas, DocumentCloud Inc.
1
+ // Underscore.js 1.3.0
2
+ // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
3
3
  // Underscore is freely distributable under the MIT license.
4
4
  // Portions of Underscore are inspired or borrowed from Prototype,
5
5
  // Oliver Steele's Functional, and John Resig's Micro-Templating.
@@ -25,7 +25,6 @@
25
25
 
26
26
  // Create quick reference variables for speed access to core prototypes.
27
27
  var slice = ArrayProto.slice,
28
- concat = ArrayProto.concat,
29
28
  unshift = ArrayProto.unshift,
30
29
  toString = ObjProto.toString,
31
30
  hasOwnProperty = ObjProto.hasOwnProperty;
@@ -49,26 +48,21 @@
49
48
  // Create a safe reference to the Underscore object for use below.
50
49
  var _ = function(obj) { return new wrapper(obj); };
51
50
 
52
- // Export the Underscore object for **Node.js** and **"CommonJS"**, with
53
- // backwards-compatibility for the old `require()` API. If we're not in
54
- // CommonJS, add `_` to the global object.
51
+ // Export the Underscore object for **Node.js**, with
52
+ // backwards-compatibility for the old `require()` API. If we're in
53
+ // the browser, add `_` as a global object via a string identifier,
54
+ // for Closure Compiler "advanced" mode.
55
55
  if (typeof exports !== 'undefined') {
56
56
  if (typeof module !== 'undefined' && module.exports) {
57
57
  exports = module.exports = _;
58
58
  }
59
59
  exports._ = _;
60
- } else if (typeof define === 'function' && define.amd) {
61
- // Register as a named module with AMD.
62
- define('underscore', function() {
63
- return _;
64
- });
65
60
  } else {
66
- // Exported as a string, for Closure Compiler "advanced" mode.
67
61
  root['_'] = _;
68
62
  }
69
63
 
70
64
  // Current version.
71
- _.VERSION = '1.2.3';
65
+ _.VERSION = '1.3.0';
72
66
 
73
67
  // Collection Functions
74
68
  // --------------------
@@ -102,6 +96,7 @@
102
96
  each(obj, function(value, index, list) {
103
97
  results[results.length] = iterator.call(context, value, index, list);
104
98
  });
99
+ if (obj.length === +obj.length) results.length = obj.length;
105
100
  return results;
106
101
  };
107
102
 
@@ -218,7 +213,7 @@
218
213
  _.invoke = function(obj, method) {
219
214
  var args = slice.call(arguments, 2);
220
215
  return _.map(obj, function(value) {
221
- return (method.call ? method || value : value[method]).apply(value, args);
216
+ return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
222
217
  });
223
218
  };
224
219
 
@@ -583,7 +578,7 @@
583
578
  // conditionally execute the original function.
584
579
  _.wrap = function(func, wrapper) {
585
580
  return function() {
586
- var args = concat.apply([func], arguments);
581
+ var args = [func].concat(slice.call(arguments, 0));
587
582
  return wrapper.apply(this, args);
588
583
  };
589
584
  };
@@ -892,6 +887,11 @@
892
887
  escape : /<%-([\s\S]+?)%>/g
893
888
  };
894
889
 
890
+ // When customizing `templateSettings`, if you don't want to define an
891
+ // interpolation, evaluation or escaping regex, we need one that is
892
+ // guaranteed not to match.
893
+ var noMatch = /.^/;
894
+
895
895
  // JavaScript micro-templating, similar to John Resig's implementation.
896
896
  // Underscore templating handles arbitrary delimiters, preserves whitespace,
897
897
  // and correctly escapes quotes within interpolated code.
@@ -901,15 +901,16 @@
901
901
  'with(obj||{}){__p.push(\'' +
902
902
  str.replace(/\\/g, '\\\\')
903
903
  .replace(/'/g, "\\'")
904
- .replace(c.escape, function(match, code) {
904
+ .replace(c.escape || noMatch, function(match, code) {
905
905
  return "',_.escape(" + code.replace(/\\'/g, "'") + "),'";
906
906
  })
907
- .replace(c.interpolate, function(match, code) {
907
+ .replace(c.interpolate || noMatch, function(match, code) {
908
908
  return "'," + code.replace(/\\'/g, "'") + ",'";
909
909
  })
910
- .replace(c.evaluate || null, function(match, code) {
910
+ .replace(c.evaluate || noMatch, function(match, code) {
911
911
  return "');" + code.replace(/\\'/g, "'")
912
- .replace(/[\r\n\t]/g, ' ') + ";__p.push('";
912
+ .replace(/[\r\n\t]/g, ' ')
913
+ .replace(/\\\\/g, '\\') + ";__p.push('";
913
914
  })
914
915
  .replace(/\r/g, '\\r')
915
916
  .replace(/\n/g, '\\n')
@@ -922,6 +923,11 @@
922
923
  };
923
924
  };
924
925
 
926
+ // Add a "chain" function, which will delegate to the wrapper.
927
+ _.chain = function(obj) {
928
+ return _(obj).chain();
929
+ };
930
+
925
931
  // The OOP Wrapper
926
932
  // ---------------
927
933
 
@@ -954,8 +960,11 @@
954
960
  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
955
961
  var method = ArrayProto[name];
956
962
  wrapper.prototype[name] = function() {
957
- method.apply(this._wrapped, arguments);
958
- return result(this._wrapped, this._chain);
963
+ var wrapped = this._wrapped;
964
+ method.apply(wrapped, arguments);
965
+ var length = wrapped.length;
966
+ if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
967
+ return result(wrapped, this._chain);
959
968
  };
960
969
  });
961
970
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appetizer-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-21 00:00:00.000000000Z
12
+ date: 2012-01-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appetizer
16
- requirement: &70315893125960 !ruby/object:Gem::Requirement
16
+ requirement: &70260195807360 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70315893125960
24
+ version_requirements: *70260195807360
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: coffee-script
27
- requirement: &70315893125140 !ruby/object:Gem::Requirement
27
+ requirement: &70260195800100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '2.2'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70315893125140
35
+ version_requirements: *70260195800100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: eco
38
- requirement: &70315893124280 !ruby/object:Gem::Requirement
38
+ requirement: &70260195797400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '1.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70315893124280
46
+ version_requirements: *70260195797400
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rack-contrib
49
- requirement: &70315893123300 !ruby/object:Gem::Requirement
49
+ requirement: &70260195795540 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '1.1'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70315893123300
57
+ version_requirements: *70260195795540
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rack-ssl
60
- requirement: &70315893122540 !ruby/object:Gem::Requirement
60
+ requirement: &70260195791620 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '1.3'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70315893122540
68
+ version_requirements: *70260195791620
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sass
71
- requirement: &70315893121640 !ruby/object:Gem::Requirement
71
+ requirement: &70260195764700 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '3.1'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70315893121640
79
+ version_requirements: *70260195764700
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sinatra
82
- requirement: &70315893120580 !ruby/object:Gem::Requirement
82
+ requirement: &70260195761200 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '1.3'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70315893120580
90
+ version_requirements: *70260195761200
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: sprockets
93
- requirement: &70315893119540 !ruby/object:Gem::Requirement
93
+ requirement: &70260195749980 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '2.1'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70315893119540
101
+ version_requirements: *70260195749980
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: sprockets-sass
104
- requirement: &70315893118540 !ruby/object:Gem::Requirement
104
+ requirement: &70260195725980 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0.6'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70315893118540
112
+ version_requirements: *70260195725980
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: uglifier
115
- requirement: &70315893117440 !ruby/object:Gem::Requirement
115
+ requirement: &70260195723020 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ~>
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '1.0'
121
121
  type: :runtime
122
122
  prerelease: false
123
- version_requirements: *70315893117440
123
+ version_requirements: *70260195723020
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: yajl-ruby
126
- requirement: &70315893116480 !ruby/object:Gem::Requirement
126
+ requirement: &70260195720000 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '1.0'
132
132
  type: :runtime
133
133
  prerelease: false
134
- version_requirements: *70315893116480
134
+ version_requirements: *70260195720000
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: yui-compressor
137
- requirement: &70315893115640 !ruby/object:Gem::Requirement
137
+ requirement: &70260195718800 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ~>
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: '0.9'
143
143
  type: :runtime
144
144
  prerelease: false
145
- version_requirements: *70315893115640
145
+ version_requirements: *70260195718800
146
146
  description: A painfully opinionated Appetizer extension for web apps.
147
147
  email:
148
148
  - tech@audiosocket.com