lib/inch/code_object/provider/yard/parser.rb in inch-0.4.0.rc2 vs lib/inch/code_object/provider/yard/parser.rb in inch-0.4.0.rc3
- old
+ new
@@ -18,14 +18,13 @@
# @param dir [String] directory
# @param config [Inch::Config::Codebase] configuration for codebase
# @return [void]
def parse(dir, config)
- old_dir = Dir.pwd
- Dir.chdir dir
- parse_yard_objects(config.included_files, config.excluded_files)
- inject_base_dir(dir)
- Dir.chdir old_dir
+ Dir.chdir(dir) do
+ parse_yard_objects(config.included_files, config.excluded_files)
+ inject_base_dir(dir)
+ end
end
# @return [Array<YARD::Object::Base>]
def objects
@objects ||= parsed_objects.map do |o|