Permalink
Browse files

Create file if it doesn't exist.

git-svn-id: http://svn.textmate.org/trunk/Bundles/GTDAlt.tmbundle@3858 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent fb70555 commit 5e6fb3040e767d2c3dc18e66580423ea6b741aae Charilaos Skiadas committed Jun 27, 2006
Showing with 4 additions and 2 deletions.
  1. +1 −1 Support/INBOX.txt
  2. +2 −0 Support/bin/GTD.rb
  3. +1 −1 Support/bin/process_inbox.rb
View
2 Support/INBOX.txt
@@ -1,4 +1,4 @@
-The GTDALT bundle now contains a script that processes and “Inbox file” for actions, and distributes them to appropriate places. The Inbox file consists of lines of the form:
+The GTDALT bundle now contains a script that processes an “Inbox file” for actions, and distributes them to appropriate places. The Inbox file consists of lines of the form:
@context action name >project name
@context another action
View
2 Support/bin/GTD.rb
@@ -114,6 +114,8 @@ def initialize(filename)
instructions = GTD::parse(f.read)
process_instructions(instructions)
f.close
+ else
+ File.touch(filename)
end
end
# Processes an array of instructions. Not to be called directly.
View
2 Support/bin/process_inbox.rb
@@ -18,10 +18,10 @@ class NormalException < Exception
end
tempInboxFilename = dir + "temp.gtd"
objects = GTDFile.process_directory(dir)
+inbox_object = objects.find{|o| o.file == tempInboxFilename}
objects << (inbox_object = GTDFile.new(tempInboxFilename)) unless inbox_object
projects = GTDFile.projects
contexts = GTDFile.get_contexts
-inbox_object = objects.find{|o| o.file == tempInboxFilename}
# pp projects.map { |p| p.name }
# pp projects
#

0 comments on commit 5e6fb30

Please sign in to comment.