Sha256: f438d229d51c4e0bda124377fc09603e41ab41c213ab0776c6369ce186c66f57
Contents?: true
Size: 1.09 KB
Versions: 14
Compression:
Stored size: 1.09 KB
Contents
module Eco class Assets attr_reader :active_config def initialize @active_config = :default @cli = Eco::CLI.new @cli_init = false end def session(key: active_config, update_active: true) config(key: key, update_active: update_active).session.tap do |session| yield(session) if block_given? end end def config(key: active_config, update_active: true) configs[:default] ||= Eco::API::Session::Config.new(key) unless configs.key?(key) @active_config = key if update_active configs[key] = configs[:default].clone(key) end configs[key].tap do |config| config.active_api(key) if config.apis.defined?(key) yield(config) if block_given? end end def configs @configs ||= {} end def cli(&block) unless @cli_init @cli_init = true require_relative('cli_default') end @cli.tap { yield(@cli) if block_given? } end end end require_relative 'assets/language' ASSETS = Eco::Assets.new
Version data entries
14 entries across 14 versions & 1 rubygems