uboost-client 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -13,8 +13,10 @@ gem install 'uboost-client'
13
13
  ```ruby
14
14
  require 'uboost-client'
15
15
 
16
- client = UboostClient::Client.new(:subdomain => 'test_subdomain', :api_credentials =>
17
- {:username => 'api_username', :password => 'api_password'})
16
+ client = UboostClient::Client.new(:subdomain => 'test_subdomain',
17
+ :debug => true, # Print debug info. Defaults to false
18
+ :api_credentials =>
19
+ {:username => 'api_username', :password => 'api_password'})
18
20
 
19
21
  # Examples
20
22
  #
@@ -19,9 +19,9 @@ module UboostClient
19
19
  def connection
20
20
  url = "https://#{@api_credentials[:username]}:#{@api_credentials[:password]}@#{@subdomain}.uboost.com"
21
21
  Faraday.new(url) do |faraday|
22
- faraday.request :url_encoded # form-encode POST params
23
- faraday.response :logger # log requests to STDOUT
24
- faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
22
+ faraday.request :url_encoded # form-encode POST params
23
+ faraday.response :logger if @debug # log requests to STDOUT
24
+ faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
25
25
  end
26
26
  end
27
27
 
@@ -29,7 +29,7 @@ module UboostClient
29
29
  url = "https://#{@subdomain}.uboost.com"
30
30
  Faraday.new(url, {:headers=>{'Cookie'=> uboost_session_id}}) do |faraday|
31
31
  faraday.request :url_encoded # form-encode POST params
32
- faraday.response :logger # log requests to STDOUT
32
+ faraday.response :logger if @debug # log requests to STDOUT
33
33
  faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  class UboostClient
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/spec/simple_test.rb CHANGED
@@ -5,7 +5,7 @@ subdomain = ENV['UBOOST_SUBDOMAIN']
5
5
  api_credentials = { :username => ENV['UBOOST_USERNAME'], :password => ENV['UBOOST_PASSWORD'] }
6
6
  session = Hash.new
7
7
 
8
- client = UboostClient::Client.new(:subdomain => subdomain, :api_credentials => api_credentials)
8
+ client = UboostClient::Client.new(:subdomain => subdomain, :api_credentials => api_credentials, :debug => false)
9
9
 
10
10
  # puts client.account.create({ "user_name" => "test_user_2" })
11
11
  # puts client.account.select(921679373)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uboost-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: