numerousapp 1.2.1 → 1.2.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/numerousapp.rb +12 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2cb812bb5dd0b6ff8eff69717086072183b6f403
4
- data.tar.gz: f597ff55c83c748b333c715552540ae42d4c04e0
3
+ metadata.gz: b5d1de99d002e38617461074b068f12e9ea25951
4
+ data.tar.gz: faefd87f5da4d43832e227fd2552cd8611f0daf9
5
5
  SHA512:
6
- metadata.gz: 62356ae9378340d0e2b3d82c617804a6bda4c5ed538da960202ce49d38acd349c9d4e8c201e6666cd2e638cbd5ccddc5317285d857192d40efd848dcecd43f3f
7
- data.tar.gz: 4162109867626e763f8a70cb6e8176ffe504904f186c90c1f416c0f4a8332545a5e55f8568b91b480cc4ff5c54609a939008a306ef96e58d26cd5cf24d4d7f31
6
+ metadata.gz: c13d42b013d15a26e0590ec9f032ebae570c978ccbf7babd0a28179349045c00accba926f851e7020da745741c92f13a123d2e030c2ffa692fb1d0fb0641c8a4
7
+ data.tar.gz: 6680ae04cfe5dfe28577e529d2071d7989d45937cc6578c28bb5de8903d3cff5da26f008577803bd87cde792b9aef34c273ba0ba8211d72ecca3cdbe4fdb20eb
data/lib/numerousapp.rb CHANGED
@@ -173,6 +173,7 @@ class NumerousClientInternals
173
173
  attr_reader :serverName, :debugLevel
174
174
  attr_reader :statistics
175
175
 
176
+
176
177
  # String representation of Numerous
177
178
  #
178
179
  # @return [String] Human-appropriate string representation.
@@ -189,10 +190,19 @@ class NumerousClientInternals
189
190
  def debug(lvl=1)
190
191
  prev = @debugLevel
191
192
  @debugLevel = lvl
193
+ # need to make sure we have started an http session
194
+ # (normally deferred until first API call)
195
+
192
196
  if @debugLevel > 0
197
+ # this is hokey, but it is what it is... it's for debug anyway
198
+ # we have to restart the session with debug on
199
+ @http = Net::HTTP.new(@serverName, @serverPort)
200
+ @http.use_ssl = true # always required by NumerousApp
193
201
  @http.set_debug_output $stderr
202
+ @http = @http.start()
203
+ @need_restart = false
194
204
  else
195
- @http.set_debug_output nil
205
+ @need_restart = true # will force a new http session
196
206
  end
197
207
  return prev
198
208
  end
@@ -212,7 +222,7 @@ class NumerousClientInternals
212
222
 
213
223
  protected
214
224
 
215
- VersionString = '20150617-1.2.1'
225
+ VersionString = '20150618-1.2.2'
216
226
 
217
227
  MethMap = {
218
228
  GET: Net::HTTP::Get,
@@ -379,8 +389,6 @@ class NumerousClientInternals
379
389
  # also where subsequent starts might be re-done after errors
380
390
 
381
391
  if @need_restart or not @http.started?()
382
-
383
- # starting a session turns on keep-alive...
384
392
  @http = Net::HTTP.new(@serverName, @serverPort)
385
393
  @http.use_ssl = true # always required by NumerousApp
386
394
  @http = @http.start()
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numerousapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Webber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-17 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Classes implementing the NumerousApp REST APIs for metrics. Requires
14
14
  Ruby 2.x