Class: IOS::MessageBank
- Inherits:
-
Object
- Object
- IOS::MessageBank
- Defined in:
- lib/ios/module/setup/MessageBank.rb
Instance Attribute Summary collapse
-
#configurator ⇒ Object
readonly
Returns the value of attribute configurator.
Instance Method Summary collapse
- #done_message ⇒ Object
- #green_bang ⇒ Object
-
#initialize(config) ⇒ MessageBank
constructor
A new instance of MessageBank.
- #red_bang ⇒ Object
- #run_command(command, output_command = nil) ⇒ Object
- #show_prompt ⇒ Object
- #yellow_bang ⇒ Object
Constructor Details
#initialize(config) ⇒ MessageBank
Returns a new instance of MessageBank.
5 6 7 |
# File 'lib/ios/module/setup/MessageBank.rb', line 5 def initialize(config) @configurator = config end |
Instance Attribute Details
#configurator ⇒ Object (readonly)
Returns the value of attribute configurator.
3 4 5 |
# File 'lib/ios/module/setup/MessageBank.rb', line 3 def configurator @configurator end |
Instance Method Details
#done_message ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ios/module/setup/MessageBank.rb', line 32 def puts "" puts "Projeto criado com " + "Sucesso".green puts Dir.pwd if Dir.exist? "Example" Dir.chdir "Example" do puts "Caso deseja abrir o projeto de Exemplo, digite " + "[" + "Y".underlined.yellow + "es]".yellow answer = STDIN.gets.downcase.chomp answer = "yes" if answer == "y" if answer.to_sym == :yes run_command "open 'Example.xcworkspace'" end end end end |
#green_bang ⇒ Object
17 18 19 |
# File 'lib/ios/module/setup/MessageBank.rb', line 17 def green_bang "! ".green end |
#red_bang ⇒ Object
21 22 23 |
# File 'lib/ios/module/setup/MessageBank.rb', line 21 def red_bang "! ".red end |
#run_command(command, output_command = nil) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/ios/module/setup/MessageBank.rb', line 25 def run_command command, output_command = nil output_command ||= command puts " " + output_command.magenta system command end |
#show_prompt ⇒ Object
9 10 11 |
# File 'lib/ios/module/setup/MessageBank.rb', line 9 def show_prompt print " > ".green end |
#yellow_bang ⇒ Object
13 14 15 |
# File 'lib/ios/module/setup/MessageBank.rb', line 13 def yellow_bang "! ".yellow end |