polly-ffmpeg 0.1.2 → 0.1.3

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.
Files changed (4) hide show
  1. data/README.rdoc +6 -1
  2. data/ffmpeg.gemspec +1 -1
  3. data/lib/ffmpeg.rb +26 -6
  4. metadata +3 -2
data/README.rdoc CHANGED
@@ -38,4 +38,9 @@
38
38
  end
39
39
 
40
40
  If you where to add a method with the same name as one already defined in the library your method will take precedence
41
- over the predefined one, a warning message informing you about the conflict will be printed out through $stderr however.
41
+ over the predefined one, a warning message informing you about the conflict will be printed out through $stderr however.
42
+
43
+ == Credit where credit's due
44
+
45
+ Thank's to jwthompson2 (http://github.com/jwthompson2), there's now support for all of the standard video and
46
+ audio options from the ffmpeg documentation as well as improved and refactored specs.
data/ffmpeg.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ffmpeg}
5
- s.version = "0.1.2"
5
+ s.version = "0.1.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Patrik Hedman"]
data/lib/ffmpeg.rb CHANGED
@@ -18,7 +18,7 @@ module FFMpeg
18
18
  def self.included(klass)
19
19
  klass.extend ClassMethods
20
20
 
21
- #
21
+ #
22
22
  # Everytime a method is added to the
23
23
  # class, check for conflicts with existing
24
24
  # module methods
@@ -42,28 +42,48 @@ module FFMpeg
42
42
  begin
43
43
  yield if block_given?
44
44
  rescue Exception => exception
45
- Thread.current[:'method checking disabled'] = true
45
+ disable_method_checking!
46
46
  raise exception
47
47
  end
48
48
  FFMpegCommand << "#{to_file[:to]}" unless to_file[:to].nil?
49
49
  end
50
50
 
51
51
  #
52
- # Runs ffmpeg
52
+ # Explicitly set ffmpeg path
53
+ #
54
+ def ffmpeg_path(path)
55
+ @ffmpeg_path = path
56
+ end
57
+
58
+ #
59
+ # Ru§ns ffmpeg
53
60
  #
54
61
  def run
55
- execute_command FFMpegCommand.command(locate_ffmpeg)
62
+ if path = @ffmpeg_path ? @ffmpeg_path : FFMpegCommand.command(locate_ffmpeg)
63
+ execute_command path
64
+ else
65
+ $stderr.puts "Couldn't locate ffmpeg, try to specify an explicit path
66
+ with the ffmpeg_path(path) method"
67
+ end
56
68
  end
57
69
 
58
70
  private
59
71
 
60
72
  #
61
- #
73
+ # Checks if the thread local varialble 'method checking disabled'
74
+ # is true or false
62
75
  #
63
76
  def method_checking_enabled?
64
77
  !Thread.current[:'method checking disabled']
65
78
  end
66
79
 
80
+ #
81
+ # Turns off the method checking functionality
82
+ #
83
+ def disable_method_checking!
84
+ Thread.current[:'method checking disabled'] = true
85
+ end
86
+
67
87
  #
68
88
  # Tries to locate the FFmpeg executable
69
89
  #
@@ -79,4 +99,4 @@ module FFMpeg
79
99
  %x[#{cmd}]
80
100
  puts $?.success?
81
101
  end
82
- end
102
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polly-ffmpeg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Hedman
@@ -36,6 +36,7 @@ files:
36
36
  - lib/ffmpeg/video_options.rb
37
37
  has_rdoc: false
38
38
  homepage: http://github.com/polly/ffmpeg
39
+ licenses:
39
40
  post_install_message:
40
41
  rdoc_options:
41
42
  - --charset=UTF-8
@@ -56,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
57
  requirements: []
57
58
 
58
59
  rubyforge_project:
59
- rubygems_version: 1.2.0
60
+ rubygems_version: 1.3.5
60
61
  signing_key:
61
62
  specification_version: 3
62
63
  summary: Need to write one