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: 4babcc9d14e923933194a1fea0954df9422dd238eda6b9cbe076cce178ed7cc9
4
- data.tar.gz: b28fa43ea06c34dff7205decd2fb91f0df75ab9baf20be3d347e2f0963d8581e
3
+ metadata.gz: 289f8b64202303e4a5832f9a251847e7a1fb68effb5d849a2173a65371ad13e9
4
+ data.tar.gz: b684583a1633977b5f4da0170bd1f05e61cf127c2614ef0abd367246c50f9427
5
5
  SHA512:
6
- metadata.gz: e8f1e338d56383b8a8edd0524a1cb97785138badb65d96818757ab8fd0732b700a18b8550d65714ab9cbd81b39f7d932f0e6ceac2e41d764240eb56915531eec
7
- data.tar.gz: f41ee31ba0f00e0478dce07a524dad97e03e91dbd530899535e3db0f67f1d72cecc64311ef7635cca832d489a3fb4c99bb76948589f2590507f0885fb43c89b8
6
+ metadata.gz: 77d298d45d4b8ef2e868ab45e63336c19434c7b0fe11dd61daf7e133a1c6c37e1b65ad4c1ad71ee4aac79c1ea96d94f7aa9ad5447aee5fa880a98a0de54f1096
7
+ data.tar.gz: ce389310b9f187525f49dd93d2c674a74e0c14b3388e341be69e1485dd8cc9393acbbd6e2ab706085d68b387b63415b40914e702609031051356a82cc7b3ba79
@@ -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
@@ -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
@@ -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.
@@ -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
@@ -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
 
@@ -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
@@ -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: 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