Skip to content

Commit

Permalink
Merge pull request #6 from umbrellio/feature/support-for-ruby-27
Browse files Browse the repository at this point in the history
Support for Ruby 2.7
  • Loading branch information
0exp authored Jan 24, 2020
2 parents 82eb79b + 5bf7a23 commit bea8a55
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rvm:
- 2.4
- 2.5
- 2.6
- 2.7
- ruby-head

before_install: gem install bundler
Expand Down
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [0.4.0] - 2020-01-24
### Added
- Support for Ruby 2.7

## [0.3.0] - 2019-02-02
### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018-2019 Dmitry Gubitskiy
Copyright (c) 2018-2020 Dmitry Gubitskiy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Logger class patch for hourly log rotation support

## Requirements

Ruby 2.3, 2.4, 2.5 or 2.6
Ruby 2.3, 2.4, 2.5, 2.6 or 2.7

## Installation

Expand Down
10 changes: 9 additions & 1 deletion lib/hourly_logger_rotator/patch/ruby_2_4.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ module Patch
module Ruby_2_4 # rubocop:disable Naming/ClassAndModuleCamelCase
SiD = Logger::Period::SiD

def initialize(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix: nil)
# rubocop:disable Lint/UnusedMethodArgument
def initialize(
log = nil,
shift_age: nil,
shift_size: nil,
shift_period_suffix: nil,
binmode: nil
)
@dev = @filename = @shift_age = @shift_size = @shift_period_suffix = nil
mon_initialize
set_dev(log)
Expand All @@ -21,6 +28,7 @@ def initialize(log = nil, shift_age: nil, shift_size: nil, shift_period_suffix:
end
end
end
# rubocop:enable Lint/UnusedMethodArgument

def next_rotate_time(now, shift_age)
case shift_age
Expand Down
13 changes: 13 additions & 0 deletions lib/hourly_logger_rotator/patch/ruby_2_7.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

require "hourly_logger_rotator/patch/ruby_2_4"

module HourlyLoggerRotator
module Patch
# rubocop:disable Naming/ClassAndModuleCamelCase
module Ruby_2_7
# rubocop:enable Naming/ClassAndModuleCamelCase
include Ruby_2_4
end
end
end
2 changes: 1 addition & 1 deletion lib/hourly_logger_rotator/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module HourlyLoggerRotator
VERSION = "0.3.0"
VERSION = "0.4.0"
end

0 comments on commit bea8a55

Please sign in to comment.