mediainfo 1.1.2 → 1.2.0

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
  SHA256:
3
- metadata.gz: d9b9f915a19f9e7ff51cbda842cb2f163e4c1977dec552db464cf1ad1d6b7c1a
4
- data.tar.gz: 5dcd60c6fe17ce779cb051de513ced21b46cb3d3f4d10b3f0ddefdb9d69e15de
3
+ metadata.gz: a980499371cba6af063e9a484fefdc52bb0ac1d0cf231c2477a9cad13c5a81c9
4
+ data.tar.gz: 86137ca8a4adf93980fa3069cd828584b974c53a7e7c43375a0f67f13e19a727
5
5
  SHA512:
6
- metadata.gz: b69a8c19047797e6bdfb71ab9d93b690ec844a3005551868f1326c011d7772b18fa032a118fd60683c32f1c226fc11bfc7b646ba0bd1d509e6688acb6c5ddf83
7
- data.tar.gz: ca6efb991313d67c59142fbe98ce82cc6b2f56036d86275e36941dd5a4ca21b23b5038b0a34a57b2edd7e27bdb0c8c6a6f067d6147b34bf95d08eaff94fb37bc
6
+ metadata.gz: 754815e1737c88fa9b1512eb79ef0f9d610d472f6a1b0c283009319f5d7a1d7f6277470398df1f66f3bf69483d3392658da8827df1f9a780d1cd7c5dfd680b23
7
+ data.tar.gz: d984ab7702fbba06307f56f510744ca11a4bd6beb9d7ab5e936a4e470a84fa94a4ced6466e26248adc59f6e31abed251cea8b4d7faa2e66654c218c9782eeecd
data/.gitignore CHANGED
@@ -13,7 +13,7 @@ pkg
13
13
  !/spec/fixtures/video/.keep
14
14
  /tmp/
15
15
  .idea
16
-
16
+ .vscode
17
17
  # rspec failure tracking
18
18
  .rspec_status
19
19
 
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.6.1
4
+ before_install:
5
+ - sudo apt-get install -y mediainfo
6
+ env:
7
+ - MEDIAINFO_PATH=/usr/bin/mediainfo
8
+ install:
9
+ # Install bundler 2
10
+ - gem update --no-document --system
11
+ - gem install bundler --no-document
12
+ # Install gems
13
+ - bundle install
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  git_source(:github) {|repo_name| "https://github.com/greatseth/#{repo_name}" }
4
-
4
+ gem 'pry'
5
5
  gemspec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # MediaInfo
1
+ # MediaInfo [![Build Status](https://travis-ci.org/greatseth/mediainfo.svg?branch=master)](https://travis-ci.org/greatseth/mediainfo)
2
2
 
3
3
  MediaInfo is a class wrapping [the mediainfo CLI](http://mediainfo.sourceforge.net).
4
4
 
@@ -15,9 +15,9 @@ MediaInfo is a class wrapping [the mediainfo CLI](http://mediainfo.sourceforge.n
15
15
  #### Handling a URL
16
16
  media_info = MediaInfo.from('http://techslides.com/demos/sample-videos/small.mp4')
17
17
 
18
- You can specify an alternate path for the MediaInfo Binary:
18
+ Ensure mediainfo is installed and within your PATH. You can specify an alternate path for the mediainfo binary if needed:
19
19
 
20
- ENV['MEDIAINFO_PATH'] = "/opt/local/bin/mediainfo"
20
+ ENV['MEDIAINFO_PATH'] = "/usr/bin/mediainfo"
21
21
 
22
22
  Once you have an MediaInfo object, you can start inspecting tracks:
23
23
 
@@ -82,7 +82,7 @@ Sometimes you'll have more than one track of a given type:
82
82
  - You can review lib/attribute_standardization_rules.yml to see them all
83
83
 
84
84
 
85
- media_info.video.bit_rate => nil (\<Bit_rate>41.2 Mbps\</Bit_rate>)
85
+ media_info.video.bit_rate => nil (\<Bit_rate>41.2 Mbps\</Bit_rate>)
86
86
  media_info.video.bitrate => "41.2 Mbps" (\<Bit_rate>41.2 Mbps\</Bit_rate>)
87
87
  media_info.general.filesize => "11.5 MiB" (\<File_size>11.5 MiB\</File_size>
88
88
 
@@ -100,7 +100,7 @@ The track type media_info.video5 is available, but no video2, 3, and 4. This is
100
100
  <ID>5</ID>
101
101
  ...
102
102
 
103
- *The ID will take priority for labeling.* Else if no ID exists, you'll see consecutive numbering for duplicate tracks in the Media.
103
+ *The ID will take priority for labeling.* Else if no ID exists, you'll see consecutive numbering for duplicate tracks in the Media.
104
104
 
105
105
  Any second level attributes are also available:
106
106
 
@@ -133,7 +133,8 @@ should at least return `nil`.
133
133
 
134
134
  ## Contributors
135
135
 
136
- * Seth Thomas Rasmussen - [http://greatseth.com](http://greatseth.com)
136
+ * Seth Thomas Rasmussen -
137
+ [http://github.com/greatseth](http://github.com/greatseth)
137
138
  * Peter Vandenberk - [http://github.com/pvdb](http://github.com/pvdb)
138
139
  * Ned Campion - [http://github.com/nedcampion](http://github.com/nedcampion)
139
140
  * Daniel Jagszent - [http://github.com/d--j](http://github.com/d--j)
data/lib/mediainfo.rb CHANGED
@@ -6,9 +6,24 @@ require 'mediainfo/string'
6
6
 
7
7
  module MediaInfo
8
8
 
9
+ def self.which(cmd)
10
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
11
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
12
+ exts.each { |ext|
13
+ exe = File.join(path, "#{cmd}#{ext}")
14
+ return exe if File.executable?(exe) && !File.directory?(exe)
15
+ }
16
+ end
17
+ return nil
18
+ end
19
+
9
20
  # Allow user to set custom mediainfo_path with ENV['MEDIAINFO_PATH']
10
21
  def self.location
11
- ENV['MEDIAINFO_PATH'].nil? ? mediainfo_location = '/usr/local/bin/mediainfo' : mediainfo_location = ENV['MEDIAINFO_PATH']
22
+ if ENV['MEDIAINFO_PATH'].nil?
23
+ mediainfo_location = which('mediainfo')
24
+ else
25
+ mediainfo_location = ENV['MEDIAINFO_PATH']
26
+ end
12
27
  raise EnvironmentError, "#{mediainfo_location} cannot be found. Are you sure mediainfo is installed?" unless ::File.exist? mediainfo_location
13
28
  return mediainfo_location
14
29
  end
@@ -57,7 +72,7 @@ module MediaInfo
57
72
 
58
73
  def self.from_string(input)
59
74
  return from_xml(input) if input.include?('<?xml')
60
- return from_link(input) if input =~ URI::regexp
75
+ return from_link(input) if input.include?('://') && input =~ URI::regexp
61
76
  return from_local_file(input) if input.match(/[^\\]*\.\w+$/)
62
77
  raise BadInputError
63
78
  end
@@ -1,3 +1,3 @@
1
1
  module MediaInfo
2
- VERSION = '1.1.2'
2
+ VERSION = '1.2.0'
3
3
  end
data/mediainfo.gemspec CHANGED
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
21
21
  end
22
22
 
23
23
  # Since Ruby 1.8, REXML is included in the standard Ruby distribution.
24
- s.add_development_dependency 'bundler', '~> 1.16'
24
+ s.add_development_dependency 'bundler', '~> 2'
25
25
  s.add_development_dependency 'rake', '~> 12.3'
26
26
  s.add_development_dependency 'rspec', '~> 3.0'
27
- s.add_development_dependency 'nokogiri', '~> 1.8' # Ability to parse XML response # Optional and should be included by user in their own gemfile
27
+ s.add_development_dependency 'nokogiri', '>= 1.8', '< 2.0' # Ability to parse XML response # Optional and should be included by user in their own gemfile
28
28
 
29
29
  if s.respond_to? :specification_version then
30
30
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mediainfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Thomas Rasmussen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-25 00:00:00.000000000 Z
11
+ date: 2019-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.16'
19
+ version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.16'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,22 @@ dependencies:
56
56
  name: nokogiri
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.8'
62
+ - - "<"
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
62
65
  type: :development
63
66
  prerelease: false
64
67
  version_requirements: !ruby/object:Gem::Requirement
65
68
  requirements:
66
- - - "~>"
69
+ - - ">="
67
70
  - !ruby/object:Gem::Version
68
71
  version: '1.8'
72
+ - - "<"
73
+ - !ruby/object:Gem::Version
74
+ version: '2.0'
69
75
  description: MediaInfo is a class wrapping the mediainfo CLI (http://mediainfo.sourceforge.net)
70
76
  that standardizes attributes/methods and also converts most values into something
71
77
  Ruby can understand.
@@ -76,8 +82,10 @@ extra_rdoc_files: []
76
82
  files:
77
83
  - ".gitignore"
78
84
  - ".rspec"
85
+ - ".travis.yml"
86
+ - ".vscode/settings.json"
79
87
  - Changelog
80
- - GemFile
88
+ - Gemfile
81
89
  - LICENSE
82
90
  - README.md
83
91
  - Rakefile
@@ -112,8 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
112
120
  - !ruby/object:Gem::Version
113
121
  version: '1.2'
114
122
  requirements: []
115
- rubyforge_project: mediainfo
116
- rubygems_version: 2.7.6
123
+ rubygems_version: 3.0.2
117
124
  signing_key:
118
125
  specification_version: 3
119
126
  summary: MediaInfo is a class wrapping the mediainfo CLI (http://mediainfo.sourceforge.net)