Skip to content

Commit ad5bafb

Browse files
committed
Add Require Entire Gemfile In A Pry Session as a ruby til
1 parent 1f14a12 commit ad5bafb

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
77
warrant a full blog post. These are mostly things I learn by pairing with
88
smart people at [Hashrocket](http://hashrocket.com/).
99

10-
_432 TILs and counting..._
10+
_433 TILs and counting..._
1111

1212
---
1313

@@ -329,6 +329,7 @@ _432 TILs and counting..._
329329
- [Rake Only Lists Tasks With Descriptions](ruby/rake-only-lists-tasks-with-descriptions.md)
330330
- [Replace The Current Process With An External Command](ruby/replace-the-current-process-with-an-external-command.md)
331331
- [Rendering ERB](ruby/rendering-erb.md)
332+
- [Require Entire Gemfile In Pry Session](ruby/require-entire-gemfile-in-pry-session.md)
332333
- [Returning With Sequel](ruby/returning-with-sequel.md)
333334
- [Running A Single MiniTest Example](ruby/running-a-single-minitest-example.md)
334335
- [Safe Navigation Operator](ruby/safe-navigation-operator.md)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Require Entire Gemfile In Pry Session
2+
3+
Want to experiment in a pry session with some of the gems in your project's
4+
`Gemfile`? You can quickly require all the gems for your project using
5+
Bundler's `#require` method.
6+
7+
Just require `bundler` itself and then execute `Bundler.requie`. Everything
8+
will be loaded in.
9+
10+
```ruby
11+
> require 'bundler'
12+
=> true
13+
> Bundler.require
14+
=> [Gem::Dependency.new("devise", Gem::Requirement.new([">= 0"]), :runtime),
15+
Gem::Dependency.new("rails", Gem::Requirement.new(["= 4.2.5"]), :runtime),
16+
Gem::Dependency.new("pg", Gem::Requirement.new(["~> 0.15"]), :runtime),
17+
...
18+
```

0 commit comments

Comments
 (0)