mediakit 0.0.11 → 0.0.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 28f784bbe9121a1cc67346a3548bef4b5adc1bc6
4
- data.tar.gz: 3513a68e6266e7fcb3d6cf88e089953c7b305f56
3
+ metadata.gz: ee3e85010075e5c0cc67eb59f16716b958a69d72
4
+ data.tar.gz: 51f35a2e74284eff387a63e51970626d8b56272b
5
5
  SHA512:
6
- metadata.gz: 9a38753995ae85517652aa5adb187dcbcefef23860914998a20d602f7d00310efdf275e748116f6d6665dafbe926f4b82f813bd03b66b22b9ff5906fce426566
7
- data.tar.gz: 61a11c6eecd52cbfc6b60aa6ac533c6791cdaf5983e6581c8afbf0ad3b1759abe3672173e7b7cfca97a56b851504adc072da47ddc664d11bd54d5594c2159926
6
+ metadata.gz: 40389b44e91057cba2e806a69aa4b361c7b8d7758b9d4217cb985c6047d4b2db0eaf6acaa0e3ae84971a15f4d926a7623beb1a034f2d0556b452aa8a5d119682
7
+ data.tar.gz: 21c2f0a2a669050440b07a83cfef0aef310b3d520e2b5e5315bf9f91bebd402d18062cc3a74e651233c6c103bf82cf62fc887cb8b108dd7ddf33da7a174460d5
@@ -9,6 +9,7 @@ module Mediakit
9
9
 
10
10
  class Base
11
11
  attr_reader(:bin)
12
+
12
13
  def initialize(bin)
13
14
  @bin = bin
14
15
  end
@@ -63,7 +64,7 @@ module Mediakit
63
64
  end
64
65
 
65
66
  class FakeDriver < PopenDriver
66
- attr_accessor(:last_command, :output, :error_output, :exit_status)
67
+ attr_accessor(:last_command, :output, :error_output, :exit_status, :timeout, :nice)
67
68
 
68
69
  # fake driver for testing
69
70
  #
@@ -75,11 +76,15 @@ module Mediakit
75
76
  # @return [String] stdout output
76
77
  def run(*args)
77
78
  @last_command = command(*args)
79
+
80
+ options, rest_args = parse_options(args.dup)
81
+ @timeout = options[:timeout] if options[:timeout]
82
+ @nice = options[:nice] if options[:nice]
78
83
  [(output || ''), (error_output || ''), (exit_status || true)]
79
84
  end
80
85
 
81
86
  def reset
82
- @last_command, @output, @error_output, @exit_status = nil
87
+ @last_command, @output, @error_output, @exit_status, @timeout, @nice = nil
83
88
  end
84
89
  end
85
90
 
@@ -77,7 +77,7 @@ module Mediakit
77
77
  if @nice == 0
78
78
  command
79
79
  else
80
- "nice -n #{ShellEscape.escape(@nice)} sh -c \"#{command}\""
80
+ "nice -n #{ShellEscape.escape(@nice.to_s)} sh -c \"#{command}\""
81
81
  end
82
82
  end
83
83
 
@@ -1,3 +1,3 @@
1
1
  module Mediakit
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mediakit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - ainame