lib/sugar-high/file.rb in sugar-high-0.3.6 vs lib/sugar-high/file.rb in sugar-high-0.3.7
- old
+ new
@@ -74,9 +74,14 @@
end
def valid_file_command?
self.to_sym.valid_file_command?
end
+
+ def new_file
+ return File.new(self) if File.exist?(self)
+ File.open(self, 'w')
+ end
end
class Symbol
def as_filename
self.to_s.underscore