Project

pry-memory

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
PRy extension for automated naming of everything that you type in console.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9
~> 10.0
~> 3.3.0

Runtime

~> 0.10.0
 Project Readme

Pry::Memory

A tiny gem for automated naming of stuff typed in the console:

[1] pry(main)> a = > 1
=> 1
[2] pry(main)> b = > 2
=> 2
[3] pry(main)> c = > 3
=> 3
[4] pry(main)> d = > a + b + c
=> 6
[5] pry(main)> e = >

Installation

Add this line to your application's Gemfile:

gem 'pry-memory'

And then execute:

$ bundle

Or install it yourself as:

$ gem install pry-memory

Usage

This gem will be automatically required with require 'pry' once you put into your Gemfile.

Configuration

Put this to your .pryrc file (bundler is not available in .pryrc, so we have to require the gem manually):

require 'pry/memory'
Pry::Memory.start(:abc)

And run pry.

Customization

:abc is a stupid name of strategy that generates lower case letters (a,b,c,...). Also the gem has a pre-defined strategy :a1a2 that generates (a1,a2,a3,...):

[1] pry(main)> a1 = > 1
=> 1
[2] pry(main)> a2 = > 2
=> 2
[3] pry(main)> a3 = > 3
=> 3
[4] pry(main)> a4 = > a1 + a2 + a3

(Activate it by writting Pry::Memory.start(:a1a2))

You can write your own strategy:

Pry::Memory.start do |counter|
  # generate a variable name here
  # you can use counter here, but it's not necessary at all
  # in fact, you can generate a random letters here
  # or even random words :)
end

If you still don't get what's going in this section, check out this file

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/pry-memory/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request