doc_rspec 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59e8d3ee3246fe4e1840227fee649981f2f57fb6be5ef1b9c02e2fb9a2ebb9ab
4
- data.tar.gz: e470857001bff3657ae5ab05c269d00369f89111e292d5678de760dd53771265
3
+ metadata.gz: 8e2ea270de14b4a37fd648bde29d59a4f0a2244159d22a06e798c2387faa96f8
4
+ data.tar.gz: b3588a664c869b921e789c778be7508f8189628281d2c65796be3c3b31c1d060
5
5
  SHA512:
6
- metadata.gz: 410226d89424038b7c58c1a971e20942af897472b6a9d4825e1b08aebe8e3a0f876bcec58c9205c0c3720006e63acd9a0654aaea8ba7693f84bbae3bacafae48
7
- data.tar.gz: 9f73f46d97b292a6e7e8c0c198186b29021adeb50bcbfcb7c8e7901d8f7640ac360f1789c073c34e4f9e36d5acaafcc755579c5e7df3495ea0625f9be5aa63f1
6
+ metadata.gz: 90a3129c0e172feaaae26d3d15cee20df6199d43d9d76676eab7b579038fbbd97c5f129fd4e72ac3ece19be2a4a01b260b60e255d765aa5f5b60478808ef2bfa
7
+ data.tar.gz: 31d6850d1534204007cf3953800c9d5a9f1cdf4e2f7e4450e93ca4dbfa44af7ea76fd8bf2e1fc03697f50a248c21eefe1f5d3d2693f76c30b9f564d18cbd59cc
@@ -13,7 +13,7 @@ class DocRSpec
13
13
  CONTEXT_DEFINITION = %r{\A \s* \# \s ={1,7} \s (.*)}x
14
14
 
15
15
  EXAMPLE_LINE = %r{\A \s* \# \s{4,} (.*)}x
16
-
16
+
17
17
  SHORT_EQUALS = %r{\s \=\=\> \s}x
18
18
  SHORT_MATCHES = %r{\s \~\> \s}x
19
19
  SHORT_PREDICATE = %r{\s is\! \s}x
@@ -62,6 +62,8 @@ class DocRSpec
62
62
  code = match[1]
63
63
  return if code.empty?
64
64
 
65
+ return if COMMENT_LINE === code
66
+
65
67
  compiled =
66
68
  SHORTCUTS.find_value(default: code) do |shtct_def|
67
69
  shtct_def => [rgx, to_or_not, rhs_template]
@@ -2,7 +2,7 @@
2
2
 
3
3
  class DocRSpec
4
4
  module Version
5
- VERSION = '0.2.4'
5
+ VERSION = '0.2.5'
6
6
  end
7
7
  end
8
8
  # SPDX-License-Identifier: AGPL-3.0-or-later
data/lib/doc_rspec.rb CHANGED
@@ -93,6 +93,15 @@ RSpec.configure { it.extend DocRSpec::RSpecExampleGroup }
93
93
  # require 'ostruct'
94
94
  # OpenStruct.new(ok?: false) not! ok
95
95
  #
96
+ #
97
+ # === Comments inside examples
98
+ #
99
+ # # example: comments are removed
100
+ #
101
+ # # so this works
102
+ # expect(1).to eq(1)
103
+ # # and this ==> too
104
+ #
96
105
  # === End of Example
97
106
  #
98
107
  # the code does not continue after the rdoc comment
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doc_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober