Class: OpsAsk::Main

Inherits:
Thor
  • Object
show all
Defined in:
lib/opsask/main.rb

Instance Method Summary collapse

Instance Method Details

#artObject



11
12
13
14
15
16
17
18
# File 'lib/opsask/main.rb', line 11

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

#serverObject



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/opsask/main.rb', line 46

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,
    require_label: nil,
    room_lookahead: 90 # days
  }

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

  App.run! \
    config: config,
    bind: options[:bind],
    port: options[:port],
    environment: options[:environment],
    raise_errors: true
end

#versionObject



21
22
23
# File 'lib/opsask/main.rb', line 21

def version
  puts OpsAsk::VERSION
end