Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make local ruby pry work #5718

Merged
merged 5 commits into from Feb 8, 2019
Merged

Commits on Jan 18, 2019

  1. Make local ruby debugging work

    This follows a similar change for local python invocation at https://github.com/serverless/serverless/blob/ad5decb080a7aa92cac1bc0f8632e3e57b99fe46/lib/plugins/aws/invokeLocal/invoke.py#L76-L82
    
    A handler such as the following will now pause at the breakpoint:
    
    ```ruby
    require 'json'
    require 'pry'
    
    def hello(event:, context:)
      binding.pry # breakpoint
      { statusCode: 200, body: JSON.generate('Go Serverless v1.0! Your function executed successfully!') }
    end
    ```
    jkburges committed Jan 18, 2019
    Copy the full SHA
    1530af2 View commit details
    Browse the repository at this point in the history
  2. Don't add newlines to echoed input

    Prior to this, debug output would look something like the following:
    
    ```
    [1] pry(Kernel)>
    f
    o
    o
    
    =
    
    "
    f
    o
    o
    "
    
    => "foo"
    
    [2] pry(Kernel)>
    ```
    
    i.e. there's a newline being added after each character is entered, making things somewhat difficult to read.
    jkburges committed Jan 18, 2019
    Copy the full SHA
    e30e242 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2019

  1. Copy the full SHA
    3bfc724 View commit details
    Browse the repository at this point in the history
  2. Revert "Don't add newlines to echoed input"

    This reverts commit e30e242.
    
    This breaks a couple of tests which are depending on:
    
        serverless.cli.consoleLog.lastCall.args[0]
    
    being set.
    
    Also, it introduces an inconsistency c.f. invokeLocalPython et al.
    
    I think here, consistency and passing tests trumps the slight annoyance of each input charact appearing on a new line. At least, for the moment and until a better way is found.
    jkburges committed Jan 22, 2019
    Copy the full SHA
    f490cb5 View commit details
    Browse the repository at this point in the history

Commits on Feb 7, 2019

  1. Copy the full SHA
    8012780 View commit details
    Browse the repository at this point in the history