mini_exiftool 0.1.0 → 0.1.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,8 @@
1
+ Version 0.1.1
2
+ - Fixing bug [#8073]
3
+ Handling the '-' in tag Self-timer
4
+ Thanks to Eric Young
5
+
1
6
  Version 0.1.0
2
7
  - New method "revert"
3
8
  - More tests
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ MY_NAME = "Jan Friedrich"
14
14
  MY_EMAIL = "miniexiftool@googlemail.com"
15
15
 
16
16
  # Short summary of your project, used in packaging.
17
- PROJECT_SUMMARY = 'A library for nice OO access to the Exiftool commandline application written by Phil Harvey.'
17
+ PROJECT_SUMMARY = 'A library for nice OO access to the Exiftool command-line application written by Phil Harvey.'
18
18
 
19
19
  # The project's package name (as opposed to its display name). Used for
20
20
  # RubyForge connectivity and packaging.
@@ -45,7 +45,7 @@ REQUIRE_PATHS << EXT_DIR if HAVE_EXT
45
45
  $LOAD_PATH.concat(REQUIRE_PATHS)
46
46
  # This library file defines the MyProject::VERSION constant.
47
47
  require "#{UNIX_NAME}"
48
- PROJECT_VERSION = eval("#{PROJECT}::Version") # e.g. "1.0.2"
48
+ PROJECT_VERSION = eval("#{PROJECT}::VERSION") # e.g. "1.0.2"
49
49
  #---
50
50
  # Clobber object files and Makefiles generated by extconf.rb.
51
51
  CLOBBER.include("#{EXT_DIR}/**/*.{so,dll,o}", "#{EXT_DIR}/**/Makefile")
@@ -25,7 +25,7 @@ class MiniExiftool
25
25
  attr_reader :filename
26
26
  attr_accessor :numerical
27
27
 
28
- Version = '0.1.0'
28
+ VERSION = '0.1.1'
29
29
 
30
30
  # opts at the moment only support :numerical for numerical values
31
31
  # (the -n parameter in the command line)
@@ -121,7 +121,7 @@ class MiniExiftool
121
121
  end
122
122
 
123
123
  def unify name
124
- name.gsub(/_/, '').downcase
124
+ name.gsub(/[_\-]/, '').downcase
125
125
  end
126
126
 
127
127
  def convert val
@@ -151,7 +151,7 @@ class MiniExiftool
151
151
  end
152
152
 
153
153
  def parse_line line
154
- if line =~ /^(\w+?)\t(.*)$/
154
+ if line =~ /^([^\t]+?)\t(.*)$/
155
155
  tag, value = $1, $2
156
156
  case value
157
157
  when /^\d{4}:\d\d:\d\d \d\d:\d\d:\d\d$/
Binary file
@@ -0,0 +1,3 @@
1
+ Following files are borrowed from the original Exiftool perl package.
2
+
3
+ Canon.jpg
@@ -0,0 +1,28 @@
1
+ require 'mini_exiftool'
2
+ require 'test/unit'
3
+ begin
4
+ require 'turn'
5
+ rescue LoadError
6
+ end
7
+
8
+ class TestSpecial < Test::Unit::TestCase
9
+
10
+ def setup
11
+ @data_dir = File.dirname(__FILE__) + '/data'
12
+ @filename_canon = @data_dir + '/Canon.jpg'
13
+ @canon = MiniExiftool.new @filename_canon
14
+ end
15
+
16
+ # Catching bug [#8073]
17
+ # Thanks to Eric Young
18
+ def test_special_chars
19
+ assert_equal 0, @canon['Self-timer']
20
+ assert_equal 0, @canon.self_timer
21
+ # preserving the original tag name
22
+ assert @canon.tags.include?('Self-timer')
23
+ assert !@canon.tags.include?('self_timer')
24
+ end
25
+
26
+
27
+
28
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.0
2
+ 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.1.0
7
- date: 2007-01-23 00:00:00 +01:00
8
- summary: A library for nice OO access to the Exiftool commandline application written by Phil Harvey.
6
+ version: 0.1.1
7
+ date: 2007-02-01 00:00:00 +01:00
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
11
11
  email: miniexiftool@googlemail.com
@@ -32,14 +32,18 @@ files:
32
32
  - lib/mini_exiftool.rb
33
33
  - test/test_write.rb
34
34
  - test/test_read.rb
35
+ - test/test_special.rb
35
36
  - Rakefile
36
37
  - COPYING
37
38
  - Changelog
38
39
  - test/data/test.jpg
40
+ - test/data/Canon.jpg
41
+ - test/data/INFORMATION
39
42
  - README
40
43
  test_files:
41
44
  - test/test_write.rb
42
45
  - test/test_read.rb
46
+ - test/test_special.rb
43
47
  rdoc_options:
44
48
  - --title
45
49
  - MiniExiftool API documentation