rafini 0.2.0 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d0b7bcd26289ae8b80bd97a8473e00c791f0752
4
- data.tar.gz: 58689d8e95c43ba906bec2dd553024fe6c3a07b4
3
+ metadata.gz: 9a244e49ee99e95774dd7896e866b7010b97e9fe
4
+ data.tar.gz: 5a4bda635a0edd3f152ed13a9ddab39af8e79024
5
5
  SHA512:
6
- metadata.gz: 526ac61f8dbc7497232d5e235d85129230628ed29f2075313180007afe7003a05c64a0a4afaf38393059445830245f5e999beb7dba2b53219b637f8a0c974200
7
- data.tar.gz: a4cc545cec4a3cd3a4742cdc7aabf6c4c072becc0e9546229ea277778b77aecf33ebc8e4f43f287ef5eafa52b7815f9ab70171b63bed40cc6700969d4c28f85b
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
@@ -1,3 +1,3 @@
1
1
  module Rafini
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
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.2.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-15 00:00:00.000000000 Z
11
+ date: 2014-11-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Just a collection of useful refinements.