Changeset 1222

Show
Ignore:
Timestamp:
01/08/08 23:50:09 (9 months ago)
Author:
sethrasmuss..@gmail.com
Message:

version reads svn rev from file in gem form without blowing up

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/merb/version.rb

    r1218 r1222  
    1717     
    1818    def svn_revision_from_file 
    19       # This block should maybe be its own method 
    20       unless File.file? svn_revision_file_path 
     19      begin 
    2120        File.open svn_revision_file_path, 'w' do |f| 
    2221          f.print svn_revision 
    2322        end 
     23      # catch permissions error when packaged as gem 
     24      rescue Errno::EACCES 
    2425      end 
    2526       
  • trunk/spec/merb/version_spec.rb

    r1221 r1222  
    1111    Merb.svn_revision_from_file 
    1212    File.file?(Merb.svn_revision_file_path).should == true 
     13  end 
     14   
     15  it 'should not raise permissions error' do 
     16    File.should_receive(:open).and_raise(Errno::EACCES) 
     17    Merb.svn_revision_from_file.should_not raise_error(Errno::EACCES) 
    1318  end 
    1419