Sha256: c5354368b5272a4ebed2eb1fb2ac7c6c37da5da84ff5b6b1afbceac4d1045295

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

require 'thor'
require 'sinatra/base'

require_relative 'app'
require_relative 'metadata'


module OpsAsk
  class Main < Thor
    desc 'art', 'Show the application art'
    def art
      max_line_len = OpsAsk::ART.lines.sort_by { |l| l.length }.last.length
      description = "OpsAsk #{OpsAsk::VERSION} / #{OpsAsk::SUMMARY} / #{OpsAsk::AUTHOR} (#{OpsAsk::EMAIL})"
      puts
      puts OpsAsk::ART
      puts description.center(max_line_len)
      puts
    end

    desc 'version', 'Show the application version'
    def version
      puts OpsAsk::VERSION
    end

    desc 'server', 'Start application web server'
    option :port, default: 3000, aliases: :p
    option :config, default: nil, aliases: :c
    def server
      config = {
        ops_group: 'change-network-operations',
        agile_board: '169', # Operations
        assignee: 'denimcores',
        jira_user: nil,
        jira_pass: nil,
        jira_url: 'http://jira.bluejeansnet.com',
        queue_size: 10,
        cutoff_hour: 18, # 6pm
        project_key: 'INF',
        project_name: 'Infrastructure',
        issue_type: 'Task',
        version: 'Un-targeted',
        jira_private_key: 'opsask.pem',
        jira_consumer_key: 'opsask-test',
        app_version: OpsAsk::VERSION
      }

      if options[:config]
        config.merge! JSON::parse(File.read(options[:config]), symbolize_names: true)
      end

      App.run! port: options[:port], config: config
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
opsask-2.0.2 lib/opsask/main.rb
opsask-2.0.1 lib/opsask/main.rb
opsask-2.0.0 lib/opsask/main.rb