Class: IOS::MessageBank

Inherits:
Object
  • Object
show all
Defined in:
lib/ios/module/setup/MessageBank.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configuratorObject (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_messageObject



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 done_message
  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_bangObject



17
18
19
# File 'lib/ios/module/setup/MessageBank.rb', line 17

def green_bang
  "! ".green
end

#red_bangObject



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_promptObject



9
10
11
# File 'lib/ios/module/setup/MessageBank.rb', line 9

def show_prompt
  print " > ".green
end

#yellow_bangObject



13
14
15
# File 'lib/ios/module/setup/MessageBank.rb', line 13

def yellow_bang
  "! ".yellow
end