Class: Pod::Thumbs::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-thumbs/configuration.rb

Class Method Summary collapse

Class Method Details

.config_file_pathObject



6
7
8
# File 'lib/cocoapods-thumbs/configuration.rb', line 6

def self.config_file_path
  File.expand_path('~/.cocoapods-thumbs.yaml')
end

.exists?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
17
# File 'lib/cocoapods-thumbs/configuration.rb', line 10

def self.exists?
  begin
    YAML::load(IO.read(config_file_path))
    true
  rescue
    false
  end
end

.loadObject



19
20
21
# File 'lib/cocoapods-thumbs/configuration.rb', line 19

def self.load
  YAML.load_file(config_file_path)
end

.set_url(url) ⇒ Object



23
24
25
26
27
# File 'lib/cocoapods-thumbs/configuration.rb', line 23

def self.set_url(url)
  config = { url: url }
  
  File.open(config_file_path, 'w') { |f| f.write config.to_yaml }
end