Class: Spout::Actions

Inherits:
Object
  • Object
show all
Defined in:
lib/spout/actions.rb

Instance Method Summary collapse

Instance Method Details

#interpret(argv) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/spout/actions.rb', line 4

def interpret(argv)
  case argv.first
  when 'new', 'n', 'ne', '-new', '-n', '-ne'
    new_template_dictionary(argv)
  when '--version', '-v', '-ve', '-ver', 'version', 'v', 've', 'ver'
    puts "Spout #{Spout::VERSION::STRING}"
  when 'test', 't', 'te', 'tes', '--test', '-t', '-te', '-tes'
    system "bundle exec rake HIDE_PASSING_TESTS=true"
  when 'tv'
    system "bundle exec rake"
  when 'import', 'i', 'im', 'imp', '--import', '-i', '-im', '-imp'
    import_from_csv(argv)
  when 'import_domain', '--import_domain', 'import_domains', '--import_domains'
    import_from_csv(argv, 'domains')
  when 'export', 'e', 'ex', 'exp', '--export', '-e', '-ex', '-exp'
    new_data_dictionary_export(argv)
  when 'hybrid', '-hybrid', '--hybrid', 'y', 'hy', '-y', '-hy'
    new_data_dictionary_export(argv, 'hybrid')
  when 'coverage', '-coverage', '--coverage', 'c', '-c'
    coverage_report(argv)
  when 'graphs', '-graphs', '--graphs', 'g', '-g'
    generate_graphs(argv.last(argv.size - 1))
  else
    help
  end
end