polyrex-headings 0.1.8 → 0.1.9
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -1
- data/lib/polyrex-headings.rb +15 -4
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b20a5b0ee1ab9d61cc68e275ff40499dc7399089
|
|
4
|
+
data.tar.gz: 3eb2e1b505550d64ed92106af7712ec6d2dbb449
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d4219e47e7fe6b6710f7dc8dc1a2cc4688c7d9934652a5be5582ad57c6d164b5ebfb26399600503783b78fd9403e27905044cbdec77a777723fb35d68a29ec58
|
|
7
|
+
data.tar.gz: 6486c87f220d4ca5bb212f02ac72c8c6e746dbcbc3aa94ebc6f69ced85a976ea38ae5d6453b2ebd6e413b35f174a42868f0b6a2216cc1fe04b074ffd54243548
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
�Q��v�wX�?F�V�:ѬI�F����m,��L]c~�w�;�I�/�.������b��L�� )�'=Y� ����(�u������i��DA���w��*y���|����`2�o�4���6�S�6D��m�DµY�qQ��Hy:��7�Â�np I<��ԫ��G&X�-�����p�c�3��
|
data/lib/polyrex-headings.rb
CHANGED
|
@@ -4,17 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
require 'polyrex'
|
|
6
6
|
|
|
7
|
+
class PolyrexHeadingsException < Exception
|
|
8
|
+
end
|
|
9
|
+
|
|
7
10
|
class PolyrexHeadings
|
|
8
11
|
|
|
9
|
-
attr_reader :to_polyrex, :to_s
|
|
12
|
+
attr_reader :to_polyrex, :to_px, :to_s
|
|
10
13
|
|
|
11
14
|
def initialize(raw_s)
|
|
15
|
+
|
|
16
|
+
buffer, type = RXFHelper.read(raw_s)
|
|
17
|
+
|
|
18
|
+
if type == :unknown and buffer.lines.length <= 1 then
|
|
19
|
+
raise PolyrexHeadingsException, 'File not found'
|
|
20
|
+
end
|
|
12
21
|
|
|
13
22
|
# add an empty space to the blank line where there is no
|
|
14
23
|
# raw record between headings
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
summary, *s =
|
|
25
|
+
buffer.gsub!(/(#+[^\n]+\n+)(?=\n#)/m,'\1 ')
|
|
26
|
+
summary, *s = buffer.split(/(?=(?:^#|[\n]+\n-+))/,2)
|
|
18
27
|
type = nil
|
|
19
28
|
|
|
20
29
|
a = if raw_s =~ /----/ then
|
|
@@ -66,13 +75,15 @@ class PolyrexHeadings
|
|
|
66
75
|
end
|
|
67
76
|
|
|
68
77
|
end
|
|
78
|
+
|
|
69
79
|
summary.sub!(/^(<\?)(ph|polyrex-headings)/,'\1polyrex')
|
|
70
80
|
@to_s = string = summary + a.join
|
|
71
81
|
|
|
72
82
|
px = Polyrex.new
|
|
83
|
+
|
|
73
84
|
px.parse(string, delimiter: ' # ')
|
|
74
85
|
|
|
75
|
-
@to_polyrex = px
|
|
86
|
+
@to_polyrex = @to_px = px
|
|
76
87
|
|
|
77
88
|
end
|
|
78
89
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: polyrex-headings
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
|
31
31
|
vMdoPmHODROmaBsBeXs0T155GSR9YIFca78CXJGUE108Vgao95n3mKksxyTbKm2Y
|
|
32
32
|
nSBX7qKERZEaiQ==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2017-01-
|
|
34
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: polyrex
|
|
@@ -39,20 +39,20 @@ dependencies:
|
|
|
39
39
|
requirements:
|
|
40
40
|
- - "~>"
|
|
41
41
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '1.
|
|
42
|
+
version: '1.1'
|
|
43
43
|
- - ">="
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: 1.
|
|
45
|
+
version: 1.1.11
|
|
46
46
|
type: :runtime
|
|
47
47
|
prerelease: false
|
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
|
49
49
|
requirements:
|
|
50
50
|
- - "~>"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '1.
|
|
52
|
+
version: '1.1'
|
|
53
53
|
- - ">="
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 1.
|
|
55
|
+
version: 1.1.11
|
|
56
56
|
description:
|
|
57
57
|
email: james@jamesrobertson.eu
|
|
58
58
|
executables: []
|
|
@@ -83,5 +83,5 @@ rubyforge_project:
|
|
|
83
83
|
rubygems_version: 2.6.8
|
|
84
84
|
signing_key:
|
|
85
85
|
specification_version: 4
|
|
86
|
-
summary:
|
|
86
|
+
summary: Parses a raw Polyrex document containing Markdown style headings
|
|
87
87
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|