yard-doctest 0.1.12 → 0.1.13
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 +5 -5
- data/.travis.yml +1 -2
- data/CHANGELOG.md +4 -0
- data/features/yard-doctest.feature +29 -0
- data/lib/yard/cli/doctest.rb +12 -1
- data/lib/yard/doctest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1081e697fbcd5c8029f9aec98ad2e0650bf5951443ea892981d7ae8f1938315e
|
4
|
+
data.tar.gz: 34c404efd74f038987bb7a3dea81abb3d1904d3ee0749b95f47f9b43b4f6d700
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c0333567ed98b350c4fc6034c216e6c1cf55ccf4ba37e566f287c16069c5ceb37d77bab63eb7b3edbb7b29f4e829332ede2c4df432d5b7450fbdb3e5c132513
|
7
|
+
data.tar.gz: bbc5144b74b3ee0821cf8977f3f8d8b2950621b423dd0dd89b8dc36c04824d172f2d061f78baf22618ebbe8020366a4082dd5801019abf93ea43a4a53fc7cdaf
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -696,3 +696,32 @@ Feature: yard doctest
|
|
696
696
|
Then the output should contain "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips"
|
697
697
|
When I run `bundle exec yard doctest -v --name=/Second/`
|
698
698
|
Then the output should contain "1 runs, 1 assertions, 1 failures, 0 errors, 0 skips"
|
699
|
+
|
700
|
+
Scenario: ignores files excluded in .yardopts
|
701
|
+
Given a file named "doctest_helper.rb" with:
|
702
|
+
"""
|
703
|
+
require 'app/app'
|
704
|
+
require 'lib/lib'
|
705
|
+
"""
|
706
|
+
And a file named "app/app.rb" with:
|
707
|
+
"""
|
708
|
+
# @example
|
709
|
+
# foo
|
710
|
+
def foo
|
711
|
+
"I should be run"
|
712
|
+
end
|
713
|
+
"""
|
714
|
+
And a file named "lib/lib.rb" with:
|
715
|
+
"""
|
716
|
+
# @example
|
717
|
+
# bar
|
718
|
+
def bar
|
719
|
+
raise "I should be ignored"
|
720
|
+
end
|
721
|
+
"""
|
722
|
+
And a file named ".yardopts" with:
|
723
|
+
"""
|
724
|
+
--exclude lib/lib.rb
|
725
|
+
"""
|
726
|
+
When I run `bundle exec yard doctest`
|
727
|
+
Then the output should contain "1 runs, 0 assertions, 0 failures, 0 errors, 0 skips"
|
data/lib/yard/cli/doctest.rb
CHANGED
@@ -41,11 +41,22 @@ module YARD
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def parse_examples(files)
|
44
|
-
YARD.parse(files)
|
44
|
+
YARD.parse(files, excluded_files)
|
45
45
|
registry = Registry.load_all
|
46
46
|
registry.all.map { |object| object.tags(:example) }.flatten
|
47
47
|
end
|
48
48
|
|
49
|
+
def excluded_files
|
50
|
+
excluded = []
|
51
|
+
args = YARD::Config.with_yardopts { YARD::Config.arguments.dup }
|
52
|
+
args.each_with_index do |arg, i|
|
53
|
+
next unless arg == '--exclude'
|
54
|
+
excluded << args[i + 1]
|
55
|
+
end
|
56
|
+
|
57
|
+
excluded
|
58
|
+
end
|
59
|
+
|
49
60
|
def generate_tests(examples)
|
50
61
|
examples.each do |example|
|
51
62
|
text = example.text
|
data/lib/yard/doctest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-doctest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Rodionov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.6
|
124
|
+
rubygems_version: 2.7.6
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Doctests from YARD examples
|