Skip to content

Commit

Permalink
add a test console
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Jul 15, 2013
1 parent 0a3858a commit 898d8ff
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ group :benchmarks do
gem 'sequel'
gem 'faker'
end

group :development do
gem 'pry'
end
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ GEM
arel (4.0.0)
atomic (1.1.10)
builder (3.1.4)
coderay (1.0.9)
data_objects (0.10.13)
addressable (~> 2.1)
diff-lcs (1.1.3)
Expand All @@ -34,9 +35,14 @@ GEM
faker (1.1.2)
i18n (~> 0.5)
i18n (0.6.4)
method_source (0.8.1)
minitest (4.7.5)
multi_json (1.7.7)
mysql (2.9.1)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rake (0.9.6)
rake-compiler (0.8.3)
rake
Expand All @@ -49,6 +55,7 @@ GEM
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
sequel (4.0.0)
slop (3.4.5)
thread_safe (0.1.0)
atomic
tzinfo (0.3.37)
Expand All @@ -63,6 +70,7 @@ DEPENDENCIES
faker
mysql
mysql2!
pry
rake (~> 0.9.3)
rake-compiler (~> 0.8.1)
rspec (~> 2.8.0)
Expand Down
5 changes: 5 additions & 0 deletions lib/mysql2/console.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Loaded by script/console. Land helpers here.

Pry.config.prompt = lambda do |context, nesting, pry|
"[mysql2] #{context}> "
end
5 changes: 5 additions & 0 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
set -e

cd "$(dirname "$0")/.."
exec bundle install --binstubs --path vendor/gems "$@"
7 changes: 7 additions & 0 deletions script/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
# Run a Ruby REPL.

set -e

cd $(dirname "$0")/..
exec ruby -S bin/pry -Ilib -r mysql2 -r mysql2/console

0 comments on commit 898d8ff

Please sign in to comment.