endow 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 718bb4d0587749ac59db826e47a1a3878a00db06
4
- data.tar.gz: e2a781f54fa1edc1dbba0564529d6b4fc0d033cc
3
+ metadata.gz: 616b181681a41d018b2f7e3bc66b358d8ec3c6a2
4
+ data.tar.gz: cb32543eba23337ae446d70a4cb725f04b6ac72f
5
5
  SHA512:
6
- metadata.gz: 1b28c17418d5562d37eebffca2ec6741d0d983dd9f804ce401510b74211086fb69fa05641dbab948cbe10a639bf760273c9369dea56ca14b88aacfd6fee36831
7
- data.tar.gz: 8d502732af0bfdaae6a5dc6b1cbf8a8f8baab2baed580fd76f215e4ba4d0fe4243ffe2173fcfbca6db1e337d3728e5c64a0a24352c2b13e34b375687160227fa
6
+ metadata.gz: d3bb94bea13e563efb7132f98071f0b0e6d7a000286372aff3222bf68fb7a8802c7e1697d3f0565ea97eab83200eca2a327243874de828f0aad436b3d11b717b
7
+ data.tar.gz: 7727e0d799a314d4612050e2a0e1711f5265ccf71a3a833e3142fd65218d3af98dfbb986a003b3bd5281e286462e4d5e98aca4efdcc3fb6a947a09d5059ffdd6
data/lib/endow/logger.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Endow
2
2
  class Logger
3
3
 
4
- def self.log_connection( service, attempt )
5
- log "#{green_prefix} #{service.class.name} (Attempt #{attempt})"
4
+ def self.log_connection( service, attempt, attempts=nil )
5
+ log "#{green_prefix} #{service.class.name} (#{attempts_segment attempt, attempts}) #{service_options service}"
6
6
  end
7
7
 
8
8
  def self.log_graceful_error( msg )
@@ -29,6 +29,18 @@ module Endow
29
29
  "#{indention}[#{ANSI.red { error_label }}]"
30
30
  end
31
31
 
32
+ def self.service_options( service )
33
+ service.respond_to?( :options_for_log ) ?
34
+ "with #{service.options_for_log.inspect}" :
35
+ nil
36
+ end
37
+
38
+ def self.attempts_segment( attempt, attempts )
39
+ attempts.blank? ?
40
+ "Attempt #{attempt}" :
41
+ "Attempt #{attempt} of #{attempts}"
42
+ end
43
+
32
44
  def self.label
33
45
  "Service Connection"
34
46
  end
data/lib/endow/logging.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Endow
2
2
  module Logging
3
3
 
4
- def log_connection( service, attempt )
5
- Endow::Logger.log_connection( service, attempt )
4
+ def log_connection( service, attempt, attempts=nil )
5
+ Endow::Logger.log_connection( service, attempt, attempts )
6
6
  end
7
7
 
8
8
  def log_graceful_error( msg )
data/lib/endow/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Endow
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: endow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Harrelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-10 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.2.1
154
+ rubygems_version: 2.4.4
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: A library to assist in consuming API endpoints.