vertebra 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac09aaa9c1a50964e9aae90406469168824c4235
4
- data.tar.gz: 18ad1f240d4272c86acc743d990c0fdf03b23210
3
+ metadata.gz: 4dd9258b8b224cd0513400c8a8ea83fe43362a2d
4
+ data.tar.gz: d1a97fcd7ff3e7b1a55468f40ee139f574c432c9
5
5
  SHA512:
6
- metadata.gz: a4c37aa6c89ae54f01317f1a70fc2ab17d3e34e6179238e2fa942bdcf41bbb9360d8dfc6831d2e0d70f17d742ef58f55a07fdb73ec2ef642f8d0c4d316d3c406
7
- data.tar.gz: da2d08aae31af7b4b6e4d3bf7d450abd0a382c369a5561f948f2970efafa8a00043c576b74add61f93ab9b6ce07fb58c32f1802c6afbc5529178aa2134db2b86
6
+ metadata.gz: 1b79a24e376ece8a56e91ddcff79da0b46f125b0a56d867470ff8218a3b5cdd4972c4b269071de0daab47e459b3644439357f3fe2bad07089e73693527bb05b0
7
+ data.tar.gz: 81d8ac00f05c7d18c5cf28201da010165c02fb4d5ec8e58a80ccd48b719093bef421249f5ec0272e38b64f8b84748ce503dad655f5cc96b71f3c29aa1a0be50e
@@ -12,6 +12,45 @@ delegateEventSplitter = /^(\S+)\s*(.*)$/
12
12
  @camelize = (str) ->
13
13
  str.replace(/(^|[-_])(.)/g, (match) -> return match.toUpperCase()).replace(/[-_]/g, '')
14
14
 
15
+ @trim = (str) ->
16
+ str.replace(/^\s+|\s+$/g, '')
17
+
18
+ _now = Date.now || -> new Date().getTime()
19
+
20
+ # Throttle function borrowed from underscore.js
21
+ @throttle = (func, wait, options) ->
22
+ previous = 0
23
+ options ?= {}
24
+
25
+ later = ->
26
+ previous = if options.leading == false then 0 else _now()
27
+ timeout = null
28
+ result = func.apply(context, args)
29
+ if !timeout
30
+ context = args = null
31
+ return
32
+
33
+ ->
34
+ now = _now()
35
+ previous = now if !previous and options.leading == false
36
+ remaining = wait - (now - previous)
37
+ context = this
38
+ args = arguments
39
+
40
+ if remaining <= 0 or remaining > wait
41
+ if timeout
42
+ clearTimeout(timeout)
43
+ timeout = null
44
+ previous = now
45
+ result = func.apply(context, args)
46
+ if !timeout
47
+ context = args = null
48
+ else if !timeout and options.trailing != false
49
+ timeout = setTimeout(later, remaining)
50
+
51
+ result
52
+
53
+
15
54
  # Minimalist Backbon.View with support for view element, this.$ and delegated
16
55
  # events on initialization.
17
56
  #
@@ -1,3 +1,3 @@
1
1
  module Vertebra
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertebra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vala
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-05 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  version: '0'
72
72
  requirements: []
73
73
  rubyforge_project:
74
- rubygems_version: 2.5.1
74
+ rubygems_version: 2.6.8
75
75
  signing_key:
76
76
  specification_version: 4
77
77
  summary: Mico-JS Framework based on the Backbone.View API