lib/moysklad/client.rb in moysklad-0.3.1 vs lib/moysklad/client.rb in moysklad-0.3.2

- old
+ new

@@ -7,10 +7,14 @@ # URL = 'https://online.moysklad.ru' URL ='https://online.moysklad.ru/api/remap/1.1/' def initialize login: nil, password: nil @client = Faraday.new URL do |conn| - conn.request(:authorization, :basic, login, password) + if Faraday::VERSION.split('.').first.to_i < 2 + conn.request(:basic_auth, login, password) + else + conn.request(:authorization, :basic, login, password) + end end end def download(path, filename) response = client.get path