Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Clean up bundler requires. #332

Merged
merged 1 commit into from

3 participants

@envygeeks

I think this is the best approach, it doesn't explicitly require Bundler and all the other checks should really be done in the gemspec IMO. The main problem I had that prompted me to make this pull request is the fact that you guys completely assume that I use Gemfile and kill my predefined BUNDLE_GEMFILE so now I am either stuck with the badly named Gemfile instead of gemfile.rb that I would prefer for my projects. At the least I think it should not overwrite BUNDLE_GEMFILE.

@saturnflyer
Owner

thanks @envygeeks! would you be able to address what @gerrit mentioned?

@envygeeks

Sorry for the delay, been extremely busy these past months, I've updated it... though I don't know if the RADIANT_NOWARNINGS will fly with ya'll considering it's an undocumented refactor to the way Radiant acts, but I like the idea of being able to silence Radiant warnings like that when some users might not prefer bundler.

@travisbot

This pull request passes (merged c98a2ed8 into 60ac92e).

@travisbot

This pull request passes (merged 9e7e703 into 60ac92e).

@saturnflyer saturnflyer merged commit f927223 into radiant:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 30, 2012
  1. @envygeeks

    Clean up bundler requires.

    envygeeks authored
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 16 deletions.
  1. +15 −16 config/preinitializer.rb
View
31 config/preinitializer.rb
@@ -1,19 +1,18 @@
-begin
- require "rubygems"
- require "bundler"
-rescue LoadError
- raise "Could not load the bundler gem. Install it with `gem install bundler`."
-end
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+# Lessens Debians need to edit.
+require "rubygems" rescue nil
-if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("1.0.0")
- raise RuntimeError, "Your bundler version is too old for Rails 2.3. " +
- "Run `gem install bundler` to upgrade."
-end
+# Since Bundler is not really a 'must have' for Rails development just send off
+# a warning and see if the sytem continues to load, the user can optionally use
+# RADIANT_NOWARNINGS to disable it.
-begin
- # Set up load paths for all bundled gems
- ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
- Bundler.setup
-rescue Bundler::GemNotFound => e
- raise RuntimeError, "Bundler couldn't find some gems: #{e}. Did you run `bundle install`?"
+if File.file?(ENV['BUNDLE_GEMFILE'])
+ begin
+ require 'bundler/setup'
+ rescue LoadError
+ unless ENV['RADIANT_NOWARNINGS'] == true
+ $stderr.puts 'WARNING: It seems you do not have Bundler installed.'
+ $stderr.puts 'WARNING: You can install it by doing `gem install bundler`'
+ end
+ end
end
Something went wrong with that request. Please try again.