Browse files

Updated Gem structure (Bundler rather than Jeweler)

Updated to RSpec 2.x
Bump to 0.2.3
  • Loading branch information...
1 parent 38cc0fd commit d30eb61f96022ef94899a0521649b0b18054aa87 Thibaud Guillaume-Gentil committed Dec 20, 2010
Showing with 134 additions and 133 deletions.
  1. +17 −0 Gemfile
  2. +52 −0 Gemfile.lock
  3. +9 −0 Guardfile
  4. +1 −1 LICENSE
  5. +4 −22 README.rdoc
  6. +17 −42 Rakefile
  7. +0 −1 VERSION
  8. 0 init.rb
  9. +3 −0 lib/video_info/version.rb
  10. +0 −1 spec/spec.opts
  11. +6 −6 spec/spec_helper.rb
  12. +4 −4 spec/video_info_spec.rb
  13. +21 −56 video_info.gemspec
View
17 Gemfile
@@ -0,0 +1,17 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in video_info.gemspec
+gemspec
+
+gem 'guard', :git => "git://github.com/guard/guard.git"
+
+require 'rbconfig'
+
+if Config::CONFIG['target_os'] =~ /darwin/i
+ gem 'rb-fsevent', '>= 0.3.5'
+ gem 'growl', '~> 1.0.3'
+end
+if Config::CONFIG['target_os'] =~ /linux/i
+ gem 'rb-inotify', '>= 0.5.1'
+ gem 'libnotify', '~> 0.1.3'
+end
View
52 Gemfile.lock
@@ -0,0 +1,52 @@
+GIT
+ remote: git://github.com/guard/guard.git
+ revision: a21bb8e306e44fd153c8b88a7c59c00e451b1d52
+ specs:
+ guard (0.2.2)
+ open_gem (~> 1.4.2)
+ thor (~> 0.14.6)
+
+PATH
+ remote: .
+ specs:
+ video_info (0.2.3)
+ hpricot (~> 0.8.3)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ configuration (1.2.0)
+ diff-lcs (1.1.2)
+ growl (1.0.3)
+ guard-rspec (0.1.9)
+ guard (>= 0.2.2)
+ hpricot (0.8.3)
+ launchy (0.3.7)
+ configuration (>= 0.0.5)
+ rake (>= 0.8.1)
+ open_gem (1.4.2)
+ launchy (~> 0.3.5)
+ rake (0.8.7)
+ rb-fsevent (0.3.9)
+ rspec (2.3.0)
+ rspec-core (~> 2.3.0)
+ rspec-expectations (~> 2.3.0)
+ rspec-mocks (~> 2.3.0)
+ rspec-core (2.3.1)
+ rspec-expectations (2.3.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.3.0)
+ thor (0.14.6)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.7)
+ growl (~> 1.0.3)
+ guard!
+ guard-rspec (~> 0.1.9)
+ hpricot (~> 0.8.3)
+ rb-fsevent (>= 0.3.5)
+ rspec (~> 2.3.0)
+ video_info!
View
9 Guardfile
@@ -0,0 +1,9 @@
+# A sample Guardfile
+# More info at http://github.com/guard/guard#readme
+
+guard 'rspec', :version => 2, :formatter => "instafail" do
+ watch('spec/spec_helper.rb') { "spec" }
+ watch(%r{lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{lib/provider/(.+)\.rb}) { "spec/video_info_spec.rb" }
+ watch(%r{spec/.+_spec\.rb})
+end
View
2 LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Thibaud Guillaume-Gentil
+Copyright (c) 2010 Thibaud Guillaume-Gentil
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
26 README.rdoc
@@ -1,10 +1,11 @@
= VideoInfo
Small Ruby Gem to get video info from youtube and vimeo url.
+Tested on Ruby 1.8.6, 1.8.7 & 1.9.2
== Install
- gem install video_info --source http://gemcutter.org
+ gem install video_info
== Usage
@@ -38,25 +39,6 @@ Small Ruby Gem to get video info from youtube and vimeo url.
video.valid? => false
-== License
+== Author
-Copyright (c) 2008 Thibaud Guillaume-Gentil
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+Thibaud Guillaume-Gentil
View
59 Rakefile
@@ -1,46 +1,21 @@
-require 'rubygems'
-require 'rake'
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "video_info"
- gem.summary = "Vimeo & Youtube parser"
- gem.description = "Get video info from youtube and vimeo url."
- gem.email = "thibaud@thibaud.me"
- gem.homepage = "http://github.com/guillaumegentil/video_info"
- gem.authors = ["Thibaud Guillaume-Gentil"]
- gem.add_development_dependency "rspec", ">= 1.2.9"
- gem.add_dependency "hpricot", ">= 0.8.2"
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
-end
-
-require 'spec/rake/spectask'
-Spec::Rake::SpecTask.new(:spec) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.spec_files = FileList['spec/**/*_spec.rb']
-end
-
-Spec::Rake::SpecTask.new(:rcov) do |spec|
- spec.libs << 'lib' << 'spec'
- spec.pattern = 'spec/**/*_spec.rb'
- spec.rcov = true
-end
-
-task :spec => :check_dependencies
+require 'bundler'
+Bundler::GemHelper.install_tasks
+require 'rspec/core/rake_task'
+RSpec::Core::RakeTask.new(:spec)
task :default => :spec
-require 'rake/rdoctask'
-Rake::RDocTask.new do |rdoc|
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
-
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "video_info #{version}"
- rdoc.rdoc_files.include('README*')
- rdoc.rdoc_files.include('lib/**/*.rb')
+namespace(:spec) do
+ desc "Run all specs on multiple ruby versions (requires rvm)"
+ task(:portability) do
+ %w[1.8.6 1.8.7 1.9.2].each do |version|
+ system <<-BASH
+ bash -c 'source ~/.rvm/scripts/rvm;
+ rvm #{version};
+ echo "--------- version #{version} ----------\n";
+ bundle install;
+ rake spec'
+ BASH
+ end
+ end
end
View
1 VERSION
@@ -1 +0,0 @@
-0.2.2
View
0 init.rb
No changes.
View
3 lib/video_info/version.rb
@@ -0,0 +1,3 @@
+module VideoInfoVersion
+ VERSION = "0.2.3"
+end
View
1 spec/spec.opts
@@ -1 +0,0 @@
---color
View
12 spec/spec_helper.rb
@@ -1,10 +1,10 @@
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems'
+require 'rspec'
require 'video_info'
-require 'spec'
-require 'spec/autorun'
-Spec::Runner.configure do |config|
+RSpec.configure do |config|
+ config.color_enabled = true
-end
+ config.filter_run :focus => true
+ config.run_all_when_everything_filtered = true
+end
View
8 spec/video_info_spec.rb
@@ -1,4 +1,4 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'spec_helper'
describe "VideoInfo" do
@@ -14,7 +14,7 @@
its(:duration) { should == 175 }
its(:width) { should be_nil }
its(:height) { should be_nil }
- its(:date) { should == Time.parse('Sat Apr 12 22:25:35 UTC 2008') }
+ its(:date) { should == Time.parse('Sat Apr 12 22:25:35 UTC 2008', Time.now.utc) }
its(:thumbnail_small) { should == 'http://i.ytimg.com/vi/mZqGqE0D0n4/2.jpg' }
its(:thumbnail_large) { should == 'http://i.ytimg.com/vi/mZqGqE0D0n4/0.jpg' }
its(:view_count) { should be > 4000 }
@@ -41,15 +41,15 @@
its(:duration) { should == 175 }
its(:width) { should == 640 }
its(:height) { should == 360 }
- its(:date) { should == Time.parse(' Mon Apr 14 13:10:39 -0400 2008') }
+ its(:date) { should == Time.parse('Mon Apr 14 13:10:39 +0200 2008', Time.now.utc) }
its(:thumbnail_small) { should == 'http://b.vimeocdn.com/ts/343/731/34373130_100.jpg' }
its(:thumbnail_large) { should == 'http://b.vimeocdn.com/ts/343/731/34373130_640.jpg' }
its(:view_count) { should be > 4000 }
it { should be_valid }
end
it "should be invalid with misstaped url" do
- video = VideoInfo.new('http://www.vimeo.com/1')
+ video = VideoInfo.new('http://www.vimo.com/1')
video.should_not be_valid
end
View
77 video_info.gemspec
@@ -1,60 +1,25 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "video_info/version"
Gem::Specification.new do |s|
- s.name = %q{video_info}
- s.version = "0.2.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Thibaud Guillaume-Gentil"]
- s.date = %q{2009-11-27}
- s.description = %q{Get video info from youtube and vimeo url.}
- s.email = %q{thibaud@thibaud.me}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.rdoc"
- ]
- s.files = [
- ".gitignore",
- "LICENSE",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "init.rb",
- "lib/provider/vimeo.rb",
- "lib/provider/youtube.rb",
- "lib/video_info.rb",
- "spec/spec.opts",
- "spec/spec_helper.rb",
- "spec/video_info_spec.rb",
- "video_info.gemspec"
- ]
- s.homepage = %q{http://github.com/guillaumegentil/video_info}
- s.rdoc_options = ["--charset=UTF-8"]
+ s.name = "video_info"
+ s.version = VideoInfoVersion::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ['Thibaud Guillaume-Gentil']
+ s.email = ['thibaud@thibaud.me']
+ s.homepage = 'http://rubygems.org/gems/video_info'
+ s.summary = 'Vimeo & Youtube parser'
+ s.description = 'Get video info from youtube and vimeo url.'
+
+ s.rubyforge_project = "video_info"
+
+ s.add_development_dependency 'bundler', '~> 1.0.7'
+ s.add_development_dependency 'rspec', '~> 2.3.0'
+ s.add_development_dependency 'guard-rspec', '~> 0.1.9'
+
+ s.add_dependency 'hpricot', '~> 0.8.3'
+
+ s.files = Dir.glob('{lib}/**/*') + %w[LICENSE README.rdoc]
s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Vimeo & Youtube parser}
- s.test_files = [
- "spec/spec_helper.rb",
- "spec/video_info_spec.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
- s.add_runtime_dependency(%q<hpricot>, [">= 0.8.2"])
- else
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
- s.add_dependency(%q<hpricot>, [">= 0.8.2"])
- end
- else
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
- s.add_dependency(%q<hpricot>, [">= 0.8.2"])
- end
-end
-
+end

0 comments on commit d30eb61

Please sign in to comment.