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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: eba9b291cde3beb389b61654c7c322867eda5c85
4
- data.tar.gz: b0ed6bad33e7898a33aacbc1c297ef876da20bcf
2
+ SHA256:
3
+ metadata.gz: 1081e697fbcd5c8029f9aec98ad2e0650bf5951443ea892981d7ae8f1938315e
4
+ data.tar.gz: 34c404efd74f038987bb7a3dea81abb3d1904d3ee0749b95f47f9b43b4f6d700
5
5
  SHA512:
6
- metadata.gz: 9c3694a20bd31d53e3716d83a9f6062c958478b80f8f4e39ff26c5e32f5c911a5414dc4086230a66b46f654f2b5fa4af3dc4e1ebed56f2efbad446abb39749fa
7
- data.tar.gz: f184b05173e542846f4b5d4c46907e1ed25b1edf80b82cf2831507758bdd3659ed3a06d7e91c244f76bccc0314bcaa2092c644b7cdb06d09378d0081beaf1307
6
+ metadata.gz: 0c0333567ed98b350c4fc6034c216e6c1cf55ccf4ba37e566f287c16069c5ceb37d77bab63eb7b3edbb7b29f4e829332ede2c4df432d5b7450fbdb3e5c132513
7
+ data.tar.gz: bbc5144b74b3ee0821cf8977f3f8d8b2950621b423dd0dd89b8dc36c04824d172f2d061f78baf22618ebbe8020366a4082dd5801019abf93ea43a4a53fc7cdaf
@@ -1,5 +1,4 @@
1
1
  rvm:
2
- - 2.0.0
3
- - 2.1.0
2
+ - 2.4.3
4
3
 
5
4
  before_script: bundle exec yard config -a autoload_plugins yard-doctest
@@ -1,3 +1,7 @@
1
+ ## 0.1.13
2
+
3
+ * Ignore files excluded in .yardopts (#7)
4
+
1
5
  ## 0.1.12
2
6
 
3
7
  * Reworked the construction of context where examples are evaluated.
@@ -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"
@@ -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
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module Doctest
3
- VERSION = '0.1.12'
3
+ VERSION = '0.1.13'
4
4
  end
5
5
  end
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.12
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-03-23 00:00:00.000000000 Z
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.14
124
+ rubygems_version: 2.7.6
125
125
  signing_key:
126
126
  specification_version: 4
127
127
  summary: Doctests from YARD examples