rubyhelper 1.2 → 1.2.1

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: d4e58cb59cdb152910ebf674ca688c14e4b7792a
4
- data.tar.gz: 2bd48c17e6dab1b72d1ac7daaded868a22d1cea3
3
+ metadata.gz: 66d5c68d4e385fe445e445cebcd63158de627935
4
+ data.tar.gz: 3a94c77a7b778035257ea769d59c14682f5388fe
5
5
  SHA512:
6
- metadata.gz: 4a293a8356d6e87ffb252362f9cd6cfa0ca06ab1b0e513fa19ce31100468474a38b7d27795ffb129095b24a6ac16f6fbc5145143b1c22c0637a00a6e54010939
7
- data.tar.gz: a98e864588d151d2c606779d02825e7dff292bdb46bc544f30732c58dbfd58da67765c74818cdb865b8ae65410416ab142effb8998e73851c499db5ca599f3d2
6
+ metadata.gz: 9ea7335d1d777160aabb79ec75debe2f7723fa0c0e1be39f0e86e58a6efcd36f7c64aee8c149cabb8fa35d56bcf75d76f0c352b8b5cffe5a72cbc2b776a6097f
7
+ data.tar.gz: 27076755ef67dcaa4021ab13debfa85268b6e4d9dfe4acf6672941cf3c056ca5e5ffed3c9f9aebecbc99409e1cd9bb45f319173b14daaea26e031b99da724056
checksums.yaml.gz.sig CHANGED
@@ -1 +1,2 @@
1
- �I:�c��I��z1���i7��v��C9=�$JN�;1�@X�I��E��{"2����g��B����I"/4Z��ti��� W�&�7,|m��%)���jFA���g���{ ]���9Z[C�?6�Ja�F*��n/�E����-b"%1��ʫ ��ʼnk4�>�#g?�^�oժ�t�@#D+�!=�!����@%$�@_ڦf7�.���6D�'�g5ӟx�����b ��ۏ7�<�G{"� �u~[��5{D
1
+ 9:~p4��s^��xPf�>c퍋`����~���k[aq�����{��we6��ܚ�,0�``&��/I*���t`[��R�ph�=��US�Õ�v�g
2
+ ���, wF[C�p� k��� ���M"��c8�&+�B��p�� E���`�@�yn���$,�{�Q��^=����@���=}�Xv�%��8ؓ�wVd�s����������E���p��"�ؘÊ�� D '��n�JV�aJ��P�Oox�
@@ -1,3 +1,3 @@
1
1
  module RubyHelper
2
- VERSION = '1.2'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -275,9 +275,10 @@ module StringHelper
275
275
  # split th string and only keep the non empty striped values
276
276
  #
277
277
  # @param sep [String] separator
278
+ # @param sep [Regexp] separator
278
279
  # @return [Array]
279
280
  def splity(sep = "\n")
280
- raise ArgumentError, "sep must be a string" unless sep.is_a? String
281
+ raise ArgumentError, "sep must be a string or a regex" unless sep.is_a? String or sep.is_a? Regexp
281
282
  return self.split(sep).map{|e| ((e.strip.empty?) ? (nil) : (e.strip))}.compact
282
283
  end
283
284
 
data/test/test_string.rb CHANGED
@@ -120,6 +120,8 @@ class StringHelperTest < Minitest::Test
120
120
  assert_equal(["bonjour", "à", "toi"], "bonjour\nà\ntoi".splity)
121
121
  assert_equal(["bonjour", "à", "toi"], "\nbonjour\n\nà\n\ntoi\n\n\r".splity)
122
122
  assert_equal(["bonjour", "à", "toi"], "\nbonjour\n\nà\n\ntoi\n\n\r".splity)
123
+ assert_equal(["bonjour", "à", "toi"], "bonjourXàXtoiX".splity("X"))
124
+ assert_equal(["bonjour", "à", "toi"], "bonjourXàYtoiX".splity(/X|Y/))
123
125
  end
124
126
 
125
127
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyhelper
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - poulet_a
metadata.gz.sig CHANGED
Binary file