codeblock 1.0 → 1.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/codeblock.rb +10 -10
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 583c7a3edfb276f54463bc3c9a04ff035d9c7597b8f353fdc18b1076cfdf1b33
4
- data.tar.gz: b6d7010884b4fc6a0347896d9a6029ce6c8e01cbc11ef2f0c0e3e8dd4441d395
3
+ metadata.gz: d4fcbff474c44f532ea3422cec17d0b7b7e88533341595ee8ea53746e3f56c56
4
+ data.tar.gz: a4106d62f580d1c3ffaeb952f8e2f25674d218da68ff0868235ada7c86c64a8e
5
5
  SHA512:
6
- metadata.gz: b001b7883f3075a41638aa92f66935eb4b52ad3a7eb90b182d1b3ebc2950f11312787e4df387b63d69de4297fb4e472495093547781da1d8edaf5acaf5b551c4
7
- data.tar.gz: 759e75ff240f9a12b4d06d67fd7af5ce536c0b0c896443ffbc30f7891d00d786147b180c7a914f7130494f82b3f44827fa61733a16283e92716e210716e5e7a1
6
+ metadata.gz: 275460199c33063d412b987e00c0d802cb0c046bc6918049fd039fd7ad397c13267ba3f2dd2e803a74600c69f69d8296fe13993ad4149d1e0d8f8df771901e4d
7
+ data.tar.gz: 21bd455594236dcf0c6e0cbcdc8ecd762951cff754c554feaebc516299d19425e69c3c6d18bf7a7d13ce9ce73810ecdf1eb9f7250cc2567c114869c6bd59ba54
data/README.md CHANGED
@@ -188,4 +188,5 @@ mike@idocs.com
188
188
 
189
189
  | version | date | notes |
190
190
  |---------|---------------|-------------------------------------------------------|
191
- | 1.0 | June 18, 2020 | Initial upload. |
191
+ | 1.0 | June 18, 2020 | Initial upload. |
192
+ | 1.1 | June 19, 2020 | Fixed bug with skip_skips. |
@@ -6,7 +6,7 @@ require 'attparser'
6
6
  #
7
7
  class CodeBlock
8
8
  # Version
9
- VERSION = '1.0'
9
+ VERSION = '1.1'
10
10
 
11
11
  #---------------------------------------------------------------------------
12
12
  # initialize
@@ -35,6 +35,7 @@ class CodeBlock
35
35
  @tab = opts['tab'] || ' '
36
36
  @indent = opts['indent']
37
37
  @line_nums = opts['line_nums']
38
+ @skip_skips = opts['skip_skips'] ? true : false
38
39
 
39
40
  # if 'se' param, set start and end to "start" and "end"
40
41
  if opts['se']
@@ -45,20 +46,13 @@ class CodeBlock
45
46
  @end = opts['end']
46
47
  end
47
48
 
48
- # if collapse is defined
49
+ # default collapse to true
49
50
  if opts.has_key?('collapse')
50
51
  @collapse = opts['collapse']
51
52
  else
52
53
  @collapse = true
53
54
  end
54
55
 
55
- # if skip_skips is defined
56
- if opts.has_key?('skip_skips')
57
- @skip_skips = opts['skip_skips']
58
- else
59
- @skip_skips = true
60
- end
61
-
62
56
  # initialize block object
63
57
  @block_ob = nil
64
58
  end
@@ -276,7 +270,13 @@ class CodeBlock::Line
276
270
  if @raw.match(/\#\#/mu)
277
271
  raw_atts = @raw.sub(/\A.*\#\#\s*/mu, '')
278
272
  raw_atts = raw_atts.rstrip
279
- @atts = AttParser.parse(raw_atts, 'infer'=>true)
273
+
274
+ # if raw atts are a single string without =, use that as the name
275
+ if raw_atts.match(/\A\S+\z/mu) and (not raw_atts.match(/\=/mu))
276
+ @atts = {'name'=>raw_atts}
277
+ else
278
+ @atts = AttParser.parse(raw_atts, 'infer'=>true)
279
+ end
280
280
  else
281
281
  @atts = {}
282
282
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeblock
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: '1.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike O'Sullivan