valkey-objects 0.4.8 → 0.5.0

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: 1bff1543f882229f211fa61e3c86b372c9a1aa2847db1775d53a3d97e1dfdc74
4
- data.tar.gz: af2d8421208fae7af41d748ffa3e8cab093fc6d61898f395daff15ab84d50dd2
3
+ metadata.gz: d49af322f308f1198814c35b6ebf232f6ef1d74c1b463e86266fa1b615732fd4
4
+ data.tar.gz: d103edca7b0a92a4658677e233142df4f5a9e976d3ee52cfd3bfa57093088b0a
5
5
  SHA512:
6
- metadata.gz: 53b7f59cb71b020cac52cd6ccc72127520001d79a5368a3e706a22089db28aaa0b75d62f0eaaba44cb105cb92b2628ed26e3353d2e58f4dd43559d12688a2d8c
7
- data.tar.gz: 84c030763ee5c46698b9ea80f9b4bcd1f889aca82af932a88f0714507bf2f67b9790bcafd2f07b67537371b9a0d35b4ba222d3ab856630fa6e51e9d10a7b2e54
6
+ metadata.gz: 43ad7391f93e204795c2a9151250396e332b8dd042361146ee54d30868c083ec687b49e5a2e0f50d88b14a6f58dc3b87d9505449a98665eed9da40ba0c2ec572
7
+ data.tar.gz: 34cf2362b197da87609c64183e9dbbc8f345d3441373cec4836c82029ee8fffe8a0bf054729a23654b40bd1ced3948f96b8bcefd98903fdfff99c5ec031a5752
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2024-10-18
3
+ ## [0.1.0] - 2025-11-18
4
4
 
5
5
  - Initial release
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at xorgnak@xorgnak.com. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in valkey-objects.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,25 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ valkey-objects (0.4.9)
5
+ redis
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ connection_pool (2.5.4)
11
+ rake (13.0.6)
12
+ redis (5.4.1)
13
+ redis-client (>= 0.22.0)
14
+ redis-client (0.25.1)
15
+ connection_pool
16
+
17
+ PLATFORMS
18
+ x86_64-linux
19
+
20
+ DEPENDENCIES
21
+ rake (~> 13.0)
22
+ valkey-objects!
23
+
24
+ BUNDLED WITH
25
+ 2.3.15
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 TODO: Write your name
3
+ Copyright (c) 2025 Erik Olson
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,97 +1,50 @@
1
- # ValKey Objects
2
- Based upon the redis-objects library, VK allows for ValKey backed ruby objects.
1
+ ## Installation
3
2
 
4
- ## installation
5
- ```
6
- gem install valkey-objects
7
- ```
3
+ Install the gem and add to the application's Gemfile by executing:
8
4
 
9
- ## usage
5
+ $ bundle add valkey-objects
10
6
 
11
- ### simple
12
- ```
13
- require 'valkey/objects'
14
- class ValKey
15
- # 1. include valkey-objects layer
16
- include VK
17
- # 2. stitch your object together.
18
- value :myvalue
19
- counter :mycounter
20
- hashkey :myhash
21
- sortedset :mysortedset
22
- set :myset
23
- queue :myqueue
24
- place :myplace
25
- pipe :mypipe
26
- toggle :mytoggle
27
- # 3. define @id in initialize.
28
- def initialize k
29
- @id = k
30
- end
31
- # other stuff...
32
- end
7
+ If bundler is not being used to manage dependencies, install the gem by executing:
33
8
 
34
- @x = ValKey.new("My Special Valkey object.")
35
- @x.mypipe.on { |msg| puts %[MSG]; ap msg }
36
- @x.mypipe << "Pipe Connected!"
37
- @x.myvalue.value = "Hello, World"
38
- @x.mycounter.value = 1.2345
39
- @x.myhash[:key] = "Value"
40
- @x.mysortedset["my other key"] = 9.8
41
- @x.mysortedset.poke "my key", @x.mysortedset["my other key"]
42
- @x.mysortedset.value { |i, e| puts %[Sorted Sets: i: #{i} e: #{e}] }
43
- @x.myset << "my member"
44
- @x.myset << "my new member"
45
- h = @x.myset[/ new /]
46
- @x.myset.value { |i, e| puts %[Sets: i: #{i} e: #{e}] }
47
- @x.myplace.add "Palermo", 13.361389, 38.115556
48
- @x.myplace.add "Catania", 15.087269, 37.502669
49
- distance = @x.myplace.distance "Palermo", "Catania"
50
- places = @x.myplace.radius 15.087269, 37.502669, 5000
51
- @x.myplace.value { |i, e| puts %[Places: i: #{i} e: #{e}] }
52
- ```
9
+ $ gem install valkey-objects
53
10
 
54
- ### advanced
55
- ```
56
- class Game
57
- include VK
58
- sortedset :points
59
- def initialize k
60
- @id = k
61
- end
62
- def score p, h={ points: 1 }
63
- self.points.poke p, h[:points]
64
- end
65
- end
66
-
67
- @game = Hash.new { |h,k| h[k] = Game.new(k) }
68
- ```
11
+ ## Usage
69
12
 
70
- ### modular
71
- ```
72
- module X
73
- @@X = Hash.new { |h,k| h[k] = Ex.new(k) }
74
- class Ex
75
- include VK
76
- set :stuff
77
- pipe :ear
78
- def initialize k
79
- @id = k
80
- end
81
- end
82
- def self.keys
83
- @@X.keys
84
- end
85
- def self.[] k
86
- if !@@X.has_key?(k)
87
- @@X[k].ear.on { |msg| puts "MSG[#{k}]:"; ap msg }
88
- end
89
- @@X[k]
90
- end
13
+ ```ruby
14
+ class X
15
+ include ValkeyObjects
16
+ value :myValue
17
+ counter :myCounter
18
+ list :myList
19
+ set :mySet
20
+ hash_key :myHash
21
+ sorted_set :mySortedSet
91
22
  end
92
23
 
93
- X['Aaa'].ear << %[A]
94
- X['Bbb'].ear << %[B]
95
- X['Ccc'].ear << %[C]
96
-
24
+ @user = X.new
25
+ @user.myValue.value = "Alice"
26
+ @user.myValue.value #=> "Alice"
27
+
28
+ @user.myCounter.increment
29
+ @user.myCounter.decrement
30
+ @user.myCounter.increment 1
31
+ @user.myCounter.decrement 2
32
+ @user.myCounter.to_i #=> -1
33
+
34
+ @user.myList << "item"
35
+ @user.myList << "this"
36
+ @user.myList[1] #=> "this"
37
+ @user.myList[1] = "next"
38
+ @user.myList.shift
39
+ @user.myList.to_a #=> ["next"]
40
+ @user.myList.knn #=> values as KNN object
41
+
42
+ @user.mySet << "one"
43
+ @user.mySet << "two"
44
+ @user.mySet.members
45
+ @user.mySet.knn #=> members as KNN object
46
+
47
+ @user.myHash[:key] = "value"
48
+ @user.myHash[:key] #=> "value"
49
+ @user.myHash.to_h
97
50
  ```
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Valkey
4
4
  module Objects
5
- VERSION = "0.4.8"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end