Class: GraphQL::Modernize::FileFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/modernize/file_finder.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ FileFinder

Returns a new instance of FileFinder.



8
9
10
# File 'lib/graphql/modernize/file_finder.rb', line 8

def initialize(config)
  @config = config
end

Instance Method Details

#find(paths = []) ⇒ Object



12
13
14
15
16
# File 'lib/graphql/modernize/file_finder.rb', line 12

def find(paths = [])
  candidates = paths.empty? ? configured_files : explicit_files(paths)
  candidates.select { |path| File.file?(path) && path.end_with?(".rb") }
            .reject { |path| excluded?(path) }.uniq.sort
end