lib/ruboty/robot.rb in ruboty-1.0.1 vs lib/ruboty/robot.rb in ruboty-1.0.2
- old
+ new
@@ -1,7 +1,8 @@
module Ruboty
class Robot
+ DEFAULT_ENV = "development"
DEFAULT_ROBOT_NAME = "ruboty"
include Mem
delegate :say, to: :adapter
@@ -47,12 +48,17 @@
AdapterBuilder.new(self).build
end
memoize :adapter
def bundle
- Bundler.require
+ Bundler.require(:default, env)
rescue Bundler::GemfileNotFound
end
+
+ def env
+ ENV["RUBOTY_ENV"] || DEFAULT_ENV
+ end
+ memoize :env
def dotenv
Dotenv.load if options[:dotenv]
end