aspec_rb 0.0.15 → 0.0.16

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
  SHA256:
3
- metadata.gz: 6ceaae8abf8a8ed63c0e9d7a58b5065ad8d56a3e13a6d9b4ca43be3367ff4869
4
- data.tar.gz: 456c514ec27c3e61b97ec3486415d71be01f38c8809e2c59fb20a3bf44ab823a
3
+ metadata.gz: 81629ea54e2cfed1b38309c4f2cef083a4b174c199f801f2f43db23a1a8db1c0
4
+ data.tar.gz: d97546374ffc196faa146acb0117d35f020250a39ce659f67aa5a5188af13f49
5
5
  SHA512:
6
- metadata.gz: 0a95bbc8b021c3811a318fc2e270e12dc2e61520d77dfdf5870a1d333ff68d5192a11a66c890a4de7f6f52f3ff4e1322d5442cba81eb4896573f57bed4dc087b
7
- data.tar.gz: 9053d5e8942fe690eb61df5370fa76ea5191c060d18b1e7c0df390f30dbc0370b41175558cde69655f7e5092697581c89409a5061b61eb1d3105ca73f6bd3f0e
6
+ metadata.gz: 474bd5d638e8eebd902d3b8bc0dbd4aabc9bda65fc4667e1a8e1be1c5135d01e5f2abc880d16c3dce8c55481f4ed08f912cf8badda361c3f643ed81c9e15ae2f
7
+ data.tar.gz: c6f33e16bdd177198faa7571ac6297eb2714fb560c2955ed37d301249552be52953fa37e4b4125f0fb39cbc078a799450f367aa4d44ffa95968dce05826bb381
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aspec_rb (0.0.15)
4
+ aspec_rb (0.0.16)
5
5
  asciidoctor
6
6
 
7
7
  GEM
@@ -7,5 +7,5 @@ module AspecRb
7
7
  # For this deploy config, see https://github.com/tcob/aspec_rb/blob/master/.travis.yml
8
8
  #
9
9
  # Manual release can be performed by running 'bundle install && rake release'
10
- VERSION = '0.0.15'
10
+ VERSION = '0.0.16'
11
11
  end
@@ -118,15 +118,24 @@ end
118
118
  doclinks += o_anchors
119
119
  doclinks.uniq!
120
120
 
121
- includes.each do |parent, _child, childpath|
122
- anchors.map! { |anchor, path, filename, text, chapter, main, _h1|
123
- filename = parent if childpath == path
124
- [anchor, path, filename, text, chapter, main, _h1]
125
- }
126
- end
127
-
128
- anchors.uniq!
121
+ # Edit the array of Anchors to point to the parent document *if* it is included.
122
+ # TODO use a while loop, repeat until no changes made
129
123
  tempanchors = []
124
+ 3.times do
125
+ tempanchors.clear
126
+
127
+ # Loop through all includes, if the anchor is contained in an include,
128
+ # edit the anchors array to point to its parent instead
129
+ includes.each do |parent, _child, childpath|
130
+ anchors.delete_if do |anchor, path, filename, text, chapter, main, _h1|
131
+ next unless Sform.trim(childpath) == Sform.trim(filename)
132
+ tempanchors.push([anchor, path, Sform.trim(parent), text, chapter, main])
133
+ true
134
+ end
135
+ end
136
+ anchors += tempanchors
137
+ anchors.uniq!
138
+ end
130
139
 
131
140
  anchors.delete_if do |anchor, apath, trim_parent, parent, amain, achapter|
132
141
  doclinks.each do |doc, link, dchapter|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspec_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - tcob
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-06-08 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler