Sha256: 505f133603195d55f5844e36fdbb697f453f8f3dfbdf903a125d8f023dd387ef

Contents?: true

Size: 1.29 KB

Versions: 15

Compression:

Stored size: 1.29 KB

Contents

command "view example" do |c|
  c.syntax = "brief view example MODEL"
  c.description = "View an example document"
  c.option '--format TYPE', String, 'Which format to present the information. json, or table'

  c.action do |args, options|
    options.default(format: 'editor')
    model = args.first

    briefcase = Brief.case = Brief::Briefcase.new(root: Pathname(options.root || Brief.pwd))
    schema_map = briefcase.schema_map(false)

    payload = schema_map

    if args.length > 0
      payload = schema_map.fetch(args.first) do
        raise "Invalid model."
      end
    end

    puts "Viewing Documentation for #{ payload }"
  end
end

command "view documentation" do |c|
  c.syntax = "brief view documentation for MODEL"
  c.description = "View the documentation for a model"
  c.option '--format TYPE', String, 'Which format to present the information. json, or table'

  c.action do |args, options|
    options.default(format: 'editor')
    model = args.first

    briefcase = Brief.case = Brief::Briefcase.new(root: Pathname(options.root || Brief.pwd))
    schema_map = briefcase.schema_map(false)

    payload = schema_map

    if args.length > 0
      payload = schema_map.fetch(args.first) do
        raise "Invalid model."
      end
    end

    puts "Viewing Documentation for #{ payload }"
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
brief-1.17.14 lib/brief/cli/examples.rb
brief-1.17.13 lib/brief/cli/examples.rb
brief-1.17.12 lib/brief/cli/examples.rb
brief-1.17.11 lib/brief/cli/examples.rb
brief-1.17.10 lib/brief/cli/examples.rb
brief-1.17.9 lib/brief/cli/examples.rb
brief-1.17.8 lib/brief/cli/examples.rb
brief-1.17.7 lib/brief/cli/examples.rb
brief-1.17.5 lib/brief/cli/examples.rb
brief-1.17.4 lib/brief/cli/examples.rb
brief-1.17.3 lib/brief/cli/examples.rb
brief-1.17.2 lib/brief/cli/examples.rb
brief-1.17.1 lib/brief/cli/examples.rb
brief-1.17.0 lib/brief/cli/examples.rb
brief-1.16.2 lib/brief/cli/examples.rb