rafini 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +10 -0
- data/lib/rafini/array.rb +8 -0
- data/lib/rafini/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: 9a244e49ee99e95774dd7896e866b7010b97e9fe
|
4
|
+
data.tar.gz: 5a4bda635a0edd3f152ed13a9ddab39af8e79024
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61f55c0829e7880a034754428abad6d7f94dc9cc906571979fa36cb288fa54424e90e673fe98300d882592160c07be296e3a9e1b01714a13ee55b891b472ec7f
|
7
|
+
data.tar.gz: 48d0c58524b28d6b38d064a6234b0be0156616fe8dc14dd8a80060000c278fc5116e246ed1d92542d6435187bb12c50616a98a10770441ea90e41ae69b001b26
|
data/README.rdoc
CHANGED
@@ -16,6 +16,12 @@ Just a collection of useful refinements.
|
|
16
16
|
['a','b','c'].per(['A','B','C']){|l,u| h[l]=u}
|
17
17
|
h #=> {'a'=>'A','b'=>'B','c'=>'C'}
|
18
18
|
|
19
|
+
# which
|
20
|
+
['dog','cat','bunny'].which{|a|a=~/c/} #=> "cat"
|
21
|
+
|
22
|
+
# is
|
23
|
+
[:a,:b,:c].is(true) #=> {a: true, b: true, c: true}
|
24
|
+
|
19
25
|
=== using Rafini::Exception
|
20
26
|
|
21
27
|
# $!.puts
|
@@ -71,6 +77,10 @@ Just a collection of useful refinements.
|
|
71
77
|
# camelize
|
72
78
|
'a_camel_kick'.camelize #=> "ACamelKick"
|
73
79
|
|
80
|
+
=== Rafini::Empty
|
81
|
+
|
82
|
+
STRING, ARRAY, HASH = ''.frozen, [].frozen, {}.frozen
|
83
|
+
|
74
84
|
== INSTALL:
|
75
85
|
|
76
86
|
$ sudo gem install rafini
|
data/lib/rafini/array.rb
CHANGED
@@ -46,6 +46,14 @@ module Rafini
|
|
46
46
|
return nil
|
47
47
|
end
|
48
48
|
|
49
|
+
# [:a,:b,:c].is(true) #=> {:a=>true,:b=>true,:c=>true}
|
50
|
+
#
|
51
|
+
# Updates a hash with the keys given by the array to the given value.
|
52
|
+
def is(value, hash={})
|
53
|
+
self.each{|key| hash[key]=value}
|
54
|
+
return hash
|
55
|
+
end
|
56
|
+
|
49
57
|
end
|
50
58
|
end
|
51
59
|
end
|
data/lib/rafini/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rafini
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- carlosjhr64
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Just a collection of useful refinements.
|