Class: Swiftfake::SourceReader

Inherits:
Object
  • Object
show all
Defined in:
lib/swiftfake/source_reader.rb

Instance Method Summary collapse

Instance Method Details

#read_file(source_file) ⇒ Object



5
6
7
8
9
10
# File 'lib/swiftfake/source_reader.rb', line 5

def read_file(source_file)
  source = File.read(source_file)
  structure_json, status = Open3.capture2("sourcekitten structure --file #{source_file}")

  [source, structure_json] if status.success?
end