13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/yptools/autocre/yp_autoinit.rb', line 13
def self.createObjcInitJson
yp_path = `pwd`
yp_path = yp_path.sub("\n","")
fileName = "YpImMessage.json"
filePath = yp_path + "/" + fileName
if File.exists?(filePath)
File.delete(filePath)
end
jsonContents = Array.new
jsonContentsJson = File.new(filePath, "w+")
jsonContents.push '{'
jsonContents.push ' "mode": "DAO",'
jsonContents.push ' "module": "YpImMessage",'
jsonContents.push ' "table": "yp_im_message",'
jsonContents.push ' "property": {'
jsonContents.push ' "id": "long",'
jsonContents.push ' "msgid": "int64_t",'
jsonContents.push ' "content": "NSString",'
jsonContents.push ' "sendTime": "NSDate",'
jsonContents.push ' "isMute": "BOOL",'
jsonContents.push ' "money": "CGFloat"'
jsonContents.push ' },'
jsonContents.push ' "index": {'
jsonContents.push ' "primary-autoincrement": "id"'
jsonContents.push ' },'
jsonContents.push ' "struct": {'
jsonContents.push ' "YpIdContent": ['
jsonContents.push ' "id",'
jsonContents.push ' "content"'
jsonContents.push ' ]'
jsonContents.push ' }'
jsonContents.push '}'
jsonContents.each { |lineText|
jsonContentsJson.syswrite(lineText);
jsonContentsJson.syswrite("\n");
}
jsonContentsJson.close
end
|