Class: Vsvipergen::ViperObjcPresenterFileGenerator
Overview
concrete class for VS<$filePrefix$>Presenter.h, VS<$filePrefix$>Presenter.m
Instance Attribute Summary collapse
Attributes inherited from Generator
#currPath, #generatedFilePaths, #now, #prefix, #year
Instance Method Summary
collapse
Instance Attribute Details
#modelPrefix ⇒ Object
Returns the value of attribute modelPrefix.
7
8
9
|
# File 'lib/vsvipergen_presenter.rb', line 7
def modelPrefix
@modelPrefix
end
|
Instance Method Details
#init(filePrefix, now, year, modelPrefix) ⇒ Object
8
9
10
11
|
# File 'lib/vsvipergen_presenter.rb', line 8
def init(filePrefix, now, year, modelPrefix)
super(filePrefix, now, year)
@modelPrefix = modelPrefix
end
|
#makeFiles ⇒ Object
13
14
15
16
17
18
19
20
|
# File 'lib/vsvipergen_presenter.rb', line 13
def makeFiles
super
makeImplementFile
return generatedFilePaths
end
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/vsvipergen_presenter.rb', line 22
def
subPath = currPath + "/presenter"
Dir.mkdir(subPath) unless File.exists?(subPath)
= subPath + "/VS#{prefix.strip}Presenter.h"
generatedFilePaths.push()
= File.expand_path '../lib/templates/Presenter/VS<$$>Presenter.h', File.dirname(__FILE__)
= ViperFileReader.new.readFile()
.gsub! "<$modelPrefix$>", modelPrefix.strip
.gsub! "<$now$>", now.strip
.gsub! "<$year$>", year.strip
.gsub! "<$prefix$>", prefix.strip
ViperFileWriter.new.writeFile(, )
end
|
#makeImplementFile ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/vsvipergen_presenter.rb', line 40
def makeImplementFile
subPath = currPath + "/presenter"
Dir.mkdir(subPath) unless File.exists?(subPath)
newImplementFilePath = subPath + "/VS#{prefix.strip}Presenter.m"
generatedFilePaths.push(newImplementFilePath)
templateImplementFilePath = File.expand_path '../lib/templates/Presenter/VS<$$>Presenter.m', File.dirname(__FILE__)
templateImplementFileContents = ViperFileReader.new.readFile(templateImplementFilePath)
templateImplementFileContents.gsub! "<$modelPrefix$>", modelPrefix.strip
templateImplementFileContents.gsub! "<$now$>", now.strip
templateImplementFileContents.gsub! "<$year$>", year.strip
templateImplementFileContents.gsub! "<$prefix$>", prefix.strip
ViperFileWriter.new.writeFile(newImplementFilePath, templateImplementFileContents)
end
|