coactive 0.5.0 → 0.5.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: e7c25e57f4b9e1c2519945529c1026470f77faa37a59753789e6c821270a3bfd
4
- data.tar.gz: 447682aaf62af161dbdc3ac8d2a7bebdf5a39ae78a106e6163b86b916e0f69b9
3
+ metadata.gz: 947921155ded7f486743447e61abf8274b0d4cbc174e7f7f3d394e3b9ce11f65
4
+ data.tar.gz: 00625fcccb57c5643e3f0580c3dd94a2159ddcdc5accde3e81f87fdbaf0efd36
5
5
  SHA512:
6
- metadata.gz: 9e4df828d91f088d1b99784bc7456cc160633b66961431e36dcb5fba5994659718cde602b4433b4510517daf29a63b4af733e7218aa5cd27066415c8efe92456
7
- data.tar.gz: 99aa8892d8a1f6324e5e587d13e44259088badc9ab923cd6969c0b746d7c3a8b1bb834827117569f75782c243de4fe43d5324025eb247cff27f04ff04a8fce05
6
+ metadata.gz: 629ce46d9b1817a04e1c74a7d20d7764ec89ba7e1930f937b4495d60c0eaa96e1c98b752b29f863860a4440ef53edecaeaf706b88b81d1409a79f0381491fe3d
7
+ data.tar.gz: 9f116e4e9cb323fc79d3db488619364dddebd2064d75d1652a9032a587fbc9bdf404a932f8fac14f58b725d473a61a00d0f4d7196f7daa8b6e9fad0bbe73c760
@@ -4,12 +4,12 @@ on: [push, pull_request]
4
4
 
5
5
  jobs:
6
6
  test:
7
- runs-on: ubuntu-20.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', 3.1, 3.2]
12
- gemfile: ['rails50', 'rails51', 'rails52', 'rails60', 'rails61', 'rails70']
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
@@ -17,16 +17,24 @@ jobs:
17
17
  gemfile: rails61
18
18
  - ruby: 2.3
19
19
  gemfile: rails70
20
+ - ruby: 2.3
21
+ gemfile: rails71
20
22
  - ruby: 2.4
21
23
  gemfile: rails60
22
24
  - ruby: 2.4
23
25
  gemfile: rails61
24
26
  - ruby: 2.4
25
27
  gemfile: rails70
28
+ - ruby: 2.4
29
+ gemfile: rails71
26
30
  - ruby: 2.5
27
31
  gemfile: rails70
32
+ - ruby: 2.5
33
+ gemfile: rails71
28
34
  - ruby: 2.6
29
35
  gemfile: rails70
36
+ - ruby: 2.6
37
+ gemfile: rails71
30
38
  - ruby: 3.0
31
39
  gemfile: rails50
32
40
  - ruby: 3.0
@@ -45,6 +53,12 @@ jobs:
45
53
  gemfile: rails51
46
54
  - ruby: 3.2
47
55
  gemfile: rails52
56
+ - ruby: 3.3
57
+ gemfile: rails50
58
+ - ruby: 3.3
59
+ gemfile: rails51
60
+ - ruby: 3.3
61
+ gemfile: rails52
48
62
 
49
63
  name: ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}
50
64
 
@@ -52,7 +66,7 @@ jobs:
52
66
  BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
53
67
 
54
68
  steps:
55
- - uses: actions/checkout@v3
69
+ - uses: actions/checkout@v4
56
70
  - uses: ruby/setup-ruby@v1
57
71
  with:
58
72
  ruby-version: ${{ matrix.ruby }}
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.5.2
4
+
5
+ * Add `frozen_string_literal: true`.
6
+
7
+ ## 0.5.1
8
+
9
+ * Fix max length of inspected string.
10
+ * Fix inspect of nil.
11
+ * Fix inspect of objects with id or attributes.
12
+
3
13
  ## 0.5.0
4
14
 
5
15
  * Simplify inspect of context.
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 6.0.0"
4
+ gem "sqlite3", "~> 1.4.0"
4
5
 
5
6
  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: "../"
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gem "rails", "~> 7.0.1"
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.1.0"
4
+ gem "sqlite3", "~> 1.6.6"
5
+
6
+ gemspec path: "../"
@@ -7,7 +7,7 @@ module Coactive
7
7
  class_attribute :max_num, :max_length, :basic_classes
8
8
  self.max_num = 3
9
9
  self.max_length = 100
10
- self.basic_classes = [Module, Symbol, String, Numeric, TrueClass, FalseClass, Regexp]
10
+ self.basic_classes = [Module, Symbol, String, Numeric, TrueClass, FalseClass, NilClass, Regexp]
11
11
 
12
12
  def call(data)
13
13
  if data.is_a?(Array)
@@ -36,11 +36,22 @@ module Coactive
36
36
  end
37
37
 
38
38
  def inspect_basic(data)
39
- data.inspect
39
+ inspected = data.inspect
40
+ if inspected.length > max_length
41
+ inspected[0..max_length] + '...'
42
+ else
43
+ inspected
44
+ end
40
45
  end
41
46
 
42
47
  def inspect_object(data)
43
- "#<#{data.class}:#{data.object_id}>"
48
+ if data.respond_to?(:id)
49
+ "#<#{data.class}/#{data.id}>"
50
+ elsif data.respond_to?(:attributes) && (attributes = data.attributes).is_a?(Hash)
51
+ "#<#{data.class} #{inspect_hash(attributes)}>"
52
+ else
53
+ "#<#{data.class}:#{data.object_id}>"
54
+ end
44
55
  end
45
56
  end
46
57
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coactive
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.2'
5
5
  end
data/lib/coactive.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support'
2
4
 
3
5
  require 'coactive/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coactive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.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: 2023-07-25 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
@@ -118,6 +118,7 @@ files:
118
118
  - gemfiles/rails60.gemfile
119
119
  - gemfiles/rails61.gemfile
120
120
  - gemfiles/rails70.gemfile
121
+ - gemfiles/rails71.gemfile
121
122
  - lib/coactive.rb
122
123
  - lib/coactive/base.rb
123
124
  - lib/coactive/coactants.rb
@@ -145,7 +146,7 @@ files:
145
146
  homepage: https://github.com/kanety/coactive
146
147
  licenses: []
147
148
  metadata: {}
148
- post_install_message:
149
+ post_install_message:
149
150
  rdoc_options: []
150
151
  require_paths:
151
152
  - lib
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  version: '0'
162
163
  requirements: []
163
164
  rubygems_version: 3.3.3
164
- signing_key:
165
+ signing_key:
165
166
  specification_version: 4
166
167
  summary: Make classes coactive
167
168
  test_files: []