hydra-file_characterization 0.3.0 → 0.3.1

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: e4919a2449be3e3a6127fdc17a5f8552e3b64821
4
- data.tar.gz: 1ab2ab15d03a9e4ddfd83b15e2f78a2be5548d86
3
+ metadata.gz: 998550a6f8a8090fa8e735b3d863f8b8da45fa26
4
+ data.tar.gz: aeedc6fcecc36f7ce17e07dcc4479709971ca30e
5
5
  SHA512:
6
- metadata.gz: d5494b689812d74a60ecca77216cc31302b8da2694635ee59be8b5b98c844bb936bd86a7ae3b09901375cc441c795ff7389b9209c36d41daaa5ba039e00cd6dd
7
- data.tar.gz: 5e828f94c57282b40fd42a6bdaaf7e30a74e8e3d85871ec3eef8e43f444fefb9eeca6a0946629a061078715f291e5dd22bdb8abd85bfa5f7c9bc900cddd107e8
6
+ metadata.gz: 42f80b2cdde8ff05833dee837dadba37770fd27a91ddefcdd6c1b90563b05c9d737f7bd0274a4dfe7a3ef05b8c0ab057db626ea72cadc3a27d4d8036dabbc217
7
+ data.tar.gz: e9bc81ce59caf0702fb8d762d4881341635793dadc6ad46e4dae08464bc8f0ea89ec1bb0c6bd1cf3c5ea52aca6f820415a18ca8f97a741d98014733702d3e5fc
@@ -42,6 +42,9 @@ module Hydra
42
42
  # @example With an open file
43
43
  # fits_xml, ffprobe_xml = Hydra::FileCharacterization.characterize(File.open('foo.mkv'), :fits, :ffprobe)
44
44
  #
45
+ # @example With an open file and a filename
46
+ # fits_xml, ffprobe_xml = Hydra::FileCharacterization.characterize(File.open('foo.mkv'), 'my_movie.mkv', :fits, :ffprobe)
47
+ #
45
48
  # @param [String] content - The contents of the original file
46
49
  # @param [String] filename - The original file's filename; Some
47
50
  # characterization tools take hints from the file names
@@ -82,7 +85,7 @@ module Hydra
82
85
  # @return [String, File], [String], [Array]
83
86
  def self.extract_arguments(args)
84
87
  content = args.shift
85
- filename = if content.is_a? File
88
+ filename = if content.is_a?(File) && !args[0].is_a?(String)
86
89
  File.basename(content.path)
87
90
  else
88
91
  args.shift
@@ -1,5 +1,5 @@
1
1
  module Hydra
2
2
  module FileCharacterization
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -61,11 +61,22 @@ module Hydra
61
61
 
62
62
  describe "for a file on disk" do
63
63
  let(:file) { File.open(fixture_file('brendan_behan.jpeg')) }
64
- subject { Hydra::FileCharacterization.characterize(file, tool_names) }
64
+ describe "without path specified" do
65
+ subject { Hydra::FileCharacterization.characterize(file, tool_names) }
65
66
 
66
- describe 'for fits' do
67
- let(:tool_names) { [:fits] }
68
- it { should match(/#{'<identity format="JPEG File Interchange Format" mimetype="image/jpeg"'}/) }
67
+ describe 'for fits' do
68
+ let(:tool_names) { [:fits] }
69
+ it { should match(/#{'<identity format="JPEG File Interchange Format" mimetype="image/jpeg"'}/) }
70
+ end
71
+ end
72
+ describe "with path specified" do
73
+ let(:file) { File.open(fixture_file('brendan_behan.jpeg')) }
74
+ subject { Hydra::FileCharacterization.characterize(file, 'Brendan.jpg', tool_names) }
75
+
76
+ describe 'for fits' do
77
+ let(:tool_names) { [:fits] }
78
+ it { should match(/#{'<identity format="JPEG File Interchange Format" mimetype="image/jpeg"'}/) }
79
+ end
69
80
  end
70
81
  end
71
82
  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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Treacy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-10-24 00:00:00.000000000 Z
14
+ date: 2013-10-25 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.0.7
133
+ rubygems_version: 2.0.3
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: To provide a wrapper for file characterization
@@ -148,3 +148,4 @@ test_files:
148
148
  - spec/lib/hydra/file_characterization/to_temp_file_spec.rb
149
149
  - spec/lib/hydra/file_characterization_spec.rb
150
150
  - spec/spec_helper.rb
151
+ has_rdoc: