---
title: "Allow pasting multiline ruby blocks in Pry when using leading dot notation"
description: "We use leading dot notation a lot now e.g."
canonical: https://oozou.com/til/allow-pasting-multiline-ruby-blocks-in-pry-when-using-leading-dot-notation-116
locale: en
date: 2021-04-30
topic: ruby
---

# Allow pasting multiline ruby blocks in Pry when using leading dot notation

> We use leading dot notation a lot now e.g.

Published: 2021-04-30 · Topic: [ruby](https://oozou.com/til-topics/ruby) ([markdown](https://oozou.com/til-topics/ruby.md))

We use leading dot notation a lot now e.g.

```ruby
Foo
  .bar
  .baz
```

If you copy and paste this into a Pry REPL it throws an error because it doesn't know how to parse it. I thought this was because Pry was parsing differently to IRB but it's actually because Pry has a feature to call system methods by prefixing them with a dot. To be able to copy paste code like this you can simply remove the Pry commands

```ruby
Pry.commands.delete /\.(.*)/
```

---

Contact OOZOU: hello@oozou.com · +66 2544 0000 · https://oozou.com/contact

More for AI agents: https://oozou.com/llms.txt · every page has a markdown twin at its URL plus ".md"
