Sha256: bf5618f51685722b4244f339197b55fd104dc22bbf3ce8d175a498d4c9306564
Contents?: true
Size: 532 Bytes
Versions: 2
Compression:
Stored size: 532 Bytes
Contents
class Sheet::Write attr_accessor :name def initialize(name) @name = name end def write create_dir_if_doesnt_exist if editor_is_set? Sheet.exec("#{Sheet.editor} #{Sheet.sheet_path(name)}", true) else Sheet.write "Please set the $EDITOR variable to write files" end end private def editor_is_set? (editor = Sheet.editor) && editor.length > 0 end def create_dir_if_doesnt_exist if ! File.directory?(Sheet.sheets_dir) Dir.mkdir(Sheet.sheets_dir) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sheet-0.1.5 | lib/sheet/write.rb |
sheet-0.1.4 | lib/sheet/write.rb |