1
0
mirror of https://github.com/amix/vimrc synced 2025-07-07 17:05:00 +08:00

Add support of auto format files.

This commit is contained in:
Kurtis Moxley
2022-05-20 17:05:00 +08:00
parent 25e4662559
commit cdd9fbbddb
25 changed files with 12539 additions and 27 deletions

View File

@ -0,0 +1,33 @@
require 'inifile'
# Reads settings from init file
class Settings
attr_reader :jusername, :jpassword, :jurl
def initialize(path)
settings = read(path)
parse(settings)
end
private
def read(path)
settings = IniFile.load(path)
fail "File #{path} not found!" unless settings
settings
end
def parse(settings)
jira = settings['jira']
fail "Init file hasn't [jira] section!" unless jira
@jusername = jira['username']
@jpassword = jira['password']
@jurl = jira['url']
fail "Init file hasn't username option!" unless jusername
fail "Init file hasn't password option!" unless jpassword
fail "Init file hasn't url option!" unless jurl
end
end