Skip to content

Commit 79c0a97

Browse files
committed
Merge branch 'main' into rubocop
* main: Update Readme on local development and debugging Set up ruby/debug in place of byebug for dev and test
2 parents b74a089 + b2524e9 commit 79c0a97

File tree

6 files changed

+38
-5
lines changed

6 files changed

+38
-5
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*.gem
2-
.byebug_history
32
.rubocop-*

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source "https://rubygems.org"
33
gemspec
44

55
gem "rake"
6-
gem "byebug"
6+
gem "debug", ">= 1.0.0"
77
gem "rubocop"
88
gem "rubocop-minitest"
99
gem "rubocop-packaging"

Gemfile.lock

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,20 @@ GEM
7070
zeitwerk (~> 2.3)
7171
ast (2.4.2)
7272
builder (3.2.4)
73-
byebug (11.1.3)
7473
concurrent-ruby (1.1.8)
7574
connection_pool (2.4.1)
7675
crass (1.0.6)
76+
debug (1.8.0)
77+
irb (>= 1.5.0)
78+
reline (>= 0.3.1)
7779
erubi (1.10.0)
7880
globalid (0.4.2)
7981
activesupport (>= 4.2.0)
8082
i18n (1.8.10)
8183
concurrent-ruby (~> 1.0)
84+
io-console (0.6.0)
85+
irb (1.7.1)
86+
reline (>= 0.3.0)
8287
json (2.6.3)
8388
language_server-protocol (3.17.0.3)
8489
loofah (2.9.0)
@@ -140,6 +145,8 @@ GEM
140145
redis-client (0.14.1)
141146
connection_pool
142147
regexp_parser (2.8.1)
148+
reline (0.3.6)
149+
io-console (~> 0.5)
143150
rexml (3.2.5)
144151
rubocop (1.54.1)
145152
json (~> 2.3)
@@ -190,7 +197,7 @@ PLATFORMS
190197
x86_64-darwin
191198

192199
DEPENDENCIES
193-
byebug
200+
debug (>= 1.0.0)
194201
kredis!
195202
rails (>= 6.0.0)
196203
rake

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,29 @@ config.kredis.connector = ->(config) { SomeRedisProxy.new(config) }
259259

260260
By default Kredis will use `Redis.new(config)`.
261261

262+
## Development
263+
264+
A development console is available by running `bin/console`.
265+
266+
From there, you can experiment with Kredis. e.g.
267+
268+
```rb
269+
>> str = Kredis.string "mystring"
270+
Kredis (0.1ms) Connected to shared
271+
=>
272+
#<Kredis::Types::Scalar:0x0000000134c7d938
273+
...
274+
>> str.value = "hello, world"
275+
Kredis Proxy (2.4ms) SET mystring ["hello, world"]
276+
=> "hello, world"
277+
>> str.value
278+
```
279+
280+
Run tests with `bin/test`.
281+
282+
[`debug`](https://github.com/ruby/debug) can be used in the development console and in the test suite by inserting a
283+
breakpoint, e.g. `debugger`.
284+
262285
## License
263286

264287
Kredis is released under the [MIT License](https://opensource.org/licenses/MIT).

bin/console

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ require "bundler/inline"
55

66
gemfile do
77
source "https://rubygems.org"
8+
9+
gem "debug", ">= 1.0.0"
10+
811
gem "kredis", path: "../"
912
end
1013

14+
require "debug"
1115

1216
Kredis.configurator = Class.new { def config_for(name) { db: "2" } end }.new
1317
ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT)

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require "active_support/test_case"
33
require "active_support/testing/autorun"
44
require "minitest/mock"
5-
require "byebug"
5+
require "debug"
66

77
require "kredis"
88

0 commit comments

Comments
 (0)