/usr/lib/ruby/vendor_ruby/berkshelf/api/mixin/services.rb is in berkshelf-api 2.2.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 42 43 44 45 46 47 48 | module Berkshelf::API
module Mixin
module Services
class << self
def included(base)
base.extend(ClassMethods)
base.send(:include, ClassMethods)
end
def extended(base)
base.send(:include, ClassMethods)
end
end
module ClassMethods
# @raise [Berkshelf::API::NotStartedError] if the cache manager has not been started
#
# @return [Berkshelf::API::CacheBuilder]
def cache_builder
app_actor(:cache_builder)
end
# @raise [Berkshelf::API::NotStartedError] if the cache manager has not been started
#
# @return [Berkshelf::API::CacheManager]
def cache_manager
app_actor(:cache_manager)
end
# @raise [Berkshelf::API::NotStartedError] if the rest gateway has not been started
#
# @return [Berkshelf::API::RESTGateway]
def rest_gateway
app_actor(:rest_gateway)
end
private
def app_actor(id)
unless Application[id] && Application[id].alive?
raise NotStartedError, "#{id} not running"
end
Application[id]
end
end
end
end
end
|