11
12
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
|
# File 'lib/textools/commands.rb', line 11
def create(name)
parent_directory = options[:working_directory]
if parent_directory
directory = File.join(parent_directory,name)
else
directory = name
end
empty_directory(directory)
['.gitignore', 'clean.bat', 'clean.sh', "README"].each do |file|
copy_file file,File.join(directory,file)
end
empty_directory(File.join(directory, "images"))
empty_directory(File.join(directory, "includes"))
template("main.tex.erb",File.join(directory,"#{name}.tex"))
template("header.tex.erb",File.join(directory,"header.tex"))
template("content.tex.erb",File.join(directory,"content.tex"))
if options.texlipse?
@name = name
template(".project.erb",File.join(directory,".project"))
template(".texlipse.erb",File.join(directory,".texlipse"))
elsif options.texniccenter?
@name = name
template("name.tcp.erb",File.join(directory,"#{name}.tcp"))
end
inside(directory, :verbose => true) do |folder|
run("git init")
run("git add .")
end
end
|