Skip to content

Commit

Permalink
implement local config system[3]
Browse files Browse the repository at this point in the history
  • Loading branch information
marguerite committed Nov 14, 2014
1 parent 59a3455 commit d5550b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 7 additions & 5 deletions BiliConfig.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
module BiliConfig

VERSION = "0.0.2"

class Biliconf

@@userHome = `echo $HOME`.gsub(/\n/,"")
@@configPath = File.join(@@userHome,".config")
@@configPath = File.join(@@userHome,".config/BiliGui")

def initialize(name="biligui.conf", path=@@configPath)

@name = name
@path = path

unless Dir.exists?(@path) then
Dir.mkdir @path
end

@config = File.join(path, name)
@configEntries = {}

unless File.exist?(@config) then
unless File.exists?(@config) then
io = File.open(@config, "w")
io.puts("Version=#{VERSION}")
io.close
else
io = File.open(@config, "r")
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.0.3
* implement the local config system (BiliConfig.rb)
* you don't have to select Bilidan.py everytime
0.0.2
* decouple BiliDan and BiliGui
* add an option to choose Bilidan.py
Expand Down
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
* capture console output in real time and print them on the GUI
* get exitStatus of the command then run next URL (multi URL paste support)
* load URLs from a file and save currently pasted URLs to a file
<del>* decouple BiliDan and BiliGui's locations</del> Done!
<s>* decouple BiliDan and BiliGui's locations</s> Done!
* let error message fade out
* config file system to avoid choose bilidan everytime!
<s>* config file system to avoid choose bilidan everytime!</s> Done!

0 comments on commit d5550b2

Please sign in to comment.