lib/phone_gap/build/credentials.rb in phone_gap-build-0.3.0 vs lib/phone_gap/build/credentials.rb in phone_gap-build-0.4.0
- old
+ new
@@ -4,17 +4,26 @@
module Build
class Credentials
include Singleton
- attr_reader :username, :password, :token
+ attr_reader :username, :password, :token, :config
attr_writer :token
def set(credentials)
@username = credentials[:username]
@password = credentials[:password]
@token = credentials[:token]
self
end
+
+ def load
+ config_file = File.expand_path('../../../../config/phonegap.yml', __FILE__)
+ if File.exists? config_file
+ @config = YAML::load_file(config_file)
+ @token = @config['token']
+ end
+ self
+ end
end
end
-end
\ No newline at end of file
+end