lib/berkshelf/api/config.rb in berkshelf-api-0.1.0 vs lib/berkshelf/api/config.rb in berkshelf-api-0.2.0
- old
+ new
@@ -3,12 +3,17 @@
module Berkshelf::API
class Config < Buff::Config::JSON
class << self
# @return [String]
def default_path
- File.expand_path("~/.berkshelf/api-server/config.json")
+ home_path = ENV['BERKSHELF_API_PATH'] || "~/.berkshelf/api-server"
+ File.expand_path(File.join(home_path, "config.json"))
end
end
+
+ attribute 'home_path',
+ type: String,
+ default: File.expand_path("~/.berkshelf/api-server")
attribute 'endpoints',
type: Array,
default: [
{