From 5385986f8875b7c24d44b25b0746531db450e5d1 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Mon, 31 Jan 2011 16:06:59 -0500 Subject: [PATCH] inital --- Gemfile | 1 + Gemfile.lock | 32 ++++++++++++++++++++++++++++++++ Rakefile | 30 ++++++++++++++++++++++++++++++ flowplayer.gemspec | 27 +++++++++++++++++++++++++++ flowplayer.rb | 3 +++ lib/player.rb | 18 ++++++++++++++++++ lib/rails/helper.rb | 19 +++++++++++++++++++ 7 files changed, 130 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 Rakefile create mode 100644 flowplayer.gemspec create mode 100644 flowplayer.rb create mode 100644 lib/player.rb create mode 100644 lib/rails/helper.rb diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..901f575 --- /dev/null +++ b/Gemfile @@ -0,0 +1 @@ +gemspec \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..12ecf3d --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,32 @@ +PATH + remote: . + specs: + flowplayer (0.0.1) + +GEM + specs: + diff-lcs (1.1.2) + mocha (0.9.10) + rake + nokogiri (1.4.4) + rake (0.8.7) + rspec (2.0.1) + rspec-core (~> 2.0.1) + rspec-expectations (~> 2.0.1) + rspec-mocks (~> 2.0.1) + rspec-core (2.0.1) + rspec-expectations (2.0.1) + diff-lcs (>= 1.1.2) + rspec-mocks (2.0.1) + rspec-core (~> 2.0.1) + rspec-expectations (~> 2.0.1) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (>= 1.0.0) + flowplayer! + mocha + nokogiri + rspec (~> 2.0.0) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..fd4e386 --- /dev/null +++ b/Rakefile @@ -0,0 +1,30 @@ +require 'rubygems' +require 'bundler' +begin + Bundler.setup(:development) +rescue Bundler::BundlerError => e + $stderr.puts e.message + $stderr.puts "Run `bundle install` to install missing gems" + exit e.status_code +end +require 'rake' + + +require 'rspec/core/rake_task' + +desc 'Default: run specs.' +task :default => :spec + +desc "Run specs" +RSpec::Core::RakeTask.new do |t| + t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default. + # Put spec opts in a file named .rspec in root + t.rspec_opts = ["--color", "--format s"] +end + +desc "Generate code coverage" +RSpec::Core::RakeTask.new(:coverage) do |t| + t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default. + t.rcov = true + t.rcov_opts = ['--exclude', 'spec'] +end \ No newline at end of file diff --git a/flowplayer.gemspec b/flowplayer.gemspec new file mode 100644 index 0000000..23dac1a --- /dev/null +++ b/flowplayer.gemspec @@ -0,0 +1,27 @@ +Gem::Specification.new do |s| + s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= + + s.name = %q{flowplayer} + s.version = '0.0.1' + s.platform = Gem::Platform::RUBY + + s.authors = ["Scott Davis"] + s.description = %q{Flowplayer Helpers} + s.summary = %q{Flowplayer helper written in ruby} + s.email = %q{jetviper21@gmail.com} + + s.date = Date.today.to_s + s.files = `git ls-files`.split("\n") + s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact + s.require_path = 'lib' + + s.homepage = %q{http://github.com/jetviper21} + s.rdoc_options = ["--charset=UTF-8"] + s.required_rubygems_version = ">= 1.3.6" + + s.add_development_dependency "bundler", ">= 1.0.0" + s.add_development_dependency "rspec", "~> 2.0.0" + s.add_development_dependency "nokogiri" + s.add_development_dependency "mocha" + +end diff --git a/flowplayer.rb b/flowplayer.rb new file mode 100644 index 0000000..8a9ac83 --- /dev/null +++ b/flowplayer.rb @@ -0,0 +1,3 @@ +module Flowplayer + +end \ No newline at end of file diff --git a/lib/player.rb b/lib/player.rb new file mode 100644 index 0000000..25a51bb --- /dev/null +++ b/lib/player.rb @@ -0,0 +1,18 @@ +module Flowplayer + class PLayer + attr_accessor :options + def initialize(dom_id, &block) + @options = [] + block.call + end + + def method_missing(method, *args, &block) + if block.nil? + options[method] = args.first + else + options[method] = block.call + end + end + + end +end \ No newline at end of file diff --git a/lib/rails/helper.rb b/lib/rails/helper.rb new file mode 100644 index 0000000..56a7217 --- /dev/null +++ b/lib/rails/helper.rb @@ -0,0 +1,19 @@ +module Flowplayer + module Helpers + + # flowplayer_for :hubble do |f| + # f.option 'foo' + # f.onLoad do + # 'this.unmute();' + # end + + + + + + def flowplayer_for(id, &block) + FlowPlayer::Player.new(id, &block) + end + + end +end \ No newline at end of file