hydra-file_characterization 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4def79bda517cce6ad3c1ffcaca7a88f9fd1aa7c
4
- data.tar.gz: 82986c4ea7f73f62ac7726457086ccbc89000c3e
3
+ metadata.gz: ac3f8bd5d49accc137edb199598480ee962e6e4a
4
+ data.tar.gz: ef7acd758a81951fedb2f859fa1b63f3e333ca48
5
5
  SHA512:
6
- metadata.gz: 769bef1cd85ca67cf31898c2db6716eeac010d9d8ba9b18b164e642171324e872b91a85d646cbaacb87a834c5442eb363f8a3908ad0c3caae1dbc65f5b159f78
7
- data.tar.gz: 0b4b47e4198067bcf264c25d452a3c5190fd781d3ea2a9726760946d2e480b9a8797d3b1604d1c7a8517a313e1fb8e12b03e60f6f18989488c1609c910ba3f2d
6
+ metadata.gz: 82f738df066f04e8e5c85781475f663ee9d64070b907c7305803efdc847fe137e01ddd64d640b8185738050efdec2343fb0d74033632f5f25c34f1320adb3a76
7
+ data.tar.gz: bf4c51962ee5f7f34da4bd18e14331aafac3da2dad44eccd63b5b0baf8d0eecbebb134f79f06ef08a56b5d38a567de77acfcdcff9ae2e62484b336dff82ff35b
@@ -9,16 +9,14 @@ module Hydra::FileCharacterization
9
9
  new(*args).call(&block)
10
10
  end
11
11
 
12
- attr_accessor :data, :filename
12
+ attr_reader :data, :filename
13
13
 
14
14
  def initialize(data, filename)
15
- @data = data
15
+ self.data = data
16
16
  @filename = filename
17
17
  end
18
18
 
19
19
  def call
20
- return if data.nil?
21
- data = data.read if data.respond_to?(:read)
22
20
  f = Tempfile.new([File.basename(filename),File.extname(filename)])
23
21
  begin
24
22
  f.binmode
@@ -31,5 +29,11 @@ module Hydra::FileCharacterization
31
29
  end
32
30
 
33
31
  end
32
+
33
+ protected
34
+
35
+ def data=(value)
36
+ @data = value.respond_to?(:read) ? value.read : value
37
+ end
34
38
  end
35
39
  end
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module FileCharacterization
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-file_characterization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Treacy