technicalpickles-flvorflv 0.1.0
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.
- data/.document +5 -0
- data/.gitignore +5 -0
- data/LICENSE +20 -0
- data/README.rdoc +27 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/features/flvorflv.feature +9 -0
- data/features/step_definitions/flvorflv_steps.rb +0 -0
- data/features/support/env.rb +4 -0
- data/lib/flvorflv.rb +26 -0
- data/spec/flvorflv_spec.rb +36 -0
- data/spec/spec_helper.rb +10 -0
- metadata +86 -0
data/.document
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Joshua Nichols
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
= flvorflv
|
2
|
+
|
3
|
+
A tiny wrapper around the flvstreamer, an open source command-line RTMP client: http://savannah.nongnu.org/projects/flvstreamer/
|
4
|
+
|
5
|
+
It really just lets you interact with it from Ruby, and to specify the long options using a hash. Call it like:
|
6
|
+
|
7
|
+
Flvorflv.run(:rtmp => 'rtmp://hostname/something.flv',
|
8
|
+
:start => 1,
|
9
|
+
:stop => 2,
|
10
|
+
:flv => 'something.flv')
|
11
|
+
|
12
|
+
See flvstreamer --help for more usage notes.
|
13
|
+
|
14
|
+
== Note on Patches/Pull Requests
|
15
|
+
|
16
|
+
* Fork the project.
|
17
|
+
* Make your feature addition or bug fix.
|
18
|
+
* Add tests for it. This is important so I don't break it in a
|
19
|
+
future version unintentionally.
|
20
|
+
* Commit, do not mess with rakefile, version, or history.
|
21
|
+
(if you want to have your own version, that is fine but
|
22
|
+
bump version in a commit by itself I can ignore when I pull)
|
23
|
+
* Send me a pull request. Bonus points for topic branches.
|
24
|
+
|
25
|
+
== Copyright
|
26
|
+
|
27
|
+
Copyright (c) 2009 Joshua Nichols. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "flvorflv"
|
8
|
+
gem.summary = %Q{A tiny wrapper around the flvstreamer}
|
9
|
+
gem.description = %Q{
|
10
|
+
A tiny wrapper around the flvstreamer, an open source command-line RTMP client: http://savannah.nongnu.org/projects/flvstreamer/
|
11
|
+
|
12
|
+
It really just lets you interact with it from Ruby, and to specify the long options using a hash
|
13
|
+
}
|
14
|
+
gem.email = "josh@technicalpickles.com"
|
15
|
+
gem.homepage = "http://github.com/technicalpickles/flvorflv"
|
16
|
+
gem.authors = ["Joshua Nichols"]
|
17
|
+
gem.add_development_dependency "rspec"
|
18
|
+
gem.add_development_dependency "rr"
|
19
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
20
|
+
end
|
21
|
+
|
22
|
+
Jeweler::GemcutterTasks.new
|
23
|
+
|
24
|
+
rescue LoadError
|
25
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
26
|
+
end
|
27
|
+
|
28
|
+
require 'spec/rake/spectask'
|
29
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
32
|
+
end
|
33
|
+
|
34
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
35
|
+
spec.libs << 'lib' << 'spec'
|
36
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
+
spec.rcov = true
|
38
|
+
end
|
39
|
+
|
40
|
+
begin
|
41
|
+
require 'cucumber/rake/task'
|
42
|
+
Cucumber::Rake::Task.new(:features)
|
43
|
+
rescue LoadError
|
44
|
+
task :features do
|
45
|
+
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
task :default => :spec
|
50
|
+
|
51
|
+
begin
|
52
|
+
require 'yard'
|
53
|
+
YARD::Rake::YardocTask.new(:yardoc)
|
54
|
+
rescue LoadError
|
55
|
+
task :yardoc do
|
56
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
57
|
+
end
|
58
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
File without changes
|
data/lib/flvorflv.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Flvorflv
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def version
|
5
|
+
output = execute_binary("--help")
|
6
|
+
if output =~ /FLVStreamer v(.*)\n/
|
7
|
+
$1
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def execute_binary(args)
|
12
|
+
`flvstreamer #{args} 2>&1`
|
13
|
+
end
|
14
|
+
|
15
|
+
def run(options)
|
16
|
+
sorted_keys = options.keys.sort {|a, b| a.to_s <=> b.to_s }
|
17
|
+
|
18
|
+
args = sorted_keys.collect do |key|
|
19
|
+
value = options[key]
|
20
|
+
"--#{key} #{value}"
|
21
|
+
end.join(" ")
|
22
|
+
|
23
|
+
execute_binary(args)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Flvorflv do
|
4
|
+
|
5
|
+
describe "binary version for 1.8f" do
|
6
|
+
before do
|
7
|
+
stub(Flvorflv).execute_binary { "FLVStreamer v1.8f\n(c) 2009 Andrej Stepanchuk, The Flvstreamer Team, license: GPL" }
|
8
|
+
@version = Flvorflv.version
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should call flvstreamer --help" do
|
12
|
+
Flvorflv.should have_received.execute_binary("--help")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return 1.8f" do
|
16
|
+
@version.should == "1.8f"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "basic use case do" do
|
21
|
+
before do
|
22
|
+
stub(Flvorflv).execute_binary
|
23
|
+
|
24
|
+
Flvorflv.run(:rtmp => 'rtmp://hostname/something.flv',
|
25
|
+
:start => 1,
|
26
|
+
:stop => 2,
|
27
|
+
:output => 'something.flv')
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should call flvstream --output something.flv --rtmp rtmp://hostname/something.flv --start 1 --stop 2" do
|
31
|
+
Flvorflv.should have_received.execute_binary("--output something.flv --rtmp rtmp://hostname/something.flv --start 1 --stop 2")
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'flvorflv'
|
4
|
+
require 'spec'
|
5
|
+
require 'spec/autorun'
|
6
|
+
require 'rr'
|
7
|
+
|
8
|
+
Spec::Runner.configure do |config|
|
9
|
+
config.mock_with RR::Adapters::Rspec
|
10
|
+
end
|
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: technicalpickles-flvorflv
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Joshua Nichols
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-08-06 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rr
|
27
|
+
type: :development
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
description: "A tiny wrapper around the flvstreamer, an open source command-line RTMP client: http://savannah.nongnu.org/projects/flvstreamer/ It really just lets you interact with it from Ruby, and to specify the long options using a hash"
|
36
|
+
email: josh@technicalpickles.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- features/flvorflv.feature
|
52
|
+
- features/step_definitions/flvorflv_steps.rb
|
53
|
+
- features/support/env.rb
|
54
|
+
- lib/flvorflv.rb
|
55
|
+
- spec/flvorflv_spec.rb
|
56
|
+
- spec/spec_helper.rb
|
57
|
+
has_rdoc: false
|
58
|
+
homepage: http://github.com/technicalpickles/flvorflv
|
59
|
+
licenses:
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options:
|
62
|
+
- --charset=UTF-8
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: "0"
|
70
|
+
version:
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: "0"
|
76
|
+
version:
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 1.3.5
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: A tiny wrapper around the flvstreamer
|
84
|
+
test_files:
|
85
|
+
- spec/flvorflv_spec.rb
|
86
|
+
- spec/spec_helper.rb
|