awesome-print / awesome_print

Pretty print your Ruby objects with style -- in full color and with proper indentation
http://github.com/michaeldv/awesome_print
MIT License
4.08k stars 454 forks source link

gemspec doesn't play well with bundler loading from git #79

Closed denishaskin closed 9 years ago

denishaskin commented 12 years ago

While trying to test my changes, awesome_print was not loading properly when I was loading it from my fork, e.g. I had this in my Gemfile:

gem 'awesome_print', :git => 'https://github.com/ceromancy/awesome_print.git'

What was happening was that because awesome_print was being loaded in awesome_print.gemspec (to get the version number), when lib/awesome_print.rb was finally loaded the AwesomePrint constant was defined, so the test in lib/awesome_print.rb to prevent it from being loaded multiple times was preventing it from ever being loaded.

What I've done is remove the

require File.dirname(__FILE__) + "/lib/awesome_print/version"

from the .gemspec and hardcoded the version in there (at the moment in my fork it's bumped to 1.0.3 because I wanted to make sure I was getting the right version).

I also removed the rake tasks in there, which was probably unnecessary. But it seems that keeping a gemspec file focused on the task of providing gem specification is probably a good idea.

My commit is 4abee8015cf36a0486a856f9c3a876854b272473 . Want me to try and clean this up for a pull request?