lib/bundler.rb in bundler-1.0.0.rc.1 vs lib/bundler.rb in bundler-1.0.0.rc.2
- old
+ new
@@ -26,28 +26,25 @@
autoload :Specification, 'bundler/shared_helpers'
autoload :UI, 'bundler/ui'
class BundlerError < StandardError
def self.status_code(code = nil)
- return @code unless code
- @code = code
+ define_method(:status_code) { code }
end
-
- def status_code
- self.class.status_code
- end
end
class GemfileNotFound < BundlerError; status_code(10) ; end
class GemNotFound < BundlerError; status_code(7) ; end
class GemfileError < BundlerError; status_code(4) ; end
class PathError < BundlerError; status_code(13) ; end
class GitError < BundlerError; status_code(11) ; end
class GemspecError < BundlerError; status_code(14) ; end
class DeprecatedError < BundlerError; status_code(12) ; end
class GemspecError < BundlerError; status_code(14) ; end
- class InvalidOption < BundlerError; status_code(15) ; end
+ class DslError < BundlerError; status_code(15) ; end
+ class ProductionError < BundlerError; status_code(16) ; end
+ class InvalidOption < DslError ; end
class VersionConflict < BundlerError
attr_reader :conflicts
def initialize(conflicts, msg = nil)
@@ -67,9 +64,17 @@
def configure
@configured ||= begin
configure_gem_home_and_path
true
end
+ end
+
+ def production?
+ @production
+ end
+
+ def production=(value)
+ @production = value
end
def ui
@ui ||= UI.new
end