rowx 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +1 -3
  3. data.tar.gz.sig +0 -0
  4. data/lib/rowx.rb +26 -14
  5. metadata +5 -5
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db79381fe9f8b61dab56089fad6a6cac6824249a
4
- data.tar.gz: 7152bc15515b7404bf677b6609dd7cb0ccf0435e
3
+ metadata.gz: fcc3c6b542ab686d3e607840f58519d753cc0baf
4
+ data.tar.gz: e0e93f028cc9a300d6c999730f487a09c295ea00
5
5
  SHA512:
6
- metadata.gz: 1053567dcd6f150ab58857c515c5f0d49c68fd73ed7101a7f079c4dd026cb6dccb2cecf015de1cf722009ceac1579f493c276b4ab25f20970074d5ffccc14ad7
7
- data.tar.gz: c9ae686b89f81613db565e2aa931c7eca216ae3a179e17e41f2aabe48182f456bffe515e253dfdef8ad8396d8f3f6e8681f147d40856f0ddfb83de72c2550084
6
+ metadata.gz: 5935c2e5be8f4d7b55a7adb0d4c867f3cdb730c43355c10f3b6f5fff10a79264b43f9ca51cb2147988658a8bbe9a4094d1e0a8f1a174d4d4dba8118ea6e9a27f
7
+ data.tar.gz: 79231dd66abcecfed13beba1d24745d7c28611898e3b98a8657365807c64be604b29fe39d769ff64dadc5b55c8d9f9c89890bec7aeeb531439d53b52fe5ff052
@@ -1,3 +1 @@
1
- ����f'u
2
- ���dQt2��>XF�ݿP�xk�ֆ�U .�4�ե�Ϻ
3
- �aP�� i����t/�� @$�=����W��Ya+�����v�a/����]D+V&�h=�ϡ�,S�d�Iƕ�L�!���`Q��@����k�u��"V��#MQ�[��H?�nK`#��#��N�g��:I �����2s�LjcM\C������x؟��������k2��
1
+ t�o�lv5��"��}���i�#ֈ&n!������d��z�K�-�+*S�(�q�L/�o��������rؓ�\ą��}W�G�6|�ЍF�ѡ7c�2
data.tar.gz.sig CHANGED
Binary file
@@ -1,19 +1,31 @@
1
- class Array
2
- def collate(pattern=nil)
3
- a = self.inject([[]]) do |r,x|
4
- if block_given? then
5
- yield(x) ? r << [x] : r[-1] << x
6
- else
7
- x =~ pattern ? r << [x] : r[-1] << x
8
- end # block
9
- r
10
- end
11
- a.shift if a.first.empty?
12
- a
13
- end
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: rowx.rb
4
+
5
+ require 'line-tree'
6
+
7
+
8
+
9
+ module ArrayCollate
10
+ refine Array do
11
+ def collate(pattern=nil)
12
+ a = self.inject([[]]) do |r,x|
13
+ if block_given? then
14
+ yield(x) ? r << [x] : r[-1] << x
15
+ else
16
+ x =~ pattern ? r << [x] : r[-1] << x
17
+ end # block
18
+ r
19
+ end
20
+ a.shift if a.first.empty?
21
+ a
22
+ end
23
+ end
14
24
  end
15
25
 
16
26
  class RowX
27
+
28
+ using ArrayCollate
17
29
 
18
30
  attr_reader :to_a, :to_xml
19
31
 
@@ -84,4 +96,4 @@ class RowX
84
96
 
85
97
  end
86
98
 
87
- end
99
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rowx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  zfHbPJGx3yldVRmxXp8GGIPagWAvf45DNXXjpQB0mqgcuusndaC2We8vbzzjGzQO
32
32
  UbqEI1/DbMhxRA==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-12-13 00:00:00.000000000 Z
34
+ date: 2016-03-26 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: line-tree
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: '0.5'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 0.5.3
45
+ version: 0.5.6
46
46
  type: :runtime
47
47
  prerelease: false
48
48
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,8 +52,8 @@ dependencies:
52
52
  version: '0.5'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.5.3
56
- description: Generates XML from rows of labelled, nested, and plain text
55
+ version: 0.5.6
56
+ description: Generates XML from rows of labelled text, nested text, and plain text
57
57
  email: james@r0bertson.co.uk
58
58
  executables: []
59
59
  extensions: []
metadata.gz.sig CHANGED
Binary file