From 183e09a02052e3253172e551a76881b2f56ccb51 Mon Sep 17 00:00:00 2001 From: Jacques Crocker Date: Fri, 16 Oct 2009 21:57:00 -0700 Subject: [PATCH] [merb-admin] Removing mlb gem dependency Removed the gem dependency for mlb from the gemspec, and added a check on the 1 rake task (sample data load task) with a message on how to install the gem when needed. --- Rakefile | 1 - lib/merb-admin/slicetasks.rb | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 138c2eb..729b0d5 100644 --- a/Rakefile +++ b/Rakefile @@ -25,7 +25,6 @@ spec = Gem::Specification.new do |s| s.homepage = HOMEPAGE s.add_dependency("merb-slices", ">= 1.0.12") s.add_dependency("builder", ">= 2.1.2") - s.add_dependency("mlb", ">= 0.0.3") s.require_path = "lib" s.files = %w(LICENSE README.markdown Rakefile) + Dir.glob("{app,lib,public,schema,spec,stubs}/**/*") s.post_install_message = <<-POST_INSTALL_MESSAGE diff --git a/lib/merb-admin/slicetasks.rb b/lib/merb-admin/slicetasks.rb index 5b42a3a..ebbeb76 100644 --- a/lib/merb-admin/slicetasks.rb +++ b/lib/merb-admin/slicetasks.rb @@ -1,5 +1,4 @@ require 'abstract_model' -require 'mlb' namespace :slices do namespace :"merb-admin" do @@ -66,6 +65,14 @@ private def load_data + begin + require "mlb" + rescue Exception => e + puts "MLB Gem Required" + puts "gem install mlb --source=http://gemcutter.org" + return + end + puts "Loading current MLB leagues, divisions, teams, and players" MLB.teams.each do |mlb_team| unless league = MerbAdmin::AbstractModel.new("League").first(:conditions => ["name = ?", mlb_team.league])