Skip to content

Commit 4aeeba8

Browse files
committed
Add console to project
This allows an easy way to get an IRB/pry session with a client
1 parent f0ab87a commit 4aeeba8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Rakefile

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ require "rubocop/rake_task"
44

55
task default: :test
66

7+
desc "Open an irb/pry session"
8+
task :console do
9+
exec "bin/console"
10+
end
11+
712
namespace :test do
813
RuboCop::RakeTask.new
914

bin/console

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env ruby
2+
ENV["APP_KIND"] = "console"
3+
APP_ROOT = File.realdirpath(File.expand_path("..", __dir__))
4+
$LOAD_PATH.unshift(APP_ROOT)
5+
6+
require "irb"
7+
require "lib/quickpay/api/client"
8+
9+
CLIENT = QuickPay::API::Client.new
10+
11+
ARGV.clear
12+
IRB.start

0 commit comments

Comments
 (0)