Class: Textus::CLI::Verb::SchemaInit

Inherits:
Textus::CLI::Verb show all
Defined in:
lib/textus/cli/verb/schema_init.rb

Instance Attribute Summary

Attributes inherited from Textus::CLI::Verb

#positional

Instance Method Summary collapse

Methods inherited from Textus::CLI::Verb

#emit, inherited, #initialize, needs_store?, option, options, #parse

Constructor Details

This class inherits a constructor from Textus::CLI::Verb

Instance Method Details

#call(store) ⇒ Object

Raises:



7
8
9
10
11
12
# File 'lib/textus/cli/verb/schema_init.rb', line 7

def call(store)
  name = positional.shift or raise UsageError.new("schema init NAME")
  raise UsageError.new("schema init requires --from=KEY") unless from_key

  emit(Textus::Schema::Tools.init(store, name: name, from: from_key))
end