sapience 2.5.2 → 2.5.3

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: 0195f4d1d99b9f8ba9ba68ab0392d4dc6c4f93c5
4
- data.tar.gz: 027ab907b08063bb5ae83028c0d80f4bff529fe4
3
+ metadata.gz: 1b780de6c0e6cd44b9c195665fc83c5fd77ec28c
4
+ data.tar.gz: 9d7f2c1e50c99c110f569f1c8b5ba30a1957040c
5
5
  SHA512:
6
- metadata.gz: 841435a105d54e40a617a8add8339281a843572604274847c45ad72534c4b2fb339573d099c716345211c65dafac290fe06e448926fc98ab1fc8973b8b264be8
7
- data.tar.gz: 8d475b0ee78ca5fcf21cff7195e989bd4ec93f1dfc9712f06719e032216c2ec1f532cd9c3152e13d9a16c3999f99a5404f52620b4a9478946bf5d110a53ec90f
6
+ metadata.gz: 443375f18bd410d190be8c23c5d7a0b07815af6d3fad3bdb127b9310a53204637da67d1fafa139c85b6d4c353a0a5ef518d693b158353542961761471aed7de7
7
+ data.tar.gz: 29ff6baac968f8401b7046531e6eff3df847b8c2634d66b5df241897426159f2ace1185a695b2c59447f4957eb5ef869a552a070d9a9cbb6d4d5552ff7a41e75
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v2.5.3
2
+
3
+ - Fix issues after applying fronzen_string_literal = true. Make it compatible to Ruby 2.1
4
+
1
5
  ## v2.5.2
2
6
 
3
7
  - Fix RuboCop auto-correct changes
data/docker-compose.yml CHANGED
@@ -55,6 +55,7 @@ services:
55
55
  rails32:
56
56
  extends:
57
57
  service: base
58
+ image: ruby:2.1
58
59
  working_dir: /usr/src/app/test_apps/rails_3_2
59
60
  entrypoint: /usr/src/app/dev-entrypoint.sh
60
61
  command: bundle exec rspec
@@ -115,7 +115,7 @@ module Sapience
115
115
  # Since only one appender thread will be writing to the file at a time
116
116
  # it is not necessary to protect access to the file with a semaphore
117
117
  # Allow this logger to filter out log levels lower than it's own
118
- @log.write(+formatter.call(log, self) << "\n")
118
+ @log.write(formatter.call(log, self) + "\n")
119
119
  true
120
120
  end
121
121
 
@@ -28,38 +28,39 @@ module Sapience
28
28
  colors = Sapience::AnsiColors
29
29
  level_color = colors::LEVEL_MAP[log.level]
30
30
 
31
- message = time_format.nil? ? +"" : +"#{format_time(log.time)} "
31
+
32
+ message = time_format.nil? ? "" : "#{format_time(log.time)} "
32
33
 
33
34
  # Header with date, time, log level and process info
34
- message << "#{level_color}#{log.level_to_s}#{colors::CLEAR} [#{log.process_info}]"
35
+ message += "#{level_color}#{log.level_to_s}#{colors::CLEAR} [#{log.process_info}]"
35
36
 
36
37
  # Tags
37
- message << " " << log.tags.collect { |tag| "[#{level_color}#{tag}#{colors::CLEAR}]" }.join(" ") if log.tags && !log.tags.empty? # rubocop:disable LineLength
38
+ message += " " + log.tags.collect { |tag| "[#{level_color}#{tag}#{colors::CLEAR}]" }.join(" ") if log.tags && !log.tags.empty? # rubocop:disable LineLength
38
39
 
39
40
  # Duration
40
- message << " (#{colors::BOLD}#{log.duration_human}#{colors::CLEAR})" if log.duration
41
+ message += " (#{colors::BOLD}#{log.duration_human}#{colors::CLEAR})" if log.duration
41
42
 
42
43
  # Class / app name
43
- message << " #{level_color}#{log.name}#{colors::CLEAR}"
44
+ message += " #{level_color}#{log.name}#{colors::CLEAR}"
44
45
 
45
46
  # Log message
46
- message << " -- #{log.message}" if log.message
47
+ message += " -- #{log.message}" if log.message
47
48
 
48
49
  # Payload: Colorize the payload if the AwesomePrint gem is loaded
49
50
  if log.payload?
50
51
  payload = log.payload
51
- message << " -- " <<
52
- if defined?(AwesomePrint) && payload.respond_to?(:ai)
53
- payload.ai(@ai_options) rescue payload.inspect # rubocop:disable RescueModifier
54
- else
55
- payload.inspect
56
- end
52
+ message += " -- "
53
+ message += if defined?(AwesomePrint) && payload.respond_to?(:ai)
54
+ payload.ai(@ai_options) rescue payload.inspect # rubocop:disable RescueModifier
55
+ else
56
+ payload.inspect
57
+ end
57
58
  end
58
59
 
59
60
  # Exceptions
60
61
  if log.exception
61
- message << " -- Exception: #{colors::BOLD}#{log.exception.class}: #{log.exception.message}#{colors::CLEAR}\n"
62
- message << log.backtrace_to_s
62
+ message += " -- Exception: #{colors::BOLD}#{log.exception.class}: #{log.exception.message}#{colors::CLEAR}\n"
63
+ message += log.backtrace_to_s
63
64
  end
64
65
  message
65
66
  end
@@ -7,32 +7,32 @@ module Sapience
7
7
  # 2011-07-19 14:36:15.660235 D [1149:ScriptThreadProcess] Rails -- Hello World
8
8
  def call(log, _logger) # rubocop:disable AbcSize, PerceivedComplexity, CyclomaticComplexity
9
9
  # Date & time
10
- message = time_format.nil? ? +"" : +"#{format_time(log.time)} "
10
+ message = time_format.nil? ? "" : "#{format_time(log.time)} "
11
11
 
12
12
  # Log level and process info
13
- message << "#{log.level_to_s} [#{log.process_info}]"
13
+ message += "#{log.level_to_s} [#{log.process_info}]"
14
14
 
15
15
  # Tags
16
- message << " " << log.tags.collect { |tag| "[#{tag}]" }.join(" ") if log.tags && !log.tags.empty?
16
+ message += " " + log.tags.collect { |tag| "[#{tag}]" }.join(" ") if log.tags && !log.tags.empty?
17
17
 
18
18
  # Duration
19
- message << " (#{log.duration_human})" if log.duration
19
+ message += " (#{log.duration_human})" if log.duration
20
20
 
21
21
  # Class / app name
22
- message << " #{log.name}"
22
+ message += " #{log.name}"
23
23
 
24
24
  # Log message
25
- message << " -- #{log.message}" if log.message
25
+ message += " -- #{log.message}" if log.message
26
26
 
27
27
  # Payload
28
28
  if (payload = log.payload_to_s)
29
- message << " -- " << payload
29
+ message += " -- " + payload
30
30
  end
31
31
 
32
32
  # Exceptions
33
33
  if log.exception
34
- message << " -- Exception: #{log.exception.class}: #{log.exception.message}\n"
35
- message << log.backtrace_to_s
34
+ message += " -- Exception: #{log.exception.class}: #{log.exception.message}\n"
35
+ message += log.backtrace_to_s
36
36
  end
37
37
  message
38
38
  end
data/lib/sapience/log.rb CHANGED
@@ -55,12 +55,12 @@ module Sapience
55
55
 
56
56
  # Returns [String] the exception backtrace including all of the child / caused by exceptions
57
57
  def backtrace_to_s
58
- trace = +""
58
+ trace = ""
59
59
  each_exception do |exception, i|
60
60
  if i == 0
61
- trace << (exception.backtrace || []).join("\n")
61
+ trace += (exception.backtrace || []).join("\n")
62
62
  else
63
- trace << "\nCause: #{exception.class.name}: #{exception.message}\n#{(exception.backtrace || []).join("\n")}"
63
+ trace += "\nCause: #{exception.class.name}: #{exception.message}\n#{(exception.backtrace || []).join("\n")}"
64
64
  end
65
65
  end
66
66
  trace
@@ -81,12 +81,12 @@ module Sapience
81
81
  minutes, ms = ms.divmod(MILLISECONDS_IN_MINUTE)
82
82
  seconds, ms = ms.divmod(MILLISECONDS_IN_SECOND)
83
83
 
84
- str = +""
85
- str << "#{days}d" if days > 0
86
- str << " #{hours}h" if hours > 0
87
- str << " #{minutes}m" if minutes > 0
88
- str << " #{seconds}s" if seconds > 0
89
- str << " #{ms}ms" if ms > 0
84
+ str = ""
85
+ str += "#{days}d" if days > 0
86
+ str += " #{hours}h" if hours > 0
87
+ str += " #{minutes}m" if minutes > 0
88
+ str += " #{seconds}s" if seconds > 0
89
+ str += " #{ms}ms" if ms > 0
90
90
 
91
91
  if days > 0 || hours > 0 || minutes > 0
92
92
  str.strip
@@ -150,7 +150,7 @@ module Sapience
150
150
 
151
151
  def namespace
152
152
  ns = Sapience.namify(Sapience.app_name)
153
- ns << ".#{Sapience.namify(Sapience.environment)}" if Sapience.environment
153
+ ns += ".#{Sapience.namify(Sapience.environment)}" if Sapience.environment
154
154
  ns
155
155
  end
156
156
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sapience
3
- VERSION = "2.5.2"
3
+ VERSION = "2.5.3"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapience
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-17 00:00:00.000000000 Z
12
+ date: 2017-07-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby