familia 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 969b9307f36ebcbc6174af20be7b408260daaaf1a273a366f45a20cde7cb6243
4
- data.tar.gz: 9ce626f524f4208902d887dbe3bab701573e55c4a5cc6a64c1c7ff5e35b3b2f2
3
+ metadata.gz: f31819ffd924bb211c9e1e09768aeb026f95f135ae820e6f97948fa6e95bb475
4
+ data.tar.gz: dccb8cb66025a0990dec762b7ea7ef50e4ae48ad02476e33fa6f01910e0dc50f
5
5
  SHA512:
6
- metadata.gz: 81caa35023632653f04f11e4f457fc3a6a0e9865cb361372a1f98644eefb12f956eb86ee1d911d7e0f17d8000e2cabd9faa9f23050668de652359997e42cbca3
7
- data.tar.gz: d2e1bb0cfaa6af02a0475985355f873d85b1f13a5f54cecb5a92db95f408a57c502e1323db29a80a60ab262879a41d1aec89982fe9f517b01a59ec4df2e54723
6
+ metadata.gz: 24173fa04960a2a0e14fee55e616b8b2ca172ec761afcbf76f1b7b6a0512cd30c5d2f57763f07d64584582d7fcb613fa7401c33e201c888a85e505a601d86af2
7
+ data.tar.gz: 6c1f92d8f1fe3e97226bdba409c85bf91c6a04295132c3f04d0dfc1670459e048c03bd120c97f8f96f58e7e6f4a13782497379eab960b81b489b096768c165bf
data/Gemfile CHANGED
@@ -11,5 +11,5 @@ group :development, :test do
11
11
  gem 'rubocop', require: false
12
12
  gem 'rubocop-performance', require: false
13
13
  gem 'rubocop-thread_safety', require: false
14
- gem 'tryouts', '~> 2.4', require: false
14
+ gem 'tryouts', '~> 3.2', require: false
15
15
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- familia (1.1.0.pre.rc1)
4
+ familia (1.2.3)
5
+ logger
5
6
  redis (>= 4.8.1, < 6.0)
6
7
  stringio (~> 3.1.1)
7
8
  uri-redis (~> 1.3)
@@ -13,29 +14,65 @@ GEM
13
14
  byebug (11.1.3)
14
15
  coderay (1.1.3)
15
16
  connection_pool (2.4.1)
16
- drydock (0.6.9)
17
+ date (3.4.1)
18
+ diff-lcs (1.6.2)
19
+ erb (5.0.2)
20
+ io-console (0.8.1)
21
+ irb (1.15.2)
22
+ pp (>= 0.6.0)
23
+ rdoc (>= 4.0.0)
24
+ reline (>= 0.4.2)
17
25
  json (2.7.2)
18
26
  language_server-protocol (3.17.0.3)
27
+ logger (1.7.0)
19
28
  method_source (1.1.0)
29
+ minitest (5.25.5)
20
30
  parallel (1.25.1)
21
31
  parser (3.3.4.0)
22
32
  ast (~> 2.4.1)
23
33
  racc
34
+ pastel (0.8.0)
35
+ tty-color (~> 0.5)
36
+ pp (0.6.2)
37
+ prettyprint
38
+ prettyprint (0.2.0)
39
+ prism (1.4.0)
24
40
  pry (0.14.2)
25
41
  coderay (~> 1.1)
26
42
  method_source (~> 1.0)
27
43
  pry-byebug (3.10.1)
28
44
  byebug (~> 11.0)
29
45
  pry (>= 0.13, < 0.15)
46
+ psych (5.2.6)
47
+ date
48
+ stringio
30
49
  racc (1.8.0)
31
50
  rainbow (3.1.1)
51
+ rdoc (6.14.2)
52
+ erb
53
+ psych (>= 4.0.0)
32
54
  redis (5.2.0)
33
55
  redis-client (>= 0.22.0)
34
56
  redis-client (0.22.2)
35
57
  connection_pool
36
58
  regexp_parser (2.9.2)
59
+ reline (0.6.2)
60
+ io-console (~> 0.5)
37
61
  rexml (3.3.2)
38
62
  strscan
63
+ rspec (3.13.1)
64
+ rspec-core (~> 3.13.0)
65
+ rspec-expectations (~> 3.13.0)
66
+ rspec-mocks (~> 3.13.0)
67
+ rspec-core (3.13.5)
68
+ rspec-support (~> 3.13.0)
69
+ rspec-expectations (3.13.5)
70
+ diff-lcs (>= 1.2.0, < 2.0)
71
+ rspec-support (~> 3.13.0)
72
+ rspec-mocks (3.13.5)
73
+ diff-lcs (>= 1.2.0, < 2.0)
74
+ rspec-support (~> 3.13.0)
75
+ rspec-support (3.13.4)
39
76
  rubocop (1.65.0)
40
77
  json (~> 2.3)
41
78
  language_server-protocol (>= 3.17.0)
@@ -55,14 +92,19 @@ GEM
55
92
  rubocop-thread_safety (0.5.1)
56
93
  rubocop (>= 0.90.0)
57
94
  ruby-progressbar (1.13.0)
58
- storable (0.10.0)
59
95
  stringio (3.1.1)
60
96
  strscan (3.1.0)
61
- sysinfo (0.10.0)
62
- drydock (< 1.0)
63
- storable (~> 0.10)
64
- tryouts (2.4.1)
65
- sysinfo (~> 0.10)
97
+ tryouts (3.2.1)
98
+ irb
99
+ minitest (~> 5.0)
100
+ pastel (~> 0.8)
101
+ prism (~> 1.0)
102
+ rspec (~> 3.0)
103
+ tty-cursor (~> 0.7)
104
+ tty-screen (~> 0.8)
105
+ tty-color (0.6.0)
106
+ tty-cursor (0.7.1)
107
+ tty-screen (0.8.2)
66
108
  unicode-display_width (2.5.0)
67
109
  uri-redis (1.3.0)
68
110
 
@@ -78,7 +120,7 @@ DEPENDENCIES
78
120
  rubocop
79
121
  rubocop-performance
80
122
  rubocop-thread_safety
81
- tryouts (~> 2.4)
123
+ tryouts (~> 3.2)
82
124
 
83
125
  BUNDLED WITH
84
126
  2.5.13
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :MAJOR: 1
3
3
  :MINOR: 2
4
- :PATCH: 2
4
+ :PATCH: 3
data/familia.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = Gem::Requirement.new('>= 2.7.8')
21
21
 
22
+ spec.add_dependency 'logger'
22
23
  spec.add_dependency 'redis', '>= 4.8.1', '< 6.0'
23
24
  spec.add_dependency 'stringio', '~> 3.1.1'
24
25
  spec.add_dependency 'uri-redis', '~> 1.3'
@@ -138,12 +138,12 @@ module Familia
138
138
  # # Method implementation
139
139
  # end
140
140
  #
141
- define_method :"#{name}!" do |*args|
141
+ if method_defined?(:"#{name}!")
142
+ warn "Method #{name}! is already defined for #{self}"
143
+ return
144
+ end
142
145
 
143
- if method_defined?(:"#{name}!")
144
- warn "Method #{name}! is already defined for #{self}"
145
- return
146
- end
146
+ define_method :"#{name}!" do |*args|
147
147
 
148
148
  # Check if the correct number of arguments is provided (exactly one).
149
149
  raise ArgumentError, "wrong number of arguments (given #{args.size}, expected 0 or 1)" if args.size > 1
@@ -51,26 +51,26 @@ raw_data
51
51
  puts "Config after refresh:"
52
52
  puts @test_obj.config.inspect
53
53
  puts "Config class: "
54
- [@test_obj.config.class, @test_obj.config.inspect]
55
- #=> [Hash, "{:theme=>\"dark\", :notifications=>true, :settings=>{:volume=>80}}"]
54
+ [@test_obj.config.class, @test_obj.config]
55
+ #=> [Hash, {theme: "dark", notifications: true, settings: {volume: 80}}]
56
56
 
57
57
  ## Test 5: Array should be deserialized back to Array
58
58
  puts "Tags after refresh:"
59
59
  puts @test_obj.tags.inspect
60
60
  puts "Tags class: #{@test_obj.tags.class}"
61
61
  @test_obj.tags.inspect
62
- @test_obj.tags.class
62
+ @test_obj.tags
63
63
  #=> ["ruby", "redis", "json", "familia"]
64
- #=> Array
64
+ #=:> Array
65
65
 
66
66
  ## Test 6: Simple string should remain a string (this works correctly)
67
67
  puts "Simple after refresh:"
68
68
  puts @test_obj.simple.inspect
69
69
  puts "Simple class: #{@test_obj.simple.class}"
70
70
  @test_obj.simple.inspect
71
- @test_obj.simple.class
71
+ @test_obj.simple
72
72
  #=> "just a string"
73
- #=> String
73
+ #=:> String
74
74
 
75
75
  ## Demonstrate the asymmetry:
76
76
  puts "\n=== ASYMMETRY DEMONSTRATION ==="
@@ -13,7 +13,7 @@ end
13
13
  @test_obj = SymbolizeTest.new
14
14
  @test_obj.id = "symbolize_test_1"
15
15
 
16
- ## Test with a hash containing string keys
16
+ # Test with a hash containing string keys
17
17
  @test_hash = { "name" => "John", "age" => 30, "nested" => { "theme" => "dark" } }
18
18
  @test_obj.config = @test_hash
19
19
  @test_obj.save
@@ -58,6 +58,7 @@ end
58
58
  @symbol_result[:name]
59
59
  #=> "John"
60
60
 
61
+ ## Check name as a string
61
62
  @string_result["name"]
62
63
  #=> "John"
63
64
 
@@ -92,5 +93,5 @@ end
92
93
  @test_obj.deserialize_value('invalid json')
93
94
  #=> "invalid json"
94
95
 
95
- ## Clean up
96
+
96
97
  @test_obj.destroy!
@@ -5,15 +5,14 @@ require_relative './test_helpers'
5
5
 
6
6
  Familia.debug = false
7
7
 
8
- # Error handling: object without proper identifier setup
9
8
  class ::BadIdentifierTest < Familia::Horreum
9
+ # Error handling: object without proper identifier setup
10
10
  # No identifier method defined - should cause issues
11
11
  end
12
12
 
13
13
  @bad_obj = ::BadIdentifierTest.new
14
14
 
15
- # Test polymorphic string usage for Familia objects
16
- @customer_id = 'customer-string-coercion-test'
15
+ @customer_id = 'customer-string-coercion-test' # Test polymorphic string usage for Familia objects
17
16
  @customer = Customer.new(@customer_id)
18
17
  @customer.name = 'John Doe'
19
18
  @customer.planid = 'premium'
@@ -25,8 +24,7 @@ end
25
24
  @session.useragent = 'Test Browser'
26
25
  @session.save
27
26
 
28
- ## Complex identifier test with array-based identifier
29
- @bone = Bone.new
27
+ @bone = Bone.new # Complex identifier test with array-based identifier
30
28
  @bone.token = 'test_token'
31
29
  @bone.name = 'test_name'
32
30
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: familia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: redis
14
28
  requirement: !ruby/object:Gem::Requirement