rafini 1.1.0 → 1.2.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: 3293f08b8bedca591dfb9191266f1fe947d7b7d7
4
- data.tar.gz: 4bc9c202326f66670eaf71a006f83b32f6775142
3
+ metadata.gz: dec030a515decf9c06b93546a0f212df061799c2
4
+ data.tar.gz: 92df305b30cbbc72bed2b967076073a7b8a3e770
5
5
  SHA512:
6
- metadata.gz: ad87bf6867f6dfe0c02f2db385bae58fbd87f108e11862d5dde8bce3add09fe6552b32802c456f6d85e26b2e35a64d46869c73a44281c2d6f3f00ead8453594d
7
- data.tar.gz: 6bb831dffcfb01708d5f2d3f8a7043f656e9bea000e923dcc821587a6328def34cb6ce0b1fef5a266dbc31df36b733919d784f0d09d8c2ddfaed0a3b62322a84
6
+ metadata.gz: 8b1911db07e48d9614ca1c9d3b5955937163e2b8b09858ffe831af8f8f86eab4edc2a6c3f236cb720e6bb70a40262e17e29d0d0ce2cfeaa2c05bd0c21ed2df20
7
+ data.tar.gz: bdb731aecd1be0c482e3eb9ea7f86ec5855a375507d54bb98836a383b4306a35ee7aa7fd3fc5fb26931fdfb6fbc6fee1236ec129885527c87cbfc1fcd0da5679
@@ -58,6 +58,9 @@ Just a collection of useful refinements.
58
58
  # amend
59
59
  {a:'A',b:'B'}.amend({b:'X',c:'C'},{c:'Y',d:'D'}) #=> {a:'A',b:'X'}
60
60
 
61
+ # maps
62
+ {a:'A',b:'B',c:'C',c:'D'}.maps(:c,:a,:b) #=> ['C','A','B']
63
+
61
64
  === using Rafini::Integer
62
65
 
63
66
  # odometer
@@ -77,6 +80,9 @@ Just a collection of useful refinements.
77
80
  # camelize
78
81
  'a_camel_kick'.camelize #=> "ACamelKick"
79
82
 
83
+ # semantic
84
+ '1.2.3'.semantic(0..1) #=> '1.2'
85
+
80
86
  === Rafini::Empty
81
87
 
82
88
  STRING, ARRAY, HASH = ''.frozen, [].frozen, {}.frozen
@@ -5,7 +5,16 @@ module Rafini
5
5
  # 1) A camel kick, as in "I gotz camelized".
6
6
  # 2) "a_camel_kick" => "ACamelKick"
7
7
  def camelize(sep=/_/)
8
- self.split(sep).map{ |word| word.capitalize }.join('')
8
+ self.split(sep).map{|word|word.capitalize }.join('')
9
+ end
10
+
11
+ # semantic:
12
+ # 'a.b.c'.semantic(1) #=> 'b'
13
+ # 'a.b.c'.semantic(0..1) #=> 'a.b'
14
+ # 'a.b.c'.semantic(0..2, '/') #=> 'b/c'
15
+ # 'a/b/c'.semantic(0..2, '.', /\//) #=> 'a.b.c'
16
+ def semantic(v,s='.',sx=/\./)
17
+ [*self.split(sx)[v]].join(s)
9
18
  end
10
19
  end
11
20
  end
@@ -1,3 +1,3 @@
1
1
  module Rafini
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.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: 1.1.0
4
+ version: 1.2.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-12-28 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Just a collection of useful refinements.