Sha256: 3c4d42ce61d9ce98fcbd445af232e770416c0a9c257ff231735fd0712a1f1e51

Contents?: true

Size: 469 Bytes

Versions: 16

Compression:

Stored size: 469 Bytes

Contents

command 'schema' do |c|
  c.syntax = "brief schema"
  c.description = "view information about the schema"

  c.option '--all-models', 'Include all models, not just those that have documents'

  c.action do |args, options|
    schema_map = Brief.case(true).schema_map(options.all_models)

    output = if args.empty?
      schema_map.to_json
    else
      detail = schema_map.fetch(args.first.downcase, nil)
      detail.to_json if detail
    end

    output
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
brief-1.11.5 lib/brief/cli/schema.rb
brief-1.11.4 lib/brief/cli/schema.rb
brief-1.11.3 lib/brief/cli/schema.rb
brief-1.11.2 lib/brief/cli/schema.rb
brief-1.11.1 lib/brief/cli/schema.rb
brief-1.11.0 lib/brief/cli/schema.rb
brief-1.10.1 lib/brief/cli/schema.rb
brief-1.10.0 lib/brief/cli/schema.rb
brief-1.9.14 lib/brief/cli/schema.rb
brief-1.9.13 lib/brief/cli/schema.rb
brief-1.9.12 lib/brief/cli/schema.rb
brief-1.9.11 lib/brief/cli/schema.rb
brief-1.9.9 lib/brief/cli/schema.rb
brief-1.9.8 lib/brief/cli/schema.rb
brief-1.9.7 lib/brief/cli/schema.rb
brief-1.9.6 lib/brief/cli/schema.rb