Project

rstub

0.0
No commit activity in last 3 years
No release in over 3 years
A gem to stub out pieces of code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.8
~> 10.4
 Project Readme

RStub

Build Status Coverage Status

Install

Run gem install rstub

About

RStub was created for CIS 196 to generate boilerplate homework for students to fill out. It was inspired from the Stubbify module.

Usage

Running rstub homework.rb studentHW on homework.rb, which has the following code:

def add (a, b)
  # add the two input variables
  # STUB
  a + b
  # ENDSTUB
end

Then, the stubs will be removed.

def add (a, b)
  # add the two input variables
end

Any number of files can be provided, and files can be glob patterns like */*.rb. The last argument must be the test directory.

RStub preserves the relative paths of the stubbed files, so ./foo/bar.rb will be copied and stubbed into ./targetDir/foo/bar.rb.

$ rstub rb/homeworkFile1.rb rb/homeworkFile2.rb rb/util/homeworkUtil.rb student-homework
$ rstub "rb/*" student-homework # equivalent with glob pattern
$ tree .
.
├── rb
│   ├── homeworkFile1.rb
│   ├── homeworkFile2.rb
│   └── util
│       └── homeworkUtil.rb
└── student-homework
    └── rb
        ├── homeworkFile1.rb
        ├── homeworkFile2.rb
        └── util
            └── homeworkUtil.rb