lib/eco/api/session/config.rb in eco-helpers-0.8.3 vs lib/eco/api/session/config.rb in eco-helpers-0.8.4

- old
+ new

@@ -22,36 +22,40 @@ def reopen yield(self) end + def cli + self["cli"] ||= Eco::CLI::Config.new + end + def apis - self["apis"] ||= Session::Config::Apis.new(config: self) + self["apis"] ||= Eco::API::Session::Config::Apis.new(config: self) end def logger - self["logger"] ||= Session::Config::Logger.new(config: self) + self["logger"] ||= Eco::API::Session::Config::Logger.new(config: self) end def s3storage - self["s3_storage"] ||= Session::Config::S3Storage.new(config: self) + self["s3_storage"] ||= Eco::API::Session::Config::S3Storage.new(config: self) end def files - self["files"] ||= Session::Config::Files.new(config: self) + self["files"] ||= Eco::API::Session::Config::Files.new(config: self) end def mailer - self["mailer"] ||= Session::Config::Mailer.new(config: self) + self["mailer"] ||= Eco::API::Session::Config::Mailer.new(config: self) end def org self["org"] end def people - self["people"] ||= Session::Config::People.new(config: self) + self["people"] ||= Eco::API::Session::Config::People.new(config: self) end # LOGGER def log_console_level=(value) logger.console_level= value @@ -161,12 +165,21 @@ def tagtree=(file) org["tagtree"] = file end + def tagtree(enviro: nil) + return @tagtree if instance_variable_defined?(:@tagtree) && @tagtree.enviro == enviro + if tree_file = org["tagtree"] + tree = [] + tree = file_manager.load_json(tree_file) unless !tree_file + @tagtree = Eco::API::Organization::TagTree.new(tree, enviro: enviro) + end + end + def policy_groups return @policy_groups if instance_variable_defined?(:@policy_groups) - pgs = api&.policy_groups.to_a + pgs = api&.policy_groups.to_a @policy_groups = Eco::API::Organization::PolicyGroups.new(pgs) end def schemas return @schemas if instance_variable_defined?(:@schemas)