doc_rspec 0.1.0 → 0.1.2

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: 90000c65d8bc3bbc74f74e8db74349c2da89966469523b644c8c4626bf3ec691
4
- data.tar.gz: 309bec43ab7c272231f30bf244d2ee35177487eb6b37f2a27ab2ae3e04495988
3
+ metadata.gz: 1ea386bcbd5e9be13a6eb83e7476d536fc4b15a565312c422dda406a1fe93d96
4
+ data.tar.gz: b05c0db28f9d81c95dddb6f782c18ba8cce4bd6e6bdf6a208b2987b7378a856f
5
5
  SHA512:
6
- metadata.gz: 6efcda2932d37904415e7b705c085d9cf270d38948d5ea583d8f4e433f360dec23a70a673345692de4e75a361edb43f4af9c5968a1830f0f59864469dbe5225a
7
- data.tar.gz: e286b14434287552c08d18fa7125557bf4aad1c9af90cdc3a6b62858266c086bc501504586ac3b62a688387b27772d383641334d95d4121301e84ae4b96ef204
6
+ metadata.gz: 6faa80959f62b2a1a3a9e4147bc5506ec274fc64189b622d6efd3df0d5c817807636db842d7a116f2738ebeed4ac494ac98a4f52fcd6b179dffa4f9be337b322
7
+ data.tar.gz: 37c7b059562e6cc58ba4ad5aa759a752c5cf94472e55260d80178a77b789082dfa23da37d4ecb5fb7e172a492b2b198e3106217e0b817f221588d8345e48d70c
@@ -5,7 +5,6 @@ class DocRSpec
5
5
  def docspec(path)
6
6
  DocRSpec.new(path, self).generate_specs
7
7
  end
8
-
9
8
  end
10
9
  end
11
10
  # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -16,7 +16,7 @@ class DocRSpec
16
16
  START_EXAMPLE = %r{\A \s* \#+ \s+ ```spec \s* (\# \s+)?(.*)?}x
17
17
  START_RDOC_COMMENT = %r{\A \s* \#\#}x
18
18
  STOP_EXAMPLE = %r{\A \s* \#+ \s+ ```}x
19
- STOP_RDOC_COMMENT = %r{\A \s* [^#]}x
19
+ STOP_RDOC_COMMENT = %r{\A \s* [^#]* \z}x
20
20
 
21
21
  attr_reader :ast, :lines, :state
22
22
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  class DocRSpec
4
4
  module Version
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.2'
6
6
  end
7
7
  end
8
8
  # SPDX-License-Identifier: AGPL-3.0-or-later
@@ -1,13 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rspec'
4
- require_relative 'doc_spec/compiler'
5
- require_relative 'doc_spec/example_group'
6
- require_relative 'doc_spec/parser'
4
+ require_relative 'doc_rspec/compiler'
5
+ require_relative 'doc_rspec/example_group'
6
+ require_relative 'doc_rspec/parser'
7
7
  RSpec.configure { it.extend DocRSpec::ExampleGroup }
8
8
 
9
9
  ##
10
+ # # Usage
11
+ #
12
+ # Install the gem `gem install doc_rspec` or put `doc_rspec` in your Gemfile
13
+ # or gemspec file.
14
+ #
15
+ # Then `require doc_rspec` in the file you want to use the `docspec` macro
16
+ # or put it into your `spec_helper.rb` or use any advanced require strategy
17
+ # you are used to.
18
+ #
10
19
  # # Abstract
20
+ #
11
21
  # DocRSpec allows us to call `doctest <sourcefile>` and the specs
12
22
  # between ` ```spec ` and ` ``` ` will be executed in the context
13
23
  # of the `RSpec` example group `doctest` has been called.
@@ -55,10 +65,10 @@ RSpec.configure { it.extend DocRSpec::ExampleGroup }
55
65
  # `formatter=:doc` looks like this:
56
66
  #
57
67
  # DocRSpec
58
- # example from rdoc (doc_spec.rb:21)
59
- # example from rdoc (doc_spec.rb:34)
60
- # example from rdoc (doc_spec.rb:41)
61
- # example from rdoc (doc_spec.rb:49)
68
+ # example from rdoc (doc_rspec.rb:21)
69
+ # example from rdoc (doc_rspec.rb:34)
70
+ # example from rdoc (doc_rspec.rb:41)
71
+ # example from rdoc (doc_rspec.rb:49)
62
72
  #
63
73
  # We can improve on this by giving an example a name with the ` ```spec # <name>` syntax
64
74
  #
@@ -70,9 +80,9 @@ RSpec.configure { it.extend DocRSpec::ExampleGroup }
70
80
  # Now the output looks like:
71
81
  #
72
82
  # DocRSpec
73
- # example from rdoc (doc_spec.rb:21)
83
+ # example from rdoc (doc_rspec.rb:21)
74
84
  # ...
75
- # fourtytwo is the answer (doc_spec.rb:65)
85
+ # fourtytwo is the answer (doc_rspec.rb:65)
76
86
  #
77
87
  class DocRSpec
78
88
 
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.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Dober
@@ -47,13 +47,13 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - LICENSE
49
49
  - README.md
50
- - lib/doc_spec.rb
51
- - lib/doc_spec/ast.rb
52
- - lib/doc_spec/ast/example.rb
53
- - lib/doc_spec/compiler.rb
54
- - lib/doc_spec/example_group.rb
55
- - lib/doc_spec/parser.rb
56
- - lib/doc_spec/version.rb
50
+ - lib/doc_rspec.rb
51
+ - lib/doc_rspec/ast.rb
52
+ - lib/doc_rspec/ast/example.rb
53
+ - lib/doc_rspec/compiler.rb
54
+ - lib/doc_rspec/example_group.rb
55
+ - lib/doc_rspec/parser.rb
56
+ - lib/doc_rspec/version.rb
57
57
  homepage: https://codeberg.org/lab419/doc_spec
58
58
  licenses:
59
59
  - AGPL-3.0-or-later
File without changes
File without changes
File without changes