Skip to content

Commit 249f035

Browse files
committed
v1.0.0 - Prep for release, fix docs, add max ActiveRecord version
1 parent 88ad0f7 commit 249f035

File tree

8 files changed

+28
-8
lines changed

8 files changed

+28
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/spec/reports/
88
/tmp/
99
.rspec_status
10+
*.gem

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,13 @@ Pre-release.
2727

2828
Add nil handling.
2929
Refactor options and add testing for them.
30+
31+
## 1.0.0 : 2022-08-29
32+
33+
Release.
34+
35+
Add setter override to write flags as flag values.
36+
Add YARD docs.
37+
Standardize output to symbols.
38+
Add validation of the attribute - less_than: 1 << flags.size
39+
Add max ActiveRecord version to protect against future breaking releases

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PATH
22
remote: .
33
specs:
4-
bitmask_enum (0.4.0)
5-
activerecord (>= 4.2)
4+
bitmask_enum (1.0.0)
5+
activerecord (>= 4.2, <= 7.0)
66

77
GEM
88
remote: https://rubygems.org/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ The method returns an array of all the defined flags. The items will be symbols.
173173

174174
**Return value:** `array` - array of defined flags. E.g. `[:flag_one, :flag_two]`
175175

176+
## Manual testing
177+
178+
This gem has been tested and found to be generally functional with the following combinations: (but it should work with any combination of Ruby 2.4+ and Rails 4.2+, theoretically it could go lower but those are already 8 years old so I felt it was sufficient.)
179+
180+
- Ruby 2.4.10 & Rails 4.2.11.3
181+
- Ruby 2.6.10 & Rails 4.2.11.3
182+
- Ruby 2.6.10 & Rails 5.2.8.1
183+
- Ruby 3.1.2 & Rails 7.0.3.1
184+
176185
## Contributing
177186

178187
Bug reports and pull requests are welcome on GitHub at https://github.com/lucygilbert/bitmask_enum. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

bitmask_enum.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
1616

1717
raise 'RubyGems 2+ required to guard against public gem pushes' unless spec.respond_to?(:metadata)
1818

19-
spec.metadata['allowed_push_host'] = 'TODO: Set to http://mygemserver.com'
19+
spec.metadata['allowed_push_host'] = 'https://rubygems.org/'
2020
spec.metadata['homepage_uri'] = spec.homepage
2121
spec.metadata['source_code_uri'] = spec.homepage
2222
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
2929

3030
spec.required_ruby_version = '>= 2.4'
3131

32-
spec.add_dependency 'activerecord', '>= 4.2'
32+
spec.add_dependency 'activerecord', '>= 4.2', '<=7.0'
3333
spec.add_development_dependency 'bundler', '~> 1.17'
3434
spec.add_development_dependency 'rake', '~> 10.0'
3535
spec.add_development_dependency 'rspec', '~> 3.0'

lib/bitmask_enum/nil_handler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def initialize(handling_option)
99
end
1010

1111
# Handles nil when evaling the attribute
12-
# @param [String] Name of the attribute
12+
# @param attribute [String] Name of the attribute
1313
# @return [String] Code string to handle a nil attribute according to the handling option
1414
def in_attribute_eval(attribute)
1515
select_handling(
@@ -19,7 +19,7 @@ def in_attribute_eval(attribute)
1919
end
2020

2121
# Handles nil for an array of values for the attribute
22-
# @param [Array] Array of integers representing values of the attribute
22+
# @param array [Array] Array of integers representing values of the attribute
2323
# @return [Array] Array of integers representing values of the attribute, now corrected for nil values
2424
def in_array(array)
2525
select_handling(

lib/bitmask_enum/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module BitmaskEnum
4-
VERSION = '0.4.0'
4+
VERSION = '1.0.0'
55
end

spec/bitmask_enum_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RSpec.describe BitmaskEnum do
44
it 'has a version number' do
5-
expect(BitmaskEnum::VERSION).to eq '0.4.0'
5+
expect(BitmaskEnum::VERSION).to eq '1.0.0'
66
end
77

88
context 'when the definition is valid' do

0 commit comments

Comments
 (0)