bin/nephos-generator in nephos-server-0.6.9 vs bin/nephos-generator in nephos-server-0.7.0

- old
+ new

@@ -76,17 +76,17 @@ uname = "#{ctr[0].upcase}#{ctr[1..-1]}Controller".gsub(/ControllerController$/, "Controller") lname = uname.gsub(/([A-Z])/, '_\1')[1..-1].downcase file = "app/#{lname}.rb" raise_invalid_appli if $remove - if File.exists?(file) and File.read(file).include? "class #{uname} < Nephos::Controller" + if File.exist?(file) and File.read(file).include? "class #{uname} < Nephos::Controller" File.delete(file) puts "Success: ".yellow + "\"#{file}\" removed" else raise BinError, "\"#{file}\" is not a valid Controller file." end else - if File.exists? file + if File.exist? file print "Warning: ".yellow + "The file #{file} already exists. Are you sure to erase it ? (y/N) : " r = STDIN.gets.to_s.chomp raise BinError, "File #{file} already exists" unless r.match(/y(es)?/) end f = File.open(file, 'w')