Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
fail-fast: false
matrix:
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- jruby-9.4
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AllCops:
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 2.7
TargetRubyVersion: 3.2

Bundler/GemFilename:
EnforcedStyle: gems.rb
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Removed

- Drop support for Ruby 3.1 and below (minimum version is now 3.2 for CRuby, 3.1 for JRuby)

## [v1.8.2] (January 14, 2019)

### Added
Expand Down
6 changes: 5 additions & 1 deletion biz.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ Gem::Specification.new do |gem|
gem.files = Dir['lib/**/*', 'README.md']
gem.metadata = {'rubygems_mfa_required' => 'true'}

gem.required_ruby_version = '>= 2.7'
gem.required_ruby_version = if RUBY_PLATFORM.include?('java')
'>= 3.1'
else
'>= 3.2'
end

gem.add_dependency 'clavius', '~> 1.0'
gem.add_dependency 'tzinfo'
Expand Down
4 changes: 2 additions & 2 deletions lib/biz.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class << self

extend Forwardable

def configure(&config)
Thread.current[:biz_schedule] = Schedule.new(&config)
def configure(&)
Thread.current[:biz_schedule] = Schedule.new(&)
end

delegate %i[
Expand Down
4 changes: 2 additions & 2 deletions lib/biz/day_time.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
module Biz
class DayTime

VALID_SECONDS = (0..Time.day_seconds).freeze
VALID_SECONDS = (0..Time.day_seconds)

module Timestamp
FORMAT = '%02d:%02d'
PATTERN =
/\A(?<hour>\d{2}):(?<minute>\d{2}):?(?<second>\d{2})?\Z/.freeze
/\A(?<hour>\d{2}):(?<minute>\d{2}):?(?<second>\d{2})?\Z/
end

include Comparable
Expand Down
4 changes: 2 additions & 2 deletions lib/biz/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class Schedule

extend Forwardable

def initialize(&config)
@configuration = Configuration.new(&config)
def initialize(&)
@configuration = Configuration.new(&)
end

delegate %i[
Expand Down
4 changes: 2 additions & 2 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
expect(configuration.intervals).to eq(
(1..5).map { |wday|
Biz::Interval.new(
Biz::WeekTime.start(week_minute(wday: wday, hour: 9)),
Biz::WeekTime.end(week_minute(wday: wday, hour: 17)),
Biz::WeekTime.start(week_minute(wday:, hour: 9)),
Biz::WeekTime.end(week_minute(wday:, hour: 17)),
TZInfo::Timezone.get('America/New_York')
)
}
Expand Down
11 changes: 5 additions & 6 deletions spec/periods/after_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@

subject(:periods) {
described_class.new(
schedule(
hours: hours,
shifts: shifts,
breaks: breaks,
holidays: holidays,
time_zone: time_zone
schedule(hours:,
shifts:,
breaks:,
holidays:,
time_zone:)
),
origin
)
Expand Down
11 changes: 5 additions & 6 deletions spec/periods/before_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@

subject(:periods) {
described_class.new(
schedule(
hours: hours,
shifts: shifts,
breaks: breaks,
holidays: holidays,
time_zone: time_zone
schedule(hours:,
shifts:,
breaks:,
holidays:,
time_zone:)
),
origin
)
Expand Down
2 changes: 1 addition & 1 deletion spec/periods/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
}

subject(:periods) { described_class.new(schedule(hours: hours)) }
subject(:periods) { described_class.new(schedule(hours:))) }

describe '#after' do
let(:origin) { Time.utc(2006, 1, 3) }
Expand Down
Loading