chef-stove 7.1.5 → 7.1.6

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: 11f736caab65c054d228ea7458d0f73b727bc199b919e778e9199e61000709a6
4
- data.tar.gz: d2383206c9bac9849499e4794b2858482c6d1f54d148b7d8ed66bd01da095d1c
3
+ metadata.gz: f98625c4f5efd8b003bca41854d70dbe4b18e0693b0af2a72744b70cf1ba016f
4
+ data.tar.gz: fbdc44771d81e6586315fc63e9a6e502707f52abdefe51ba1da39d5ee68b07ff
5
5
  SHA512:
6
- metadata.gz: 1d89919f2710d877a4f772831baf5ce3194646792446bec2a4221ca37a1c2b384418b9778285ad5b43f02b23a2d88e34f920147f630a3660837b92e695d7f08e
7
- data.tar.gz: ccd2629fa03d9e6f05aba1f599f326e2d1fba4081eb520adb5dcbfdb27c253882f0e0d3837930b8069c7edc031561d8766b9714e2a4ae85603f0a8548efb0144
6
+ metadata.gz: e581cc745e4ce75325d6f821b5c89a5c7ba584c13a8215e2f05ef856fb2a083bad96f91db22080cdf94847171ab6407f5c6b89b77a73881443f50d681ef944d0
7
+ data.tar.gz: 052ebde245c6bad0dece9b9a935ae6abd2542ccec1246bdb7b41929ea0ba7704538824854c615a0187b3fbfe3a5613557217ba3d4c2235e4283fd57d1e4d6cf8
data/lib/stove.rb CHANGED
@@ -1,4 +1,3 @@
1
- require 'logify'
2
1
  require 'pathname'
3
2
 
4
3
  module Stove
@@ -15,6 +14,7 @@ module Stove
15
14
  autoload :Util, 'stove/util'
16
15
  autoload :Validator, 'stove/validator'
17
16
  autoload :VERSION, 'stove/version'
17
+ autoload :Log, 'stove/log'
18
18
 
19
19
  module Middleware
20
20
  autoload :ChefAuthentication, 'stove/middlewares/chef_authentication'
@@ -53,7 +53,7 @@ module Stove
53
53
 
54
54
  class << self
55
55
  #
56
- # The source root of the ChefAPI gem. This is useful when requiring files
56
+ # The source root of the Stove gem. This is useful when requiring files
57
57
  # that are relative to the root of the project.
58
58
  #
59
59
  # @return [Pathname]
@@ -66,13 +66,13 @@ module Stove
66
66
  # Set the log level.
67
67
  #
68
68
  # @example Set the log level to :info
69
- # ChefAPI.log_level = :info
69
+ # Stove.log_level = :info
70
70
  #
71
71
  # @param [#to_sym] level
72
72
  # the log level to set
73
73
  #
74
- def log_level=(level)
75
- Logify.level = level.to_sym
74
+ def log_level=(lev)
75
+ Stove::Log.level = lev.to_sym
76
76
  end
77
77
 
78
78
  #
@@ -81,7 +81,7 @@ module Stove
81
81
  # @return [Symbol]
82
82
  #
83
83
  def log_level
84
- Logify.level
84
+ Stove::Log.level
85
85
  end
86
86
  end
87
87
  end
data/lib/stove/cli.rb CHANGED
@@ -3,8 +3,6 @@ require 'stove'
3
3
 
4
4
  module Stove
5
5
  class Cli
6
- include Logify
7
-
8
6
  def initialize(argv, stdin=STDIN, stdout=STDOUT, stderr=STDERR, kernel=Kernel)
9
7
  @argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
10
8
  end
@@ -48,8 +46,8 @@ module Stove
48
46
 
49
47
  # Useful debugging output for when people type the wrong fucking command
50
48
  # and then open an issue like it's somehow my fault
51
- log.info("Options: #{options.inspect}")
52
- log.info("ARGV: #{@argv.inspect}")
49
+ Stove::Log.info("Options: #{options.inspect}")
50
+ Stove::Log.info("ARGV: #{@argv.inspect}")
53
51
 
54
52
  # Make a new cookbook object - this will raise an exception if there is
55
53
  # no cookbook at the given path
@@ -62,10 +60,11 @@ module Stove
62
60
  # If we got this far, everything was successful :)
63
61
  @kernel.exit(0)
64
62
  rescue => e
65
- log.error('Stove experienced an error!')
66
- log.error(e.class.name)
67
- log.error(e.message)
68
- log.error(e.backtrace.join("\n"))
63
+ Stove::Log.init($stderr)
64
+ Stove::Log.error('Stove experienced an error!')
65
+ Stove::Log.error(e.class.name)
66
+ Stove::Log.error(e.message)
67
+ Stove::Log.error(e.backtrace.join("\n"))
69
68
 
70
69
  @kernel.exit(e.respond_to?(:exit_code) ? e.exit_code : 500)
71
70
  ensure
data/lib/stove/config.rb CHANGED
@@ -3,7 +3,6 @@ require 'json'
3
3
 
4
4
  module Stove
5
5
  class Config
6
- include Logify
7
6
  include Mixin::Instanceable
8
7
 
9
8
  def method_missing(m, *args, &block)
@@ -69,7 +68,7 @@ module Stove
69
68
 
70
69
  @__raw__
71
70
  rescue Errno::ENOENT => e
72
- log.warn { "No config file found at `#{__path__}'!" }
71
+ Stove::Log.warn { "No config file found at `#{__path__}'!" }
73
72
  @__raw__ = {}
74
73
  end
75
74
  end
@@ -4,8 +4,6 @@ require 'time'
4
4
 
5
5
  module Stove
6
6
  class Cookbook
7
- include Logify
8
-
9
7
  require_relative 'cookbook/metadata'
10
8
 
11
9
  #
@@ -3,9 +3,9 @@ require 'json'
3
3
  module Stove
4
4
  class Cookbook
5
5
  # Borrowed and modified from:
6
- # {https://raw.github.com/opscode/chef/11.4.0/lib/chef/cookbook/metadata.rb}
6
+ # {https://raw.github.com/chef/chef/11.4.0/lib/chef/cookbook/metadata.rb}
7
7
  #
8
- # Copyright:: Copyright 2008-2017 Chef Software, Inc.
8
+ # Copyright:: Copyright 2008-2019 Chef Software, Inc.
9
9
  #
10
10
  # Licensed under the Apache License, Version 2.0 (the "License");
11
11
  # you may not use this file except in compliance with the License.
data/lib/stove/filter.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  module Stove
2
2
  class Filter
3
- include Logify
4
-
5
3
  include Mixin::Insideable
6
4
 
7
5
  #
@@ -49,7 +47,7 @@ module Stove
49
47
  # the cookbook to run this filter against
50
48
  #
51
49
  def run(cookbook, options = {})
52
- log.info(message)
50
+ Stove::Log.info(message)
53
51
  instance = klass.new(cookbook, options)
54
52
 
55
53
  inside(cookbook) do
data/lib/stove/log.rb ADDED
@@ -0,0 +1,25 @@
1
+ #
2
+ # Copyright:: 2019 Chef Software, Inc.
3
+ # License:: Apache License, Version 2.0
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ #
17
+
18
+ require 'mixlib/log'
19
+
20
+ module Stove
21
+ class Log
22
+ extend Mixlib::Log
23
+ Mixlib::Log::Formatter.show_time = false
24
+ end
25
+ end
@@ -5,8 +5,6 @@ require 'zlib'
5
5
 
6
6
  module Stove
7
7
  class Packager
8
- include Logify
9
-
10
8
  ACCEPTABLE_FILES = [
11
9
  '.foodcritic',
12
10
  'README.*',
@@ -1,14 +1,12 @@
1
1
  module Stove
2
2
  class Plugin::Base
3
- include Logify
4
-
5
3
  extend Mixin::Optionable
6
4
  extend Mixin::Validatable
7
5
 
8
6
  class << self
9
7
  def run(description, &block)
10
8
  actions << Proc.new do |instance|
11
- log.info { description }
9
+ Stove::Log.info { description }
12
10
  instance.instance_eval(&block)
13
11
  end
14
12
  end
@@ -16,8 +16,8 @@ module Stove
16
16
  local_sha = git_null("rev-parse #{branch}").strip
17
17
  remote_sha = git_null("rev-parse #{remote}/#{branch}").strip
18
18
 
19
- log.debug("Local SHA: #{local_sha}")
20
- log.debug("Remote SHA: #{remote_sha}")
19
+ Stove::Log.debug("Local SHA: #{local_sha}")
20
+ Stove::Log.debug("Remote SHA: #{remote_sha}")
21
21
 
22
22
  local_sha == remote_sha
23
23
  end
@@ -34,8 +34,8 @@ module Stove
34
34
  private
35
35
 
36
36
  def git(command, errors = true)
37
- log.debug("the command matches")
38
- log.debug("Running `git #{command}', errors: #{errors}")
37
+ Stove::Log.debug("the command matches")
38
+ Stove::Log.debug("Running `git #{command}', errors: #{errors}")
39
39
  Dir.chdir(cookbook.path) do
40
40
  response = %x|git #{command}|
41
41
 
data/lib/stove/runner.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  module Stove
2
2
  class Runner
3
- include Logify
4
-
5
3
  attr_reader :cookbook
6
4
  attr_reader :options
7
5
 
@@ -23,9 +21,9 @@ module Stove
23
21
 
24
22
  def run_plugin(name)
25
23
  if skip?(name)
26
- log.info { "Skipping plugin `:#{name}'" }
24
+ Stove::Log.info { "Skipping plugin `:#{name}'" }
27
25
  else
28
- log.info { "Running plugin `:#{name}'" }
26
+ Stove::Log.info { "Running plugin `:#{name}'" }
29
27
  klass = Plugin.const_get(Util.camelize(name))
30
28
  klass.new(cookbook, options).run
31
29
  end
@@ -1,7 +1,5 @@
1
1
  module Stove
2
2
  class Validator
3
- include Logify
4
-
5
3
  include Mixin::Insideable
6
4
 
7
5
  #
@@ -49,12 +47,12 @@ module Stove
49
47
  # the cookbook to run this validation against
50
48
  #
51
49
  def run(cookbook, options = {})
52
- log.info("Running validations for `#{klass.id}.#{id}'")
50
+ Stove::Log.info("Running validations for `#{klass.id}.#{id}'")
53
51
 
54
52
  inside(cookbook) do
55
53
  instance = klass.new(cookbook, options)
56
54
  unless result = instance.instance_eval(&block)
57
- log.debug("Validation failed, result: #{result.inspect}")
55
+ Stove::Log.debug("Validation failed, result: #{result.inspect}")
58
56
 
59
57
  # Convert the class and id to their magical equivalents
60
58
  error = Error.const_get("#{Util.camelize(klass.id)}#{Util.camelize(id)}ValidationFailed")
@@ -62,7 +60,7 @@ module Stove
62
60
  end
63
61
  end
64
62
 
65
- log.debug("Validation #{id} passed!")
63
+ Stove::Log.debug("Validation #{id} passed!")
66
64
  end
67
65
  end
68
66
  end
data/lib/stove/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stove
2
- VERSION = "7.1.5".freeze
2
+ VERSION = "7.1.6".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-stove
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.5
4
+ version: 7.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-10-18 00:00:00.000000000 Z
12
+ date: 2020-01-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef-api
@@ -26,19 +26,19 @@ dependencies:
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0.5'
28
28
  - !ruby/object:Gem::Dependency
29
- name: logify
29
+ name: mixlib-log
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: '0.2'
34
+ version: '2.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
- version: '0.2'
41
+ version: '2.0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: aruba
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +156,7 @@ files:
156
156
  - lib/stove/cookbook/metadata.rb
157
157
  - lib/stove/error.rb
158
158
  - lib/stove/filter.rb
159
+ - lib/stove/log.rb
159
160
  - lib/stove/mash.rb
160
161
  - lib/stove/mixins/insideable.rb
161
162
  - lib/stove/mixins/instanceable.rb