rowx 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/rowx.rb +17 -9
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10d0489ab6c4aab281eec01a23b84e1e46460cef
|
4
|
+
data.tar.gz: 164afbc00effb8ea28fc0a31d5c46f4c6f926574
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce9ac34e3c09afe80905514ec7518ae9d6cd2b953eb19bb36bd4f4d32f82ea676ddf7bef85a5b23a7dc15618f66fe414e7fca5b0e601b376bb6a1520c66166d9
|
7
|
+
data.tar.gz: 1d17ac9f1a3c463b41b4a8808c880ddee97c0b0cff0835d71b536b10528332c2a5c4029f8459801609da9af59cac898950c464c1b2ded5c090e37815d8178678
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/rowx.rb
CHANGED
@@ -2,14 +2,8 @@
|
|
2
2
|
|
3
3
|
# file: rowx.rb
|
4
4
|
|
5
|
-
|
6
|
-
require 'requestor'
|
5
|
+
require 'line-tree'
|
7
6
|
|
8
|
-
code = Requestor.read('http://rorbuilder.info/r/ruby') do |x|
|
9
|
-
x.require 'line-tree'
|
10
|
-
end
|
11
|
-
|
12
|
-
eval code
|
13
7
|
|
14
8
|
# for an example of ArrayCollate
|
15
9
|
# see http://www.jamesrobertson.eu/snippets/2014/jun/08/collating-items-in-an-array.html
|
@@ -39,8 +33,22 @@ class RowX
|
|
39
33
|
|
40
34
|
def initialize(txt, level: nil)
|
41
35
|
|
42
|
-
|
43
|
-
|
36
|
+
# auto indent any multiline values
|
37
|
+
|
38
|
+
indent = ''
|
39
|
+
|
40
|
+
lines = txt.gsub(/^-*$/m,'').lines.map do |line|
|
41
|
+
|
42
|
+
if not line[/\s*\w+:/] then
|
43
|
+
indent + ' ' + line
|
44
|
+
else
|
45
|
+
indent = line[/^\s+/] || ''
|
46
|
+
line
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
a = LineTree.new(lines.join, level: level, ignore_blank_lines: false).to_a
|
44
52
|
|
45
53
|
keyfield = a[0][0][/\w+:/]; i = 0
|
46
54
|
|
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.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
tTW+rjyuLX3NtJ5iyGmmz/CE0gX9kWF2/5wYZ/it0UG4W9z/7Rfdke4SD00FUWVB
|
32
32
|
VqXQja9F+5d+OA==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-
|
34
|
+
date: 2017-03-04 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: line-tree
|
metadata.gz.sig
CHANGED
Binary file
|