Class: Rubex::Cli
- Inherits:
-
Thor
- Object
- Thor
- Rubex::Cli
- Defined in:
- lib/rubex/cli.rb
Overview
Cli for rubex using Thor(whatisthor.com/)
Instance Method Summary collapse
Instance Method Details
#generate(file) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rubex/cli.rb', line 13 def generate(file) if (force = [:force]) directory = ([:dir] ? [:dir].to_s : Dir.pwd) + "/#{Rubex::Compiler.extract_target_name(file)}" STDOUT.puts "Warning! you are about to replace contents in the directory '#{directory}', Are you sure? [Yn] " confirmation = STDIN.gets.chomp force = (confirmation == 'Y') end Rubex::Compiler.compile file, target_dir: [:dir], force: force, make: [:install], debug: [:debug] end |