enum_ish 1.6.0 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9578ab7ba6e720321c8706fabc463af41bcd7244e24d65ff736943a197abdc9b
4
- data.tar.gz: 69b73002c3b790e6a737db306fadfb411e418c1ed5e25faf53a96c57f9f44582
3
+ metadata.gz: b9ba2d3bf75254c8f3254a3724f7445e88624da78b10fc2bef8a8bfcc1824677
4
+ data.tar.gz: 757fb848eb78f79a97b419a789622d467d14f8aece08f38e042c64823ac782de
5
5
  SHA512:
6
- metadata.gz: 955eb532c9bc238d8721589240bf600412e679f97b6d0c782f2b34916db04dbd757b389f551fa32605516216a5031730ac37c9778df9ff947cd81825c74e7cf7
7
- data.tar.gz: ba5eabfa271493a71ea0d08950b674662535df79a37386b4b59b46000e365ed95f8175946edbd2236310de21b16fb6de3af827766b61db35f3d16820e56cdaf9
6
+ metadata.gz: c9245c499e7a19f8d25941573e04f76828815fd3cb8842faf9e8a6428ee09092d1bea871f1d080fb2e1b2a47b89ce178816e76244f763f4ad9b72176eca4a6fc
7
+ data.tar.gz: 1c953c8ab828e06929b3cb118ac72000a0355eb00e7600cc4aa2abc14183734a715dc90963ce961f61d56fe341f7891b5d4ba4b73d8468bd471c35f48e96ea4d
@@ -4,27 +4,61 @@ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  test:
7
- runs-on: ubuntu-18.04
7
+ runs-on: ubuntu-22.04
8
8
  strategy:
9
9
  fail-fast: false
10
10
  matrix:
11
- ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0]
12
- gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61']
11
+ ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3]
12
+ gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70', 'rails71']
13
13
  exclude:
14
14
  - ruby: 2.3
15
15
  gemfile: rails60
16
16
  - ruby: 2.3
17
17
  gemfile: rails61
18
+ - ruby: 2.3
19
+ gemfile: rails70
20
+ - ruby: 2.3
21
+ gemfile: rails71
18
22
  - ruby: 2.4
19
23
  gemfile: rails60
20
24
  - ruby: 2.4
21
25
  gemfile: rails61
26
+ - ruby: 2.4
27
+ gemfile: rails70
28
+ - ruby: 2.4
29
+ gemfile: rails71
30
+ - ruby: 2.5
31
+ gemfile: rails70
32
+ - ruby: 2.5
33
+ gemfile: rails71
34
+ - ruby: 2.6
35
+ gemfile: rails70
36
+ - ruby: 2.6
37
+ gemfile: rails71
22
38
  - ruby: 3.0
23
39
  gemfile: rails50
24
40
  - ruby: 3.0
25
41
  gemfile: rails51
26
42
  - ruby: 3.0
27
43
  gemfile: rails52
44
+ - ruby: 3.1
45
+ gemfile: rails50
46
+ - ruby: 3.1
47
+ gemfile: rails51
48
+ - ruby: 3.1
49
+ gemfile: rails52
50
+ - ruby: 3.2
51
+ gemfile: rails50
52
+ - ruby: 3.2
53
+ gemfile: rails51
54
+ - ruby: 3.2
55
+ gemfile: rails52
56
+ - ruby: 3.3
57
+ gemfile: rails50
58
+ - ruby: 3.3
59
+ gemfile: rails51
60
+ - ruby: 3.3
61
+ gemfile: rails52
28
62
 
29
63
  name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
30
64
 
@@ -32,7 +66,7 @@ jobs:
32
66
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
33
67
 
34
68
  steps:
35
- - uses: actions/checkout@v2
69
+ - uses: actions/checkout@v4
36
70
  - uses: ruby/setup-ruby@v1
37
71
  with:
38
72
  ruby-version: ${{ matrix.ruby }}
data/.gitignore CHANGED
@@ -4,7 +4,7 @@ Gemfile.lock
4
4
  coverage/
5
5
  gemfiles/*.lock
6
6
  pkg/
7
- spec/dummy/db/*.sqlite3
7
+ spec/dummy/db/*.sqlite3*
8
8
  spec/dummy/log/*.log
9
9
  spec/dummy/tmp/*
10
10
  tmp/
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.6.2
4
+
5
+ * Add `frozen_string_literal: true`.
6
+
7
+ ## 1.6.1
8
+
9
+ * Support activerecord 7.0.
10
+
3
11
  ## 1.6.0
4
12
 
5
13
  * Add `EnumIsh.config.defaults` which allows to set default options for `enum_ish`.
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.0.0"
4
4
  gem "sqlite3", "~> 1.3.6"
5
+ gem "loofah", "~> 2.19.1"
5
6
 
6
7
  gemspec path: "../"
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.1.0"
4
4
  gem "sqlite3", "~> 1.3.6"
5
+ gem "loofah", "~> 2.19.1"
5
6
 
6
7
  gemspec path: "../"
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 5.2.0"
4
4
  gem "sqlite3", "~> 1.3.6"
5
+ gem "loofah", "~> 2.19.1"
5
6
 
6
7
  gemspec path: "../"
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 6.0.0"
4
+ gem "sqlite3", "~> 1.4.0"
5
+ gem "psych", "~> 3.3.0"
4
6
 
5
7
  gemspec path: "../"
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 6.1.0"
4
+ gem "sqlite3", "~> 1.4.0"
4
5
 
5
6
  gemspec path: "../"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 7.0.1"
4
+ gem "sqlite3", "~> 1.4.0"
5
+
6
+ gemspec path: "../"
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem "rails", "~> 7.1.0"
4
+ gem "sqlite3", "~> 1.6.6"
5
+
6
+ gemspec path: "../"
@@ -26,14 +26,18 @@ module EnumIsh
26
26
  enum.mapping.fetch(value, value)
27
27
  end
28
28
 
29
- args =
30
- if ActiveRecord.version > Gem::Version.new('6.1.0.a')
31
- [enum.name]
32
- else
33
- [enum.name, :enum]
29
+ if ActiveRecord.version > Gem::Version.new('7.0.0.a')
30
+ attribute(enum.name) do |subtype|
31
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
32
+ end
33
+ elsif ActiveRecord.version > Gem::Version.new('6.1.0.a')
34
+ decorate_attribute_type(enum.name) do |subtype|
35
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
36
+ end
37
+ else
38
+ decorate_attribute_type(enum.name, :enum) do |subtype|
39
+ EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
34
40
  end
35
- decorate_attribute_type(*args) do |subtype|
36
- EnumIsh::ActiveRecordEnumType.new(enum.name, enum.mapping, subtype)
37
41
  end
38
42
  end
39
43
  end
data/lib/enum_ish/base.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative 'enum'
2
4
  require_relative 'dictionary'
3
5
  require_relative 'errors'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EnumIsh
2
4
  class DictionaryLookup
3
5
  def initialize(klass, enum, options = {})
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EnumIsh
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enum_ish
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshikazu Kaneta
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-23 00:00:00.000000000 Z
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -115,6 +115,8 @@ files:
115
115
  - gemfiles/rails52.gemfile
116
116
  - gemfiles/rails60.gemfile
117
117
  - gemfiles/rails61.gemfile
118
+ - gemfiles/rails70.gemfile
119
+ - gemfiles/rails71.gemfile
118
120
  - lib/enum_ish.rb
119
121
  - lib/enum_ish/active_record_definer.rb
120
122
  - lib/enum_ish/active_record_enum_type.rb
@@ -130,7 +132,7 @@ files:
130
132
  homepage: https://github.com/kanety/enum_ish
131
133
  licenses: []
132
134
  metadata: {}
133
- post_install_message:
135
+ post_install_message:
134
136
  rdoc_options: []
135
137
  require_paths:
136
138
  - lib
@@ -145,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
147
  - !ruby/object:Gem::Version
146
148
  version: '0'
147
149
  requirements: []
148
- rubygems_version: 3.1.6
149
- signing_key:
150
+ rubygems_version: 3.3.3
151
+ signing_key:
150
152
  specification_version: 4
151
153
  summary: A ruby and rails extension to generate enum-like methods
152
154
  test_files: []