Class: Gitara::App

Inherits:
Thor
  • Object
show all
Defined in:
lib/gitara/app.rb

Instance Method Summary collapse

Instance Method Details

#export(source_path) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gitara/app.rb', line 17

def export(source_path)
  load source_path
  tab = Gitara.tab
  lilypond_name = Pow(source_path).name(false) + '.ly'
  lilypond_path = Pow(options['target-directory']) / lilypond_name
  lilypond_path.write(Gitara.render('tab', tab))

  if options['run-lilypond']
    `lilypond -o #{lilypond_path.parent / lilypond_path.name(false)} #{lilypond_path}`
  end
end