Class: Pa::App

Inherits:
Object
  • Object
show all
Defined in:
lib/pa.rb

Class Method Summary collapse

Class Method Details

.cacheObject



16
17
18
# File 'lib/pa.rb', line 16

def self.cache
  @cache ||= Pa::Cache.new '~/.pa'
end

.configObject



24
25
26
27
28
29
# File 'lib/pa.rb', line 24

def self.config
  OpenStruct.new(
    timezone: ENV.fetch('TIMEZONE', 'Asia/Shanghai'),
    token: ENV.fetch('TOKEN')
  )
end

.reposObject



20
21
22
# File 'lib/pa.rb', line 20

def self.repos
  @repos ||= IO.readlines(File.expand_path('~/.pa/repos'), chomp: true)
end

.rootObject



12
13
14
# File 'lib/pa.rb', line 12

def self.root
  @root ||= File.dirname(File.expand_path(__dir__))
end