Class: Yetty::Site::App

Inherits:
Sinatra::Base
  • Object
show all
Includes:
Bogo::Memoization
Defined in:
lib/yetty/site/app.rb

Overview

Web UI

Instance Method Summary collapse

Instance Method Details

#bucketObject



27
28
29
30
31
32
33
34
# File 'lib/yetty/site/app.rb', line 27

def bucket
  storage = Miasma.api(
    :type => :storage,
    :provider => config.get(:site, :storage, :provider),
    :credentials => config.get(:site, :storage, :credentials)
  )
  storage.buckets.get(config.get(:site, :storage, :bucket))
end

#configObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/yetty/site/app.rb', line 14

def config
  memoize(:config, :direct) do
    path = ENV['YETTY_SITE_CONFIG']
    unless(path)
      path = Command::DEFAULT_CONFIGURATION_FILES.detect do |check|
        full_check = File.expand_path(check)
        File.exists?(full_check)
      end
    end
    MultiJson.load(File.read(path)).to_smash
  end
end