RStub
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
endThen, the stubs will be removed.
def add (a, b)
# add the two input variables
endAny 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