boost_info 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0114ee49982c750a6dd040d3ad3cbe442016bc04
4
- data.tar.gz: 9294cc5f854ce61386ca2fd54291ebb72fa5c0ae
3
+ metadata.gz: 2cffceb241116406690e2c464bcb09148f51f3c7
4
+ data.tar.gz: 7015bcb66989f77e30701f30d53b2c09a4737793
5
5
  SHA512:
6
- metadata.gz: f59e7d7de56fbd7ca43ddd23e0b854bd243c27a39069ced005d7bb2565d66f050a18fbe83e297631805670c6e7a577788c87f37d2f12e1c8932b2ecfe70e4699
7
- data.tar.gz: f87f5e05fe8e597d1fd23c26a0c5c8c5b6eec943891593fc8c097d92ba984950886ab7159da53cf15b2157da207198196e58587c8e0abddd67adee7932ec100c
6
+ metadata.gz: 556ffe4650c8aad4eb2e5cf1d0f90a5c0cd4bbd71a5605a78a7994bf50b87829c8c18e58d74c9decc616c62934f7c5818b2aac7122edbe0c26a6f8166c6ce792
7
+ data.tar.gz: 8273df261f7327e6eebdb0bd7ded4b081d9b5cd060ded79eef9850d72bfc4d9fae0f6e185393110c3417ae1051a88001cc03c74c950098e52e1f444fc9256766
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # BoostInfo [![Build Status](https://travis-ci.org/zenbro/boost_info.svg?branch=master)](https://travis-ci.org/zenbro/boost_info)
1
+ # BoostInfo [![GitHub release](https://img.shields.io/github/release/zenbro/boost_info.svg)](https://github.com/zenbro/boost_info/releases) [![Build Status](https://travis-ci.org/zenbro/boost_info.svg?branch=master)](https://travis-ci.org/zenbro/boost_info) [![GitHub issues](https://img.shields.io/github/issues/zenbro/boost_info.svg)](https://github.com/zenbro/boost_info/issues)
2
2
 
3
3
  Simple parser for [Boost INFO format](http://www.boost.org/doc/libs/1_42_0/doc/html/boost_propertytree/parsers.html#boost_propertytree.parsers.info_parser).
4
4
 
@@ -11,12 +11,19 @@ module BoostInfo
11
11
  end
12
12
 
13
13
  def to_info
14
- build_info(@root_node, 0).join("\n") + "\n"
14
+ lines = build_info(@root_node, 0)
15
+ if lines.empty?
16
+ ''
17
+ else
18
+ lines.join("\n") + "\n"
19
+ end
15
20
  end
16
21
 
17
22
  private
18
23
 
19
24
  def build_hash(parent_node)
25
+ return {} unless parent_node.childrens
26
+
20
27
  hash = {}
21
28
  parent_node.childrens.each do |node|
22
29
  key = @opts[:symbolize_keys] ? node.key.to_sym : node.key
@@ -30,6 +37,7 @@ module BoostInfo
30
37
  end
31
38
 
32
39
  def build_info(parent_node, level)
40
+ return [] unless parent_node.childrens
33
41
  lines = []
34
42
  last_node_index = parent_node.childrens.size - 1
35
43
  parent_node.childrens.each_with_index do |node,index|
@@ -1,3 +1,3 @@
1
1
  module BoostInfo
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boost_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Vetrov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-26 00:00:00.000000000 Z
12
+ date: 2015-07-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler