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 +4 -4
- data/lib/{doc_spec → doc_rspec}/example_group.rb +0 -1
- data/lib/{doc_spec → doc_rspec}/parser.rb +1 -1
- data/lib/{doc_spec → doc_rspec}/version.rb +1 -1
- data/lib/{doc_spec.rb → doc_rspec.rb} +19 -9
- metadata +8 -8
- /data/lib/{doc_spec → doc_rspec}/ast/example.rb +0 -0
- /data/lib/{doc_spec → doc_rspec}/ast.rb +0 -0
- /data/lib/{doc_spec → doc_rspec}/compiler.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea386bcbd5e9be13a6eb83e7476d536fc4b15a565312c422dda406a1fe93d96
|
4
|
+
data.tar.gz: b05c0db28f9d81c95dddb6f782c18ba8cce4bd6e6bdf6a208b2987b7378a856f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6faa80959f62b2a1a3a9e4147bc5506ec274fc64189b622d6efd3df0d5c817807636db842d7a116f2738ebeed4ac494ac98a4f52fcd6b179dffa4f9be337b322
|
7
|
+
data.tar.gz: 37c7b059562e6cc58ba4ad5aa759a752c5cf94472e55260d80178a77b789082dfa23da37d4ecb5fb7e172a492b2b198e3106217e0b817f221588d8345e48d70c
|
@@ -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
|
|
@@ -1,13 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rspec'
|
4
|
-
require_relative '
|
5
|
-
require_relative '
|
6
|
-
require_relative '
|
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 (
|
59
|
-
# example from rdoc (
|
60
|
-
# example from rdoc (
|
61
|
-
# example from rdoc (
|
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 (
|
83
|
+
# example from rdoc (doc_rspec.rb:21)
|
74
84
|
# ...
|
75
|
-
# fourtytwo is the answer (
|
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.
|
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/
|
51
|
-
- lib/
|
52
|
-
- lib/
|
53
|
-
- lib/
|
54
|
-
- lib/
|
55
|
-
- lib/
|
56
|
-
- lib/
|
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
|