12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/jem/build.rb', line 12
def Build.build project_name
return puts "Please specify a project name." if project_name == nil
if !File.exists? project_name
print "* Building structure in directory: #{project_name}/\n"
options = {:verbose => true}
print "\t=> "
FileUtils.mkdir_p File.expand_path(project_name) + '/lib/' + File.basename(project_name), options
FileUtils.cd project_name
print "\t=> "
FileUtils.mkdir %w(test docs examples bin), options
print "\t=> "
FileUtils.touch %w(LICENCE README CHANGELOG VERSION Rakefile), options
project_name = File.basename(project_name)
print "\t=> "
FileUtils.touch project_name + '.gemspec', options
FileUtils.cd 'lib'
print "\t=> "
FileUtils.touch project_name + '.rb', options
puts "* Done."
else
print "Directory \"#{project_name}\" already exists.\n"
end
end
|