Class: Pod::Tdfire::BinaryConfig
- Inherits:
-
Object
- Object
- Pod::Tdfire::BinaryConfig
- Defined in:
- lib/cocoapods-tdfire-binary/binary_config.rb
Constant Summary collapse
- REPO_URL_KEY =
'repo_url'.freeze
- SERVER_ROOT_KEY =
'server_host'.freeze
- TEMPLATE_URL_KEY =
'template_url'.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #binary_setting_file ⇒ Object
- #config_with_setting(setting) ⇒ Object
- #private_sources(keywords = repo_url) ⇒ Object
- #repo_url ⇒ Object
- #server_host ⇒ Object
- #setting_file_name ⇒ Object
- #setting_hash ⇒ Object
- #template_url ⇒ Object
Class Method Details
.instance ⇒ Object
13 14 15 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 13 def self.instance @instance ||= new end |
Instance Method Details
#binary_setting_file ⇒ Object
42 43 44 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 42 def binary_setting_file config.home_dir + setting_file_name end |
#config_with_setting(setting) ⇒ Object
46 47 48 49 50 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 46 def config_with_setting(setting) File.open(binary_setting_file, 'w+') do |f| f.write(setting.to_yaml) end end |
#private_sources(keywords = repo_url) ⇒ Object
52 53 54 55 56 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 52 def private_sources(keywords = repo_url) config.sources_manager.all.select do |source| source.url.downcase.include? keywords end end |
#repo_url ⇒ Object
17 18 19 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 17 def repo_url setting_for_key(REPO_URL_KEY) end |
#server_host ⇒ Object
21 22 23 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 21 def server_host setting_for_key(SERVER_ROOT_KEY) end |
#setting_file_name ⇒ Object
38 39 40 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 38 def setting_file_name 'binary_config.yml' end |
#setting_hash ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 29 def setting_hash @setting ||= begin if File.exist?(binary_setting_file) @setting = YAML.load_file(binary_setting_file) end end @setting end |
#template_url ⇒ Object
25 26 27 |
# File 'lib/cocoapods-tdfire-binary/binary_config.rb', line 25 def template_url setting_for_key(TEMPLATE_URL_KEY) end |