mini_exiftool 0.4.0 → 0.4.1

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/Changelog CHANGED
@@ -1,3 +1,6 @@
1
+ Version 0.4.1
2
+ - Compatibility for Ruby 1.9
3
+
1
4
  Version 0.4.0
2
5
  - MiniExiftool::Error inherits now from StandardError
3
6
  - Alternative installation via setup.rb
data/Rakefile CHANGED
@@ -42,7 +42,9 @@ EXT_DIST_FILES = EXT_SOURCES + EXTCONF_FILES
42
42
  #---
43
43
  REQUIRE_PATHS = ["lib"]
44
44
  REQUIRE_PATHS << EXT_DIR if HAVE_EXT
45
- $LOAD_PATH.concat(REQUIRE_PATHS)
45
+ REQUIRE_PATHS.reverse_each do |p|
46
+ $LOAD_PATH.unshift p
47
+ end
46
48
  # This library file defines the MyProject::VERSION constant.
47
49
  require "#{UNIX_NAME}"
48
50
  PROJECT_VERSION = eval("#{PROJECT}::VERSION") # e.g. "1.0.2"
@@ -203,7 +205,7 @@ end
203
205
  # files for a new release.
204
206
  desc "Run tests, generate RDoc and create packages."
205
207
  task "prepare-release" => ["clobber"] do
206
- puts "Preparing release of #{PROJECT} version #{VERSION}"
208
+ puts "Preparing release of #{PROJECT} version #{PROJECT_VERSION}"
207
209
  Rake::Task["test"].invoke
208
210
  Rake::Task["rdoc"].invoke
209
211
  Rake::Task["package"].invoke
@@ -27,7 +27,7 @@ class MiniExiftool
27
27
  attr_reader :filename
28
28
  attr_accessor :numerical, :composite, :errors
29
29
 
30
- VERSION = '0.4.0'
30
+ VERSION = '0.4.1'
31
31
 
32
32
  # opts support at the moment
33
33
  # * <code>:numerical</code> for numerical values, default is +false+
@@ -47,7 +47,7 @@ class MiniExiftool
47
47
 
48
48
  # Load the tags of filename.
49
49
  def load filename
50
- if filename.nil? || !File.exists?(filename)
50
+ if filename.nil? || !File.exist?(filename)
51
51
  raise MiniExiftool::Error.new("File '#{filename}' does not exist.")
52
52
  elsif File.directory?(filename)
53
53
  raise MiniExiftool::Error.new("'#{filename}' is a directory.")
@@ -242,7 +242,9 @@ class MiniExiftool
242
242
  tag, value = $1, $2
243
243
  case value
244
244
  when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d$/
245
- value = Time.local(* (value.split /[: ]/))
245
+ arr = value.split /[: ]/
246
+ arr.map! {|elem| elem.to_i}
247
+ value = Time.local *arr
246
248
  when /^\d+\.\d+$/
247
249
  value = value.to_f
248
250
  when /^0+[1-9]+$/
@@ -292,7 +294,8 @@ class MiniExiftool
292
294
  end
293
295
 
294
296
  def self.determine_tags arg
295
- lines = `#{@@cmd} -#{arg}`
297
+ output = `#{@@cmd} -#{arg}`
298
+ lines = output.split /\n/
296
299
  tags = Set.new
297
300
  lines.each do |line|
298
301
  next unless line =~ /^\s/
@@ -24,8 +24,8 @@ class TestSpecial < Test::Unit::TestCase
24
24
  # Catching bug [#8073]
25
25
  # Thanks to Eric Young
26
26
  def test_special_chars
27
- assert_equal 0, @canon['Self-timer']
28
- assert_equal 0, @canon.self_timer
27
+ assert_not_nil @canon['Self-timer']
28
+ assert_not_nil @canon.self_timer
29
29
  # preserving the original tag name
30
30
  assert @canon.tags.include?('Self-timer')
31
31
  assert !@canon.tags.include?('self_timer')
@@ -71,14 +71,14 @@ class TestWrite < Test::Unit::TestCase
71
71
  end
72
72
 
73
73
  def test_float_conversion
74
- assert_kind_of Float, @mini_exiftool_num['ExposureTime']
75
- new_time = @mini_exiftool_num['ExposureTime'] * 2.0
76
- @mini_exiftool_num['ExposureTime'] = new_time
77
- assert_equal new_time, @mini_exiftool_num['ExposureTime']
78
- assert true, @mini_exiftool_num.changed_tags.include?('ExposureTime')
74
+ assert_kind_of Float, @mini_exiftool_num['BrightnessValue']
75
+ new_time = @mini_exiftool_num['BrightnessValue'] + 1
76
+ @mini_exiftool_num['BrightnessValue'] = new_time
77
+ assert_equal new_time, @mini_exiftool_num['BrightnessValue']
78
+ assert true, @mini_exiftool_num.changed_tags.include?('BrightnessValue')
79
79
  @mini_exiftool_num.save
80
- assert_kind_of Float, @mini_exiftool_num['ExposureTime']
81
- assert_equal new_time, @mini_exiftool_num['ExposureTime']
80
+ assert_kind_of Float, @mini_exiftool_num['BrightnessValue']
81
+ assert_equal new_time, @mini_exiftool_num['BrightnessValue']
82
82
  end
83
83
 
84
84
  def test_integer_conversion
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.1
3
3
  specification_version: 1
4
4
  name: mini_exiftool
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.4.0
7
- date: 2007-07-24 00:00:00 +02:00
6
+ version: 0.4.1
7
+ date: 2008-01-03 00:00:00 +01:00
8
8
  summary: A library for nice OO access to the Exiftool command-line application written by Phil Harvey.
9
9
  require_paths:
10
10
  - lib