confluence_helper 0.0.1 → 0.0.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: 871a0cbe9392a85d9fbcc1dbee5d85ccad98f8da
4
- data.tar.gz: 1089c0962a376f79dc98dfb6d2b7d4c8ee930e56
3
+ metadata.gz: d6007884edf8b589101607a422b3bfaf37fbef6a
4
+ data.tar.gz: d386b468a27aec5cb2af0cd8d457016251abaf9b
5
5
  SHA512:
6
- metadata.gz: 51355352fd4557663437a81280ce8ded2507b538b282df80699c60a264a5b54a35caead2d117fa90f3684c6009422725ff4dec7368e1acfddca4e5619d99d0d1
7
- data.tar.gz: 4d8414608b8f4be1d5af6563ac8b87077cd2cb48a16ba0122b791c34238dac19f612decba21a6321cde889b0a352df1e26d7aab1a05575797b979a3e163b1c38
6
+ metadata.gz: a6ddad351654a25546651934bd3c8f96ed1c20fb3a44b418186d02dd26d890f480952f7af708be907d11a1b32eb532e3caba18db013c551315560a298a52f0c5
7
+ data.tar.gz: 5dba7c8e269a5df94da6cd3dbf919066e9bccef821d3f177cb6ea35aef6d1048dcb7c8b2a0811d61d32c81bde82ee1b77f1441d8c252b0e94eed17a601a2fa5e
@@ -1,3 +1,3 @@
1
1
  module ConfluenceHelper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require "confluence_helper/version"
2
2
 
3
3
  module ConfluenceHelper
4
-
4
+
5
5
  class HtmlTable
6
6
  def initialize(node)
7
7
  @node = node
@@ -86,7 +86,7 @@ class Confluence
86
86
  tables.select{|t| is_deliverables_table? t } .map{|table| table.data }.flatten
87
87
  end
88
88
 
89
- #Name DHFR Status Location Comments
89
+ #Name DHFR Status Location Comments
90
90
  def is_deliverables_table?(table)
91
91
  table.has_columns? columns: %w{Name DHFR Status Location Comments}
92
92
  end
@@ -195,14 +195,17 @@ class WikiPage < Confluence
195
195
  page = query_rest_api( url , {expand:"body.export_view"} )
196
196
  return Nokogiri::HTML( page.body["body"]["export_view"]["value"] )
197
197
  end
198
-
199
198
 
200
199
  def parse_wiki_table(doc)
201
200
  rows = doc.xpath("//table/tbody/tr")
202
201
  headers = rows.xpath("th").map{|n| n.content}
203
202
  rows = rows - rows.xpath("th/..")
204
203
  documents = rows.map{ | row | row_to_hash(row, headers) } #convert to hashes
205
- documents.each_with_object({}){|doc, o| o[doc["ID"].to_i] = doc } # index by id
204
+ if headers.include?("ID")
205
+ documents.each_with_object({}){|doc, o| o[doc["ID"].to_i] = doc } # index by id
206
+ else
207
+ documents
208
+ end
206
209
  end
207
210
 
208
211
  def row_to_hash(row, headers)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confluence_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Thorne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-10 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler