Class: RailsOrbit::Configuration

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

Constant Summary collapse

VALID_ADAPTERS =
%i[sqlite host_db external].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
13
14
15
16
17
18
19
# File 'lib/rails_orbit/configuration.rb', line 10

def initialize
  @storage_adapter    = :sqlite
  @storage_url        = nil
  @retention_days     = 7
  @kamal_enabled      = false
  @kamal_ssh_key_path = nil
  @dashboard_title    = "Orbit"
  @poll_interval      = 5
  @auth_block         = default_auth_block
end

Instance Attribute Details

#auth_blockObject (readonly)

Returns the value of attribute auth_block.



8
9
10
# File 'lib/rails_orbit/configuration.rb', line 8

def auth_block
  @auth_block
end

#dashboard_titleObject

Returns the value of attribute dashboard_title.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def dashboard_title
  @dashboard_title
end

#kamal_enabledObject

Returns the value of attribute kamal_enabled.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def kamal_enabled
  @kamal_enabled
end

#kamal_ssh_key_pathObject

Returns the value of attribute kamal_ssh_key_path.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def kamal_ssh_key_path
  @kamal_ssh_key_path
end

#poll_intervalObject

Returns the value of attribute poll_interval.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def poll_interval
  @poll_interval
end

#retention_daysObject

Returns the value of attribute retention_days.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def retention_days
  @retention_days
end

#storage_adapterObject

Returns the value of attribute storage_adapter.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def storage_adapter
  @storage_adapter
end

#storage_urlObject

Returns the value of attribute storage_url.



5
6
7
# File 'lib/rails_orbit/configuration.rb', line 5

def storage_url
  @storage_url
end

Instance Method Details

#authenticate_with(&block) ⇒ Object



21
22
23
# File 'lib/rails_orbit/configuration.rb', line 21

def authenticate_with(&block)
  @auth_block = block
end

#validate!Object



25
26
27
28
29
# File 'lib/rails_orbit/configuration.rb', line 25

def validate!
  validate_storage_adapter!
  validate_external_url!
  validate_kamal_ssh_key!
end