asciibuild 0.4.0 → 0.5.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciibuild/extensions.rb +8 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7d504183cebbc48f58474ddb695625d22c66c71
4
- data.tar.gz: ca3f3e66597e1d029b59df92337b4a65fae5a124
3
+ metadata.gz: f2c30824fc02df2f417b338f1009740077fcb7d9
4
+ data.tar.gz: 98f4fdaaaacd26c26ef375dd99a117f21a8ac4ec
5
5
  SHA512:
6
- metadata.gz: 8882a0552645928345632016ad9e8911ab01c2767f2a24742b03cfea52308426894f4973ac94f1eeb679904f9fbfae04405d415c0873448dddea3e94e89c382b
7
- data.tar.gz: b0bf78dc4d5cebd2dada1de1419f0073585dc7c92da364e6679de62584f6016ed20024b48153a2813903c2111d786067306ce700acda796790beb28ab5cde4a9
6
+ metadata.gz: 8ce5ac3266186050381a94ad654102847f522a0c9109aca74616d88dc0eae2480ba219549f5a4492892cd4ac8d7275547c5d0964e0353685597517e9f65b2bf4
7
+ data.tar.gz: 779badcf11c72d88359a2088beeb1d52f7e79b9cc687381258d73010b0c885a5bf4eb38634008a973c0faf4cc6371eb2de4f5a1055a1d1a7b2941ce95a5c1fde
@@ -50,12 +50,13 @@ def write_file attrs, default_name, body
50
50
  end
51
51
  end
52
52
 
53
- def redact parent, attrs, lines
54
- patts = if parent.document.attributes['redact']
55
- if parent.document.attributes['redact'].class == Array
56
- parent.document.attributes['redact']
53
+ def normalize parent, attrs, lines
54
+ redact = parent.document.attributes['redact']
55
+ patts = if redact
56
+ if redact.class == Array
57
+ redact
57
58
  else
58
- [parent.document.attributes['redact']]
59
+ [redact]
59
60
  end
60
61
  else
61
62
  []
@@ -66,7 +67,7 @@ def redact parent, attrs, lines
66
67
  patts.each do |p|
67
68
  l = l.gsub(Regexp.new(p), "[****]")
68
69
  end
69
- new_lines << l
70
+ new_lines << l.gsub(/\e\[([;\d]+)?m/, '') # Sneak in ANSI color stripping here as well
70
71
  end
71
72
  new_lines
72
73
  end
@@ -164,7 +165,6 @@ module Asciibuild
164
165
  # If using a language like BASH or Python, the language's interpreter should accept `STDIN` as
165
166
  # input and be found in the `PATH`.
166
167
 
167
-
168
168
  use_dsl
169
169
  named :asciibuild
170
170
  on_context :listing
@@ -297,7 +297,7 @@ module Asciibuild
297
297
  attrs['title'] = 'icon:check-circle[role=green] ' + attrs['title']
298
298
  end
299
299
 
300
- after_end cmd, parent, redact(parent, attrs, lines), attrs
300
+ after_end cmd, parent, normalize(parent, attrs, lines), attrs
301
301
  end
302
302
 
303
303
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciibuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Brisbin