Module: Katarina::Path

Defined in:
lib/katarina/path.rb

Class Method Summary collapse

Class Method Details

.include_paths(paths) ⇒ Object



6
7
8
# File 'lib/katarina/path.rb', line 6

def include_paths(paths)
  paths.reject { Katarina.config.exclude_paths.include?(_1) }
end

.output_dir(paths) ⇒ Object



14
15
16
# File 'lib/katarina/path.rb', line 14

def output_dir(paths)
  [Dir.pwd, Katarina.config.output_dir, *include_paths(paths)[0..-2]].join('/')
end

.output_file_name(file_name) ⇒ Object



18
19
20
# File 'lib/katarina/path.rb', line 18

def output_file_name(file_name)
  file_name + '.d.ts'
end

.output_path(paths) ⇒ Object



10
11
12
# File 'lib/katarina/path.rb', line 10

def output_path(paths)
  [output_dir(paths), output_file_name(paths.last)].join('/')
end