docman 0.0.86 → 0.0.87

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: 6234e6919844d4f9e7546fcecb7e58711d9bab64
4
- data.tar.gz: 8c25759cc79929d0f825d0980f88c16bdd59ce4a
3
+ metadata.gz: 03255c785f6091860d96ade58f4fedb79a90e202
4
+ data.tar.gz: 8a286ef146bfce8751c0bfdf9174dd11d51c9699
5
5
  SHA512:
6
- metadata.gz: 4bbfae6415164b4e058df0bdef17a1a85a872c358f298eaa97700f029412901223238b6b2eabaf6d1459b19347b04bde21ba7e5bcd045b1074232a8058fc76f8
7
- data.tar.gz: 70bdefd68d94284c1c74e8db6b5658e15ca6498835421e739fc0c13b55f3e80c277eafced2a15b4234b9b625521152e4a33e04b233049d87d52d5cf0476e17c0
6
+ metadata.gz: 6106b522056fa9001c4fcdd12a05c11c66d69857167d6faa4f500e1f1aa522e41085acc91e1c7237bade6d127f3ae83d0a187d474d645e330708cac4ca0e3848
7
+ data.tar.gz: '042814f4d6a523fb8d50f613859bc8baa053d667b5d6f51123d5b51096fec6e4aff37795997d2394478886c4dcb6ea94d71c4f0eac3fa22093a97e8d05b8c568'
data/.gitignore CHANGED
@@ -21,3 +21,4 @@ tmp
21
21
  *.a
22
22
  mkmf.log
23
23
  .idea
24
+ .project
@@ -45,7 +45,7 @@ module Docman
45
45
  if File.directory? master_file
46
46
  @structure = structure_build(File.join(@docroot_config_dir, 'master'))
47
47
  else
48
- @structure = structure_build_from_config_file(File.join(@docroot_config_dir, 'master'))
48
+ @structure = structure_build_from_config_file(Docman::Application.instance.config)
49
49
  end
50
50
  end
51
51
 
@@ -56,12 +56,17 @@ module Docman
56
56
  GitUtil.update @docroot_config_dir, "#{options} #{branch.strip}"
57
57
  end
58
58
 
59
- def structure_build_from_config_file(path, prefix = '', parent = nil, parent_key = 'master')
60
- config = Docman::Application.instance.config
59
+ def structure_build_from_config_file(config, prefix = '', parent = nil, parent_key = 'master')
61
60
  return if config['components'][parent_key].nil?
62
61
  children = []
63
62
 
64
63
  info = config['components'][parent_key]
64
+
65
+ children_components_config = nil
66
+ unless info['components'].nil?
67
+ children_components_config = {'components' => info.delete('components')}
68
+ end
69
+
65
70
  @raw_infos[parent_key] = info
66
71
 
67
72
  unless info['status'].nil?
@@ -70,7 +75,7 @@ module Docman
70
75
 
71
76
  name = parent_key
72
77
  prefix = prefix.size > 0 ? File.join(prefix, name) : name
73
- info['full_path'] = path
78
+ info['full_path'] = @docroot_config_dir
74
79
  info['docroot_config'] = self
75
80
  info['build_path'] = prefix
76
81
  info['full_build_path'] = File.join(@docroot_dir, prefix)
@@ -91,16 +96,11 @@ module Docman
91
96
 
92
97
  @names[name.to_s] = i
93
98
 
94
- # Dir.foreach(path) do |entry|
95
- # next if (entry == '..' || entry == '.')
96
- # full_path = File.join(path, entry)
97
- # if File.directory?(full_path)
98
- # dir_hash = structure_build(full_path, prefix, i)
99
- # unless dir_hash == nil
100
- # children << dir_hash
101
- # end
102
- # end
103
- # end
99
+ unless children_components_config.nil?
100
+ children_components_config['components'].each {|name, config|
101
+ children << structure_build_from_config_file(children_components_config, prefix, i, name)
102
+ }
103
+ end
104
104
  i
105
105
  end
106
106
 
@@ -1,3 +1,3 @@
1
1
  module Docman
2
- VERSION = "0.0.86"
2
+ VERSION = "0.0.87"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.86
4
+ version: 0.0.87
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Tolstikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-18 00:00:00.000000000 Z
11
+ date: 2017-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler