line-tree 0.4.4 → 0.4.5

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: 636d76784f401cbc4bd98ff9d08dc572c9cbf979
4
- data.tar.gz: 1ccbf7d4e2529bc46ff5b39c77eb88aff7ecac8d
3
+ metadata.gz: 176cc7dca8380d6d8c186a9f54f59ce214f3afbd
4
+ data.tar.gz: ba91cd9e7df690b03aab22bf69de31c16279dfa3
5
5
  SHA512:
6
- metadata.gz: f83bb9283f45bde6cdb45a107fb082b28ff3a5276d8a49c54aa632c0ffba3eeb65959e0e1bcf620f7e803295b312dac480d9b2edaf339415535c9ac45b29eb0c
7
- data.tar.gz: ab4a9beb7cceadfeb636ccf87693ad40120f6498d525e85fdc80021d9443d584fbcfbd968887b8747b8cc8512637cb5854d3523f92190a407554a45b14bc8e00
6
+ metadata.gz: 3407e7ef8d54f2a56e8c4557121315ae415919e947dc3bfd1ee82de1ea62e91079992ca8229aac2364afde02ab6e62dfee77d57c87419fd40d6f5960ea895a0b
7
+ data.tar.gz: 5a05e73f5c5fa0389415bb99bec40c5d48eb7ff66aa1864709286ea512551a3e90bb4054865f2cad4669419e9d9e1949919a55a71a37008dd75fc8bad73e8768
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- ���#�s2ݖi�N��-3���.�4Ç��pp2����ƭص��z����D�YFC �K������'8��*�lQ`����RvĻ3�^ac@��Y���CG6��dBnai�+�O��Rk#U�j�� ������Sج��+��+|5_Sg�9,�ē���]�Ӌ%�m����X�E%D����S�ߝ��
2
- �“�!/e�*6ZYN4��Xnk�i�R`��γ'����Nbe����a�.��7>w��Qf�F�V
1
+ {���1�!�v*��цe��D�_�^�aiA
2
+ ��Y���-W@�����A7g<����fA٧���B�������-~(7�3w����l[������ܴ������,�Z��Y
3
+ ��c l�2��"��� �J��Ȟ�o�$�n��3��2�P;�QHSN����Yq2�;�~4=9g��Pܒ���qc�ԓ�t���avT��T�Y�1�u�
data.tar.gz.sig CHANGED
Binary file
data/lib/line-tree.rb CHANGED
@@ -8,9 +8,11 @@ class LineTree
8
8
 
9
9
  attr_reader :to_a
10
10
 
11
- def initialize(lines, level: nil, ignore_non_element: true)
11
+ def initialize(lines, level: nil, ignore_non_element: true,
12
+ ignore_blank_lines: true)
12
13
 
13
14
  @ignore_non_element = ignore_non_element
15
+ @ignore_blank_lines = ignore_blank_lines
14
16
  @to_a = scan_shift(lines.strip, level)
15
17
  end
16
18
 
@@ -31,7 +33,7 @@ class LineTree
31
33
 
32
34
  unless x[/.*/][/^\s*\w+:\S+/] then
33
35
 
34
- rlines = (x).split(/\n/,-1) #[0..-2]
36
+ rlines = @ignore_blank_lines ? (x).split(/\n/) : (x).split(/\n/,-1)
35
37
  rlines = [x] if level and level < 0
36
38
  label = [rlines.shift]
37
39
  new_lines = rlines.map{|x| x[2..-1]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  ErtlSTAImlBCK8q5BS4jBBt8VAEpNdkWpWbtDtLPA639pW2QWIcPx13ObWJh7Ejk
32
32
  THoVqqsHTfeg3g==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-12-27 00:00:00.000000000 Z
34
+ date: 2014-12-28 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rexle
metadata.gz.sig CHANGED
Binary file