;----------------------
; Xpadder Profile File
;----------------------
Version=5.6
[Profile Settings]
[Set Settings]
Set1DPadMode=FourWay
[Assignments]
Set1Button1Slots=Z
Set1Button2Slots=Enter
Set1Button3Slots=A
Set1Button5Slots=Escape
Set1Button7Slots=Left Shift
Set1Button8Slots=Space
Set1DPadUpSlots=Arrow Up
Set1DPadRightSlots=Arrow Right
Set1DPadDownSlots=Arrow Down
Set1DPadLeftSlots=Arrow Left
如上文件,我想用 ruby 解析此文件。
我需要的流程“ 1,打开此文件 2,读取 [Assignments] 节 3,把 [Assignments] 下面的所有数据都按照 k/v 格式读取出来
如何读取呢?