Skip to content

Commit

Permalink
[merb-admin] Removing mlb gem dependency
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
merbjedi committed Oct 17, 2009
1 parent 60e1f29 commit 183e09a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion lib/merb-admin/slicetasks.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require 'abstract_model'
require 'mlb'

namespace :slices do
namespace :"merb-admin" do
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit 183e09a

Please sign in to comment.