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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 11a66d1ab3498554a5ea259a5d9f6402f9e9da2f
4
- data.tar.gz: 5d938eaa0b08ac5b642bb6aab2260b92d1846a9d
3
+ metadata.gz: 10d0489ab6c4aab281eec01a23b84e1e46460cef
4
+ data.tar.gz: 164afbc00effb8ea28fc0a31d5c46f4c6f926574
5
5
  SHA512:
6
- metadata.gz: ae48e18cf88a93719057be77d5c69574310f858fb51a84a771516068d828183e206687e16054f1ae9ed49bec6a39f0454396da066c92ec0c121bd58dbd07b25d
7
- data.tar.gz: 8ab04f916ffed593e462a1a9d4a394f5e05716485cb322cfa90c9b7411708634e69b411f9508648460b68391d95b423baea8f362993b86b899af2825e282276a
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
- #require 'line-tree'
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
- a = LineTree.new(txt.gsub(/^-*$/m,''), \
43
- level: level, ignore_blank_lines: false).to_a
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.1
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-01-08 00:00:00.000000000 Z
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