hanami-utils 1.3.4 → 1.3.5

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
  SHA256:
3
- metadata.gz: 68be8ddda779b8240ab53da6641e364091bea551058a1d70867a5473e1132a67
4
- data.tar.gz: 955c6531113488bcc4d46a89fdcbc08d8a4b08377ba9bc16307b5415fb20d51c
3
+ metadata.gz: c4939f478fe78b3060ebf7f744977332a2dea527f84bcd4ba809cf2fc6b9c02d
4
+ data.tar.gz: 9b291ed5abecc39bd86da3605699b2770fa6f17f16d382802d3691ce4545bd42
5
5
  SHA512:
6
- metadata.gz: 40e0d112499873dabd51acaab7f7e4283754bfc764080a83d766970fb3908553a0f1c637492f570f7716919823cca883c5e5280d07efe9c9aa7780d97241401c
7
- data.tar.gz: fcd8e38137f5527e245da4c5e1af4a3248a40314588d35ea6de24a097dddcc1ce9da6601153f264f2a32e991631fab7b1e0e0b37003fdbde52097dca7df60f64
6
+ metadata.gz: 39cc6955396c483181fb2ee9aa520fc862fe9a8a8e40bbe248302bda58053f71009ebe143a9d403f27da12236aa6d3e607876c3a5d29b8de97b8b7cbb4fb6e3b
7
+ data.tar.gz: b789c74a652f67bfa79c6dd349ee77d03af433850cd11e268abf3e1a9050da6bbab9227f48d1b6a61454f9e384662e0d7d8c400c7cf6c4734bf0430594d1a78a
@@ -1,6 +1,11 @@
1
1
  # Hanami::Utils
2
2
  Ruby core extentions and class utilities for Hanami
3
3
 
4
+ ## v1.3.5 - 2019-10-25
5
+ ### Fixed
6
+ - [Ivan Kabluchkov] Ensure `Hanami::Logger` filters to not crash when logger stream is a closed tempfile
7
+ - [Luca Guidi] Ensure `Utils::Files.append` to append contents properly when existing file doesn't end with a newline
8
+
4
9
  ## v1.3.4 - 2019-09-27
5
10
  ### Added
6
11
  - [Luca Guidi] Let `Utils::BasicObject` to lookup constants at the top-level namespace
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'concurrent-ruby', '~> 1.0'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '>= 1.6', '< 3'
25
- spec.add_development_dependency 'rake', '~> 12'
25
+ spec.add_development_dependency 'rake', '~> 13'
26
26
  spec.add_development_dependency 'rspec', '~> 3.7'
27
27
  end
@@ -42,7 +42,7 @@ module Hanami
42
42
  # @api private
43
43
  def _key_paths(hash, base = nil)
44
44
  hash.inject([]) do |results, (k, v)|
45
- results + (v.respond_to?(:each) ? _key_paths(v, _build_path(base, k)) : [_build_path(base, k)])
45
+ results + (_key_paths?(v) ? _key_paths(v, _build_path(base, k)) : [_build_path(base, k)])
46
46
  end
47
47
  end
48
48
 
@@ -63,6 +63,17 @@ module Hanami
63
63
  res + [correct_key]
64
64
  end
65
65
  end
66
+
67
+ # Check if the given value can be iterated (`Enumerable`) and that isn't a `File`.
68
+ # This is useful to detect closed `Tempfiles`.
69
+ #
70
+ # @since 1.3.5
71
+ # @api private
72
+ #
73
+ # @see https://github.com/hanami/utils/pull/342
74
+ def _key_paths?(value)
75
+ value.is_a?(Enumerable) && !value.is_a?(File)
76
+ end
66
77
  end
67
78
  end
68
79
  end
@@ -163,6 +163,7 @@ module Hanami
163
163
  mkdir_p(path)
164
164
 
165
165
  content = ::File.readlines(path)
166
+ content << "\n" unless content.last.end_with?("\n")
166
167
  content << "#{contents}\n"
167
168
 
168
169
  write(path, content)
@@ -6,7 +6,7 @@ module Hanami
6
6
  # Hash on steroids
7
7
  # @since 0.1.0
8
8
  #
9
- # rubocop:disable ClassLength
9
+ # rubocop:disable Metrics/ClassLength
10
10
  class Hash
11
11
  # @since 0.6.0
12
12
  # @api private
@@ -520,6 +520,6 @@ module Hanami
520
520
  @hash.respond_to?(method_name, include_private)
521
521
  end
522
522
  end
523
- # rubocop:enable ClassLength
523
+ # rubocop:enable Metrics/ClassLength
524
524
  end
525
525
  end
@@ -3,6 +3,6 @@ module Hanami
3
3
  # Defines the version
4
4
  #
5
5
  # @since 0.1.0
6
- VERSION = '1.3.4'.freeze
6
+ VERSION = '1.3.5'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: transproc
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '12'
67
+ version: '13'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '12'
74
+ version: '13'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rspec
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.0.3
147
+ rubygems_version: 3.0.6
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: Ruby core extentions and Hanami utilities