Module: Ssource::SourceKitten

Defined in:
lib/ssource/source_kitten.rb

Class Method Summary collapse

Class Method Details

.structure(file) ⇒ Object



24
25
26
27
# File 'lib/ssource/source_kitten.rb', line 24

def structure(file)
  json = JSON.parse `sourcekitten structure --file #{file}`
  json['key.substructure'].map(&:purify_hash)
end

.syntax(file) ⇒ Object



20
21
22
# File 'lib/ssource/source_kitten.rb', line 20

def syntax(file)
  JSON.parse `sourcekitten syntax --file #{file}`
end