kafo 5.1.0 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ module Kafo
4
4
  class Store
5
5
  attr_accessor :data
6
6
 
7
- def initialize(path=nil)
7
+ def initialize(path = nil)
8
8
  @data = {}
9
9
  load_path(path) if path
10
10
  end
@@ -18,7 +18,7 @@ module Kafo
18
18
  "#{prefix}#{d(param.name)}"
19
19
  end
20
20
 
21
- def parametrize(param, prefix='')
21
+ def parametrize(param, prefix = '')
22
22
  "--#{prefix}#{with_prefix(param)}"
23
23
  end
24
24
  end
@@ -15,7 +15,7 @@ module Kafo
15
15
  end
16
16
 
17
17
  def logger
18
- Logging::logger['checks']
18
+ ::Logging::logger['checks']
19
19
  end
20
20
 
21
21
  def check
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "5.1.0"
4
+ VERSION = "6.2.0"
5
5
  end
@@ -1,5 +1,6 @@
1
1
  # encoding: UTF-8
2
- require 'highline/import'
2
+ require 'forwardable'
3
+ require 'highline'
3
4
  require 'yaml'
4
5
 
5
6
  module Kafo
@@ -8,14 +9,17 @@ module Kafo
8
9
  Kafo::ENV::LANG =~ /UTF-8\z/
9
10
  end
10
11
 
12
+ extend Forwardable
13
+ def_delegators :@highline, :agree, :ask, :choose, :say
14
+
11
15
  OK = utf_support? ? '✓' : 'y'
12
16
  NO = utf_support? ? '✗' : 'n'
13
17
 
14
- def initialize(kafo)
18
+ def initialize(kafo, input=$stdin, output=$stdout)
15
19
  @kafo = kafo
16
20
  @config = kafo.config
17
21
  @name = @config.app[:name] || 'Kafo'
18
- setup_terminal
22
+ @highline = setup_terminal(input, output)
19
23
  end
20
24
 
21
25
  def run
@@ -178,11 +182,17 @@ END
178
182
  say "\n" + HighLine.color("Value for #{param.name} reset to default", :important)
179
183
  end
180
184
 
181
- def setup_terminal
182
- $terminal = HighLine.new
183
- data = HighLine::SystemExtensions.terminal_size
184
- $terminal.wrap_at = data.first > 80 ? 80 : data.first if data.first
185
- $terminal.page_at = data.last if data.last
185
+ def setup_terminal(input, output)
186
+ highline = HighLine.new(input, output)
187
+ # HighLine 2 vs 1
188
+ data = if highline.respond_to?(:terminal)
189
+ highline.terminal.terminal_size
190
+ else
191
+ HighLine::SystemExtensions.terminal_size
192
+ end
193
+ highline.wrap_at = data.first > 80 ? 80 : data.first if data.first
194
+ highline.page_at = data.last if data.last
195
+ highline
186
196
  end
187
197
  end
188
198
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2021-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -171,7 +171,7 @@ dependencies:
171
171
  version: 1.6.21
172
172
  - - "<"
173
173
  - !ruby/object:Gem::Version
174
- version: '2.0'
174
+ version: '3.0'
175
175
  type: :runtime
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
@@ -181,7 +181,7 @@ dependencies:
181
181
  version: 1.6.21
182
182
  - - "<"
183
183
  - !ruby/object:Gem::Version
184
- version: '2.0'
184
+ version: '3.0'
185
185
  - !ruby/object:Gem::Dependency
186
186
  name: powerbar
187
187
  requirement: !ruby/object:Gem::Requirement
@@ -218,6 +218,8 @@ files:
218
218
  - doc/kafo_run.png
219
219
  - doc/kafo_run.uml
220
220
  - lib/kafo.rb
221
+ - lib/kafo/app_option/declaration.rb
222
+ - lib/kafo/app_option/definition.rb
221
223
  - lib/kafo/base_context.rb
222
224
  - lib/kafo/color_scheme.rb
223
225
  - lib/kafo/condition.rb
@@ -257,6 +259,7 @@ files:
257
259
  - lib/kafo/hooking.rb
258
260
  - lib/kafo/kafo_configure.rb
259
261
  - lib/kafo/logger.rb
262
+ - lib/kafo/logging.rb
260
263
  - lib/kafo/migration_context.rb
261
264
  - lib/kafo/migrations.rb
262
265
  - lib/kafo/param.rb
@@ -290,7 +293,6 @@ files:
290
293
  - modules/kafo_configure/spec/classes/init_spec.rb
291
294
  - modules/kafo_configure/spec/fixtures/hiera/hiera.yaml
292
295
  - modules/kafo_configure/spec/fixtures/hiera/test.yaml
293
- - modules/kafo_configure/spec/fixtures/manifests/site.pp
294
296
  - modules/kafo_configure/spec/fixtures/modules/dummy/manifests/init.pp
295
297
  - modules/kafo_configure/spec/fixtures/modules/dummy/manifests/params.pp
296
298
  - modules/kafo_configure/spec/functions/dump_lookups_spec.rb
@@ -301,7 +303,7 @@ homepage: https://github.com/theforeman/kafo
301
303
  licenses:
302
304
  - GPL-3.0+
303
305
  metadata: {}
304
- post_install_message:
306
+ post_install_message:
305
307
  rdoc_options: []
306
308
  require_paths:
307
309
  - lib
@@ -309,15 +311,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
309
311
  requirements:
310
312
  - - ">="
311
313
  - !ruby/object:Gem::Version
312
- version: 2.0.0
314
+ version: 2.4.0
313
315
  required_rubygems_version: !ruby/object:Gem::Requirement
314
316
  requirements:
315
317
  - - ">="
316
318
  - !ruby/object:Gem::Version
317
319
  version: '0'
318
320
  requirements: []
319
- rubygems_version: 3.1.2
320
- signing_key:
321
+ rubygems_version: 3.1.4
322
+ signing_key:
321
323
  specification_version: 4
322
324
  summary: A gem for making installations based on puppet user friendly
323
325
  test_files: []