Sha256: 2aee6ff7af3524a6441658fbf788e531bfefddee957b907b39491315190adbb8
Contents?: true
Size: 622 Bytes
Versions: 25
Compression:
Stored size: 622 Bytes
Contents
require 'fileutils' module Recurly module ConfigParser class << self def parse(path = nil) path ||= Recurly.settings_path settings = {} if File.exists?(path) settings = YAML.load_file(path) || {} else puts "\n#{path} file not found. Run rake recurly:setup to create one\n\n" end settings end def save(settings = {}, path = nil) path ||= Recurly.settings_path FileUtils.mkdir_p(File.dirname(path)) File.open(path, 'w' ) do |out| YAML.dump(settings, out) end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems