cfa 0.6.2 → 0.6.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
- SHA1:
3
- metadata.gz: ea6e4639e7b32b029af4f8e59ce6cc4951654934
4
- data.tar.gz: 6775d4085722ba982b8ab801b5d623df8110bba9
2
+ SHA256:
3
+ metadata.gz: 0b935ded0de71ea141ce56290ee7e46c62d3b5c4f3719d392a2f3d2607fb6e50
4
+ data.tar.gz: 6d8ec5f5cc7fd9490a1bad3a2f19466873f5a906c15a3351fe6de507fbdfcefe
5
5
  SHA512:
6
- metadata.gz: d36646d8d6cb6b171c1d7db0b9435ab4b3e69153e17ab0ffed8afeb35c0dcdad36aeeb4ea5e223b8bd19f641f7044791c8e11b9281739482f694545a90331a6f
7
- data.tar.gz: d2c49f5cc8459a36efa7c2116d241606dca3c4de284e4c179e40fee59bfaa4912d408354920fb464db39bbfcd83cdfe21b83f05bd79c1e25f88bf1012d468b36
6
+ metadata.gz: 04f2051c36312ebbc098eb1e4c26f5f6ad0339d89e34c57a4395286862ef302858306242ef951810c69452298cf0ad1f043e1f8e355518ffb4c29d678bf4e234
7
+ data.tar.gz: 1935ed5dff889f4a223363aa4b50892f88abf525a29a93c750a4add401d802aab8cc14fe1d461adab44d0cbc1fe16f1ce5217f2d1fb8df7825713730e464501f
@@ -313,6 +313,10 @@ module CFA
313
313
  # @return [AugeasTree] the parsed data
314
314
  def parse(raw_string)
315
315
  require "cfa/augeas_parser/reader"
316
+ # Workaround for augeas lenses that don't handle files
317
+ # without a trailing newline (bsc#1064623, bsc#1074891, bsc#1080051
318
+ # and gh#hercules-team/augeas#547)
319
+ raw_string += "\n" unless raw_string.end_with?("\n")
316
320
  @old_content = raw_string
317
321
 
318
322
  # open augeas without any autoloading and it should not touch disk and
@@ -70,7 +70,6 @@ module CFA
70
70
  tree[key]
71
71
  end
72
72
 
73
- # rubocop:disable Style/TrivialAccessors
74
73
  # Returns if configuration was already loaded
75
74
  def loaded?
76
75
  @loaded
@@ -82,11 +81,11 @@ module CFA
82
81
  @default_file_handler ||= File
83
82
  end
84
83
 
85
- # Sets default file handler. Useful when needed to change default like if
86
- # whole program use non standard file reading.
87
- # @param value for value specification see constructor
88
- def self.default_file_handler=(value)
89
- @default_file_handler = value
84
+ class << self
85
+ # Sets default file handler. Useful when needed to change default like if
86
+ # whole program use non standard file reading.
87
+ # @param value for value specification see constructor
88
+ attr_writer :default_file_handler
90
89
  end
91
90
 
92
91
  # Generates accessors for trivial key-value attributes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-14 00:00:00.000000000 Z
11
+ date: 2018-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-augeas
@@ -61,10 +61,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: 1.3.6
62
62
  requirements: []
63
63
  rubyforge_project:
64
- rubygems_version: 2.2.5
64
+ rubygems_version: 2.7.3
65
65
  signing_key:
66
66
  specification_version: 4
67
67
  summary: CFA (Config Files API) provides an easy way to create models on top of configuration
68
68
  files
69
69
  test_files: []
70
- has_rdoc: