Sha256: c2425752b4fba668756f4dc41061cfc31829a7daf65fb68b06d169fba32e82da

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

class TcCli
  desc "Adds new metric to the project"
  long_desc "Allows to add new metric to the project"
  arg_name '{metric_name}'
  command :add_metric do |command|
    command.arg_name 'project name'
    command.desc 'name of the project, to which you want to add metric'
    command.flag :pn, :project_name

    command.arg_name 'metric type'
    command.desc 'type of the metric you want to add (string, number, boolean)'
    command.default_value "string"
    command.flag :mt, :metric_type

    command.action do |global, options, args|
      project_name = options[:project_name]
      metric_type = options[:metric_type]
      metric_name = args.first
      puts "Metric #{metric_name} with type #{metric_type} was successfully added to project #{project_name}." if AddMetric.new(project_name, metric_type, metric_name).call
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
techcor-0.0.1 lib/commands/gli/add_metric.rb