lib/recurly.rb in recurly-0.2.9 vs lib/recurly.rb in recurly-0.3.0
- old
+ new
@@ -43,16 +43,24 @@
def configured?
RecurlyBase.user && RecurlyBase.password && RecurlyBase.site
end
def configure
- yield self
+ if block_given?
+ yield self
- RecurlyBase.user = username
- RecurlyBase.password = password
- RecurlyBase.site = site || "https://app.recurly.com"
+ RecurlyBase.user = username
+ RecurlyBase.password = password
+ RecurlyBase.site = site || "https://app.recurly.com"
- true
+ return true
+ else
+ if ENV["RECURLY_CONFIG"]
+ Recurly.configure_from_json(ENV["RECURLY_CONFIG"])
+ else
+ Recurly.configure_from_yaml
+ end
+ end
end
# allows configuration from a yml file that contains the fields:
# username,password,site
def configure_from_yaml(path = nil)
\ No newline at end of file