<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,13 +1,28 @@
 module Taskomaly
   
+  # Parse a paper. 
+  # +name+ is the name of the paper.
+  # +body+ is the text of the paper.
+  #
+  #  paper = Taskomaly::As 'My awesome paper', File::read '/home/bob/my.tasks'
   def self.As name, body
     return Paper.new name, body
   end
   
+  # Create a paper from a file.
+  #
+  #  paper = Taskomaly::Load '~/my.tasks'
+  def self.Load filename
+    return Paper.new filename
+  end
+  
   class Paper
     
-    attr_accessor :name
+    attr_accessor :name, :api
     
+    # Create a paper from a file. The name of the paper becomes
+    # a sanitized version of the file name.
+    # +file+ is the location of the file.
     def self.From file
       raise ArgumentError, &quot;file #{file} does not exist&quot; unless File.exist? file
       return Paper.new(
@@ -31,11 +46,7 @@ module Taskomaly
       @body = new_body
       parse_body
     end
-    
-    def api
-      return @api
-    end
-    
+
     def save
       return false unless @api
       return @api.request(:edit, @name, @body)
@@ -55,6 +66,17 @@ module Taskomaly
       @projects.map { |project| project.name }
     end
     
+    def to_text
+      text = &quot;&quot;
+      @projects.each do |project|
+        text += project.to_s + &quot;\n&quot;
+        self.project[project.name].tasks.each do |task|
+          text += task.to_task + &quot;\n&quot;
+        end
+      end
+      return text
+    end
+    
     private
     
     def parse_body</diff>
      <filename>lib/paper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -35,6 +35,11 @@ module Taskomaly
       @tasks &lt;&lt; Task.new(task)
     end
     
+    # Display the formatted project name.
+    def to_s
+      self.name.to_s.gsub(/_/, ' ').capitalize + &quot;:&quot;
+    end
+    
   end
   
 end
\ No newline at end of file</diff>
      <filename>lib/project.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,6 +48,11 @@ module Taskomaly
     def display
       &quot;#{@desc}#{ @tags.length &gt; 0 ? ' ' : ''}#{@tags.collect { |tag| '@' + tag.to_s }.join(@delimiter || ' ')}&quot;
     end
+    
+    # Format the task as a task, with tags, and prefixed hyphen.
+    def to_task
+      &quot;- &quot; + self.display
+    end
         
     private
     </diff>
      <filename>lib/task.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,15 @@
+no_comments_paper.tasks: |
+  Project number one:
+  - This is task number one
+  - This is task number two @done
+  - This is task number three
+  - This is task number four
+  - This is task number five
+  - This is task number six @done
+  - This is task number seven
+  - This is task number eight
+  - This is task number nine
+
 test_paper_one.tasks: |
   Project Number One:
   This task is designed to have nine tasks. Two of these tasks are completed -- tasks numbers two, and six. This comment is on line one of the project.</diff>
      <filename>spec/fixtures/test_papers.yml</filename>
    </modified>
    <modified>
      <diff>@@ -4,9 +4,10 @@ describe &quot;Taskomaly::Paper&quot; do
 
   before do
     @t = Taskomaly::API.new :user =&gt; 9999, :key =&gt; 'd9cca721a735dac4efe709e0f3518373'
-    @t.stubs(:papers).returns( ['Test Paper One', 'Test Paper Two'] )
+    @t.stubs(:papers).returns( ['Test Paper One', 'Test Paper Two', 'No comments paper'] )
     @t.expects(:request).with(:paper, 'Test Paper Two').returns(Taskomaly::Paper.new 'Test Paper Two', TEST_PAPER_TWO, @t)
     @t.expects(:request).with(:paper, 'Test Paper One').returns(Taskomaly::Paper.new 'Test Paper One', TEST_PAPER_ONE, @t)
+    @t.expects(:request).with(:paper, 'No comments paper').returns(Taskomaly::Paper.new 'No comments paper', TEST_PAPERS['no_comments_paper.tasks'])
     @t.expects(:request).with(:edit, 'Test Paper Two', NEW_PAPER).returns(true)
   end
   
@@ -151,4 +152,10 @@ describe &quot;Taskomaly::Paper&quot; do
     pending &quot;Not done yet&quot;
   end
   
+  it &quot;can reproduce the inputted task file&quot; do
+    p = @t.request :paper, 'No comments paper'
+    puts (p.to_text + &quot;test&quot;).inspect
+    p.to_text.should == p.body
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>spec/paper_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>6ab526f9fbd069b09d43d97ea042b48271c4d9c7</id>
    </parent>
  </parents>
  <author>
    <name>Ardekantur</name>
    <email>greystone@ardekantur.com</email>
  </author>
  <url>http://github.com/ardekantur/taskomaly/commit/6fcdcd22dcd38c8c097cd641a689906a78ab27bf</url>
  <id>6fcdcd22dcd38c8c097cd641a689906a78ab27bf</id>
  <committed-date>2008-08-11T18:16:55-07:00</committed-date>
  <authored-date>2008-08-11T18:16:55-07:00</authored-date>
  <message>recreating papers works</message>
  <tree>70500978e58faa8a5d558620bc051a45606ea93a</tree>
  <committer>
    <name>Ardekantur</name>
    <email>greystone@ardekantur.com</email>
  </committer>
</commit>
