activevlc 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: e7277724b68e5a47757cd221b47c6522bc74cf0c
4
- data.tar.gz: 19a56e502c9d73feb2c0fdeb114dcaf98162d665
3
+ metadata.gz: 56e04816c9e72596198ffd78ca019173741da370
4
+ data.tar.gz: bcd7e86c5d4434d25424147cb6cfdf6d05aa554c
5
5
  SHA512:
6
- metadata.gz: eaf8db920f751616a47ba9a46bcc252684d04120cf82703071ce66f6bf46fa9896165f26c383fa66866b453c3a27a6f0aa139ee8a542a4238dfa4084c5887014
7
- data.tar.gz: 01bf1845e930f5ad7ee4cf4e0a929a869b986e1fb3ddc94f8c33547d4dff0d6ea782906ce1f84e958151cd479de2d88360e62de7ee5e5e8b2b49071dc7da2f22
6
+ metadata.gz: 4d927d352f1d6fe1e667eec163dd48d11a4deff7a8dbe5fd4772b5978c7e2d1c06cc2c72a9664b8a3b937b3e6cab168d54bd15779b0119cff4e2200ad91e441e
7
+ data.tar.gz: 2828541e9c4416d50bab649b5f7d330a6098df884bccf4b65d280eca9b431a838d4371695e038afa038e1f046c5716acf01997ee263555caef8c6fde736f3119
data/lib/activevlc/cli.rb CHANGED
@@ -44,39 +44,26 @@ module ActiveVlc
44
44
  end
45
45
 
46
46
  desc 'exec path [input_file_1 [input_file_2] [...]]', 'Launch vlc executable to run the pipeline described in path file'
47
+ option :cmd, type: :boolean, default: false
47
48
  def exec(path, *inputs)
48
49
  if File.readable?(path)
49
50
  begin
50
51
  pipe = ActiveVlc::parse(path)
51
- pipe.inputs << inputs
52
+ pipe.input << inputs
52
53
  fragment = pipe.fragment
53
54
  rescue
54
- puts "Error while parsing pipe file"
55
+ puts "Error while parsing pipe file: #{$!}"
55
56
  exit 43
56
57
  end
57
- Kernel.exec "cvlc -vvv --play-and-exit #{fragment}"
58
- else
59
- puts "Error: file [#{path}] doesn't exist or reading permission denied."
60
- end
61
- exit $?.exitstatus
62
- end
63
-
64
- desc 'run path [input_file_1 [input_file_2] [...]]', 'Run the path pipeline using LibVlc (usually better than exec)'
65
- def run(path, *inputs)
66
- if File.readable?(path)
67
- begin
68
- pipe = ActiveVlc::parse(path)
69
- pipe.inputs << inputs
70
- fragment = pipe.fragment
71
- rescue
72
- puts "Error while parsing pipe file"
73
- exit 43
58
+ if options[:cmd]
59
+ Kernel.exec "vlc -I dummy -vvv --play-and-exit #{fragment}"
60
+ else
61
+ ActiveVlc::Runner.new(pipe).run
74
62
  end
75
- ActiveVlc::Runner.new(pipe).run
76
63
  else
77
64
  puts "Error: file [#{path}] doesn't exist or reading permission denied."
78
65
  end
79
- exit 0
66
+ exit $?.exitstatus
80
67
  end
81
68
 
82
69
  desc 'dump path', 'Dump the internal representation of the pipeline defined in the file path'
@@ -44,7 +44,7 @@ module ActiveVlc::LibVlc
44
44
 
45
45
  @events_received += 1;
46
46
 
47
- puts "Received event (#{@events_received}): #{EventType[event[:type]]}"
47
+ # puts "Received event (#{@events_received}): #{EventType[event[:type]]}"
48
48
 
49
49
  return unless @callbacks[event[:type]].is_a? Array
50
50
  @callbacks[event[:type]].each { |proc| proc.call(type) }
@@ -37,7 +37,8 @@ module ActiveVlc
37
37
  player = @api.create_player
38
38
  events = player.event_manager
39
39
 
40
- sout.gsub!('\'', '').gsub!('"', '')
40
+ sout.gsub!('\'', '')
41
+ sout.gsub!('"', '')
41
42
 
42
43
  # Building the medias with the right options
43
44
  medias = @pipeline.input.inputs.map do |input|
@@ -1,3 +1,4 @@
1
1
  module ActiveVlc
2
- VERSION = "0.0.3"
2
+ CODENAME = "Reserved Words"
3
+ VERSION = "0.0.4"
3
4
  end
data/spec/runner_spec.rb CHANGED
@@ -20,7 +20,7 @@ describe ActiveVlc::Runner do
20
20
  `rm -f #{out}`
21
21
  end
22
22
 
23
- it 'can be ran in a separate process' do
23
+ it 'can be ran in a separate proces' do
24
24
  out = "output.ogg"
25
25
  pipe = ActiveVlc.parse('spec/pipes/no_input.rb')
26
26
  runner = ActiveVlc::Runner.new(pipe)
@@ -31,4 +31,9 @@ describe ActiveVlc::Runner do
31
31
  File.exist?(out).should be_true
32
32
  `rm -f #{out}`
33
33
  end
34
+
35
+ it 'can be ran using the cmd line' do
36
+ `bundle exec activevlc exec spec/pipes/basic.rb`
37
+ $?.exitstatus.should eq(0)
38
+ end
34
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activevlc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien 'Lta' BALLET
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2013-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler