Sha256: d16b7475bb51445b0aa7c887f2a158757cf6245019b0b64a6a3590f964126153
Contents?: true
Size: 675 Bytes
Versions: 26
Compression:
Stored size: 675 Bytes
Contents
command 'write' do |c| c.syntax = 'brief write MODEL_TYPE [OPTIONS]' c.description = 'Create a new document for a given model type' c.action do |args, _options| string_args = args.select { |a| a.is_a?(String) } model_class = Brief::Model.lookup_class_from_args(string_args) base_content = '' if model_class && model_class.example_body.to_s.length > 0 base_content = model_class.example_body else # document_contents = model_class.inspect + model_class.example_body.to_s end document_contents = ask_editor(base_content) file = ask('enter a name for this file:', String) puts file puts document_contents end end
Version data entries
26 entries across 26 versions & 1 rubygems