Class: Poxy::Generator
- Inherits:
-
Object
- Object
- Poxy::Generator
- Defined in:
- lib/poxy/generator.rb
Instance Method Summary collapse
-
#initialize(arguments) ⇒ Generator
constructor
A new instance of Generator.
- #install ⇒ Object
- #remove ⇒ Object
- #run ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(arguments) ⇒ Generator
Returns a new instance of Generator.
5 6 7 |
# File 'lib/poxy/generator.rb', line 5 def initialize(arguments) @subcommand = arguments.first end |
Instance Method Details
#install ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/poxy/generator.rb', line 29 def install if poxy_files_already_exist? puts "Poxy files already installed, doing nothing." else install_files puts "Poxy files installed to poxy/" end end |
#remove ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/poxy/generator.rb', line 38 def remove if poxy_files_already_exist? remove_poxy_directory puts "Poxy was successfully removed." else puts "No existing poxy installation. Doing nothing." end end |
#run ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/poxy/generator.rb', line 9 def run if @subcommand == "install" install elsif @subcommand == "update" update elsif @subcommand == "remove" remove end end |
#update ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/poxy/generator.rb', line 19 def update if poxy_files_already_exist? remove_poxy_directory install_files puts "Poxy files updated." else puts "No existing poxy installation. Doing nothing." end end |