• Stars
    star
    139
  • Rank 262,954 (Top 6 %)
  • Language
    Ruby
  • Created over 12 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Enhances your Ruby REPL. Supports rails, mongoid, rspec and cucumber

Installation

Prerequisites: rvm or rbenv.

To install, run

git clone git://github.com/nviennot/irb-config.git ~/.irb
cd ~/.irb
make install

make install installs all the required gems for all your installed rubies. When installing a new ruby, please make update in the ~/.irb directory.

Updates

To update the repository and all the gems, run

make update

What is it ?

Watch the screencast

Watch the screencast!

It packages:

This way you can switch back and forth from the development environment and the test environment, which is what the rspec/cucumber commands do.

How to use

  • All the goodies are automatically loaded into your rails console.
  • Use the rspec command pretty much like the usual one.
  • Use the cucumber command pretty much like the usual one.
  • Use the rake, test, generate, destroy, update commands as usual.
  • Type help to see the Pry help.

Notes

  • All the gems from your global gemset can be loaded bypassing Bundler.
  • The RSpec/Cucumber context run with your test environment, including your test database settings. Furthermore, whenever you run the rspec command, all your classes are reloaded with reload!.

Vim Integration

With the Screen plugin, you can communicate with screen/tmux to send some commands. I find these one particularly useful:

command -nargs=? -complete=shellcmd W  :w | :call ScreenShellSend("load '".@%."';")
map <Leader>c :ScreenShellVertical bundle exec rails c<CR>
map <Leader>r :w<CR> :call ScreenShellSend("rspec ".@% . ':' . line('.'))<CR>
map <Leader>e :w<CR> :call ScreenShellSend("cucumber --format=pretty ".@% . ':' . line('.'))<CR>
map <Leader>b :w<CR> :call ScreenShellSend("break ".@% . ':' . line('.'))<CR>

This is setup in my Vim configuration.

Assuming you have a tmux session with vim and the rails console:

  • :W saves and reloads the current file in the console.
  • ,c opens a tmux pane with a rails console.
  • ,r saves the file and run the rspec test corresponding to the cursor line.
  • ,e saves the file and run the cucumber test corresponding to the cursor line.
  • ,b puts a break point on the current line

License

irb config is released under the MIT license.

More Repositories

1

core-to-core-latency

Measures the latency between CPU cores
Jupyter Notebook
1,078
star
2

playdrone

Google Play Crawler
Ruby
420
star
3

stm32-emulator

Rust
358
star
4

jd-core-java

Java Library for JD-Core, a java decompiler
Java
257
star
5

turbo-resin

Open-source firmware for resin printers
Rust
210
star
6

android-checkin

Pretends to be a phone to get a legit android_id
Java
133
star
7

rspec-console

Run RSpec tests in your rails console
Ruby
101
star
8

reversing-mono4k

Reverse engineering of the Anycubic Mono 4K
BASIC
79
star
9

easy-finance

Personal finance accounting tool
JavaScript
79
star
10

vim-config

The Vim config I use
Vim Script
46
star
11

tmux-config

The tmux config I use
Makefile
45
star
12

mongoid_lazy_migration

Lazy Migrate your MongoDB documents to avoid downtime
Ruby
34
star
13

playdrone-kitchen

Kitchen for the Google Play Crawler cluster
Ruby
27
star
14

nginx-tcp-keepalive

Nginx TCP Keepalive configuration module
C
21
star
15

zsh-vim-plugin

Shell
20
star
16

tinyusb-sys-rs

Rust wrapper for the TinyUSB library
Rust
17
star
17

objc-tracer

Objective-C method call tracer
C
15
star
18

libscribe

Scribe user-space library
C
12
star
19

py-scribe

Scribe python bindings and Scribe userspace tools
Python
9
star
20

run_as_exe

C
8
star
21

tests-scribe

Test suite for Scribe
C
6
star
22

youtube-audio

Web service to stream the audio out of a youtube video in real time
Ruby
4
star
23

symbol_decoration

Support for Ruby symbol decorations such as where(:field.in => [1,2,3])
Ruby
3
star
24

stm32-gpio-monitor

Monitor the GPIO of a STM32 live
Rust
3
star
25

cflat

C Flat compiler
OCaml
3
star
26

cucumber-console

Run Cucumber tests in your console
Ruby
3
star
27

rails-env-switcher

Switch from a Rails environment to another
Ruby
3
star
28

thesis

My PhD thesis
TeX
2
star
29

abricot

Fast cloud command dispatcher tool with Redis pub/sub
Ruby
2
star
30

libssh

fork of libssh (bug fixes)
C
2
star
31

candy-crusher

Bot for candy crush
Ruby
2
star
32

edeliver-build-docker

docker image for edeliver
2
star
33

velvetpulse

My blog
CSS
1
star
34

mongoid-colors

Colorize your Mongoid traces
Ruby
1
star
35

synapse-benchmark

Ruby
1
star