I used to make mix tapes (CDs) back in high school all the time. There’s nothing quite like spending hours upon hours picking 75 minutes worth of songs that fit together, flow nicely, and make you look cool to girls. Different types, too. Like a ‘slow song’ mix tape or a ‘punk rock’ mix tape or even a ‘moody-instrumentals-only’ mix tape. My favorite was the Quake mix, best enjoyed while playing Quake. Metal. You know Megadeth covered the Duke Nukem theme song, right? Fraggin’ bliss.
Today I present a different type of mix tape: the irb Mix Tape. This one’s just for you. I wrote out the lyrics by hand and illustrated the insert. I hope it cheers you up on those long bus rides to school.
Track 1: The C in MVC
I’ll get to the good part right away for you Railers. The overture. We all know script/console is wonderful when playing with models, but what about those other letters in MVC? ActionPack needs love, too.
Witness the love. First up, app. It’s a local variable you get for free in script/console. An instance of ActionController::Integration::Session, it’s a lot like those pseudo-controllers you bang around in functional tests. Again, witness:
$ ruby script/console Loading development environment. >> app.url_for(:controller => 'stories', :action => 'show', :id => '10002') => "http://www.example.com/stories/10002" >> app.get '/stories/10002' => 200 >> app.assigns(:story) => #<Story:0x24aad0c ... > >> app.path => "/stories/10002" >> app.reset! => nil >> app.get '/yeah/right/dude' => 404 >> app.post '/account/login', { :username => 'defunkt', :password => 'razzletaz' } => 200 >> app.cookies => {"_session_id"=>"9d1c014f42881524ff6cb81fb5b594bc"}
Neat, huh?
Track 2: The H in MVC
Helpers? Yeah, we got that. Just like app, Rails gives you a helper local variable to play with. Like a little two minute bridge gearing you up for the rest of the tape.
$ ruby script/console Loading development environment. >> helper.pluralize 2, "story" => "2 stories" >> helper.submit_tag => "<input name=\"commit\" type=\"submit\" value=\"Save changes\" />" >> helper.visual_effect :blindUp, 'post' => "new Effect.BlindUp(\"post\",{});"
Etc.
Track 3: Context
Spawn irb subsessions in the context of an object. This track is loud and exciting, with a hint of lament. You can do it with normal irb which means you can also do it with script/console.
$ ruby script/console Loading development environment. >> irb Story >> self => Story >> find(:first) => #<Story:0x2427c2c ... > >> quit >> irb Story.find(:first) >> title => "Mail-Order Desserts" >> quit => #<IRB::Irb: @scanner=#<RubyLex:0x249a36c>, @context=#<IRB::Context:0x249e534>, @signal_status=:IN_EVAL> >> irb app >> host => "www.example.com"
It’s like you’re actually in the object. Any methods you call are getting called on the object whose context and privacy you have invaded. Saves some typing and gets you in with @instance_variables, too. Remember: you can use this in normal irb as well.
Track 4: Sandboxin’
No, not _why’s sandbox. The Rails script/console has a great feature which lets bungle your data without fear of ruining your precious information. Sandbox. The beat on this track is just killer.
$ ruby script/console --sandbox Loading development environment in sandbox. Any modifications you make will be rolled back on exit. >> story = Story.find(:first) => #<story:0x244f0ec> >> story.title => "Mail-Order Desserts" >> story.title = "Snail Mail Droooolz!" => "Snail Mail Droooolz!" >> story.save => true >> Story.find(:first).title => "Snail Mail Droooolz!" >> quit $ ruby script/console Loading development environment. >> Story.find(:first).title => "Mail-Order Desserts"
How wonderful! I love the timing on the snare.
Track 5: Watson the Underbar
There’s always this little guy floating around, very coyly, who can tell you the value of the last evaluated expression in irb. He’s like your Watson. I call him Underbar and he reminds me of a soothing acoustic melody.
>> 1 + 1 => 2 >> _ => 2 >> _ * _ => 4 >> if _ >> "#{_} is true!" >> else ?> "#{_} is false :(" >> end => "4 is true!"
What a chap.
Track 7: Back Tracking
Starting irb with --tracer will show you what Ruby is up to whenever you run a command. We quickly escape our relaxing acoustic instrumental and return to an up-tempo feat of guitar stringmanship.
$ irb --tracer /usr/local/lib/ruby/1.8/tracer.rb:151: warning: tried to create Proc object without a block /usr/local/lib/ruby/1.8/tracer.rb:147: warning: tried to create Proc object without a block >> 1 + 1 #0:(irb):1:Object:-: - #0:(irb):1:Fixnum:>: - #0:(irb):1:Fixnum:<: -> 2 >> name = 'chris' #0:(irb):2:Object:-: - => "chris"
Start irb with --tracer and enter something like require ‘rubygems’. I dare you.
Track 8: bashish
This one is metal, like the Duke.
So you can jump into different contexts with irb, but you can also jump between different contexts. Like bash’s jobs and fg, irb comes fully loaded with its own jobs and fg.
Use jobs to see all the open subsessions. Each one has a number. Use fg # to jump to that subsession while keeping your current one running somewhere in background-land. To halt any of the subsessions, use kill #. Here’s something like the script/console session I had going earlier:
$ ruby script/console Loading development environment. >> irb Story >> self => Story >> jobs => #0->irb on main (#<thread:0x1db740>: stop) #1->irb#1 on Story (#<thread:0x2439558>: running) >> fg 0 => #<irb::irb:><rubylex:0x249a36c>, @context=#<irb::context:0x249e534>, @signal_status=:IN_EVAL> >> irb helper >> jobs => #0->irb on main (#<thread:0x1db740>: stop) #1->irb#1 on Story (#<thread:0x2439558>: stop) #2->irb#2 on #<object:0x249c3c4> (#<thread:0x2410bbc>: running) >> fg 1 => #<irb::irb:><rubylex:0x24393c8>, @context=#<irb::context:0x24393dc>, @signal_status=:IN_EVAL> >> self => Story >> fg 2 => #<irb::irb:><rubylex:0x2410b08>, @context=#<irb::context:0x2410b1c>, @signal_status=:IN_EVAL> >> self => #<object:0x249c3c4> >> kill 1 => [1] >> jobs => #0->irb on main (#<thread:0x1db740>: running) #2->irb#2 on #<object:0x249c3c4> (#<thread:0x2424f68>: running)
Honestly, kill doesn’t seem to work right for me. But no matter. If you already have any of these methods defined on your object you can just use irb_jobs, irb_fg, or irb_kill. Thanks, Ruby.
Epilogue
The metal lead fades out and we embark on an epic climax. See, there’s a lot of really great irb stuff out there. _why in particular seems very interested in the holiest of holies. I trust you’ve seen most of his RedHanded posts, but if not you can start with MethodFinder or Tab Completion in irb. He’s got a chapter on irb in his book as do, naturally, the Praggies.
Bloggers. Ruby-o-sphere. First you’ve got a cross-session command history from Nick Sieger, a staple. For the adventurous Graeme Mathieson is crazy enough to chase the shell in irb and Paul Battley has a neat iterative development in irb trick. While we’re at it, why don’t you grab yourself a simple irb prompt on your way out?
We’re just touching the surface here, really. You have any song suggestions? Did I miss a killer track? Surely. Either way, enjoy this song selection. Maybe I’ll make you another mix tape someday. Someday.
So… much… magic!
Wait! What happened to Track 6?
Gotta love mixtapes. Nice writeup. :)
And what’s on the hidden track? Let me know when you find out.
What happened to Track 6????
Okay here’s one of many hidden tracks. This one sounds a lot like the Outkast song where he keeps saying, “forever, forever-ever, forever-ever.”
Hey those rails tricks are pretty neat. I somehow missed that.
Thanks. Time to go play with irb now.
Thanks for this great article! Very nice.
Thanks for this great post. Very helpful.
Fucking nice work, man. You’ve gone and turned my desire to curse this evening for the better. And thanks for the love, especially.
How can I access the helpers that I defined myself?
Excellent man, always wanted to know how script/console accessed the application. Cheers :)
Appreciate all your helpful information and I would like to print it out.
However, how would it be possible that when one prints out the code in your post that instead of being TRUNCATED, the code WRAPS?
Podcasting is the new mixtape.
Oh, wow, I didn’t know that. I’m gonna be humming track 2 all day!
great article!
is this possible somehow? it’d be very useful. cheers.
I’m trying to test if I can test the GET with parameters I want to fill in the form. Anyone knows the formatting?
nice long article really usefull
sweet!
Awesome Post!
The best article, thanks to the author. good jokes, funny jokes
One of the best mix tapes ever.
Tattoos Celtic Tattoos Lower Back Tattoos Dragon Tattoos Skull Tattoos Heart Tattoos Butterfly Tattoos Chinese Tattoos Layered Hair Styles Layered Hairstyles Emo Hairstyles Medium Hairstyles Bang Hairstyle Prom Hairstyle Hair Coloring Heart Lower Back Tattoos
sikiş porno sex video izle iyi porno uzun porno yeni pornolar porno seyret sex seyret porno filmler sex izleyin sex izle porno sex erotik porn video türk porno canlı porno porno izle porno porno film sex filmleri porn video porno film sex seyret porno video seyret orgazm porno seks izle erotik video sex videolar yetişkin video sex video izle porno video izle bedava porno 18 video seks porno sıcak izle yetişkin film sikiş seyret sex amatör videolar teen video erotik videolar yetişkin video yetişkin videolar pornolar porno video teen kızlık bozma sikiş sikiş video seks türban sex sex erotik seks izle sıcak ateşli
modern abstract art sofa manufacturer гранит 净水器 混合机 过滤机 DHL快递 保险箱 法兰 法兰标准 牛皮癣 皮肤病 北京快递公司 北京国际快递 传世私服 传奇世界私服 天龙八部私服 天龙私服 网络电话 免费网络电话 假发 补发 织发 植发 上海搬家公司 上海搬场公司 大众搬家 大众搬场 张家界旅游 香港旅游 深圳旅行社 打包机 收缩机 萎缩性胃炎 neoprene laptop bags SEO优化 SEO优化 计量泵 胃炎 胃病 冷水机 冰水机 工业冷水机 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 油罐车 北京办证 办证 北京特价机票 北京打折计票 北京国际机票 北京机票预定 北京飞机票 北京订机票 北京机票查询 血糖仪 血糖仪 银杏 水培花卉 企业宣传片 空分设备 机电设备安装 代孕 代孕网 代孕 代孕 代孕 试管婴儿 代孕 电话交换机 程控交换机 集团电话 集装袋 混合机混合机 混合机捏合机 捏合机 捏合机导热油炉 导热油炉 导热油炉 反应釜 反应釜 反应釜 回流焊 波峰焊 spherical roller bearing 搬运车 搬运车 电动搬运车 油桶搬运车 堆高车 电动堆高车 半电动堆高车 堆垛车 高空作业平台车 电动叉车 平衡重叉车 前移叉车 电瓶叉车 苗木价格 苗木信息 标牌制作 深圳标牌 儿童摄影 北京儿童摄影 防静电鞋 淘宝刷信誉 威海凤凰湖 威海海景房 大庆密封件 打标机 淘宝刷信誉 TESOL/TEFL国际英语教师证书 英语教师进修及培训 韩国饰品批发 代写论文 代写论文 代写论文 代写代发 论文代写 电源模块 模块电源 X架 超薄灯箱> 易拉宝 展柜制作 代理服务器 游戏加速器 网络加速器 网通加速器 电信加速器 电信网通转换器 电信网通加速器 网通电信互转 网通电信互通 网络游戏加速器 美国VPN代理 美国独享VPN 美国独享IP pvc ceiling panel Spherical roller bearings 天龙八部私服 SEO优化 安全鞋 劳保鞋 防砸鞋 电绝缘鞋 上海安全鞋 上海劳保鞋 江苏劳保鞋 服装软件 服装管理软件 进销存软件 进销存管理软件 服装管理系统 服装进销存软件 进销存系统 进销存管理系统 免费进销存软件 吉林中医 东北特产 打包机 dhl 阳痿 阴茎短小 阴茎增大 早泄 前列腺炎 阴茎增粗 阴茎延长 国际机票 上海国际机票 国际打折机票 国际特价机票 CRM 客户管理软件 客户关系管理 免费客户管理软件 客户管理软件下载 客户信息管理系统 销售管理系统 销售管理 CRM系统 CRM软件 客户关系管理系统 客户关系管理软件 客户管理 客户管理系统 营销管理系统 客户资源管理 销售管理软件 客户资料管理软件 客户资源管理软件 客户信息管理软件 客户资料管理 客户资源管理 客户信息管理 客户资料管理系统 客户资源管理系统 客户管理软件免费版 砂磨机 砂磨机 砂磨机 卧式砂磨机 卧式砂磨机 卧式砂磨机 三辊研磨机 三辊研磨机 三辊研磨机 混合机 混合机 混合机 锥形混合机 锥形混合机 锥形混合机 行星动力混合机 行星动力混合机 行星动力混合机 无重力混合机 无重力混合机 无重力混合机 干粉砂浆设备 干粉砂浆设备 干粉砂浆设备 捏合机 捏合机 捏合机 导热油炉 导热油炉 导热油炉 反应釜 反应釜 反应釜 搪玻璃反应釜 搪玻璃反应釜 搪玻璃反应釜 乳化机 涂料设备 干混砂浆设备 无重力混合机 胶体磨 涂料成套设备 双螺旋混合机 北京婚庆 北京婚庆公司 400电话 办证 呼吸机 制氧机 亚都 亚都加湿器 亚都净化器 亚都装修卫士 饰品批发 小饰品批发 韩国饰品 韩国饰品批发 premature ejaculation penis enlargement 破碎机 制砂机 球磨机 雷蒙磨 雷蒙磨粉机 鄂式破碎机 鄂式破碎机 免烧砖机 加气混凝土设备 反击式破碎机 选矿设备 安利产品 马来西亚留学 网站优化 网站推广 衬布 代写论文 代写论文 代写论文 论文代写 代写论文 代写硕士论文 代写毕业论文 磁力泵 离心泵 化工泵 隔膜泵 螺杆泵 潜水泵 油泵 耐腐蚀泵 泵 水泵 拖链 防护罩 排屑机 塑料拖链 钢铝拖链 水泵 磁力泵 隔膜泵 离心泵 液下泵 自吸泵 多级泵 排污泵 螺杆泵 油泵 化工泵 电动隔膜泵 气动隔膜泵 自吸式磁力泵 氟塑料磁力泵 管道离心泵 导热油泵 深井泵 潜水泵 污水泵 潜水排污泵 深圳装饰 深圳装饰公司 深圳装修公司 特价机票 打折机票 国际机票 机票 新风换气机 换气机 立式新风换气机 风机箱 新风系统 能量回收机 搅拌机 混合机 乳化机 分散机 毛刷 毛刷辊 工业毛刷 刷子 钢丝刷 涂层测厚仪 硬度计 兆欧表 激光测距仪 测振仪 转速表 温湿度计 风速仪 超声波测厚仪 粗糙度仪 噪音计 红外测温仪 万用表 硬度计 万用表 美容院 美容加盟 澳洲留学 澳大利亚留学 什么是法兰 电烤箱 酒店预定 北京酒店预定 北京酒店 离心机 nail equipment nail products nail product nail uv lamp nail uv lamp nail uv lamps uv nail lamp nail brush nail file nail tool nail tip nail gel curing uv lamps lights 万用表 风速仪 红外测温仪 噪音计
Thanks so much for this! This is exactly what I was looking for
mirc mırc mırç mirç mirc indir mirc yükle mirc yukle türkçe mirc mirc indir mirc islami sohbet kelebek kelebek script kelebek sohbet kelebek mirc chat çet cet çet odaları sohbet kanalları sohbet odaları kameralı sohbet kameralı chat sohbet eğlence mirc sohbet odaları sevgili arkadaş arkadaş bul arkaraş ara oto araba şarkı sözleri astroloji ikinci el telefon gazete gazeteler günlük gazeteler marifetname bedava domain ücretsiz domain benimurl parça kontör parça kontör radyo dinle bedava blog ücretsiz blog
Victorias Secret Victoria’s Secret Fashion show Victorias Secret Pink Victorias Secret Model Victorias Secret Credit Card Victorias Secret Coupon Code Victorias Secret Lingerie Victorias Secret Fashion Show 2005 Victorias Secret Fashion Show 2006 Victorias Secret Bra Victorias Secret Catalog Victorias Secret Pantie Victorias Secret Online Coupon Victorias Secret Fashion Show 2007 Victorias Secret Girl Free Shipping Victorias Secret Victorias Secret Home Victorias Secret Christmas Victoria’S Secret Pink Dog Victorias Secret Music Victorias Secret Semi Annual Sale Victorias Secret Jobs Victorias Secret Free Shipping Code Victorias Secret Shoes Victorias Secret Thong Victorias Secret Commercial Victorias Secret Promotional Code Victorias Secret Love Spell Victorias Secret Boots Victorias Secret Employment Victorias Secret Reviews Victorias Secret Jeans Victorias Secret Brasil Victorias Secret Bag
sorry there’s so much spam. This has been really helpful for me when building out things like Michigan teaching districts
情人用品,情人用品性哥,情 人用品,情趣用品,視訊交友,視訊美女,視訊美女,視訊交友網,視訊聊天室,視訊聊天室,視訊 交友網,免費視訊聊天,辣妹視訊,辣妹視訊,情人視訊網
徵信社,案件討論,男女專區,法律諮詢,相關新聞,情趣用品,情趣用品,情趣精品,情趣用品,情趣用品,情趣用品,情趣用品,威而柔,自慰套,自慰套,SM,充氣娃娃,充氣娃娃,潤滑液,飛機杯,按摩棒,跳蛋,性感睡衣
威而柔,自慰套,自慰套,SM,充氣娃娃,充氣娃娃,潤滑液,飛機杯,按摩棒,跳蛋,性感睡衣,視訊交友90739,情人視訊網,情色交友,視訊交友,辣妹視訊,美女視訊,aio交友愛情館,情色論壇,成人論壇,免費視訊聊天,辣妹視訊,視訊交友網,美女視訊,視訊交友,成人視訊,情趣用品,成人聊天室,情趣,情趣,視訊聊天室,視訊聊天,視訊聊天室,情色視訊,情人視訊網,免費視訊聊天室,aio交友愛情館,色情遊戲,寄情築園小遊戲,情色文學,一葉情貼圖片區
Chime in.