diff options
Diffstat (limited to 'lib/leap_cli/config/manager.rb')
-rw-r--r-- | lib/leap_cli/config/manager.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/leap_cli/config/manager.rb b/lib/leap_cli/config/manager.rb index 05df22f..f34566c 100644 --- a/lib/leap_cli/config/manager.rb +++ b/lib/leap_cli/config/manager.rb @@ -19,10 +19,21 @@ module LeapCli attr_reader :services, :tags, :nodes, :provider, :common, :secrets attr_reader :base_services, :base_tags, :base_provider, :base_common + # + # returns the Hash of the contents of facts.json + # def facts @facts ||= JSON.parse(Util.read_file(:facts) || "{}") end + # + # returns an Array of all the environments defined for this provider. + # the returned array includes nil (for the default environment) + # + def environments + @environments ||= [nil] + self.tags.collect {|name, tag| tag['environment']}.compact + end + ## ## IMPORT EXPORT ## |