ruby-cafinfo 0.1 → 0.2
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 +5 -0
- data/README +3 -1
- data/Rakefile +9 -5
- data/bin/cafinfo +27 -0
- data/lib/caf/chunk/helper.rb +4 -3
- data/lib/cafinfo.rb +1 -1
- metadata +11 -10
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
=== 0.2 / 2010-01-07
|
2
|
+
|
3
|
+
* updated to be compatible with float-formats 0.2.
|
4
|
+
* removed require of rubygems from inside ruby-cafinfo: now it has to be required externally: http://tomayko.com/writings/require-rubygems-antipattern
|
5
|
+
|
1
6
|
=== 0.1 / 2009-03-12
|
2
7
|
|
3
8
|
* initial release: contains basic support for audio_description, data, free and magick cookie chunks.
|
data/README
CHANGED
@@ -26,6 +26,7 @@ Specs for CAF format can be found here[http://developer.apple.com/DOCUMENTATION/
|
|
26
26
|
|
27
27
|
Using as a lib is easy:
|
28
28
|
|
29
|
+
require "rubygems"
|
29
30
|
require "cafinfo"
|
30
31
|
# read and display info
|
31
32
|
CafInfo.open("myfile.caf") do |cafinfo|
|
@@ -73,4 +74,5 @@ MIT license
|
|
73
74
|
|
74
75
|
== TODO:
|
75
76
|
|
76
|
-
* support for other chunk types
|
77
|
+
* support for other chunk types
|
78
|
+
* tests
|
data/Rakefile
CHANGED
@@ -7,18 +7,22 @@ require 'rake/testtask'
|
|
7
7
|
|
8
8
|
spec = Gem::Specification.new do |s|
|
9
9
|
s.name = 'ruby-cafinfo'
|
10
|
-
s.version = '0.
|
10
|
+
s.version = '0.2'
|
11
11
|
s.has_rdoc = true
|
12
12
|
s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGELOG']
|
13
13
|
s.summary = 'ruby-cafinfo is a ruby library to retrieve low level informations on CAF files'
|
14
|
-
s.description =
|
14
|
+
s.description = <<-EOF
|
15
|
+
ruby-cafinfo is a ruby library to retrieve low level informations on CAF files.
|
16
|
+
It also provides a cafinfo program that retrieves informtaions of CAF files passed
|
17
|
+
as arguments.
|
18
|
+
EOF
|
15
19
|
s.author = 'Oleguer Huguet Ibars'
|
16
20
|
s.email = 'olegueret@rubyforge.org'
|
17
|
-
|
21
|
+
s.executables = ['cafinfo']
|
18
22
|
s.files = %w(LICENSE README Rakefile) + Dir.glob("{bin,lib,spec}/**/*")
|
19
23
|
s.require_path = "lib"
|
20
|
-
|
21
|
-
s.add_dependency 'float-formats', '>=0.
|
24
|
+
s.bindir = "bin"
|
25
|
+
s.add_dependency 'float-formats', '>=0.2.0'
|
22
26
|
s.rubyforge_project = 'ruby-cafinfo'
|
23
27
|
s.homepage = 'http://ruby-cafinfo.rubyforge.org'
|
24
28
|
end
|
data/bin/cafinfo
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# coding:utf-8
|
3
|
+
# License:: Mit
|
4
|
+
# Author:: Oleguer Huguet Ibars (mailto:oleguer_DOT_huguet_AT__gmail_DOT_com)
|
5
|
+
# Website:: http://ruby-cafinfo.rubyforge.org/
|
6
|
+
|
7
|
+
require 'rubygems'
|
8
|
+
require 'cafinfo'
|
9
|
+
|
10
|
+
if ARGV.size == 0
|
11
|
+
puts "usage: #{$0} file1.caf [file2.caf file3.caf...]"
|
12
|
+
else
|
13
|
+
error = 0
|
14
|
+
while filename = ARGV.shift
|
15
|
+
begin
|
16
|
+
info = CafInfo.new(filename)
|
17
|
+
puts filename
|
18
|
+
puts info
|
19
|
+
rescue Caf::Error => e
|
20
|
+
puts "#{filename}\nERROR: #{e}"
|
21
|
+
error = 1
|
22
|
+
end
|
23
|
+
puts
|
24
|
+
end
|
25
|
+
exit(error)
|
26
|
+
end
|
27
|
+
|
data/lib/caf/chunk/helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'float-formats'
|
3
|
-
|
2
|
+
|
3
|
+
include Flt
|
4
4
|
|
5
5
|
module Caf::Chunk
|
6
6
|
module Helper
|
@@ -24,7 +24,8 @@ module Caf::Chunk
|
|
24
24
|
|
25
25
|
def self.read_double(data, offset = 0)
|
26
26
|
num = read_bytes(8, data, offset)
|
27
|
-
IEEE_binary64.from_bits_integer(num).to_number(Float)
|
27
|
+
# IEEE_binary64.from_bits_integer(num).to_number(Float)
|
28
|
+
IEEE_DOUBLE.from_bits(num).convert_to(Float)
|
28
29
|
end
|
29
30
|
|
30
31
|
def self.read_int(data, offset = 0)
|
data/lib/cafinfo.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-cafinfo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oleguer Huguet Ibars
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-07 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,12 +20,12 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.
|
23
|
+
version: 0.2.0
|
24
24
|
version:
|
25
|
-
description: ruby-cafinfo is a ruby library to retrieve low level informations on CAF files
|
25
|
+
description: " ruby-cafinfo is a ruby library to retrieve low level informations on CAF files.\n It also provides a cafinfo program that retrieves informtaions of CAF files passed\n as arguments.\n"
|
26
26
|
email: olegueret@rubyforge.org
|
27
|
-
executables:
|
28
|
-
|
27
|
+
executables:
|
28
|
+
- cafinfo
|
29
29
|
extensions: []
|
30
30
|
|
31
31
|
extra_rdoc_files:
|
@@ -36,9 +36,8 @@ files:
|
|
36
36
|
- LICENSE
|
37
37
|
- README
|
38
38
|
- Rakefile
|
39
|
+
- bin/cafinfo
|
39
40
|
- lib/cafinfo.rb
|
40
|
-
- lib/caf
|
41
|
-
- lib/caf/chunk
|
42
41
|
- lib/caf/chunk/audio_description.rb
|
43
42
|
- lib/caf/chunk/magic_cookie.rb
|
44
43
|
- lib/caf/chunk/base.rb
|
@@ -52,6 +51,8 @@ files:
|
|
52
51
|
- CHANGELOG
|
53
52
|
has_rdoc: true
|
54
53
|
homepage: http://ruby-cafinfo.rubyforge.org
|
54
|
+
licenses: []
|
55
|
+
|
55
56
|
post_install_message:
|
56
57
|
rdoc_options: []
|
57
58
|
|
@@ -72,9 +73,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
73
|
requirements: []
|
73
74
|
|
74
75
|
rubyforge_project: ruby-cafinfo
|
75
|
-
rubygems_version: 1.3.
|
76
|
+
rubygems_version: 1.3.5
|
76
77
|
signing_key:
|
77
|
-
specification_version:
|
78
|
+
specification_version: 3
|
78
79
|
summary: ruby-cafinfo is a ruby library to retrieve low level informations on CAF files
|
79
80
|
test_files: []
|
80
81
|
|