checksummer 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/checksummer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{checksummer}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tobias Schwab"]
12
- s.date = %q{2011-07-04}
12
+ s.date = %q{2011-07-11}
13
13
  s.description = %q{Replace files with links to md5 files}
14
14
  s.email = %q{tobias.schwab@dynport.de}
15
15
  s.executables = ["checksummer"]
@@ -1,5 +1,6 @@
1
1
  require "time"
2
2
  require "fileutils"
3
+ require "pathname"
3
4
 
4
5
  class ChecksummerFile
5
6
  attr_accessor :modified_at, :size, :type, :path, :original_path, :original_line
@@ -62,7 +63,7 @@ class ChecksummerFile
62
63
  FileUtils.touch(path, :mtime => mtime)
63
64
  else
64
65
  status[:status] = :was_symlink
65
- status.merge!(:status => :was_symlink, :realpath => File.realpath(path))
66
+ status.merge!(:status => :was_symlink, :realpath => Pathname.new(path).realpath)
66
67
  end
67
68
  status
68
69
  end
@@ -183,11 +183,14 @@ describe ChecksummerFile do
183
183
  end
184
184
 
185
185
  it "calls File.realpath with path" do
186
- File.should_receive(:realpath).with("/some/text.csv").and_return "/real_path"
186
+ rp = double("rp", :realpath => "/real_path")
187
+ Pathname.stub!(:new).with("/some/text.csv").and_return rp
187
188
  file.checksum_to!("/tmp/data")
188
189
  end
189
190
 
190
191
  it "sets the realpath" do
192
+ rp = double("rp", :realpath => "/some/real/path")
193
+ Pathname.stub!(:new).with("/some/text.csv").and_return rp
191
194
  file.checksum_to!("/tmp/data")[:realpath].should == "/some/real/path"
192
195
  end
193
196
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: checksummer
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.3
5
+ version: 0.2.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tobias Schwab
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-04 00:00:00 Z
13
+ date: 2011-07-11 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
166
  - - ">="
167
167
  - !ruby/object:Gem::Version
168
- hash: -180317539703424019
168
+ hash: 2964293804353679217
169
169
  segments:
170
170
  - 0
171
171
  version: "0"