lib/buildbox/configuration.rb in buildbox-0.2 vs lib/buildbox/configuration.rb in buildbox-0.2.1
- old
+ new
@@ -12,11 +12,22 @@
else
env_workers.to_s.split(",")
end
end
+ def api_key
+ ENV['BUILDBOX_API_KEY'] || self[:api_key]
+ end
+
def api_endpoint
ENV['BUILDBOX_API_ENDPOINT'] || self[:api_endpoint] || "https://api.buildbox.io/v1"
+ end
+
+ def check
+ unless api_key
+ puts "No api_key set. You can set it with\nbuildbox authenticate [api_key]"
+ exit 1
+ end
end
def update(attributes)
attributes.each_pair { |key, value| self[key] = value }
save