Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CHORE: Removed deprecations - old style will no longer work

  • Loading branch information...
commit c249a424c753faf4c4ee8ebe88db058ddee7ee7a 1 parent bf9b329
Rudolf Schmidt authored
Showing with 3 additions and 40 deletions.
  1. +1 −9 lib/yell/adapters/datefile.rb
  2. +2 −31 lib/yell/logger.rb
10 lib/yell/adapters/datefile.rb
View
@@ -28,15 +28,7 @@ class Datefile < Yell::Adapters::File
self.keep = options.fetch(:keep, false)
# check whether to symlink the otiginal filename (default false)
- self.symlink = if options.key?(:symlink_original_filename)
- Yell._deprecate( "0.13.3", "Use :symlink for symlinking to original filename",
- :before => "Yell.new { |l| l.adapter :datefile, :symlink_original_filename => true }",
- :after => "Yell.new { |l| l.adapter :datefile, :symlink => true }"
- )
- options.fetch(:symlink_original_filename, false)
- else
- options.fetch(:symlink, false)
- end
+ self.symlink = options.fetch(:symlink, false)
@original_filename = ::File.expand_path options.fetch(:filename, default_filename)
options[:filename] = @original_filename
33 lib/yell/logger.rb
View
@@ -34,7 +34,7 @@ class Logger
# Yell::Logger.new :datefile, 'development.log' do |l|
# l.level = :info
# end
- def initialize( *args, &block )
+ def initialize( *args )
@adapters = []
# extract options
@@ -58,7 +58,7 @@ def initialize( *args, &block )
self.adapter args.pop if args.any?
# eval the given block
- _call( &block ) if block
+ yield(self) if block_given?
# default adapter when none defined
self.adapter :file if @adapters.empty?
@@ -98,21 +98,6 @@ def name=( val )
Yell::Repository[val] = self
end
- # Deprecated: Use attr_reader in future
- def level( val = nil )
- if val.nil?
- @level
- else
- # deprecated, but should still work
- Yell._deprecate( "0.5.0", "Use :level= for setting the log level",
- :before => "Yell::Logger.new { level :info }",
- :after => "Yell::Logger.new { |l| l.level = :info }"
- )
-
- @level = Yell::Level.new( val )
- end
- end
-
# Convenience method for resetting all adapters of the Logger.
def close
@adapters.each(&:close)
@@ -142,20 +127,6 @@ def #{name}( m = nil, o = {}, &b ) # def info( m = nil, o = {}, &b )
private
- def _call( &block )
- if block.arity == 0
- Yell._deprecate( "0.5.0", "Yell::Logger.new with block expects argument now",
- :before => "Yell::Logger.new { adapter STDOUT }",
- :after => "Yell::Logger.new { |l| l.adapter STDOUT }"
- )
-
- # deprecated, but should still work
- instance_eval( &block )
- else
- block.call(self)
- end
- end
-
# The :adapters key may be passed to the options hash. It may appear in
# multiple variations:
#
Please sign in to comment.
Something went wrong with that request. Please try again.