lib/buildbox.rb in buildbox-0.0.4 vs lib/buildbox.rb in buildbox-0.1

- old
+ new

@@ -1,40 +1,27 @@ -require "buildbox/utf8" -require "buildbox/command" -require "buildbox/result" -require "buildbox/build" -require "buildbox/version" -require "buildbox/client" -require "buildbox/api" -require "buildbox/worker" -require "buildbox/pid_file" -require "buildbox/configuration" -require "buildbox/auth" -require "buildbox/response" -require "buildbox/observer" +require 'pathname' module Buildbox - require 'fileutils' - require 'pathname' - require 'logger' + autoload :API, "buildbox/api" + autoload :Build, "buildbox/build" + autoload :Command, "buildbox/command" + autoload :CLI, "buildbox/cli" + autoload :Configuration, "buildbox/configuration" + autoload :Environment, "buildbox/environment" + autoload :Monitor, "buildbox/monitor" + autoload :Runner, "buildbox/runner" + autoload :Script, "buildbox/script" + autoload :UTF8, "buildbox/utf8" + autoload :Worker, "buildbox/worker" + autoload :VERSION, "buildbox/version" - class << self - def configuration - @configuration ||= Configuration.load - end + def self.config + @config ||= Configuration.new.tap(&:reload) + end - def root_path - path = Pathname.new File.join(ENV['HOME'], ".buildbox") - path.mkpath unless path.exist? + def self.root_path + path = Pathname.new File.join(ENV['HOME'], ".buildbox") + path.mkpath unless path.exist? - Pathname.new(path) - end - - def logger=(logger) - @logger = logger - end - - def logger - @logger ||= Logger.new(STDOUT) - end + Pathname.new(path) end end