Skip to content

Commit 898d8ff

Browse files
committed
add a test console
1 parent 0a3858a commit 898d8ff

File tree

5 files changed

+29
-0
lines changed

5 files changed

+29
-0
lines changed

Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ group :benchmarks do
1010
gem 'sequel'
1111
gem 'faker'
1212
end
13+
14+
group :development do
15+
gem 'pry'
16+
end

Gemfile.lock

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ GEM
2525
arel (4.0.0)
2626
atomic (1.1.10)
2727
builder (3.1.4)
28+
coderay (1.0.9)
2829
data_objects (0.10.13)
2930
addressable (~> 2.1)
3031
diff-lcs (1.1.3)
@@ -34,9 +35,14 @@ GEM
3435
faker (1.1.2)
3536
i18n (~> 0.5)
3637
i18n (0.6.4)
38+
method_source (0.8.1)
3739
minitest (4.7.5)
3840
multi_json (1.7.7)
3941
mysql (2.9.1)
42+
pry (0.9.12.2)
43+
coderay (~> 1.0.5)
44+
method_source (~> 0.8)
45+
slop (~> 3.4)
4046
rake (0.9.6)
4147
rake-compiler (0.8.3)
4248
rake
@@ -49,6 +55,7 @@ GEM
4955
diff-lcs (~> 1.1.2)
5056
rspec-mocks (2.8.0)
5157
sequel (4.0.0)
58+
slop (3.4.5)
5259
thread_safe (0.1.0)
5360
atomic
5461
tzinfo (0.3.37)
@@ -63,6 +70,7 @@ DEPENDENCIES
6370
faker
6471
mysql
6572
mysql2!
73+
pry
6674
rake (~> 0.9.3)
6775
rake-compiler (~> 0.8.1)
6876
rspec (~> 2.8.0)

lib/mysql2/console.rb

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Loaded by script/console. Land helpers here.
2+
3+
Pry.config.prompt = lambda do |context, nesting, pry|
4+
"[mysql2] #{context}> "
5+
end

script/bootstrap

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
set -e
3+
4+
cd "$(dirname "$0")/.."
5+
exec bundle install --binstubs --path vendor/gems "$@"

script/console

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# Run a Ruby REPL.
3+
4+
set -e
5+
6+
cd $(dirname "$0")/..
7+
exec ruby -S bin/pry -Ilib -r mysql2 -r mysql2/console

0 commit comments

Comments
 (0)