amazon-archives / aws-sdk-core-ruby

This repository has moved to the master branch of aws/aws-sdk-ruby
https://github.com/aws/aws-sdk-ruby
243 stars 57 forks source link

Add `console` rake task #202

Closed ktheory closed 9 years ago

ktheory commented 9 years ago

A convenient way to open a REPL with the current directory’s aws-sdk library loaded (relying on the load path setup at the top of the Rakefile).

Use pry if available, and fall back to irb.

Example:

$ rake console
[1] pry(main)> Aws::VERSION
=> "2.0.21"

# IRB (pry is not installed)
$ rake console
irb(main):001:0> Aws::VERSION
=> "2.0.21"

@trevorrowe not sure how widely useful this is...but it's a big part of my dev workflow.

:neckbeard: + :shower: + :necktie: = :bowtie:

trevorrowe commented 9 years ago

Are you aware of the bundled REPL? The aws-sdk-core gem ships with a aws.rb binary that will load a console, enable logging and responds to some helpful flags.

$ aws.rb -h
Usage: aws-rb [options]
        --region NAME                specify the AWS region, e.g. us-west-2
        --repl REPL                  specify the repl environment, pry or irb
    -e 'command'                     one line of script. Several -e's allowed.
    -l, --[no-]log                   log client requets, on by default
    -c, --[no-]color                 colorize request logging, on by default
    -d, --[no-]debug                 log HTTP wire traces, off by default
    -Idirectory                      specify $LOAD_PATH directory (may be used more than once)
    -rlibrary                        require the library
    -v, --verbose                    enable client logging and HTTP wire tracing
    -q, --quiet                      disable client logging and HTTP wire tracing
    -h, --help

If you are working in a checkout of the repo, you can use the bundled repl via

$ ./aws-sdk-core/bin/aws.rb
trevorrowe commented 9 years ago

Also, I'm cleaning up pull-requests as the repository has recently moved to aws/aws-sdk-ruby as part of the v2 stable release. Please feel free to continue the discussion there or in the gitter channel: http://gitter.im/aws/aws-sdk-ruby

ktheory commented 9 years ago

Thanks! I wasn't aware of bin/aws.rb.

On Feb 5, 2015, at 5:26 PM, Trevor Rowe notifications@github.com wrote:

Are you aware of the bundled REPL? The aws-sdk-core gem ships with a aws.rb binary that will load a console, enable logging and responds to some helpful flags.

$ aws.rb -h Usage: aws-rb [options] --region NAME specify the AWS region, e.g. us-west-2 --repl REPL specify the repl environment, pry or irb -e 'command' one line of script. Several -e's allowed. -l, --[no-]log log client requets, on by default -c, --[no-]color colorize request logging, on by default -d, --[no-]debug log HTTP wire traces, off by default -Idirectory specify $LOAD_PATH directory (may be used more than once) -rlibrary require the library -v, --verbose enable client logging and HTTP wire tracing -q, --quiet disable client logging and HTTP wire tracing -h, --help If you are working in a checkout of the repo, you can use the bundled repl via

$ ./aws-sdk-core/bin/aws.rb — Reply to this email directly or view it on GitHub.