material_raingular 0.1.5.5 → 0.1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/extensions.coffee +22 -2
- data/lib/material_raingular/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59a9545f417c657e7d89f1e04b11709a3881d24d
|
4
|
+
data.tar.gz: aa2000cc97a512d745269f2df766d433bc5ac715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d867df5b880ad63b2d84edfe952c9657a66ee39a59eb6d6038d702ea05c8f6cf8fd9367e4935e48071ba847a0ad79f2e47e3b67a169673bc533708e6b722e9cc
|
7
|
+
data.tar.gz: ad5d51e3f4b6f83da301c08fb0d50622060b14c758c2f7b82a0b62f4a694b0fd140a2638bc3da60375e3cebecf8f2ce9d921ac97eaac4e8e536578f271a0f949
|
@@ -45,8 +45,12 @@ Array.prototype.sum = ->
|
|
45
45
|
Array.prototype.includes = (entry)->
|
46
46
|
this.indexOf(entry) > -1
|
47
47
|
Array.prototype.drop = (entry)->
|
48
|
-
|
49
|
-
|
48
|
+
if entry.hasOwnProperty('id')
|
49
|
+
index = @.pluck('id').indexOf(entry.id)
|
50
|
+
else
|
51
|
+
index = @.indexOf(entry)
|
52
|
+
return this unless index > -1
|
53
|
+
@.splice(index,1)
|
50
54
|
String.prototype.titleize = ->
|
51
55
|
return this.replace(/\_/g,' ').replace(/([A-Z])/g, ' $1').trim().replace(/\b[a-z]/g, (letter)->
|
52
56
|
return letter[0].toUpperCase())
|
@@ -90,3 +94,19 @@ Array.prototype.where = (obj) ->
|
|
90
94
|
addEntry = addEntry && equiv(entry[key], value)
|
91
95
|
result.push(entry) if addEntry
|
92
96
|
result
|
97
|
+
Array.prototype.intersection = (arr) ->
|
98
|
+
res = []
|
99
|
+
for val in @
|
100
|
+
res.push(val) if arr.includes(val)
|
101
|
+
return res
|
102
|
+
Array.prototype.intersects = (arr) ->
|
103
|
+
@.intersection(arr).length > 0
|
104
|
+
Array.prototype.find = (id) ->
|
105
|
+
index = @.pluck('id').indexOf(id)
|
106
|
+
@[index]
|
107
|
+
Array.prototype.index = (obj) ->
|
108
|
+
return unless obj.hasOwnProperty('id')
|
109
|
+
@.pluck('id').indexOf(obj.id)
|
110
|
+
Array.prototype.update = (obj) ->
|
111
|
+
return unless obj.hasOwnProperty('id')
|
112
|
+
@[@.index(obj)] = obj
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material_raingular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.5.
|
4
|
+
version: 0.1.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Moody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|