Module: Pry::Testable::Utility
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/testable/utility.rb
Instance Method Summary collapse
- #inner_scope ⇒ Object
-
#temp_file(ext = '.rb') {|file| ... } ⇒ void
Creates a Tempfile then unlinks it after the block has yielded.
- #unindent(*args) ⇒ Object
Instance Method Details
#inner_scope ⇒ Object
27 28 29 30 31 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/testable/utility.rb', line 27 def inner_scope catch(:inner_scope) do yield -> { throw(:inner_scope, self) } end end |
#temp_file(ext = '.rb') {|file| ... } ⇒ void
This method returns an undefined value.
Creates a Tempfile then unlinks it after the block has yielded.
16 17 18 19 20 21 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/testable/utility.rb', line 16 def temp_file(ext = '.rb') file = Tempfile.open(['pry', ext]) yield file ensure file.close(true) if file end |
#unindent(*args) ⇒ Object
23 24 25 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/testable/utility.rb', line 23 def unindent(*args) Pry::Helpers::CommandHelpers.unindent(*args) end |