class Renamespace::ExpandRelativeRequiresWithinAllFiles
Public Instance Methods
call()
click to toggle source
# File lib/renamespace/expand_relative_requires_within_all_files.rb, line 7 def call all_suitable_ruby_file_paths.each do |path| content_orig = File.read(path) content_new = expand_in_file(content_orig, path) File.write(path, content_new) unless content_orig == content_new end end
Private Instance Methods
all_suitable_ruby_file_paths()
click to toggle source
# File lib/renamespace/expand_relative_requires_within_all_files.rb, line 21 def all_suitable_ruby_file_paths Renamespace::Paths.all_ruby_file_paths - exclusions end
exclusions()
click to toggle source
# File lib/renamespace/expand_relative_requires_within_all_files.rb, line 25 def exclusions %w[ spec/spec_helper.rb renamespace_spec.rb lib/bootstrap.rb ] end
expand_in_file(content_orig, path)
click to toggle source
# File lib/renamespace/expand_relative_requires_within_all_files.rb, line 17 def expand_in_file(content_orig, path) Renamespace::ExpandRelativeRequiresInFileContent.new(content: content_orig, path: path).call end