<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -24,7 +24,7 @@ PROJ.name = 'slither'
 PROJ.authors = 'Ryan Wood'
 PROJ.email = 'ryan.wood@gmail.com'
 PROJ.url = 'http://github.com/ryanwood/slither'
-PROJ.version = '0.99.2'
+PROJ.version = '0.99.3'
 PROJ.exclude = %w(\.git .gitignore ^tasks \.eprj ^pkg)
 PROJ.readme_file = 'README.rdoc'
 </diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,8 @@
 require 'date'
 
 class Slither
+  class ParserError &lt; RuntimeError; end
+  
   class Column
     attr_reader :name, :length, :alignment, :type, :padding, :precision, :options
     
@@ -12,6 +14,7 @@ class Slither
       @alignment = options[:align] || :right
       @type = options[:type] || :string
       @padding = options[:padding] || :space
+      @truncate = options[:truncate] || false
       # Only used with floats, this determines the decimal places
       @precision = options[:precision] 
     end
@@ -34,6 +37,8 @@ class Slither
           end
         else value.strip
       end
+    rescue
+      raise ParserError, &quot;The value '#{value}' could not be converted to type #{@type}: #{$!}&quot;
     end
     
     def format(value)
@@ -90,11 +95,7 @@ class Slither
           else 
             value.to_s
         end
-        raise( 
-          Slither::FormattedStringExceedsLengthError, 
-          &quot;The formatted value '#{result}' in column '#{@name}' exceeds the allowed length of #{@length} chararacters.&quot;
-        ) if result.length &gt; @length
-        result
+        validate_size result
       end
 
       def assert_valid_options(options)
@@ -104,6 +105,20 @@ class Slither
         unless options[:padding].nil? || [:space, :zero].include?(options[:padding])
           raise ArgumentError, &quot;Option :padding only accepts :space (default) or :zero&quot;
         end
-      end    
+      end
+      
+      def validate_size(result)
+        # Handle when length is out of range
+        if result.length &gt; @length
+          if @truncate
+            start = @alignment == :left ? 0 : -@length
+            result = result[start, @length]
+          else
+            raise Slither::FormattedStringExceedsLengthError, 
+              &quot;The formatted value '#{result}' in column '#{@name}' exceeds the allowed length of #{@length} chararacters.&quot;
+          end
+        end
+        result
+      end
   end  
 end
\ No newline at end of file</diff>
      <filename>lib/slither/column.rb</filename>
    </modified>
    <modified>
      <diff>@@ -153,12 +153,24 @@ describe Slither::Column do
       @column.format('Bill').should == '      Bill'
     end
     
-    it &quot;should raise an error if the value is longer than the length&quot; do
-      @value = &quot;XX&quot; * @length
-      lambda { @column.format(@value) }.should raise_error(
-        Slither::FormattedStringExceedsLengthError, 
-        &quot;The formatted value '#{@value}' in column '#{@name}' exceeds the allowed length of #{@length} chararacters.&quot;
-      )
+    describe &quot;whose size is too long&quot; do
+      it &quot;should raise an error if truncate is false&quot; do
+        @value = &quot;XX&quot; * @length
+        lambda { @column.format(@value) }.should raise_error(
+          Slither::FormattedStringExceedsLengthError,
+          &quot;The formatted value '#{@value}' in column '#{@name}' exceeds the allowed length of #{@length} chararacters.&quot;
+        )
+      end
+      
+      it &quot;should truncate from the left if truncate is true and aligned left&quot; do
+        @column = Slither::Column.new(@name, @length, :truncate =&gt; true, :align =&gt; :left)
+        @column.format(&quot;This is too long&quot;).should == &quot;This &quot;
+      end
+      
+      it &quot;should truncate from the right if truncate is true and aligned right&quot; do
+        @column = Slither::Column.new(@name, @length, :truncate =&gt; true, :align =&gt; :right)
+        @column.format(&quot;This is too long&quot;).should == &quot; long&quot;
+      end
     end
     
     it &quot;should support the integer type&quot; do
@@ -208,4 +220,5 @@ describe Slither::Column do
       @column.format(dt).should == '08222009'
     end 
   end
+
 end
\ No newline at end of file</diff>
      <filename>spec/column_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a0ae028c745ad39e3bd3ffdaeca64c3d97967cee</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Wood</name>
    <email>ryan.wood@gmail.com</email>
  </author>
  <url>http://github.com/ryanwood/slither/commit/4dfbe5efc0c146682b1fd7568c6665bc23390f58</url>
  <id>4dfbe5efc0c146682b1fd7568c6665bc23390f58</id>
  <committed-date>2009-06-22T11:25:31-07:00</committed-date>
  <authored-date>2009-06-22T11:25:31-07:00</authored-date>
  <message>Added truncate option</message>
  <tree>7f2dccc04d1789cc1763e55f8f76d8f62812f431</tree>
  <committer>
    <name>Ryan Wood</name>
    <email>ryan.wood@gmail.com</email>
  </committer>
</commit>
