Created
February 10, 2016 18:41
-
-
Save rattrayalex/6c80a1e6d220d236a2ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[{:a=>1, :b=>2, :c=>[3, 4, 5]}, 6, 7]" | |
] | |
}, | |
"execution_count": 1, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"h = [{a: 1, b: 2, c: [3, 4, 5]}, 6, 7]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"true" | |
] | |
}, | |
"execution_count": 2, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"require \"awesome_print\"" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[{:a=>1, :b=>2, :c=>[3, 4, 5]}, 6, 7]" | |
] | |
}, | |
"execution_count": 3, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"h" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
":output_value" | |
] | |
}, | |
"execution_count": 4, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"AwesomePrint.irb!" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[{:a=>1, :b=>2, :c=>[3, 4, 5]}, 6, 7]" | |
] | |
}, | |
"execution_count": 5, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"h" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"#<Proc:0x007f89f4dd9368@/Users/arattray/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/awesome_print-1.6.1/lib/awesome_print/inspector.rb:45>\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"#<Proc:0x007f89f4dd9368@/Users/arattray/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/awesome_print-1.6.1/lib/awesome_print/inspector.rb:45>" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"AwesomePrint.pry!" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"[\n", | |
" \u001b[1;37m[0] \u001b[0m{\n", | |
" :a\u001b[0;37m => \u001b[0m\u001b[1;34m1\u001b[0m,\n", | |
" :b\u001b[0;37m => \u001b[0m\u001b[1;34m2\u001b[0m,\n", | |
" :c\u001b[0;37m => \u001b[0m[\n", | |
" \u001b[1;37m[0] \u001b[0m\u001b[1;34m3\u001b[0m,\n", | |
" \u001b[1;37m[1] \u001b[0m\u001b[1;34m4\u001b[0m,\n", | |
" \u001b[1;37m[2] \u001b[0m\u001b[1;34m5\u001b[0m\n", | |
" ]\n", | |
" },\n", | |
" \u001b[1;37m[1] \u001b[0m\u001b[1;34m6\u001b[0m,\n", | |
" \u001b[1;37m[2] \u001b[0m\u001b[1;34m7\u001b[0m\n", | |
"]\n" | |
] | |
}, | |
{ | |
"data": { | |
"text/plain": [ | |
"[{:a=>1, :b=>2, :c=>[3, 4, 5]}, 6, 7]" | |
] | |
}, | |
"execution_count": 7, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"h" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"** I want the above to appear in the `Out` field above, and not in the stdout. **" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Ruby 2.3.0", | |
"language": "ruby", | |
"name": "ruby" | |
}, | |
"language_info": { | |
"file_extension": ".rb", | |
"mimetype": "application/x-ruby", | |
"name": "ruby", | |
"version": "2.3.0" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment