ohmage 0.0.26 → 0.0.27

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d5f4f2ac05147e948d9a379130ca8038bec7020
4
- data.tar.gz: 9dd845bde8c95ede9875d77a6f6114cded397f57
3
+ metadata.gz: 64c328cf55b9df6ceb1223d0087da1a72166b12f
4
+ data.tar.gz: 890467c7b121ff0f7297e08a88be4191f56ee322
5
5
  SHA512:
6
- metadata.gz: 32c08f220a54993acb41a52308d17bc3454bc0567afce20c2f99e4a1637728dc07660d9f2a2be24b35980db06cf8ab15561c891630e3448ae013bb120d9f7dea
7
- data.tar.gz: c5ea443d7089a88cc03e2a974bbaf53d5dbcf9ccb55778ccd98540b00fb8c2d0577184b96adfca92b26eee8253598df08ccd55b33c2bd30fd5df4b733ec4a7fb
6
+ metadata.gz: 3466a84d76e12b5cfb9a5da019ab7c9fad25135f4173aa10d3f58b81132cfb2ef29798ee89f03d6b155054b8024a8c8d103f7d5a7021c48a48ec0c9a8a079f12
7
+ data.tar.gz: 34f6c3b805a9f73efadf7f20ab1f1c155f398c1dc0cff681503af11cf79495a518968c30abbcc789634e5d060f3cfa257d07bb05046d4136b96d1cc426a11c2e
@@ -4,7 +4,7 @@ require 'ohmage/request'
4
4
  module Ohmage
5
5
  class Client
6
6
  include Ohmage::API
7
- attr_accessor :port, :path, :client_string, :user, :password, :token, :server_config, :server_url
7
+ attr_accessor :port, :path, :client_string, :user, :password, :token, :server_config, :server_url, :server_debug
8
8
  def initialize(options = {}) # rubocop:disable MethodLength
9
9
  self.server_url = ENV['OHMAGE_SERVER_URL']
10
10
  self.user = ENV['OHMAGE_USER']
@@ -12,6 +12,7 @@ module Ohmage
12
12
  self.client_string = 'ruby-ohmage'
13
13
  self.path = 'app/'
14
14
  self.port = 443
15
+ self.server_debug = false
15
16
  options.each do |k, v|
16
17
  instance_variable_set("@#{k}", v)
17
18
  end
@@ -17,8 +17,9 @@ module Ohmage
17
17
  begin
18
18
  require 'oga'
19
19
  @xml = Oga.parse_xml(@xml)
20
- rescue LoadError
20
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
21
21
  # no op, gem is not required.
22
+ # and yes, rubocop, I did this on purpose!
22
23
  end
23
24
  end
24
25
  end
@@ -68,6 +68,7 @@ module Ohmage
68
68
  # so we're going to catch the real ones first, assuming
69
69
  # they are sent from the web server (like 502 or 404)
70
70
  klass = Ohmage::Error::ERRORS[code]
71
+ puts "\e[36m#{body.inspect}\e[0" if @client.server_debug
71
72
  if klass.nil?
72
73
  # we're not necessarily sure that this really isn't an error
73
74
  # so we have to inspect the response body to look for result:failure
@@ -14,7 +14,7 @@ module Ohmage
14
14
 
15
15
  # @return [Integer]
16
16
  def patch
17
- 26
17
+ 27
18
18
  end
19
19
 
20
20
  # @return [Integer, NilClass]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohmage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Nolen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2016-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable