mediainfo 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,3 +1,6 @@
1
+ v0.6.2 XML Configuration Examples
2
+ - added examples on how to configure XML back end
3
+
1
4
  v0.6.1 GitHub Home Page
2
5
  - use GitHub Pages url as home page for gem
3
6
 
data/README.markdown CHANGED
@@ -15,6 +15,22 @@ You can specify an alternate path if necessary:
15
15
 
16
16
  Mediainfo.path = "/opt/local/bin/mediainfo"
17
17
 
18
+
19
+ By default, REXML is used as the XML parser. If you'd like, you can
20
+ configure Mediainfo to use Hpricot or Nokogiri instead using one of
21
+ the following approaches:
22
+
23
+ * define the `MEDIAINFO_XML_PARSER` environment variable to be the
24
+ name of the parser as you'd pass to a :gem or :require call.
25
+
26
+ e.g. `export MEDIAINFO_XML_PARSER=nokogiri`
27
+
28
+ * assign to Mediainfo.xml_parser after you've loaded the gem,
29
+ following the same naming conventions mentioned previously.
30
+
31
+ e.g. `Mediainfo.xml_parser = "hpricot"`
32
+
33
+
18
34
  Once you've got an instance setup, you can call numerous methods to get
19
35
  a variety of information about a file. Some attributes may be present
20
36
  for some files where others are not, but any supported attribute
data/Rakefile CHANGED
@@ -23,6 +23,7 @@ Echoe.new "mediainfo" do |p|
23
23
  p.email = "sethrasmussen@gmail.com"
24
24
  p.url = "http://greatseth.github.com/mediainfo"
25
25
  p.ignore_pattern = %w( test/**/* )
26
+ p.retain_gemspec = true
26
27
  p.honor_gitignore!
27
28
  end
28
29
 
data/lib/mediainfo.rb CHANGED
@@ -1,35 +1,59 @@
1
1
  require "mediainfo/string"
2
2
  require "mediainfo/attr_readers"
3
3
 
4
- # Mediainfo is a class encapsulating the ability to run `mediainfo`
5
- # on a file and expose the information it produces in a straightforward
6
- # manner.
7
- #
8
- # Basic usage:
9
- #
10
- # info = Mediainfo.new "/path/to/file"
11
- #
12
- # That will issue the system call to `mediainfo` and parse the output.
13
- # From there, you can call numerous methods to get a variety of information
14
- # about a file. Some attributes may be present for some files where others
15
- # are not.
16
- #
17
- # You may also initialize a Mediainfo instance using raw CLI output
18
- # you have saved for some reason.
19
- #
20
- # info = Mediainfo.new
21
- # info.raw_response = cli_output
22
- #
23
- # Setting the raw_response triggers the system call, and from that point on
24
- # the object should behave the same as if you'd initialized it with the path
25
- # to a file.
26
- #
27
- # For a list of all possible attributes supported:
28
- #
29
- # Mediainfo.supported_attributes
30
- #
31
- # In addition to the stock arguments provided by parsing `mediainfo` output,
32
- # some convenience methods and added behavior is added.
4
+ =begin
5
+ # Mediainfo
6
+
7
+ Mediainfo is a class wrapping [the mediainfo CLI](http://mediainfo.sourceforge.net).
8
+
9
+ ## Installation
10
+
11
+ $ gem install mediainfo -s http://gemcutter.org
12
+
13
+ ## Usage
14
+
15
+ info = Mediainfo.new "/path/to/file"
16
+
17
+ That will issue the system call to `mediainfo` and parse the output.
18
+ You can specify an alternate path if necessary:
19
+
20
+ Mediainfo.path = "/opt/local/bin/mediainfo"
21
+
22
+
23
+ By default, REXML is used as the XML parser. If you'd like, you can
24
+ configure Mediainfo to use Hpricot or Nokogiri instead using one of
25
+ the following approaches:
26
+
27
+ * define the `MEDIAINFO_XML_PARSER` environment variable to be the
28
+ name of the parser as you'd pass to a :gem or :require call.
29
+
30
+ e.g. `export MEDIAINFO_XML_PARSER=nokogiri`
31
+
32
+ * assign to Mediainfo.xml_parser after you've loaded the gem,
33
+ following the same naming conventions mentioned previously.
34
+
35
+ e.g. `Mediainfo.xml_parser = "hpricot"`
36
+
37
+
38
+ Once you've got an instance setup, you can call numerous methods to get
39
+ a variety of information about a file. Some attributes may be present
40
+ for some files where others are not, but any supported attribute
41
+ should at least return `nil`.
42
+
43
+ For a list of all possible attributes supported:
44
+
45
+ Mediainfo.supported_attributes
46
+
47
+ ## Requirements
48
+
49
+ This requires at least the following version of the Mediainfo CLI:
50
+
51
+ MediaInfo Command line,
52
+ MediaInfoLib - v0.7.25
53
+
54
+ Previous versions of this gem(<= 0.5.1) worked against v0.7.11, which did not
55
+ generate XML output, and is no longer supported.
56
+ =end
33
57
  class Mediainfo
34
58
  extend AttrReaders
35
59
 
data/mediainfo.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mediainfo}
5
- s.version = "0.6.1"
5
+ s.version = "0.6.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Seth Thomas Rasmussen"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mediainfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Thomas Rasmussen