This web application randomly generates tongue-in-cheek class names suitable for object-oriented programming languages.
What it does
Make a request to the server, and it will respond with a randomly-generated class name.
The server can respond with HTML or plain text. Request the path "/index.html" (or just "/") for HTML and "/index.txt" for plain text.
The body of the plain-text response is encoded with UTF-8 and has no boilerplate: simply the class name followed by a line feed character. This allows programs to get class names without having to extract the name from HTML markup.
There are two class name generators: a generic one (example output: PrioritizedUploadWrapper) and one reminiscent of the Spring Framework (example output: RefreshableDataSourceOperationFactoryProxy). The request can supply a "generator" parameter to specify which one to use: "generic" for the generic one and "spring" for the Spring-like one. If the parameter is not supplied, the server will use the generic generator.
- Request "/" and the server will use the generic class name generator and respond with HTML.
- Request "/index.html?generator=generic" and the server will do the same.
- Request "/index.txt?generator=spring" and the server will use the Spring-like class name generator and respond with plain text.
What it's built on
How to run the code
To run the application, you must have Ruby installed on your system. I develop and test with version 2.2.1 of Matz's Ruby Interpreter, the reference implementation.
You must also have some version of the Bundler gem installed. You can probably install it by running "gem install bundler" at the command line.
Once you have these things installed, start a shell, go into the directory containing the source code for this application, and run "bundle install" to install the dependencies.
To run the automated test suite, run "bundle exec rake test".
To run the web application on port 9292, run "bundle exec rackup". Then you can visit http://localhost:9292/ in a web browser and hopefully see the application running.
This was written by Aaron Beckerman, who you can email at email@example.com.
Thanks to Colin Shea for suggesting the plain-text option.
Thanks to Luiz Signorelli and Marta Paciorkowska for suggesting improvements to the generic name generator.
Thanks to Franz Antesberger for suggesting the Spring-style name generator.
This code is distributed under the MIT License (also known as the Expat License). See the LICENSE file for details.