Sha256: 37a7cf3d04b6cd51429537354e5a986b719ae59da14a1f948924a6ee9810cda3
Contents?: true
Size: 1.12 KB
Versions: 47
Compression:
Stored size: 1.12 KB
Contents
# frozen_string_literal: true require 'yaml' require 'lhj/config' module Lhj class OSSConfig def self.config_file file = 'oss_config.yml' File.expand_path("#{Lhj::Config.instance.home_dir}/#{file}") end def self.config @yaml ||= YAML.load_file(config_file) end def self.clean @yaml = nil end def self.oss_endpoint config['oss_endpoint'] end def self.oss_endpoint=(endpoint) config['oss_endpoint'] = endpoint end def self.oss_access_key_id config['oss_access_key_id'] end def self.oss_access_key_secret config['oss_access_key_secret'] end def self.oss_bucket config['oss_bucket'] end def self.oss_bucket=(bucket) config['oss_bucket'] = bucket end def self.oss_domain config['oss_domain'] end def self.oss_domain=(domain) config['oss_domain'] = domain end def self.oss_bucket_list config['oss_bucket_list'] end def self.save file_to_save = File.open(config_file, 'w+') YAML.dump(config, file_to_save) file_to_save.close end end end
Version data entries
47 entries across 47 versions & 1 rubygems