filey-diff 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/changelog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ * Remove the -number suffix from S3 ETags ([thanks
6
+ postmodern!](https://github.com/laurilehmijoki/filey-diff/pull/2))
7
+
3
8
  ## 1.0.1
4
9
 
5
10
  * Support S3 etags that are longer than 32 characters
data/filey-diff.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'filey-diff'
3
- s.version = '1.0.1'
3
+ s.version = '1.0.2'
4
4
 
5
5
  s.summary = "Compare two data sources that contain file-like objects"
6
6
  s.description =
@@ -20,7 +20,7 @@ module Filey
20
20
  Filey.new(normalised_path,
21
21
  name,
22
22
  s3_object.last_modified,
23
- s3_object.etag.gsub(/"/, ''))
23
+ s3_object.etag.gsub(/"/, '').split('-',2).first)
24
24
  }
25
25
  end
26
26
  end
@@ -6,7 +6,7 @@ module Filey
6
6
  raise InvalidPathError unless path.match(/^\..*\/$/)
7
7
  raise InvalidTimeError unless last_modified.instance_of?(Time)
8
8
  raise InvalidNameError if name.match(/\//)
9
- raise InvalidMd5Error unless md5.length >= 32
9
+ raise InvalidMd5Error unless md5.length == 32
10
10
  @path = path
11
11
  @name = name
12
12
  @last_modified = last_modified
data/spec/filey_spec.rb CHANGED
@@ -78,14 +78,16 @@ describe Filey::Filey do
78
78
  }.to raise_error(Filey::Filey::InvalidMd5Error)
79
79
  end
80
80
 
81
- it 'accepts md5s longer than 31' do
81
+ it 'accepts md5s of length 32' do
82
82
  Filey::Filey.new('./ripley/', 'aliens.txt', Time.now,
83
83
  'ca022be4a1c56c770b9700df99473d01')
84
84
  end
85
85
 
86
- it 'accepts md5s longer than 31' do
86
+ it 'raises an error if the md5 hash longer than 32 characters' do
87
+ expect {
87
88
  Filey::Filey.new('./ripley/', 'aliens.txt', Time.now,
88
- 'f392c1602cd1d9a0176853c41b366db5-5')
89
+ 'ca022be4a1c56c770b9700df99473d03-5')
90
+ }.to raise_error(Filey::Filey::InvalidMd5Error)
89
91
  end
90
92
  end
91
93
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filey-diff
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-03 00:00:00.000000000 Z
12
+ date: 2013-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake