ECS 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/ecs/time_management.rb +10 -3
  3. metadata +1 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 0.1.3
2
+ * Extracted the file checking code for ECS::TimeManagement
3
+
4
+
1
5
  0.1.2
2
6
  * Fixed the error raised if the cache_directory is not writable
3
7
 
@@ -44,14 +44,21 @@ module ECS
44
44
  def self.time_file
45
45
  @@time_file
46
46
  end
47
+ def self.prepare_time_file( f )
48
+ file = File.expand_path( f )
49
+ FileUtils.touch( file ) unless File.exist?( file )
50
+ File.writable?( file )
51
+ rescue
52
+ false
53
+ end
47
54
  def self.time_file=( f='' )
48
55
  file = File.expand_path( f )
49
- FileUtils.touch( file )
50
- raise "#{file} is an unacceptable time file." unless File.writable?( file )
56
+ raise "#{file} is an unacceptable time file." unless self.prepare_time_file( file )
51
57
  @@time_file = file
52
58
  end
53
59
  def self.kill_time_file
54
- File.unlink( @@time_file )
60
+ raise "Cannot kill time file #{self.time_file}." unless self.prepare_time_file( self.time_file )
61
+ File.unlink( self.time_file )
55
62
  rescue
56
63
  end
57
64
  end
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: ECS
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.2
6
+ version: 0.1.3
7
7
  date: 2007-03-13 00:00:00 -07:00
8
8
  summary: A Ruby interface to Amazon's E-Commerce Service.
9
9
  require_paths: