Class: Configuration

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

Constant Summary collapse

FILE_PATH =
File.expand_path('~/.pushnote.yml')

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
# File 'lib/pushnote/configuration.rb', line 7

def initialize
  unless File.exist?(FILE_PATH)
    template_path = File.expand_path('../../../.pushnote.yml', __FILE__)
    FileUtils.cp(template_path, FILE_PATH)
  end
  super(YAML.load_file(FILE_PATH))
end