class Object

Constants

BUGZILLA_ACCOUNT
BUGZILLA_URL
CHECKED_LISTS

Trello list IDs, see also show_list_ids

ENV_TRELLO_KEY
ENV_TRELLO_TOKEN
INC_BOARD_ID

Trello board IDs

TEAM_1_BOARD_ID
TEAM_A_BOARD_ID
TEAM_S_NO_SCRUM

Public Instance Methods

debug(s) click to toggle source
# File lib/ytrello.rb, line 98
def debug(s)
  $stderr.puts s if $VERBOSE
end
setup_bicho() click to toggle source

set the SUSE Bugzilla connection

# File lib/ytrello.rb, line 69
def setup_bicho
  Bicho.client = Bicho::Client.new(BUGZILLA_URL)
end
setup_trello() click to toggle source

set the Trello credentials

# File lib/ytrello.rb, line 74
def setup_trello
  fn = "#{ENV["HOME"]}/.config/trello-creds.yml"
  text = File.exist?(fn) ? File.read(fn) : ""
  creds = Hash(YAML.safe_load(text))
  key = ENV[ENV_TRELLO_KEY] || creds[ENV_TRELLO_KEY]
  token = ENV[ENV_TRELLO_TOKEN] || creds[ENV_TRELLO_TOKEN]
  unless key && token
    msg = "Error: Pass the Trello credentials via #{ENV_TRELLO_KEY} and\n" \
          "  #{ENV_TRELLO_TOKEN}, either in #{fn} or in environment variables."
    $stderr.puts msg
    exit 1
  end

  Trello.configure do |config|
    config.developer_public_key = key
    config.member_token = token
  end
end
to_array(a) click to toggle source

Array#to_a -> Trello::MultiAssociation, WTF?!

# File lib/ytrello.rb, line 94
def to_array(a)
  a.map { |i| i }
end