Skip to content

Commit

Permalink
Make the source more yardoc friendly
Browse files Browse the repository at this point in the history
- added .yardopts
- removed :nodoc: tags
  • Loading branch information
dchelimsky committed Oct 16, 2011
1 parent 87a2645 commit 9dcc529
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ Gemfile.lock
*.rbc
bin
.rbx
.yardoc
4 changes: 4 additions & 0 deletions .yardopts
@@ -0,0 +1,4 @@
--no-private
--exclude features
-
lib/**/*.rb
2 changes: 1 addition & 1 deletion lib/rspec/core/configuration.rb
Expand Up @@ -121,7 +121,7 @@ def settings
@settings ||= {}
end

def clear_inclusion_filter # :nodoc:
def clear_inclusion_filter
self.inclusion_filter = nil
end

Expand Down
9 changes: 4 additions & 5 deletions lib/rspec/core/errors.rb
Expand Up @@ -2,11 +2,10 @@ module RSpec
module Core
# If Test::Unit is loaed, we'll use its error as baseclass, so that Test::Unit
# will report unmet RSpec expectations as failures rather than errors.
superclass = ['Test::Unit::AssertionFailedError', '::StandardError'].map do |c|
eval(c) rescue nil
end.compact.first

class PendingExampleFixedError < superclass
begin
class PendingExampleFixedError < Test::Unit::AssertionFailedError; end
rescue
class PendingExampleFixedError < StandardError; end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/core/example.rb
Expand Up @@ -27,7 +27,7 @@ def example_group
@example_group_class
end

def around_hooks # :nodoc:
def around_hooks
@around_hooks ||= example_group.around_hooks_for(self)
end

Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/formatters/snippet_extractor.rb
Expand Up @@ -2,8 +2,8 @@ module RSpec
module Core
module Formatters
# This class extracts code snippets by looking at the backtrace of the passed error
class SnippetExtractor #:nodoc:
class NullConverter; def convert(code, pre); code; end; end #:nodoc:
class SnippetExtractor
class NullConverter; def convert(code, pre); code; end; end

begin
require 'syntax/convertors/html'
Expand Down
4 changes: 2 additions & 2 deletions lib/rspec/core/let.rb
Expand Up @@ -86,12 +86,12 @@ def let!(name, &block)
end

module InstanceMethods
def __memoized # :nodoc:
def __memoized
@__memoized ||= {}
end
end

def self.included(mod) # :nodoc:
def self.included(mod)
mod.extend ClassMethods
mod.__send__ :include, InstanceMethods
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/core/rake_task.rb
Expand Up @@ -154,7 +154,7 @@ def initialize(*args)

private

def files_to_run # :nodoc:
def files_to_run
if ENV['SPEC']
FileList[ ENV['SPEC'] ]
else
Expand Down
10 changes: 5 additions & 5 deletions lib/rspec/core/ruby_project.rb
Expand Up @@ -11,23 +11,23 @@ def add_to_load_path(*dirs)
dirs.map {|dir| add_dir_to_load_path(File.join(root, dir))}
end

def add_dir_to_load_path(dir) # :nodoc:
def add_dir_to_load_path(dir)
$LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir)
end

def root # :nodoc:
def root
@project_root ||= determine_root
end

def determine_root # :nodoc:
def determine_root
find_first_parent_containing('spec') || '.'
end

def find_first_parent_containing(dir) # :nodoc:
def find_first_parent_containing(dir)
ascend_until {|path| File.exists?(File.join(path, dir))}
end

def ascend_until # :nodoc:
def ascend_until
Pathname(File.expand_path('.')).ascend do |path|
return path if yield(path)
end
Expand Down
12 changes: 6 additions & 6 deletions lib/rspec/core/runner.rb
Expand Up @@ -16,20 +16,20 @@ def self.disable_autorun!
@autorun_disabled = true
end

def self.autorun_disabled? # :nodoc:
def self.autorun_disabled?
@autorun_disabled ||= false
end

def self.installed_at_exit? # :nodoc:
def self.installed_at_exit?
@installed_at_exit ||= false
end

def self.running_in_drb? # :nodoc:
def self.running_in_drb?
(DRb.current_server rescue false) &&
DRb.current_server.uri =~ /druby\:\/\/127.0.0.1\:/
end

def self.trap_interrupt # :nodoc:
def self.trap_interrupt
trap('INT') do
exit!(1) if RSpec.wants_to_quit
RSpec.wants_to_quit = true
Expand Down Expand Up @@ -72,11 +72,11 @@ def self.run(args, err=$stderr, out=$stdout)
RSpec.reset
end

def self.run_over_drb(options, err, out) # :nodoc:
def self.run_over_drb(options, err, out)
DRbCommandLine.new(options).run(err, out)
end

def self.run_in_process(options, err, out) # :nodoc:
def self.run_in_process(options, err, out)
CommandLine.new(options, RSpec::configuration, RSpec::world).run(err, out)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rspec/core/subject.rb
Expand Up @@ -152,7 +152,7 @@ def subject(&block)
block ? @explicit_subject_block = block : explicit_subject || implicit_subject
end

attr_reader :explicit_subject_block # :nodoc:
attr_reader :explicit_subject_block

private

Expand Down
6 changes: 3 additions & 3 deletions lib/rspec/core/version.rb
@@ -1,6 +1,6 @@
module RSpec # :nodoc:
module Core # :nodoc:
module Version # :nodoc:
module RSpec
module Core
module Version
STRING = '2.7.0.rc1'
end
end
Expand Down

0 comments on commit 9dcc529

Please sign in to comment.