Class: Pod::Command::IPC::Repl
- Inherits:
-
IPC
- Object
- IPC
- Pod::Command::IPC::Repl
- Includes:
- ProjectDirectory
- Defined in:
- lib/cocoapods/command/ipc/repl.rb
Constant Summary collapse
- END_OF_OUTPUT_SIGNAL =
"\n\r".freeze
Instance Method Summary collapse
- #execute_repl_command(repl_command) ⇒ Object
- #listen ⇒ Object
- #print_version ⇒ Object
- #run ⇒ Object
- #signal_end_of_output ⇒ Object
Instance Method Details
#execute_repl_command(repl_command) ⇒ Object
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/cocoapods/command/ipc/repl.rb', line 38 def execute_repl_command(repl_command) unless repl_command == '\n' repl_commands = repl_command.split subcommand = repl_commands.shift.capitalize arguments = repl_commands subcommand_class = Pod::Command::IPC.const_get(subcommand) subcommand_class.new(CLAide::ARGV.new(arguments)).run signal_end_of_output end end |
#listen ⇒ Object
32 33 34 35 36 |
# File 'lib/cocoapods/command/ipc/repl.rb', line 32 def listen while repl_command = STDIN.gets execute_repl_command(repl_command) end end |
#print_version ⇒ Object
23 24 25 |
# File 'lib/cocoapods/command/ipc/repl.rb', line 23 def print_version output_pipe.puts "version: '#{Pod::VERSION}'" end |
#run ⇒ Object
17 18 19 20 21 |
# File 'lib/cocoapods/command/ipc/repl.rb', line 17 def run print_version signal_end_of_output listen end |
#signal_end_of_output ⇒ Object
27 28 29 30 |
# File 'lib/cocoapods/command/ipc/repl.rb', line 27 def signal_end_of_output output_pipe.puts(END_OF_OUTPUT_SIGNAL) STDOUT.flush end |