Module: MGit::Manifest::Internal
- Included in:
- MGit::Manifest
- Defined in:
- lib/m-git/manifest/internal.rb
Instance Method Summary collapse
-
#__setup(config_path, strict_mode) ⇒ Object
配置对象.
-
#__simple_setup(config_content, strict_mode) ⇒ Object
简单配置对象,部分属性为nil.
Instance Method Details
#__setup(config_path, strict_mode) ⇒ Object
配置对象
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/m-git/manifest/internal.rb', line 15 def __setup(config_path, strict_mode) @strict_mode = strict_mode if File.directory?(config_path) config_dir = config_path config_path = File.join(config_dir, Constants::CONFIG_FILE_NAME[:manifest]) else config_dir = File.dirname(config_path) config_path = File.join(config_dir, File.basename(config_path)) end local_path = File.join(config_dir, Constants::CONFIG_FILE_NAME[:local_manifest]) cache_path = File.join(config_dir, Constants::CONFIG_FILE_NAME[:manifest_cache]) __load_config(config_path, local_config_path: local_path, cache_path: cache_path) end |
#__simple_setup(config_content, strict_mode) ⇒ Object
简单配置对象,部分属性为nil
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/m-git/manifest/internal.rb', line 37 def __simple_setup(config_content, strict_mode) @strict_mode = strict_mode if config_content.is_a?(Hash) @config = config_content.deep_clone else @config = JSON.parse(config_content) end lint_raw_json!(config) @light_repos = __generate_light_repos(config) @config_repo = light_repos.find { |light_repo| light_repo.is_config_repo } # 计算配置文件哈希 @hash_sha1 = __generate_hash_sha1(config.to_json) end |