polyrex-headings 0.1.8 → 0.1.9

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
  SHA1:
3
- metadata.gz: 30d320ec3a85a1f1cbf02386055aa990b9e43774
4
- data.tar.gz: 4f64cfdba7853716e010617a46911d8ea9359de8
3
+ metadata.gz: b20a5b0ee1ab9d61cc68e275ff40499dc7399089
4
+ data.tar.gz: 3eb2e1b505550d64ed92106af7712ec6d2dbb449
5
5
  SHA512:
6
- metadata.gz: ce10b4e0cf6d3d906d1435c4d38bdb81d48299e1e63fd15441018d48d7457a1a244e7ec1ef0f0aa2a6ca9133b64fff1d95c0089fa5a5be46dd6aa3f2ad22bd1d
7
- data.tar.gz: 54d8512dc605e8a9ca469787b1a5ae0c4fd17da33977cec9001085114f950e99850ce2cd9d5c7ae80baf3a74eadc3ce62c59afb333e2ad7451284b9ba2b1fadc
6
+ metadata.gz: d4219e47e7fe6b6710f7dc8dc1a2cc4688c7d9934652a5be5582ad57c6d164b5ebfb26399600503783b78fd9403e27905044cbdec77a777723fb35d68a29ec58
7
+ data.tar.gz: 6486c87f220d4ca5bb212f02ac72c8c6e746dbcbc3aa94ebc6f69ced85a976ea38ae5d6453b2ebd6e413b35f174a42868f0b6a2216cc1fe04b074ffd54243548
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- ���X��bnr\�8���llo����R �5=��i3��?Ju>��>)�ޝ`E4��k�����c@[C;u�k�S����hoղ��L��k,$� ɵ%��)�s-��(���#f�#��p�����AP��r�^!Y����{'#���)U}���"�~�VǣϹP,w��:Ϸ�Pi�ӛ&�x�еD�b#�HM��`Pp}�>���H)b@�'��iI^����Dt4�д��%V۪�㉘Oh��nG�od
1
+ �Q��vwX�?FV�:ѬIF����m,��L]c~�w�;�I�/�.������b��L�� )�'=Y� ����(�u������i ��DA���w��*y���|����`2o�4���6�S�6D��mD µYqQ��Hy:��7�Â�np I<��ԫ��G&X�-�����p�c�3��
@@ -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
- raw_s.gsub!(/(#+[^\n]+\n+)(?=\n#)/m,'\1 ')
17
- summary, *s = raw_s.split(/(?=(?:^#|[\n]+\n-+))/,2)
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.8
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-10 00:00:00.000000000 Z
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.0'
42
+ version: '1.1'
43
43
  - - ">="
44
44
  - !ruby/object:Gem::Version
45
- version: 1.0.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.0'
52
+ version: '1.1'
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 1.0.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: polyrex-headings
86
+ summary: Parses a raw Polyrex document containing Markdown style headings
87
87
  test_files: []
metadata.gz.sig CHANGED
Binary file