Class: Instadoc::Java::PathnameSeeker

Inherits:
Object
  • Object
show all
Defined in:
lib/instadoc/java/pathname_seeker.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ PathnameSeeker

Returns a new instance of PathnameSeeker.



6
7
8
# File 'lib/instadoc/java/pathname_seeker.rb', line 6

def initialize(config)
  @config = config
end

Instance Method Details

#search_in(base_pathname) ⇒ Object

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/instadoc/java/pathname_seeker.rb', line 10

def search_in(base_pathname)
  raise(ArgumentError, "base_pathname must not be null.") if  base_pathname.nil?

  path_names = Array.new
  files_path = File.join(base_pathname, "**", "*.java")
  Dir.glob(files_path) { |file|
    path_name = Pathname.new(file).realpath
    path_names << path_name
  }

  path_names
end