Skip to content

Commit

Permalink
fix(build): ensure Klogger::VERSION is set correctly in built gems
Browse files Browse the repository at this point in the history
This requires "klogger/version" by default, and also includes any
VERSION from in the repository when building the gem, to ensure that
"Klogger::VERSION" has the correct value. Previously it would always end
up returning "0.0.0.dev".
  • Loading branch information
jimeh committed Jul 25, 2023
1 parent 40a0cec commit 5e3bfba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
Gemfile.lock
VERSION
3 changes: 2 additions & 1 deletion klogger-logger.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Gem::Specification.new do |s|
s.required_ruby_version = '>= 2.6'
s.homepage = 'https://github.com/krystal/klogger'
s.version = Klogger::VERSION
s.files = Dir.glob('{lib}/**/*')
s.files = Dir.glob(File.join('{lib}', '**', '*')) +
Dir['{README.*,*LICENSE*,VERSION}']
s.require_paths = ['lib']
s.authors = ['Adam Cooke']
s.email = ['adam@krystal.uk']
Expand Down
5 changes: 4 additions & 1 deletion lib/klogger/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

require 'logger'
require 'securerandom'

require 'concurrent/atomic/thread_local_var'

require 'klogger/formatters/json'
require 'klogger/formatters/simple'
require 'klogger/formatters/go'
require 'concurrent/atomic/thread_local_var'
require 'klogger/group_set'
require 'klogger/version'

module Klogger
class Logger < ::Logger
Expand Down

0 comments on commit 5e3bfba

Please sign in to comment.