flvorflv 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,5 @@
1
+ *.sw?
2
+ .DS_Store
3
+ coverage
4
+ rdoc
5
+ pkg
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.
@@ -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.
@@ -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
@@ -0,0 +1,9 @@
1
+ Feature: something something
2
+ In order to something something
3
+ A user something something
4
+ something something something
5
+
6
+ Scenario: something something
7
+ Given inspiration
8
+ When I create a sweet new gem
9
+ Then everyone should see how awesome I am
@@ -0,0 +1,4 @@
1
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
2
+ require 'flvorflv'
3
+
4
+ require 'spec/expectations'
@@ -0,0 +1,63 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{flvorflv}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Joshua Nichols"]
12
+ s.date = %q{2009-08-27}
13
+ s.description = %q{
14
+ A tiny wrapper around the flvstreamer, an open source command-line RTMP client: http://savannah.nongnu.org/projects/flvstreamer/
15
+
16
+ It really just lets you interact with it from Ruby, and to specify the long options using a hash
17
+ }
18
+ s.email = %q{josh@technicalpickles.com}
19
+ s.extra_rdoc_files = [
20
+ "LICENSE",
21
+ "README.rdoc"
22
+ ]
23
+ s.files = [
24
+ ".document",
25
+ ".gitignore",
26
+ "LICENSE",
27
+ "README.rdoc",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "features/flvorflv.feature",
31
+ "features/step_definitions/flvorflv_steps.rb",
32
+ "features/support/env.rb",
33
+ "flvorflv.gemspec",
34
+ "lib/flvorflv.rb",
35
+ "spec/flvorflv_spec.rb",
36
+ "spec/spec_helper.rb"
37
+ ]
38
+ s.homepage = %q{http://github.com/technicalpickles/flvorflv}
39
+ s.rdoc_options = ["--charset=UTF-8"]
40
+ s.require_paths = ["lib"]
41
+ s.rubygems_version = %q{1.3.5}
42
+ s.summary = %q{A tiny wrapper around the flvstreamer}
43
+ s.test_files = [
44
+ "spec/flvorflv_spec.rb",
45
+ "spec/spec_helper.rb"
46
+ ]
47
+
48
+ if s.respond_to? :specification_version then
49
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
50
+ s.specification_version = 3
51
+
52
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
53
+ s.add_development_dependency(%q<rspec>, [">= 0"])
54
+ s.add_development_dependency(%q<rr>, [">= 0"])
55
+ else
56
+ s.add_dependency(%q<rspec>, [">= 0"])
57
+ s.add_dependency(%q<rr>, [">= 0"])
58
+ end
59
+ else
60
+ s.add_dependency(%q<rspec>, [">= 0"])
61
+ s.add_dependency(%q<rr>, [">= 0"])
62
+ end
63
+ end
@@ -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
@@ -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,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: 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-27 00:00:00 -04: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: "\n A tiny wrapper around the flvstreamer, an open source command-line RTMP client: http://savannah.nongnu.org/projects/flvstreamer/\n\n It really just lets you interact with it from Ruby, and to specify the long options using a hash\n "
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
+ - flvorflv.gemspec
55
+ - lib/flvorflv.rb
56
+ - spec/flvorflv_spec.rb
57
+ - spec/spec_helper.rb
58
+ has_rdoc: true
59
+ homepage: http://github.com/technicalpickles/flvorflv
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options:
64
+ - --charset=UTF-8
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ version:
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ version:
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.3.5
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: A tiny wrapper around the flvstreamer
86
+ test_files:
87
+ - spec/flvorflv_spec.rb
88
+ - spec/spec_helper.rb