Class: Stable::Registry

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

Class Method Summary collapse

Class Method Details

.appsObject



17
18
19
# File 'lib/stable/registry.rb', line 17

def self.apps
  File.exist?(file_path) ? YAML.load_file(file_path) : []
end

.file_pathObject



8
9
10
# File 'lib/stable/registry.rb', line 8

def self.file_path
  File.join(Stable.root, 'apps.yml')
end

.save(apps) ⇒ Object



12
13
14
15
# File 'lib/stable/registry.rb', line 12

def self.save(apps)
  FileUtils.mkdir_p(Stable.root)
  File.write(file_path, apps.to_yaml)
end