Skip to content

Commit a97151d

Browse files
committed
Patched few bugs from previous implementation
1 parent dfdd69d commit a97151d

8 files changed

+15
-51
lines changed

ISM/CommandLineMirrorsSettings.cr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ module ISM
2727
return from_json(File.read(path))
2828
end
2929

30-
# def loadConfiguration(path = self.class.filePath)
31-
# if !File.exists?(path)
32-
# writeConfiguration(path)
33-
# end
34-
#
35-
# self = self.class.from_json(File.read(path))
36-
# end
37-
3830
def writeConfiguration(path = self.class.filePath)
3931
file = File.open(path,"w")
4032
to_json(file)

ISM/CommandLinePortsSettings.cr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,6 @@ module ISM
2727
return from_json(File.read(path))
2828
end
2929

30-
# def loadConfiguration(path = self.class.filePath)
31-
# if !File.exists?(path)
32-
# writeConfiguration(path)
33-
# end
34-
#
35-
# self = self.class.from_json(File.read(path))
36-
# end
37-
3830
def writeConfiguration(path = self.class.filePath)
3931
file = File.open(path,"w")
4032
to_json(file)

ISM/CommandLineSettings.cr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,6 @@ module ISM
254254
file.close
255255
end
256256

257-
# def loadConfiguration(path = self.class.filePath)
258-
# if !File.exists?(path)
259-
# writeSystemConfiguration
260-
# end
261-
#
262-
# self = self.class.from_json(File.read(path))
263-
# end
264-
265257
def writeChrootConfiguration
266258
self.class.writeConfiguration( #File path
267259
@rootPath+ISM::Default::CommandLineSettings::SettingsFilePath,

ISM/FavouriteGroup.cr

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ module ISM
3030
return from_json(File.read(path))
3131
end
3232

33-
# def loadConfiguration(path = self.class.filePath)
34-
# if !File.exists?(path)
35-
# writeConfiguration(path)
36-
# end
37-
#
38-
# self = self.class.from_json(File.read(path))
39-
# end
40-
4133
def writeConfiguration(path = self.class.filePath)
4234
file = File.open(path,"w")
4335
to_json(file)

ISM/KernelOption.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ module ISM
2929
end
3030
end
3131

32-
# def loadConfiguration(path : String)
33-
# self = self.class.loadConfiguration(path)
34-
# end
35-
3632
def writeConfiguration(path : String)
3733
finalPath = path.chomp(path[path.rindex("/")..-1])
3834

ISM/Mirror.cr

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,21 @@ module ISM
3131
return from_json(File.read(path))
3232
end
3333

34-
# def loadConfiguration(path = self.class.filePath)
35-
# if !File.exists?(path)
36-
# writeConfiguration(path)
37-
# end
38-
#
39-
# self = self.class.from_json(File.read(path))
40-
# end
34+
def self.sourcesLink(codeName : String) : String
35+
begin
36+
return from_json(File.read(filePath(codeName))).sourcesLink
37+
rescue
38+
return String.new
39+
end
40+
end
41+
42+
def self.patchesLink(codeName : String) : String
43+
begin
44+
return from_json(File.read(filePath(codeName))).patchesLink
45+
rescue
46+
return String.new
47+
end
48+
end
4149

4250
def writeConfiguration(path = self.class.filePath)
4351
file = File.open(path,"w")

ISM/Port.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ module ISM
4747
return self.class.directoryPathPrefix+@name
4848
end
4949

50-
# def loadConfiguration
51-
# self = self.class.from_json(File.read(filePath))
52-
# end
53-
5450
def writeConfiguration
5551
file = File.open(filePath,"w")
5652
to_json(file)

ISM/SoftwareInformation.cr

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ module ISM
4949
end
5050
end
5151

52-
# def loadConfiguration(path : String)
53-
# self = self.class.from_json(File.read(path))
54-
# end
55-
5652
def writeInformationFile(path : String)
5753
finalPath = path.chomp(path[path.rindex("/")..-1])
5854

0 commit comments

Comments
 (0)