Class: CircuitPatchTools::Commands::Portable

Inherits:
Object
  • Object
show all
Defined in:
lib/circuit_patch_tools/commands/portable.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  synth: 1
}

Instance Method Summary collapse

Instance Method Details

#descriptionObject



15
16
17
# File 'lib/circuit_patch_tools/commands/portable.rb', line 15

def description
  'make patches portable'
end

#nameObject



11
12
13
# File 'lib/circuit_patch_tools/commands/portable.rb', line 11

def name
  'portable'
end

#run(args) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/circuit_patch_tools/commands/portable.rb', line 19

def run(args)
  options = DEFAULT_OPTIONS.dup

  OptionParser.new do |opts|
    opts.banner = "      \#{name}: \#{description}\n\n      Usage: circuit-patch \#{name} [options] patch1.sysex [patch2.sysex ...]\n\n      Options:\n    END\n    opts.on('-sSYNTH', '--synth=SYNTH',\n            'Synth for the patch',\n            \"Default: \#{DEFAULT_OPTIONS[:synth]}\",\n            Integer) do |v|\n      options[:synth] = v\n    end\n    opts.on('-h', '--help', 'Print this help') do\n      puts opts\n      return\n    end\n  end.parse!(args)\n\n  args.each do |path|\n    make_portable options, path\n  end\nend\n"