Skip to content

Commit b2524e9

Browse files
Merge pull request #121 from basecamp/replace-byebug-with-debug
Set up ruby/debug in place of byebug
2 parents 6e4f77c + 61fcb63 commit b2524e9

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,2 +1 @@
11
*.gem
2-
.byebug_history

Gemfile

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

55
gem "rake"
6-
gem "byebug"
6+
gem "debug", ">= 1.0.0"

Gemfile.lock

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,20 @@ GEM
6969
tzinfo (~> 2.0)
7070
zeitwerk (~> 2.3)
7171
builder (3.2.4)
72-
byebug (11.1.3)
7372
concurrent-ruby (1.1.8)
7473
connection_pool (2.4.1)
7574
crass (1.0.6)
75+
debug (1.8.0)
76+
irb (>= 1.5.0)
77+
reline (>= 0.3.1)
7678
erubi (1.10.0)
7779
globalid (0.4.2)
7880
activesupport (>= 4.2.0)
7981
i18n (1.8.10)
8082
concurrent-ruby (~> 1.0)
83+
io-console (0.6.0)
84+
irb (1.7.1)
85+
reline (>= 0.3.0)
8186
loofah (2.9.0)
8287
crass (~> 1.0.2)
8388
nokogiri (>= 1.5.9)
@@ -131,6 +136,8 @@ GEM
131136
redis-client (>= 0.9.0)
132137
redis-client (0.14.1)
133138
connection_pool
139+
reline (0.3.6)
140+
io-console (~> 0.5)
134141
sprockets (4.0.2)
135142
concurrent-ruby (~> 1.0)
136143
rack (> 1, < 3)
@@ -152,7 +159,7 @@ PLATFORMS
152159
x86_64-darwin
153160

154161
DEPENDENCIES
155-
byebug
162+
debug (>= 1.0.0)
156163
kredis!
157164
rails (>= 6.0.0)
158165
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)