chef_backup 0.1.1 → 0.2.0.pre1

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: 1fd9e42aaddb3298dee25b5dff5ff972f92ed2b9554fac1cfdbd487edd3c9bc9
4
- data.tar.gz: 3b53768ed83f86bcf25259e65a8b710198d3b97b9fdc7e5ca52446e7511e69d6
3
+ metadata.gz: 51de6280ecd6ede16153afcfb70d6fcfa508e76dfa48dea7858d5d5fcc4be278
4
+ data.tar.gz: a358070ef671054bda4e8b21bc6e6bb51fb915b31bded0567d4c717731fff0c5
5
5
  SHA512:
6
- metadata.gz: 3f9a37b97ab0553644d533a63d49b42fa68a28eef2f821da971f78341c5d1d4324f219ac9996ab8abb59f47d707e05e71fccbbee2003b9b0725260758ddb3d00
7
- data.tar.gz: 8ad641f82c2e0592dd29eff51e8ebd155980bdd27730718f23cb798008c5ba226eadaeaba0764bf5e5305f614660885bc8605891629fbe72169aaf8bf718b18d
6
+ metadata.gz: cbc70201b088ac22f49d34cfb6114eebfe62f8b2f8cca7fd3beb5255b54df77dddcdc76287f3474f284532b387a9297c8659c4eaf5c5a50444536579c7e98354
7
+ data.tar.gz: 96e4e39b9d0083c81a0ba2dbf009f32545e027aa5a5a5f0f3beb91eb34f7fae0a17f9493e1c766979ec73719ee5104c28aae8fa59d739141ba9d49a64d6aa805
@@ -1,6 +1,6 @@
1
- require "fileutils"
2
- require "json"
3
- require "forwardable"
1
+ require "fileutils" unless defined?(FileUtils)
2
+ require "json" unless defined?(JSON)
3
+ require "forwardable" unless defined?(Forwardable)
4
4
 
5
5
  module ChefBackup
6
6
  # ChefBackup Global Config
@@ -1,4 +1,4 @@
1
- require "time"
1
+ require "time" unless defined?(Time.zone_offset)
2
2
 
3
3
  module ChefBackup
4
4
  # DataMap class to store data about the data we're backing up
@@ -1,5 +1,3 @@
1
- require "highline"
2
-
3
1
  module ChefBackup
4
2
  # Basic Logging Class
5
3
  class Logger
@@ -16,17 +14,24 @@ module ChefBackup
16
14
 
17
15
  def initialize(logfile = nil)
18
16
  $stdout = logfile ? File.open(logfile, "ab") : $stdout
19
- @highline = HighLine.new($stdin, $stdout)
17
+ end
18
+
19
+ # pastel.decorate is a lightweight replacement for highline.color
20
+ def pastel
21
+ @pastel ||= begin
22
+ require "pastel" unless defined?(Pastel)
23
+ Pastel.new
24
+ end
20
25
  end
21
26
 
22
27
  def log(msg, level = :info)
23
28
  case level
24
29
  when :warn
25
30
  msg = "WARNING: #{msg}"
26
- $stdout.puts(color? ? @highline.color(msg, :yellow) : msg)
31
+ $stdout.puts(color? ? pastel.decorate(msg, :yellow) : msg)
27
32
  when :error
28
33
  msg = "ERROR: #{msg}"
29
- $stdout.puts(color? ? @highline.color(msg, :red) : msg)
34
+ $stdout.puts(color? ? pastel.decorate(msg, :red) : msg)
30
35
  else
31
36
  $stdout.puts(msg)
32
37
  end
@@ -1,5 +1,5 @@
1
- require "fileutils"
2
- require "pathname"
1
+ require "fileutils" unless defined?(FileUtils)
2
+ require "pathname" unless defined?(Pathname)
3
3
 
4
4
  module ChefBackup
5
5
  # ChefBackup::Runner class initializes the strategy and runs the action
@@ -60,16 +60,14 @@ module ChefBackup
60
60
  # @return [String] A path to backup tarball or EBS snapshot ID
61
61
  #
62
62
  def restore_strategy
63
- @restore_strategy ||= begin
64
- if tarball?
65
- unpack_tarball
66
- manifest["strategy"]
67
- elsif ebs_snapshot?
68
- "ebs"
69
- else
70
- raise InvalidStrategy, "#{restore_param} is not a valid backup"
71
- end
72
- end
63
+ @restore_strategy ||= if tarball?
64
+ unpack_tarball
65
+ manifest["strategy"]
66
+ elsif ebs_snapshot?
67
+ "ebs"
68
+ else
69
+ raise InvalidStrategy, "#{restore_param} is not a valid backup"
70
+ end
73
71
  end
74
72
 
75
73
  #
@@ -1,7 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'json'
3
3
  require 'time'
4
- require 'highline/import'
5
4
 
6
5
  # rubocop:disable IndentationWidth
7
6
  module ChefBackup
@@ -244,7 +243,8 @@ class TarBackup
244
243
  msg << 'continuing. You can skip this message by passing a "--yes" '
245
244
  msg << 'argument. Do you wish to proceed? (y/N):'
246
245
 
247
- exit(1) unless ask(msg) =~ /^y/i
246
+ require "tty-prompt" unless defined?(TTY::Prompt)
247
+ exit(1) unless TTY::Prompt.new(interrupt: :exit).ask(msg) =~ /^y/i
248
248
  end
249
249
  end
250
250
  end
@@ -1,6 +1,6 @@
1
- require "fileutils"
2
- require "pathname"
3
- require "forwardable"
1
+ require "fileutils" unless defined?(FileUtils)
2
+ require "pathname" unless defined?(Pathname)
3
+ require "forwardable" unless defined?(Forwardable)
4
4
  require "chef_backup/deep_merge"
5
5
 
6
6
  # rubocop:disable IndentationWidth
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-24 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -31,25 +31,33 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: '4.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: highline
34
+ name: pastel
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '1.6'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- version: 1.6.9
39
+ version: '0'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: tty-prompt
49
+ requirement: !ruby/object:Gem::Requirement
46
50
  requirements:
47
51
  - - "~>"
48
52
  - !ruby/object:Gem::Version
49
- version: '1.6'
50
- - - ">="
53
+ version: '0.21'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
51
59
  - !ruby/object:Gem::Version
52
- version: 1.6.9
60
+ version: '0.21'
53
61
  description: A library to backup a Chef Server
54
62
  email:
55
63
  - oss@chef.io
@@ -94,11 +102,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
102
  version: '0'
95
103
  required_rubygems_version: !ruby/object:Gem::Requirement
96
104
  requirements:
97
- - - ">="
105
+ - - ">"
98
106
  - !ruby/object:Gem::Version
99
- version: '0'
107
+ version: 1.3.1
100
108
  requirements: []
101
- rubygems_version: 3.0.3
109
+ rubygems_version: 3.1.6
102
110
  signing_key:
103
111
  specification_version: 4
104
112
  summary: A library to backup a Chef Server