attributor-flatpack 1.2.4 → 1.3.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: 4da3d2d76d0c3e0d7404e2c682fd9ae17ab4865b
4
- data.tar.gz: 75e65dc5638d3a01053b40ba50c310c995c0149a
3
+ metadata.gz: c7ba5d07df3cd10ee6e98585c8b11179a9076277
4
+ data.tar.gz: 3086f4ea1f236e744771245993917855eff749e2
5
5
  SHA512:
6
- metadata.gz: 125fe14b5ce534c5864e0907d4c3f7b30058341cb2445883abeb72d059708783027dc4ae16bce96e3c3ec2f62d363ef7b7314c7995f91a6c8fe4a9bdd4a74bdc
7
- data.tar.gz: 172b676460ca771e621f6c68672e8223cf8da6df0cf5be08b2578731b78dfddbcb5dd7b9f97d0ebd12ab5696a558345c1802952d607ae7738ea8546ea24d0b2b
6
+ metadata.gz: 939304f1c55c7a9efcd26b0d2b9aa06f97b4b0941d6f1df24bb714ed5e4dd1c4d9424c02b932c05a61a3b7e4c3b4b12a3283c5f9c0c3790e4a9cb564154f087b
7
+ data.tar.gz: 21b3fa39b3701e4e28d42c9798c2cb64a70740304e5e5857afa09e7af39a0207337552ebe73107f2018c341242488fcf9de3de155e2878241fe8f4afc8a8ffc0
data/.rubocop.yml CHANGED
@@ -13,8 +13,13 @@ Metrics/MethodLength:
13
13
  Metrics/ClassLength:
14
14
  Enabled: false
15
15
  Metrics/LineLength:
16
- Max: 85
16
+ Max: 160
17
+ Exclude:
18
+ - "spec/**/*.rb"
17
19
  Style/RedundantSelf:
18
20
  Enabled: false
19
21
  Style/DoubleNegation:
20
22
  Enabled: false
23
+ Metrics/BlockLength:
24
+ Exclude:
25
+ - spec/**/*.rb
data/CHANGELOG.md CHANGED
@@ -1,13 +1,17 @@
1
1
  # attributor-flatpack changelog
2
2
 
3
+ ## 1.3
4
+
5
+ - Add `Attributor::Flatpack::MultilineString` type to handle multiline strings from environment variables.
6
+
3
7
  ## 1.2
4
8
 
5
- * Add support for redefining the separator
9
+ - Add support for redefining the separator
6
10
 
7
11
  ## 1.1
8
12
 
9
- * Significant performance improvements. See [benchmark results](benchmark/output.txt) for comparisons.
13
+ - Significant performance improvements. See [benchmark results](benchmark/output.txt) for comparisons.
10
14
 
11
15
  ## 1.0
12
16
 
13
- * Initial Release
17
+ - Initial Release
@@ -5,6 +5,7 @@ require 'attributor/flatpack/config_dsl_compiler'
5
5
 
6
6
  require 'attributor/flatpack/config'
7
7
  require 'attributor/flatpack/undefined_key'
8
+ require 'attributor/flatpack/types/multiline_string'
8
9
 
9
10
  module Attributor
10
11
  module Flatpack
@@ -0,0 +1,18 @@
1
+ # Sometimes a multline string when read in by ruby has escaped newlines, sometimes not.
2
+ # This type will remove any escaping of newline from a string.
3
+
4
+ module Attributor
5
+ module Flatpack
6
+ class MultilineString < Attributor::String
7
+ def self.load(value, context = Attributor::DEFAULT_ROOT_CONTEXT, **options)
8
+ value.gsub('\\n', "\n")
9
+ rescue StandardError
10
+ super
11
+ end
12
+
13
+ def self.example(*)
14
+ '-----BEGIN EC PRIVATE KEY-----\\nMIHcAgEBBEI\\n3abcdefghijklmnop==\\n-----END EC PRIVATE KEY-----'
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Attributor
2
2
  module Flatpack
3
- VERSION = '1.2.4'.freeze
3
+ VERSION = '1.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attributor-flatpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dane Jensen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-11-28 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attributor
@@ -221,6 +221,7 @@ files:
221
221
  - lib/attributor/flatpack.rb
222
222
  - lib/attributor/flatpack/config.rb
223
223
  - lib/attributor/flatpack/config_dsl_compiler.rb
224
+ - lib/attributor/flatpack/types/multiline_string.rb
224
225
  - lib/attributor/flatpack/undefined_key.rb
225
226
  - lib/attributor/flatpack/version.rb
226
227
  homepage: https://github.com/careo/attributor-flatpack