Class: Phper::CLI
- Inherits:
-
CommandLineUtils::CLI
- Object
- CommandLineUtils::CLI
- Phper::CLI
- Includes:
- Phper
- Defined in:
- lib/phper/cli.rb
Instance Attribute Summary collapse
-
#out ⇒ Object
Returns the value of attribute out.
Instance Method Summary collapse
- #dispatch(cmd, cmd_argv) ⇒ Object
-
#initialize {|_self| ... } ⇒ CLI
constructor
A new instance of CLI.
- #version ⇒ Object
Methods included from Phper
#decode, #encode, #git_remote, #git_remotes, #git_root, #in_git?, #name_of_key
Constructor Details
Instance Attribute Details
#out ⇒ Object
Returns the value of attribute out.
6 7 8 |
# File 'lib/phper/cli.rb', line 6 def out @out end |
Instance Method Details
#dispatch(cmd, cmd_argv) ⇒ Object
13 14 15 16 |
# File 'lib/phper/cli.rb', line 13 def dispatch(cmd,cmd_argv) raise "Unknown command. #{cmd}" unless @commands.commands.include?(cmd) @commands.send(cmd.gsub(/:/,"_")) end |
#version ⇒ Object
17 18 19 20 21 22 |
# File 'lib/phper/cli.rb', line 17 def version File.open(File.join(File.dirname(__FILE__) , "..","..","VERSION"),"r") { |file| @out.puts file.gets } end |