Class: PlayTime::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/play_time/configuration.rb

Defined Under Namespace

Classes: MissingOption

Constant Summary collapse

DEFAULT_CONFIG =
'config/play_time.yml'.freeze
OPTIONS =
%w(
  apk_path
  client_name
  client_version
  secret_path
  secret_passphrase
  issuer
  package_name
).freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Configuration

Returns a new instance of Configuration.



28
29
30
# File 'lib/play_time/configuration.rb', line 28

def initialize(config)
  @config = config
end

Class Method Details

.create_config(config_dir, config_path) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/play_time/configuration.rb', line 20

def self.create_config(config_dir, config_path)
  unless File.exist?(config_dir)
    FileUtils.mkdir_p(config_dir)
  end

  FileUtils.cp("#{__dir__}/templates/play_time.yml", config_path)
end

.exists?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/play_time/configuration.rb', line 16

def self.exists?
  File.exist? PlayTime.config_path
end