Class: Commandable::AppController
- Inherits:
-
Object
- Object
- Commandable::AppController
- Extended by:
- Commandable
- Defined in:
- lib/commandable/app_controller.rb
Overview
A helper to display the read me file and generate an example app
Constant Summary
Constants included from Commandable
Class Method Summary collapse
-
.error ⇒ Object
Causes an error so you can see what it will look like if you have an error in your code.
-
.examples(path = "./examples") ⇒ Object
Copies the test classes to a folder so you can see a bunch of small examples.
- .readme ⇒ Object
-
.v ⇒ Object
(also: version)
Version.
Methods included from Commandable
[], class_cache, clear_commands, commands, each, execute, execution_queue, help, parse_arguments, parse_optional, readline, reset_all, reset_colors, reset_screen_clearing
Class Method Details
.error ⇒ Object
Causes an error so you can see what it will look like if you have an error in your code.
26 27 28 |
# File 'lib/commandable/app_controller.rb', line 26 def error raise Exception, "An example of what an error looks like if you make a mistake using Commandable." end |
.examples(path = "./examples") ⇒ Object
Copies the test classes to a folder so you can see a bunch of small examples
20 21 22 |
# File 'lib/commandable/app_controller.rb', line 20 def examples(path="./examples") copy_dir(File.(File.dirname(__FILE__) + '/../../spec/source_code_examples'),path) end |
.readme ⇒ Object
14 15 16 |
# File 'lib/commandable/app_controller.rb', line 14 def readme `open #{File.expand_path((File.dirname(__FILE__) + '/../../readme.md'))}` end |
.v ⇒ Object Also known as: version
Version
32 33 34 |
# File 'lib/commandable/app_controller.rb', line 32 def v puts "Commandable: #{Commandable::VERSION}" end |