-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.pryrc
41 lines (31 loc) · 851 Bytes
/
.pryrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true
Pry.config.prompt = Pry::Prompt[:rails]
Pry.config.pager = false
def app_config
@app_config ||= Rails.application.config.x.app
end
def esi_config
@esi_config ||= Rails.application.config.x.esi
end
def esi_client
@esi_client ||= ESI::Client.new(user_agent: app_config.user_agent)
end
def esi_authorize!(authorization)
authorization.refresh_token!
{ Authorization: "Bearer #{authorization.access_token}" }
end
def markets_reader
@markets_reader ||= Kredis.redis(config: :markets_reader)
end
def markets_writer
@markets_writer ||= Kredis.redis(config: :markets_writer)
end
def orders_reader
@orders_reader ||= Kredis.redis(config: :orders_reader)
end
def orders_writer
@orders_writer ||= Kredis.redis(config: :orders_writer)
end
def main_alliance
Alliance.find(app_config.main_alliance_id)
end