Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
cousine [cousine!~cousine@196.221.242.180] has joined #ruby
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
cachemoney [cachemoney!~cachemone@71-94-132-42.static.mtpk.ca.charter.com] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
redgetan [redgetan!~reg@CPE0023bee17c0e-CM0023bee17c0b.cpe.net.cable.rogers.com] has joined #ruby
<multi_io> do the ruby 1.9.x introduce Ruby language modifications over 1.9.0?
<multi_io> *the ruby 1.9.x releases
akem [akem!~akem@164.15.85.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
<yakko> multi_io: they changed hash :(
<heftig> 1.9.1 changed the C api
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby
ryan_marsh [ryan_marsh!~ryan_mars@99-160-193-138.lightspeed.hstntx.sbcglobal.net] has joined #ruby
carbncl [carbncl!~carbncl@bne75-3-82-225-142-80.fbx.proxad.net] has joined #ruby
Schmidt [Schmidt!~lsc@h-11-69.a254.priv.bahnhof.se] has joined #ruby
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby
jthomas__ [jthomas__!~jthomas@c-98-222-28-137.hsd1.il.comcast.net] has joined #ruby
hunterloftis [hunterloftis!~hunter@cpe-071-075-103-203.carolina.res.rr.com] has joined #ruby
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
<Mon_Ouie> There have been changes to the way constants are looked up
kiwnix [kiwnix!~kiwnix@82.158.154.223.dyn.user.ono.com] has joined #ruby
td123 [td123!~tom@archlinux/trusteduser/td123] has quit ["WeeChat 0.3.6"]
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
jessemc [jessemc!~jessemc@S0106602ad0702c43.ed.shawcable.net] has joined #ruby
_dink [_dink!~anonymous@c-68-52-194-205.hsd1.tn.comcast.net] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
_dink_ [_dink_!~anonymous@c-68-52-194-205.hsd1.tn.comcast.net] has joined #ruby
<multi_io> looks like under 1.8, $: include ".", while under 1.9 it doesn't.
<multi_io> or is that my environment? :-O
<shevy> multi_io yeah that was changed
<shevy> I think something about including the current path is unsafe or that
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
<multi_io> shevy: ok
<multi_io> I see
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
skrewler [skrewler!~skrewler@76-220-40-103.lightspeed.sntcca.sbcglobal.net] has joined #ruby
mpabst [mpabst!~mpabst@50-81-140-212.client.mchsi.com] has joined #ruby
nate_h [nate_h!~husimon@c73-208.rim.net] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
igotnolegs [igotnolegs!~igotnoleg@75-162-83-166.slkc.qwest.net] has joined #ruby
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
jbw [jbw!~jbw@dsl-044-084.cust.imagine.ie] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
<multi_io> in 1.8, if I wanted to "unrequire" a previously required module, it was $".delete "module.rb"
<multi_io> after that, 'require "module"' would load and run the module's code again.
jessemc [jessemc!~jessemc@S0106602ad0702c43.ed.shawcable.net] has joined #ruby
<multi_io> in 1.9, it doesn't?
dyer [dyer!~dyer@108-193-172-174.lightspeed.tukrga.sbcglobal.net] has joined #ruby
dyer [dyer!~dyer@unaffiliated/dyer] has joined #ruby
nvez [nvez!~textual@unaffiliated/nvez] has joined #ruby
retnuh [retnuh!~huntercla@adsl-184-36-106-72.asm.bellsouth.net] has joined #ruby
antonishen [antonishen!~antonishe@adsl-76-249-17-228.dsl.klmzmi.sbcglobal.net] has joined #ruby
dyer [dyer!~dyer@unaffiliated/dyer] has joined #ruby
<shevy> hmm
tightwork [tightwork!~tightwork@50-57-89-237.static.cloud-ips.com] has joined #ruby
<shevy> multi_io good question
<shevy> I actually never saw $".delete before myself
a|i [a|i!~ali@unaffiliated/ai/x-9091534] has joined #ruby
viuo [viuo!~viuo@staticline41439.toya.net.pl] has joined #ruby
<a|i> I'm using 2 gems which define different classes/modules with the same name.
<a|i> how to resolve this conflict?
<waxjar> require the first one, give it a new class name using New < Original, then require the second one?
<waxjar> idk if that would work, its pretty ugly anyway.
<a|i> waxjar: one of them is a class, the other is a module.
<a|i> the first gem was written rather poorly, it doesn't have any modules.
<burgestrand> multi_io: it does, but $" contains the full path to module.rb, not the relative one
<a|i> waxjar: does NewClassname < OldClassName remove the old class name too?
<waxjar> no, it just extends newClassname with the methods of OldClassName
<a|i> waxjar: the problem is the second gem defined a module named OldClassName
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
<burgestrand> a|i: you can assign one of them to another constant, remove the constant, and then require the other one
<burgestrand> a|i: I think that’s what waxjar is thinking, but his way of writing it is wrong
<a|i> burgestrand: how to do that assignment?
<burgestrand> a|i: keep in mind, it may so happen that other pieces of either of those gems rely on that constant, so it’s still a hack and is very likely to break something
<waxjar> that was my thinking yeah
<multi_io> burgestrand: ah...
<multi_io> indeed
<multi_io> so this was changed too then
<multi_io> in 1.8 it contains the relative path
<multi_io> shevy: I need it in some unit tests here to re-initialize the environment before each test. I would stay away from such hackery in production code I think :P
<burgestrand> a|i: NewClassName = ClashingClassName
<burgestrand> a|i: assuming ClashingClassName is in the global scope, you can then do Object.send(:remove_const, "ClashingClassName")
<a|i> burgestrand: thanks, but I think that will mess up other dependencies.
<burgestrand> a|i: but once again, this is a hack, bad mojo, here be dragons and whatnot
<a|i> damn.
<a|i> why do people publish gems with no wrapping modules/namespaces?
<burgestrand> a|i: it’s bad practice to not do it
<burgestrand> a|i: send the authors a message, report an issue or whatever
<waxjar> you could fork it and wrap it in a module
antonishen [antonishen!~antonishe@adsl-76-249-17-228.dsl.klmzmi.sbcglobal.net] has joined #ruby
<a|i> I'm just gonna do my own from scratch.
<a|i> had enough with depending on sleeping authors.
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.47] has joined #ruby
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby
<burgestrand> a|i: now that I think of it, there might be one thing that could help
<a|i> like what?
<burgestrand> I believe load has an extra parameter or something, never used it though, will look it up, don’t say yay yet
<a|i> I keep my yay.
fayimora [fayimora!~fayimora@95.175.159.21] has joined #ruby
<burgestrand> a|i: http://ruby-doc.org/core-1.9.3/Kernel.html#method-i-load — probably false alarm, can’t see anything interesting about it in the description
<a|i> me too.
ly-_ [ly-_!~ly_@251.200.193.77.rev.sfr.net] has joined #ruby
albedoa [albedoa!~albedoa@ip68-108-106-30.lv.lv.cox.net] has joined #ruby
QaDeS [QaDeS!~mklaus@frbg-5d84f8c6.pool.mediaWays.net] has joined #ruby
viuo [viuo!~viuo@staticline41439.toya.net.pl] has joined #ruby
meh [meh!62fdbf5d@gateway/web/freenode/ip.98.253.191.93] has joined #ruby
jessemc [jessemc!~jessemc@S0106602ad0702c43.ed.shawcable.net] has joined #ruby
<shevy> hmm
<shevy> would be nice to re-assign modules upon loading
<shevy> or even wrap loaded code into modules on the fly
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
_|christian|_ [_|christian|_!~christian@201.240.192.232] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
<linduxed> what's the difference between "rake db:migrate" and "rake db:migrate db:test:clone" ?
viuo [viuo!~viuo@178.181.102.224.nat.umts.dynamic.t-mobile.pl] has joined #ruby
<linduxed> i assume it does some test, and clones something, but i can't figure out what
colint [colint!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
antonishen [antonishen!~antonishe@adsl-76-249-17-228.dsl.klmzmi.sbcglobal.net] has joined #ruby
nykc [nykc!~nykc@99-40-62-66.lightspeed.clmboh.sbcglobal.net] has joined #ruby
ly- [ly-!~ly-@251.200.193.77.rev.sfr.net] has joined #ruby
RenatoSilva [RenatoSilva!~nouser@186.205.140.94] has joined #ruby
ly- [ly-!~ly-@unaffiliated/ly-] has joined #ruby
ly- [ly-!~ly-@unaffiliated/ly-] has quit [#ruby]
ly- [ly-!~ly-@unaffiliated/ly-] has joined #ruby
<burgestrand> linduxed: the second one will run two rake tasks, the first one only one
fungoat [fungoat!~fungoat@184.91.163.230] has joined #ruby
RenatoSilva [RenatoSilva!~nouser@186.205.140.94] has quit [#ruby]
<nykc> I am having issues with setting up my environment in Linux Mint for whatever reason.
<nykc> installed Rails 3.1.0 through rvm and it apparently worked
<linduxed> burgestrand: ok
<burgestrand> linduxed: if this is rails, the first second one will run migrations on your development database (default working environment), and then clone the new resulting schema to your test database — you use a different database for development as opposed to the one in testing, so it’s good to do this
<nykc> when I create a rails new test_app and cd to director
<burgestrand> nykc: rails through rvm? how?
<nykc> gem install rails
<linduxed> burgestrand: ok, thank you
_|christian|_ [_|christian|_!~christian@201.240.192.232] has joined #ruby
<burgestrand> nykc: that’s not rvm
<nykc> sorry installed rubygems through rvm
<linduxed> burgestrand: just saw the command in an alias, wanted to know what it was for
<nykc> everything installed okay but when i did a rails server and went to localhost:3000
<burgestrand> linduxed: most often you do db:test:prepare though, which is same as :clone but it clones the structure from the development environment only, db:test:clone clones it from the *current* environment database
<nykc> I got an unable to load
<linduxed> burgestrand: i'm afraid that's a bit too advanced for me at the moment, but a lot anyway
<burgestrand> linduxed: :)
<burgestrand> linduxed: sorry, I meant to tell you to scroll to section 3.1.1 too
<burgestrand> linduxed: first hit on google with a description of the rake task
v0n [v0n!~v4n@bas1-montreal19-1177820429.dsl.bell.ca] has joined #ruby
new_ruby_program [new_ruby_program!~new_ruby_@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby
albedoa [albedoa!~albedoa@ip68-108-106-30.lv.lv.cox.net] has joined #ruby
<burgestrand> nykc: when you do ”rails server”, what does it say?
antonishen [antonishen!~antonishe@adsl-76-249-17-228.dsl.klmzmi.sbcglobal.net] has quit [#ruby]
new_ruby_program [new_ruby_program!~new_ruby_@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby
ryanf [ryanf!~revfitz@adsl-67-122-210-207.dsl.snfc21.pacbell.net] has joined #ruby
<nykc> I am reinstalling I will let you know in a sec. Thank you
<savage-> burgestrand: do you like to create attr_reader/writer/accessor for instances variables that you don't expose outside of the internals of your class? Or do you refer to the @instance_variable name everywhere directly?
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
<burgestrand> savage-: attr_* — for one it allows me to document my expectations of the instance member, and it allows me to change the implementation with minimal impact on the rest of the code :)
<burgestrand> savage-: like, I can use YARD to actually define what the instance variable will contain and why it’s there
MissionCritical [MissionCritical!~MissionCr@unaffiliated/missioncritical] has joined #ruby
<savage-> burgestrand: great, that's what I've been doing as well. I'm also speciyfing the attr_* within 'private'.
<burgestrand> savage-: mostly for the reader though, I’m not really that strict when it comes to the writer which is probably stupid of me :p
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<savage-> lol
<burgestrand> then again I mostly only set things from the initializer :)
<savage-> true :)
<linduxed> burgestrand: hey, is there a difference between <% foobar %> and <% foobar -%> ?
<burgestrand> linduxed: I believe the latter one cuts off the trailing newline
<linduxed> i've notived that a plugin inserts the -
<linduxed> *noticed
<linduxed> burgestrand: hmmm, any idea why that would be made standard instead of without the minus?
<burgestrand> perhaps it might even cut off trailing whitespace
Banistergalaxy [Banistergalaxy!~AndChat@118.82.185.158] has joined #ruby
<burgestrand> linduxed: HTML does care about whitespace at times, for example between tags; if you make a horizontal list with ol/li elements, the whitespace you often place between the li-elements (one li on each line) will actually put a space between each item
<burgestrand> linduxed: cutting it off would pack those elements tightly together
<linduxed> hmm, true
<burgestrand> linduxed: kind of hard to explain what it does in words :p
<linduxed> no i think i understand
<linduxed> i mean, i see the value in cleaning off whitespace
<linduxed> i was just surprised that this function that previously entered the former now enters the latter
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
<linduxed> (vim-ragtag plugin from tpope, if you're curious what i'm talking about)
<burgestrand> oh :)
<burgestrand> well, that’d be it I guess, often when aligning HTML code in your editor you don’t really want it to affect the content on the page
<burgestrand> you want the white-space to be insignificant, so it makes sense for it to be the default
theRoUS [theRoUS!~KenCoar@apache/committer/coar] has joined #ruby
<burgestrand> this is all under the assumption that it actually *does* clear off trailing whitespace :p
<linduxed> sounds like this minus is nothing but good...
<new_ruby_program> hello, can somebody please take a look at this: puts "Hello, World!" is "Hello, World!" a string literal or just a regular string
<new_ruby_program> i heard a string literal is embedded directly into code, so is this a literal then>
<burgestrand> new_ruby_program: I’d say it’s both :p
<burgestrand> new_ruby_program: I’d even say it’s the same thing
<v0n> hi
<v0n> a personal OutOfBoundsException should inherit from Exception or StandardError?
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
<burgestrand> new_ruby_program: or, well, not the same; a string literal is a string, but a string is not *necessarily* a string literal
<new_ruby_program> ahh i see that makes sense now :)
nerdy_ [nerdy_!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
<burgestrand> new_ruby_program: a = "Hello, world!" — a is a variable, it contains a string, in some contexts you would say ”a” is a string (even though it just refers to a string, the string is not *in* a, a points to it); whereas "Hello, world!" *is* a string, and it *is* a string literal
Gryyt [Gryyt!g@unaffiliated/gryyt] has joined #ruby
<linduxed> burgestrand: hmmm, yeah i checked the code for the plugin, it's correctly input, it's no error... the minus is to be added at the end of these tags
<linduxed> burgestrand: so i guess that feature was put in for a good reason
<burgestrand> v0n: probably from StandardError
<burgestrand> v0n: I say probably because I don’t know the context, but most likely StandardError; unless you have a good reason not to inherit from it
<v0n> burgestrand, I don't mind, I'm just looking for the best practice :) thanks
<burgestrand> v0n: then definitely StandardError :)
<new_ruby_program> burgestrand: "Hello, World!" by itself is a string literal because it's by itself right? puts "Hello, World!
<new_ruby_program> " is also a string literal because its also by itself
<new_ruby_program> a = "Hello, world!" is just a regular string because it's a string being referenced by a variable?
<nykc> burgestrand: /home/nykc/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.2.13/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
<new_ruby_program> lol am i right?
<v0n> burgestrand, so maybe it should better be called OutOfBoundsError, isn't it?
<burgestrand> new_ruby_program: yes, yes, not *entirely*
baniseterfiend` [baniseterfiend`!~baniseter@118.82.185.158] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<burgestrand> nykc: add gem 'therubyracer' to your Gemfile, bundle install and then start again :)
<burgestrand> nykc: you can also install nodejs on your computer if you prefer that approach, the link in the error contains some additional information
<burgestrand> new_ruby_program: a = "Hello, world!" is itself an expression, a is a variable that references "Hello, world!", the string (and in this case) literal
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<new_ruby_program> A regular string would be the string a variable references, right? or so I have been told by a ruby-forum.com member
<burgestrand> v0n: ah, yes, it’s also common for errors to be suffixed by Error
tshauck [tshauck!~tshauck@98.156.55.148] has joined #ruby
<ryanf> holy crap
<ryanf> still with the string literals?
<new_ruby_program> var = "string" => "string" # this is the string referenced by 'var'
<burgestrand> new_ruby_program: yeah, sure
abstrakt [abstrakt!~abstrakt@gateway/tor-sasl/abstrak1] has joined #ruby
<burgestrand> new_ruby_program: most often you don’t make the distinction between string and string literal though, it’s rarely relevant
<abstrakt> so it seems that ruby 1.9.3 no longer has Array#inject?
<abstrakt> what is the replacement for this?
<abstrakt> reject?
<burgestrand> abstrakt: it does
<burgestrand> abstrakt: Array#reduce is an alias available in 1.9
<abstrakt> burgestrand, hmm, why don't I see it on the left on this page then http://ruby-doc.org/core-1.9.3/Array.html
dhodgkin [dhodgkin!~dhodgkin@cpe-76-179-199-112.maine.res.rr.com] has joined #ruby
<abstrakt> burgestrand, oh, ok so reduce in 1.9 = inject from 1.8?
<abstrakt> or something similar?
<burgestrand> abstrakt: for one the new docs suck because lots of things are missing, secondly because inject is in Enumerable :)
<abstrakt> burgestrand, ahh, ok great thx :)
<abstrakt> burgestrand, ok great, got it
<burgestrand> abstrakt: \o/
<nykc> burgestrand: Thank you... nodejs did the trick
<burgestrand> nykc: the reason you got the error is because you were missing a way to compile coffee-script to javascript — rails 3.1 has coffee-script in the Gemfile by default, and it uses ExecJS to find a coffee-script compiler
<burgestrand> (actually it’s just finding something that it can use to run the coffee-script compiler with)
Gryyt [Gryyt!g@unaffiliated/gryyt] has quit [#ruby]
p0y [p0y!~p0y@122.52.126.66] has joined #ruby
<nykc> burgestrand: makes sense
<burgestrand> but ExecJS will be happy with nodejs, therubyracer, and a a bunch of other things that are listed in its readme
<nykc> I also installed therubyracer
<nykc> Cool time to learn Rails :) thanks again for the help
syamajala [syamajala!~syamajala@c-75-68-106-118.hsd1.ma.comcast.net] has joined #ruby
<burgestrand> nykc: enjoy :) there’s also #ror channel for rails-related issues
<nykc> I'll look into. I am crossing over from Python/PHP so I can't wait to see what I have been missing
_|christian|__ [_|christian|__!~christian@190.233.132.118] has joined #ruby
meh [meh!62fdbf5d@gateway/web/freenode/ip.98.253.191.93] has quit [#ruby]
mrapple [mrapple!~mrapple@bzflag/player/MrAppleComputer] has quit [#ruby]
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
<a|i> any idea how to force a ruby gem to fetch its submodules upon install?
<a|i> in bundler, gem 'foo', :git => '..', :submodules => true works.
<a|i> but it doesn'r work without the :git option.
ewag [ewag!~ewagner@s247.n194.n222.n216.static.myhostcenter.com] has joined #ruby
<burgestrand> a|i: I’m not sure you can do it without fetching it from :git as there’s no information about the submodules that way; why are you trying to fetch submodules without using git?
trend [trend!~trend@97-81-69-219.dhcp.athn.ga.charter.com] has joined #ruby
<a|i> burgestrand: I just pushed the gem to rubygems.
<linduxed> burgestrand: care to answer a simple question?
abstrakt [abstrakt!~abstrakt@gateway/tor-sasl/abstrak1] has quit ["Leaving"]
<burgestrand> a|i: rubygems have nothing to do with git, it packages all files from the file list into the gem, nothing about git is saved in it
<burgestrand> linduxed: you should know better than to ask to ask by now :)
<a|i> burgestrand: can the gem be configured so that at some point it can fetch the submodules?
<linduxed> burgestrand: in this guide http://guides.rubyonrails.org/getting_started.html i get told that after extracting a piece of code to a partial, i should just do a <% render :partial => 'comment' %>
<linduxed> whoops
<linduxed> <%=
<linduxed> however
<new_ruby_program> how long does it take to start programming complex applications? I just started getting into software programming two days ago and I started with ruby. Just wondering btw
<burgestrand> a|i: no, rubygems is completely oblivious to git — in your .gemspec there is a gem.files = something directive, it tells rubygems what files are part of the gem
<linduxed> my plugin also adds ", :collection => @post.comments" before the %>
<burgestrand> a|i: gem.files should contain all files that are part of your gem; if it’s the `git ls-files` line from bundler it does not contain files from within submodules
<linduxed> turns out that without the :collection stuff, it won't work
<savage-> wow
<savage-> guys, don't forget about Enumerable#slice_before and Enumerable#chunk.
<linduxed> so the plugin helped me out in this case... but i wouldn't have figured this out otherwise
<linduxed> burgestrand: so the question i have is: why is this not mentioned (am i using a "too new" version of rails?) and what does it _mean_?
<burgestrand> new_ruby_program: you can start immediately, but even the most die-hard programmers learn better ways to do things every day, if you look at your code that you write today in a month and vomit in disgust and want to re-write it you’re doing it right
oponder [oponder!~oponder@145.118.116.102] has joined #ruby
<a|i> burgestrand: my gem uses a huge non-gem, but git-maintained library, no point in copying the whole lib in my gem. any other ways?
<linduxed> new_ruby_program: really depends on what you consider complex
<burgestrand> a|i: nope, no other ways, if you want it in your gem you put the files in your gem
<linduxed> new_ruby_program: if you're aiming for creating a new github or twitter... then yeah that can take a while
<a|i> :(
<linduxed> new_ruby_program: so much so that we won't be able to telly you how long
<burgestrand> a|i: you could possibly make the library itself into its’ own gem (it’s what therubyracer does for the v8 library)
<burgestrand> a|i: but that just splits it into two gems, the actual files you have to include won’t be very different
<linduxed> new_ruby_program: to be honest, it's not even that wise to set that kind of goal if you're two days in, that won't help you in any way
<new_ruby_program> yes i am aiming to create a social network site!
<linduxed> haha
<a|i> burgestrand: maintaining the library is a pain, it keeps get updates every day.
<new_ruby_program> that's exactly what i want to do
<new_ruby_program> or planning to do
<burgestrand> linduxed: could you summarize your question? I got a bit lost :)
<linduxed> new_ruby_program: well, i'm not trying to discourage you, you ought to have visions, but set a lot smaller goals
<linduxed> new_ruby_program: then you'll get there, step by step
<linduxed> new_ruby_program: finish some tutorials first, create smaller projects, maintain them, expand upon them, and most importantly - refactor
<burgestrand> a|i: sorry, I know of no other way, the whole point of a gem version is that it’s expected to stay the same unless you install a new version of it or its dependencies :p
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
<linduxed> burgestrand: i'm doing a partial. in the tutorial it omits ", :collection => @post.comments" inside the <%= render.... %>
<linduxed> burgestrand: but my plugin added that automatically when extracting the partial
<linduxed> burgestrand: turns out the plugin knew that it was needed, without it the stuff dies
<burgestrand> linduxed: so, essentially ”render :partial => …, :collection => @post.comments”?
<linduxed> burgestrand: this is not mentioned in the tutorial
<linduxed> burgestrand: yes
<linduxed> burgestrand: 2 questions
<linduxed> burgestrand: 1. why is this not mentioned? (too new rails?)
<linduxed> burgestrand: 2. what does it mean, that thing about collection
<new_ruby_program> alright thanks for the advice :) I am an ambitious person, that is all :) I will create smaller projects, but my main goal will be a social networking site! :)
<linduxed> new_ruby_program: sure go ahead!
slide [slide!~slide@unaffiliated/slide] has joined #ruby
<burgestrand> linduxed: 1: not sure, I’d expect that to work
<slide> How can I use SSL in Ruby? I found something with a 'start_tls' method but I dont know where that is coming from
nerdy_ [nerdy_!~textual@66-44-118-195.c3-0.grg-ubr1.lnh-grg.md.cable.rcn.com] has joined #ruby
<linduxed> burgestrand: a little clarification for 1.
ewag [ewag!~ewagner@s247.n194.n222.n216.static.myhostcenter.com] has joined #ruby
<burgestrand> linduxed: 2: collection means you’ll render a partial for each item in it, it tells rails that you don’t want to render it just once, but once for *every* item in the collection, it also means that the partial itself needs to be written in a way so that it’s aware it’s being rendered for a collection
<linduxed> burgestrand: in the tutorial, they go about doing it without the :collection at all
<burgestrand> linduxed: don’t you just hate the magic behind the covers sometimes
<linduxed> burgestrand: ok then that was what i suspected from seeing the code
<linduxed> burgestrand: if you mean stuff that happens that you don't know about... can be irritating yes
<linduxed> at least if it's not obvious
<burgestrand> linduxed: in the tutorial, the name of the partial is inferred from the model_name (I believe) of the "collection", I’m not sure what rails will consider a collection (if it responds to #each would maybe be a sane choice?), that’s why they can leave it out
<burgestrand> linduxed: if your partial follows another name, you’ll need to specify it with :partial
<burgestrand> linduxed: http://guides.rubyonrails.org/layouts_and_rendering.html has a section on rendering collections
<linduxed> oh now i see why then
<linduxed> the plugin decided to put the partial automatically in the same dir
<linduxed> instead of putting it in views/comments
<linduxed> it got dropped in views/posts
<linduxed> i take it that is a situation where you have to inform the partial what you're talking about
<burgestrand> could very well be true
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
<banisterfiend> burgestrand: burgdiggitydogg
<burgestrand> banisterfiend: bandiddityfiddelysomething :d
<banisterfiend> hehehehe
jessemc [jessemc!~jessemc@S010678cd8e6f175f.ed.shawcable.net] has joined #ruby
<linduxed> oooooh
<linduxed> it doesn't say <%= render :partial => 'comment' %>
daniel_hinojosa [daniel_hinojosa!~danno@67-0-103-21.albq.qwest.net] has joined #ruby
<linduxed> it says <%= render @post.comments %>
<linduxed> should have noted that :-P
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
<burgestrand> :p
<burgestrand> yes
<burgestrand> that might confuse you a bit otherwise
<burgestrand> hehe
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby
zakwilson [zakwilson!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby
rodasc [rodasc!~crodas@li22-40.members.linode.com] has joined #ruby
Doppp [Doppp!~Doppp@unaffiliated/doppp] has joined #ruby
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
a|i [a|i!~ali@client-86-31-246-98.oxfd.adsl.virginmedia.com] has joined #ruby
a|i [a|i!~ali@unaffiliated/ai/x-9091534] has joined #ruby
|kjs3| [|kjs3|!~kjs3@c-24-99-80-255.hsd1.ga.comcast.net] has joined #ruby
<linduxed> gaaaah
<linduxed> i've been on point 9 on http://guides.rubyonrails.org/getting_started.html for like ten minutes or more now
<linduxed> i've done everything exactly their way
<linduxed> hell i even deleted my handwritten code and copy-pasted
<linduxed> but when i press that damned "Destroy Comment" link
<brownies> what's the error
<linduxed> i get Unknown action
<linduxed> The action 'show' could not be found for CommentsController
<linduxed> why would it be doing 'show'?
<savage-> cat production.log | ruby --encoding='UTF-8' -e 'ARGF.each_line.map(&:strip).reject(&:empty?).slice_before(/^Started /).each { |slice| puts "#{slice.first}***#{slice.last}" if slice.last[/in (\d+)ms/, 1].to_i > 5000}'
<brownies> you tell me
<brownies> look at the code you wrote
<brownies> what happens when you call /destroy ?
trend [trend!~trend@97-81-69-219.dhcp.athn.ga.charter.com] has joined #ruby
<linduxed> brownies: how can i try calling it?
<brownies> you can read the code and tell me what happens
<linduxed> just by typing some address?
<brownies> there are 4 lines of code in the destroy method
<brownies> just use... your brain.
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
<linduxed> shit
<linduxed> no man i'm stumped here
<linduxed> it's _exactly_ like their code... and it doesn't work
<linduxed> i'm most confused why it instist on using the show action
<shevy> there are two possibilities
<linduxed> *insists
<shevy> either you suck. or their code is wrong
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
<linduxed> shevy: probably the first one :-)
<shevy> don't rule out the other choice too soon
<shevy> however ... I think at a tutorial that is exposed to many people out there, they would fix any error quite quickly
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
<linduxed> nothing short of incredible, this is
<linduxed> i don't even understand why the hell show is in the picture
<linduxed> i mean i guess you could expect it to use show for rendering it all after the destroy, but the link_to says to go to the post_path!
<linduxed> i don't get it, i just don't
<mattyohe> "The destroy action will find the post we are looking at, locate the comment within the @post.comments collection, and then remove it from the database and send us back to the show action for the post."
<mattyohe> so...
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
<linduxed> mattyohe: so while it does mention the show action... why is it looking for it inside the CommentsCotroller?
<linduxed> i can't wrap my brain around that
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
jasdeepjaitla [jasdeepjaitla!~jasdeepja@c-98-207-73-250.hsd1.ca.comcast.net] has joined #ruby
Sliker [Sliker!~ponies@194.28.113.87.dyn.plus.net] has joined #ruby
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
trend [trend!~trend@97-81-69-219.dhcp.athn.ga.charter.com] has joined #ruby
<linduxed> ok i think i get it a bit now
<linduxed> so the comment partial contains the line <%= link_to 'Destroy Comment', [comment.post, comment], :confirm => 'Are you sure?', :method => :delete %>
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
<linduxed> i now assume that the [comment.post, comment] sends the link_to to the showing of the comment
<linduxed> hence the show command which rails tries to get to in the comment controller
tomzx [tomzx!~tomzx@dsl-216-221-39-59.aei.ca] has joined #ruby
<linduxed> but then again, why does it ignore the :method => :delete then?
<linduxed> gaaaah
<linduxed> i'm so confused
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
<banisterfiend> linduxed: cant u join some rails channel
<banisterfiend> probably more help there
<linduxed> banisterfiend: yeah you're right
<linduxed> maybe it's the 5 o'clock in the morning that's messing my thinking up...
<shevy> where u live
<linduxed> shevy: sweden
<shevy> hah like burgestrand
<banisterfiend> burgestrand is norwegian i think
<banisterfiend> hmm or maybe he's swedish
<banisterfiend> scandiwigian
thismat [thismat!~thismat@66-190-79-183.dhcp.dntn.tx.charter.com] has joined #ruby
<shevy> man, burge borg burg ... castle!
<shevy> skapelsen!!!
<shevy> thor wauki!
THE_GFR|WORK [THE_GFR|WORK!~THE_GFR_W@76.164.19.2] has joined #ruby
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
visof [visof!~visof@41.196.196.150] has joined #ruby
<visof> hello
<visof> i have two files, one which i defined a class and i want to use it in the other file and add in the other file require 'file1' to can use class but i got error said error load file1
<visof> what is that?
<multi_io> visof: if you're using Ruby 1.9, try require './file1'
<visof> ah ok
<multi_io> require doesn't search in the current directory by default anymore.
<multi_io> (this was changed from 1.8 to 1.9)
sonkei [sonkei!~sonkei@d14-69-26-171.try.wideopenwest.com] has joined #ruby
thecreators [thecreators!~rskagy@cpe-65-27-201-203.cinci.res.rr.com] has joined #ruby
<visof> i tried ./file1 but i got the same error
jessemc_ [jessemc_!~jessemc@S010678cd8e6f175f.ed.shawcable.net] has joined #ruby
<ryanf> do require_relative 'file1'
<ryanf> require './file1' isn't a good solution to that problem
<ryanf> because it relies on your working directory being the same as the directory with the code in it, which could easily not be the case
zenergi [zenergi!~zenergi@pdpc/supporter/student/zenergi] has joined #ruby
<multi_io> well, yeah
<visof> my files and error
<visof> i tried require_relative and tell no file
mxweas [mxweas!~max@c-24-7-45-147.hsd1.ca.comcast.net] has joined #ruby
tnk1 [tnk1!~tnk@ip72-195-134-180.ri.ri.cox.net] has joined #ruby
* tnk1 is away: Gone away for now
<multi_io> visof: name the file roman.rb, not just roman
<visof> omg
<visof> ok
THE_GFR|WORK2 [THE_GFR|WORK2!~THE_GFR_W@76.164.19.2] has joined #ruby
<visof> multi_io: thanks , that fixed the problem
<multi_io> visof: :-P
THE_GFR|WORK2 [THE_GFR|WORK2!~THE_GFR_W@76.164.19.2] has quit [#ruby]
<multi_io> ...so, in 1.9, a proc can be called with any number of arguments, no matter how it is defined?
<multi_io> whereas in 1.8, you get ArgumentError if the number of arguments doesn't match the proc's definition
<banisterfiend> multi_io: no
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
<banisterfiend> multi_io: in 1.8 a real proc doesnt care about arity either
<banisterfiend> multi_io: it's just that the 'proc' method in 1.8 is an alias for lambda
<banisterfiend> multi_io: create a real proc in 1.8 using Proc.new { }
init[1] [init[1]!~dlevel@shellium/member/buffer] has joined #ruby
<visof> when i run ruby code first time it run slow but when run it again it run faster than the first time, is that true? , because interpreter cache the values?
<init[1]> hi, i'm planning to buy a book on ruby. what is you suggestion on most upto date reference to learn ruby ? Programming Ruby 1.9: The Pragmatic Programmers' Guide (Facets of Ruby) is of 2009
<visof> init[1]: this book is great ruby book
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<visof> init[1]: i'm learning from it
jessemc [jessemc!~jessemc@S010678cd8e6f175f.ed.shawcable.net] has joined #ruby
<linduxed> OH FFS
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby
<linduxed> better allow javascript next time on localhost:3000 if i want rails to fucking work
<linduxed> GAAAH
<linduxed> well that's a lesson learned... only an hour later
<init[1]> visof, will the year of publication matter. ?
<init[1]> i mean ROR, is kinda dynamic. does ruby has such syndrome ?
<multi_io> banisterfiend: ok, thanks
cooper [cooper!~mitchell@unaffiliated/furryfishy] has joined #ruby
<multi_io> is that the only difference between procs and lambdas?
<visof> init[1]: i guess no, that's my view , the people want to learn C as example maybe use K & R book that is sorta very old book
<init[1]> visof, ha i get i now, by what you mean. So it is still safe to learn from Pragmatic. I believe ruby still has the same stuff in Pragamatic right ?
<init[1]> i get it^
<init[1]> soory for my lame question. I worried about the time spend. I shouldn't spend time on outdated stuff.
<visof> init[1]: yeah i mean yeah you can learn from that book, sorry for my English
<init[1]> visof, alright thanks :)
<visof> init[1]: Is Ruby your first programming language you willlearn?
Skaag [Skaag!~Skaag@cpe-67-247-51-89.nyc.res.rr.com] has joined #ruby
<init[1]> visof, no i'm a OOps guy from Java, quite familiar with C and C++ aswell. :)
<hemanth> is it the right channel to ask about ruby waitr?
<visof> init[1]: ok
<shevy> init[1] the only real way to learn ruby is to write ruby scripts and code
<Bonkers> is there an easy way to mock out time in a test::unit test? I need to control what Time.now returns
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
<shevy> I liked the pickaxe from around ... 2006 (not the first edition, was it the second?), the one around 2009 I didnt like that much... not sure why. it just didnt feel that special anymore
hydraulix [hydraulix!~hydraulix@c-24-126-117-251.hsd1.md.comcast.net] has joined #ruby
<init[1]> shevy, :) yes i agree.
otakutom_ [otakutom_!~otakutomo@zaq771a4b1b.zaq.ne.jp] has joined #ruby
<shevy> metaprogramming in ruby was ok
<shevy> it's hard to say how it is for others because like 50% of it was not new to me
<shevy> so someone new to it may profit from those books more
otakutomo [otakutomo!~otakutomo@zaq771a4b1b.zaq.ne.jp] has joined #ruby
<Gekz> I'm surprised I didn't like ruby when I first tried it
<shevy> Gekz hmm
<shevy> I still don't like certain ruby code out there
<shevy> mostly code with @@
<shevy> or *eval*
<Gekz> yes
<shevy> or lots of $vars
<Gekz> I think that's what stoppe dme
<Gekz> I had to find someone to convince me to give it another go
<davidcelis> $dont_do_this
<davidcelis> $please
<shevy> you can write really really horrible code in ruby :(
<davidcelis> you can write really horrible code in any language
<Gekz> it's very perlesque
<Gekz> it's more difficultto write ugly code in Python I've found
<Gekz> which is why I used it
<shevy> davidcelis, yeah not sure about how much
<Gekz> much more difficult to write code as concisely as I wanted.
otakutom_ [otakutom_!~otakutomo@zaq771a4b1b.zaq.ne.jp] has joined #ruby
<shevy> when I look at perl code and compare it to python code, 80% of the time I find the perl code uglier
<Gekz> Python not having the retry keyword blows my mind.
<Gekz> perl is almost always uglier
<Gekz> because it has _so much syntax_
otakutomo [otakutomo!~otakutomo@zaq771a4b1b.zaq.ne.jp] has joined #ruby
<shevy> perl is like the granddaddy of scripting languages
<mitchty> meh, perls fine for what it does
<Gekz> and by god does it show.
<mitchty> i think people confuse syntax for beauty
hydraulix [hydraulix!~hydraulix@c-24-126-117-251.hsd1.md.comcast.net] has quit [#ruby]
<Gekz> code readability is all that matters.
<multi_io> I've found that Ruby is the better Perl :P
<Gekz> I'd agree with that I guess.
<multi_io> i.e. you can write Perlish code in Ruby, and if you do, it's easier that doing it in Perl...
init[1] [init[1]!~dlevel@shellium/member/buffer] has joined #ruby
<mitchty> you can write java in almost any language, doesn't mean you should
<Gekz> I just like how object oriented it is
<Gekz> I'm a Java and Python guy
<Gekz> it has the best bits of both I reckon.
<multi_io> yeah I didn't mean to say you should write perl in ruby
<Gekz> also, I'm not sure what @@ means in ruby
<multi_io> but e.g. Perl is said to be good at text processing. And it is. But Ruby is better at it. So Ruby is the better Perl :)
<QaDeS> Gekz, you might like coffeescript, too ;)
<mitchty> effectively @@var is a class singleton variable
<Gekz> QaDeS: I hate the hell out of coffeescript
<mitchty> multi_io: not entirely accurate, perls regex parser is quite a bit more turing complete
<multi_io> I kinda like the OOP in Perl though
<Gekz> mitchty: er, what.
<QaDeS> how come?
<multi_io> mitchty: yeah, maybe
thecreators [thecreators!~rskagy@cpe-65-27-201-203.cinci.res.rr.com] has joined #ruby
<mitchty> Gekz: it means for class Foo, it will be the same across any instance of Foo, its not local to the one class
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
<Gekz> mitchty: so it's a class attribute, not an instance attribute.
<shevy> perl OOP $this->bla();
<shevy> hmm no thank you, I stick with ruby
<Gekz> perl was quite a bit like C in a lot of ways
<mitchty> Gekz: yes, basically, but the pattern is effectively singletons
<Gekz> mitchty: how so
<shevy> perl didn't care much about syntax :)
<shevy> perl is still faster than ruby and python though
<mitchty> Gekz: because thats what it does? http://en.wikipedia.org/wiki/Singleton_pattern
<Gekz> it doesn't restrict class instantiation
<mitchty> depends on if you're using things like moose or not
<Gekz> at least from what you explained
<mitchty> Gekz: i probably explained crappily go grab a proper ruby book and have at it and see what it does
<shevy> @@foo is a bit like a limited global variable. it's shared among the same class hierarchy
<banisterfiend> Gekz: what's your question
<shevy> and I absolutely hate it
<mitchty> it can be occasionally useful
<mitchty> much like $ with things like $stdout/etc...
<shevy> I think $ is more useful than @@
<Gekz> from what I understand, @@ is the equivalent of a private static variable in Java, no?
<shevy> what is a static variable in java doing?
<shevy> static sounds unchangable
<shevy> you can modify @@ quite freely
<Gekz> that's a final.
<Gekz> static just means it's a class method/attribute
<shevy> final ... isn't that what is executed when your script ends?
<Gekz> lawl.
<banisterfiend> Gekz: the problem with @@ is that it's shared by all subclasses and instances of the subclasses
<Gekz> trolled.
<shevy> hah but only half Gekz :D I really dont know what they do in Java... but I find those name choice odd
<banisterfiend> the scope is generally too broad
<Gekz> banisterfiend: I gathered that from what shevy said before.
<Gekz> I can see that becoming a bit of a bitch of a problem
<shevy> Gekz, ask how much mitchty uses @@ ;D
<Gekz> shevy: static means something different in all languages lol
<mitchty> shevy: only in one spot, ever :P
<Gekz> final just means constant.
<shevy> hmm
<shevy> wait
<shevy> why don't they call it "constant" or "const" then?
<Gekz> hi, my name is Sun Microsystems like 10 years ago
<shevy> hahaha
<Gekz> there was some logic to it
<shevy> I can still remember having played java applets... dragonquest or something was the game
<Gekz> it wasn't a good argument but they had noe
<mitchty> ooh there are still some
<shevy> most browser games today are a bit simplistic
<mitchty> only now they are wrapped java apps in webstart
<Gekz> lawl
<mitchty> my friends tried to get me into this german online rpgish thing, it was horrible
<Gekz> now onto ruby topics
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby
<Gekz> Nokogiri amuses me
<Gekz> I have a 158MB XML file
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
<Gekz> parsing that takes about 1.2GB haha
<mitchty> Gekz: have a look at https://github.com/headius/rx
<Gekz> what problem does it solve
<Gekz> it's a SAX parser
<Gekz> ?
<mitchty> replaces rexml, which is regex parsing in the ruby stdlib
<mitchty> was more curious how it compared
Count_Niedar [Count_Niedar!~nnscript@ip68-231-248-182.hr.hr.cox.net] has joined #ruby
pencilcheck [pencilcheck!~pen@140.112.30.137] has joined #ruby
<Gekz> well Nokogiri loads it as a DOM tree
<Gekz> so I don't think they're comparable
<shevy> good old XML
<shevy> 158 MB
<shevy> Gekz, you are a poor man
<shevy> here is what I would do:
<shevy> rm *xml
<Gekz> nah, it's a shitload of statistical data
<Gekz> I might just convert it into SQL
<shevy> haha
<Gekz> oh wow, it's nearly at 2GB of RAM
<mitchty> 2g of ram should be enough for everybody
oponder [oponder!~oponder@145-118-116-102.fttx.bbned.nl] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@2001:5c0:1000:a::2f] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
apok [apok!~apok@96.24.67.22] has joined #ruby
yxhuvud [yxhuvud!mongo@h-17-181.a149.priv.bahnhof.se] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
orospakr [orospakr!~orospakr@mobotropolis.orospakr.ca] has joined #ruby
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby
Know1edge [Know1edge!Know1edge@c-69-247-141-247.hsd1.tn.comcast.net] has joined #ruby
bamboozle [bamboozle!~travis@cpc7-chap8-2-0-cust11.aztw.cable.virginmedia.com] has joined #ruby
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
<bamboozle> Oh, I see my problem is a semi-common one and doesn't seem to be an issue.
<bamboozle> Thanks anyway, for those that read it.
fungoat [fungoat!~fungoat@184.91.163.230] has joined #ruby
PaciFisT [PaciFisT!~PeaCE@CPE602ad06de6b3-CM602ad06de6b0.cpe.net.cable.rogers.com] has joined #ruby
Lord-Harlot [Lord-Harlot!~Serenity@adsl-87-102-40-242.karoo.KCOM.COM] has joined #ruby
PaciFisT1 [PaciFisT1!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
hemanth [hemanth!~hemanth@121.244.159.130] has joined #ruby
<hemanth> using watir-webdriver trying to handle popups, looking for solid examples
rethaw [rethaw!~textual@c-98-234-116-174.hsd1.ca.comcast.net] has joined #ruby
rpowell [rpowell!~rpowell@CPE-58-164-72-158.lns1.ken.bigpond.net.au] has joined #ruby
tayy [tayy!~tayy@208.59.93.230] has joined #ruby
<Gekz> so r
<Gekz> Nokogiri finished that 136MB XML file: 3.6GB RAM
colint [colint!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
Seisatsu [Seisatsu!~seisatsu@2001:5c0:1000:a::679] has joined #ruby
tk_ [tk_!~tk@p252198.doubleroute.jp] has joined #ruby
jbpros [jbpros!~jbpros@246-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
skrewler [skrewler!~skrewler@70-36-139-140.dsl.dynamic.sonic.net] has joined #ruby
Dante2 [Dante2!4721a6e9@gateway/web/freenode/ip.71.33.166.233] has joined #ruby
<Dante2> Is anyone here?
<Dante2> Ok, I am wondering if there is someone who can help me with getting ruby to work the way it's supposed to from the command line
lateau_ [lateau_!~Adium@KD125054233174.ppp-bb.dion.ne.jp] has joined #ruby
<bamboozle> Dante2: What OS?
<Dante2> Wondows Vista
<Dante2> And thank you. :)
<bamboozle> What is the problem?
<Dante2> I have a book that is telling me what kinds of commands to run in ruby.
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
<Dante2> like "ruby setup.rb
fridim_ [fridim_!~fridim@2a01:e35:2ece:f2d0:223:4eff:fe6c:c754] has joined #ruby
<Dante2> and all I get is a line telling me that ruby is not a valid director
<Dante2> or a valid command
<bamboozle> You could try this.
Spockz [Spockz!~Spockz@84.245.46.110] has joined #ruby
<bamboozle> Then, you'd run `setup.rb` and it would run it using Ruby.
<Dante2> like when you open a command prompt with ruby, then type irb, and the "ruby setup.rb"?
<bamboozle> Hmm, sorry, I'm a little confused.
<bamboozle> You're trying to run `ruby setup.rb` from the Command Prompt (cmd.exe), yeah?
<Bonkers> you probably need to add ruby to your path
<Bonkers> which is who knows where on windows these days
<Dante2> I've tried that and it tells me that "ruby" is not recognized as an internal or external command
<Bonkers> then you've added the path incorrectly
<Bonkers> did you close and reopne the cmd window?
<Bonkers> path is nto updated in existing windows
<lateau_> restart cmd after append path to ruby
colint [colint!~ColinT@64.9.156.8] has joined #ruby
<Dante2> And how do I do that? I used an automatic ruby installer to get ruby on my pc.
<Dante2> default was the root of C:\
Deesl [Deesl!~bsdboy@unaffiliated/deesl] has joined #ruby
<Bonkers> restart cmd? just close the window and run it open it again?
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
<Bonkers> start->run 'cmd'
<Bonkers> how'd you open it in the first place?
<Dante2> i just type cmd in the search box and hit enter when the cmd.exe pops up. then it runs
<lateau_> ye, close then open it again
<Bonkers> right, close the window that's open right now
<Bonkers> and do that again
<Dante2> ok
<Dante2> now I just opened another one.
<Bonkers> does it work?
<Dante2> I'll try starting an irb session
<Dante2> Same message as always
<Dante2> 'irb' is not recognized as an internal or external command, operable program or batch file.
<Bonkers> check the path you added
<Bonkers> make sure irb.exe is really there
<Bonkers> and that double clicking it directly works
gayasentinel [gayasentinel!~gayasenti@46.21.207.167] has joined #ruby
<Dante2> ok, I think the light just came on. Give me a sec to see.
<lateau_> bonkers: echo %path% works on windows? I don't have windows now so I don't know about it
<Bonkers> I think 'echo %PATH%' might work
<Bonkers> I'm not on windows either
<lateau_> :)
<lateau_> Dante2: try to echo %PATH% on your cmd
<Dante2> C:\Ruby193\bin>echo %PATH% C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x8 6)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\ATI Stream\ bin\x86_64;C:\Program Files (x86)\ATI Stream\bin\x86;C:\Windows\system32;C:\Wind ows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CyberLink\Power2Go;C:\Progra m Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Univer sal Extr
<Dante2> That's what I got
<Dante2> Not sure if I echoed from the right folder
<Dante2> But once I navigated to the ruby.exe file irb kicks in fine.
<lateau_> ok, you need to append c:\Ruby193\bin to your PATH
<Dante2> That was in the link you sent right?
<lateau_> ye
<Dante2> Hate to say it, but I am not sure what I am looking at.
<Dante2> C:\Ruby193\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\ATI Stream\bin\x86_64;C:\Program Files (x86)\ATI Stream\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\CyberLink\Power2Go;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Universal Extractor;C:\Program
Nies [Nies!~Nies@137.Red-81-44-152.dynamicIP.rima-tde.net] has joined #ruby
<Dante2> If I am reading it correctly, it looks like it's already in there.
thone_ [thone_!~thone@e177081213.adsl.alicedsl.de] has joined #ruby
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
<lateau_> i think path is correct now.
<Dante2> I didn't change anything. THat is from the user variables
<Dante2> Looking at the system variables, I don't see the path for ruby, so I am going to try adding it.
<lateau_> ok
<Dante2> If I stop responding, It probably means I've completely crashed my computer. ;)
<lateau_> yup :)
<Dante2> Ok, it's in. Now what do I do? Start irb or stick with windows command prompt? What I am trying to do is install gems really.
<lateau_> ok, just try to ruby -v to checking your ruby is works
<Dante2> ok good. It's reporting the version numbers
<lateau_> good. now time to rock to doing what you want :)
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
krz [krz!~foobar@unaffiliated/krz] has joined #ruby
<Dante2> And there's the brick wall. :( The instructions simply said to unpack the gems file into a directory and run "ruby setup.rb". Just did that and I got an error
<Dante2> ruby: No such file or directory -- setup.rb (LoadError)
<durre> on ubuntu, after some gem installations I get errors like: Invalid gemspec in [/var/lib/gems/1.8/specifications/compass-0.11.6.gemspec]: invalid date format in specification: "2011-12-24 00:00:00.000000000Z" ... I know how to manually fix this, but I want to avoid it alltogether. why does this happen?
<lateau_> Dante2: what is it try to install?
<Dante2> The gems file. rubygems-update-1.8.12.gem
<Dante2> But I thik I just realized another error on my part.
<csmrfx> I guess at this point most people will tell you: "Use rvm"
xjiujiu [xjiujiu!~quassel@218.77.14.195] has joined #ruby
awesome [awesome!~awesome@212.62.202.84.customer.cdi.no] has joined #ruby
<lateau_> Dante2: just try to "gem install" instead unpack the gem file
<lateau_> on same path the file is.
<banisterfiend> csmrfx: hey carl
<csmrfx> oh I see you're on vista
<csmrfx> banisterfiend: hny bahn-hofs-fiendQ
kakashi_ [kakashi_!~kakashi_@nltk/kakashi] has joined #ruby
<banisterfiend> csmrfx: my real brother (carl stephen mair, i.e csm) is here right now, so my loneliness is plugged finally and i may stop calling you carl for the short duration he's here
Araxia__ [Araxia__!~Araxia@c-24-22-63-1.hsd1.or.comcast.net] has joined #ruby
<Dante2> Well I'll be a son of a blue nosed gopher. It worked. It actually worked. 1 Gem installed
<csmrfx> banisterfiend: you should consult him about changing your nick to bahnhofsfriend
<lateau_> Dante2: good. now check the gem version with gem —version
<Dante2> 1.8.11
<banisterfiend> csmrfx: he's drunk probably not a good time to ask
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
<csmrfx> lol get him to sign deeds
<banisterfiend> csmrfx: he's weeping in the corner with a photoalbum haunted by memories of past girlfriends
mafolz [mafolz!~mafolz@dhcp50-210.start.uni-saarland.de] has joined #ruby
<Dante2> currently updating gems
<Dante2> says I need build tools
<csmrfx> "It's so easy to leave me, all alone with the mamm'ries..."
<lateau_> Dante2: good
<Dante2> gave a couple links to follow to install build tools. Gonna give it a shot.
<Dante2> lateau: A tad bit nervous. It's telling me to take files out not concernig legacy dev-kits... given that I have ruby 1.9.3 are legacy files something I need to be concerned about?
<csmrfx> imo no
<csmrfx> but some things that work on 1.8 just might not work on some other v
<Dante2> Well, I guess the bottom line question is really this: If i just run the installer and get an error after the fact, can I simply remove the files mentioned on the site and have everything run smoothly?
<csmrfx> ok, I see. I dont know. I dont know what files.
pen [pen!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
<lateau_> Dante2: unfortunately i don't have a idea about it...
<Dante2> Whelp, guess I'm gonna find out the hard way. ;)
<lateau_> ok :)
<lateau_> may be there a some other hard way with compiling ruby instead using ruby-installer. :)
<Dante2> Perhaps. My script seems to run now, thought..... perhaps I'll worry about messing with the devkit at a later date.
<Dante2> After this I have to install rails. That promises to be a real blast.
vmatiyko [vmatiyko!~vmatiyko@178.120.67.145] has joined #ruby
<banisterfiend> csmrfx: carl
<Dante2> Thank you everyone for all of your help. =D It's late and I'm going to hit the hay.
stoffus [stoffus!~stoffus@2001:9b0:1:dead:129a:ddff:fe58:6835] has joined #ruby
<lateau_> have a good day :)
emmanuelux [emmanuelux!~emmanuel@2a01:e35:2e4d:9010:21d:60ff:fe0e:b818] has joined #ruby
Schmidt [Schmidt!~lsc@h-11-69.a254.priv.bahnhof.se] has joined #ruby
Dante2 [Dante2!4721a6e9@gateway/web/freenode/ip.71.33.166.233] has quit [#ruby]
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
bluOxigen [bluOxigen!ssf@unaffiliated/bluOxigen] has joined #ruby
freelanceful [freelanceful!~jamesfend@c-71-228-225-167.hsd1.tn.comcast.net] has joined #ruby
<freelanceful> hey guys, does CanCan work for limiting access for roles? for instance, I have workers and buyers and they each access different pages and parts...
<freelanceful> also right now, any buyer can edit any project by simply typing it in the URL.. how shall I limit that? use CanCan?
shevy [shevy!~shevy@213-33-13-171.adsl.highway.telekom.at] has joined #ruby
zommi [zommi!quassel@nat/ibm/x-oeinryvisniehnha] has joined #ruby
<csmrfx> banisterfiend: summin up?
Jackneill [Jackneill!~Jackneill@unaffiliated/jackneill] has joined #ruby
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
robertjpayne [robertjpayne!~robertjpa@122.58.169.214] has joined #ruby
bintut [bintut!~bintut@cm61.sigma15.maxonline.com.sg] has joined #ruby
frerich [frerich!~frerich@mail.froglogic.com] has joined #ruby
frerich [frerich!~frerich@kde/raabe] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has joined #ruby
Deiu [Deiu!~deiu@unaffiliated/deiu] has quit [#ruby]
eldariof [eldariof!~CLD@95.84.56.1] has joined #ruby
aantix [aantix!~jjones@70-36-141-115.dsl.dynamic.sonic.net] has joined #ruby
libertyprime [libertyprime!~libertypr@182.236.125.102] has joined #ruby
kakashi_ [kakashi_!~kakashi_@nltk/kakashi] has joined #ruby
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby
skim1776 [skim1776!~sergey@95.56.183.160] has joined #ruby
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
tobym [tobym!~tobym@c-24-128-127-47.hsd1.vt.comcast.net] has joined #ruby
<hemanth> anyone working with "watir-webdriver/extensions/alerts" ?
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
`gregorg` [`gregorg`!~Greg@unaffiliated/gregorg] has joined #ruby
mohits [mohits!~mohit@unaffiliated/mohits] has joined #ruby
ghosTM55 [ghosTM55!~ghosTM55@li279-245.members.linode.com] has joined #ruby
jbpros [jbpros!~jbpros@188.188.78.231] has joined #ruby
tilde` [tilde`!~tilde@host226-185-dynamic.23-79-r.retail.telecomitalia.it] has joined #ruby
Cyrus [Cyrus!~Cyrus@unaffiliated/cyrus] has joined #ruby
ly- [ly-!~ly-@unaffiliated/ly-] has joined #ruby
nicoulaj [nicoulaj!~nicoulaj@V10K2.bull.fr] has joined #ruby
xpot [xpot!~xpot@166-70-100-198.ip.xmission.com] has joined #ruby
<hemanth> browser.alert not working with watir-webdriver/extensions/alerts!
PaciFisT [PaciFisT!~PeaCE@CPE0023be436752-CM0023be436750.cpe.net.cable.rogers.com] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
Barakas [Barakas!~v@77.242.201.52] has joined #ruby
mohits [mohits!~mohit@unaffiliated/mohits] has joined #ruby
manizzle [manizzle!~manizzle@adsl-99-91-42-119.dsl.pltn13.sbcglobal.net] has joined #ruby
xec [xec!~xec@2a00:10b0:1:1002:5ab0:35ff:fef8:6a01] has joined #ruby
cachemoney [cachemoney!~cachemone@71-94-132-42.static.mtpk.ca.charter.com] has joined #ruby
elliot98 [elliot98!~elliot@IGLD-84-229-15-130.inter.net.il] has joined #ruby
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
Schmidt [Schmidt!~lsc@h-79-136-103-158.na.cust.bahnhof.se] has joined #ruby
crayfishx [crayfishx!~craig@78.129.240.7] has joined #ruby
shtirlic [shtirlic!~shtirlic@188.134.7.124] has joined #ruby
probst [probst!~probst@bumblebee.cl.cam.ac.uk] has joined #ruby
Clooth [Clooth!~Clooth@GGYKMMDCXCVII.gprs.sl-laajakaista.fi] has joined #ruby
Schmidt [Schmidt!~lsc@h-79-136-103-158.na.cust.bahnhof.se] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
mohits1 [mohits1!~mohit@115.113.153.226] has joined #ruby
mohits [mohits!~mohit@unaffiliated/mohits] has joined #ruby
berserkr [berserkr!~david@212.122.111.205.dyn.user.ono.com] has joined #ruby
jbpros [jbpros!~jbpros@d515285E6.access.telenet.be] has joined #ruby
crayfishx [crayfishx!~craig@78.129.240.7] has joined #ruby
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@bb220-255-36-18.singnet.com.sg] has joined #ruby
deband [deband!~wewilknow@189.38.230.215] has joined #ruby
dekroning [dekroning!~dekroning@541B931D.cm-5-4c.dynamic.ziggo.nl] has joined #ruby
deband [deband!~wewilknow@189.38.230.215] has quit [#ruby]
apok [apok!~apok@96.24.67.22] has joined #ruby
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
vmatiyko [vmatiyko!~vmatiyko@178.120.67.145] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@187.64.90.129] has joined #ruby
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
xec [xec!~xec@188.95.241.142] has joined #ruby
xec [xec!~xec@2a00:10b0:1:1002:5ab0:35ff:fef8:6a01] has joined #ruby
jamiemill [jamiemill!~jamiemill@78-86-4-116.zone2.bethere.co.uk] has joined #ruby
Natanaiel [Natanaiel!~Unknown@unaffiliated/natanaiel] has joined #ruby
<Natanaiel> how can I set a folder in local system as a source in Gemfile?
<waxjar> why would you use the Gemfile for that?
SterNiX [SterNiX!~LessIsMor@unaffiliated/nu253r/x-0655220] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
<Natanaiel> to install all the required gem files automaticly. I have all of them in my localsystem, but I don't want to install them one by one
<Natanaiel> waxjar: ^^
<waxjar> it's not really what Bundler is intended for.
<waxjar> do you have .gems or just folders of code?
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
<Natanaiel> waxjar: my real problem is I want to install snorby gem files with bundle install on a system that I have no internet
<Natanaiel> so I've download gems files and copy them into cache folder
<Natanaiel> but when I run bundle install it wants to connect to a source on the internet
<waxjar> you could install them to a directory in your project folder on a machine you have internet on and transfer it to the machine without internet
<waxjar> or write a simple ruby script that installs all .gems in directory x (an each block with system("gem i #{gem}") maybe)
<Natanaiel> so can't I specify a file as a source?!
pen [pen!~pen@wl065.cc.ntu.edu.tw] has joined #ruby
QaDeS [QaDeS!~mklaus@frbg-5d84f8c6.pool.mediaWays.net] has joined #ruby
<waxjar> i don't think so
<waxjar> there is a :path option for specifying gems
shtirlic [shtirlic!~shtirlic@188.134.7.124] has joined #ruby
mattyohe [mattyohe!~mattyohe@2620:0:e50:3011:54b4:bad:c021:4691] has joined #ruby
pantsman [pantsman!~pantsman@2.27.111.48] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
fixl [fixl!~fixl@124-170-21-28.dyn.iinet.net.au] has joined #ruby
berkes [berkes!~ber@indebossenvanleusden.xs4all.nl] has joined #ruby
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
marcol [marcol!~marcol@ppp-23-47.26-151.libero.it] has joined #ruby
<phrame> is there a difference between @var and self.var when inside an instance method?
<phrame> they're the same, right?
Guedes [Guedes!~guedes@189.31.65.14] has joined #ruby
Guedes [Guedes!~guedes@unaffiliated/guedes] has joined #ruby
<Gekz> I believe so phrame
<phrame> okay
<Gekz> syntactic sugar and all that
<Gekz> I believe it's convention to use @ for attributes
<phrame> yeah
<phrame> i'm reading someone else's code and it's throwing me off a bit
<phrame> so i'm wondering if there's some subtle difference that he's taking advantage of
<banisterfiend> phrame: they're very different
<phrame> oh :(
<banisterfiend> phrame: self.var <-------- method invocation @var <---- ivar
<banisterfiend> phrame: in the case someone has done: attr_accessor :var though, then self.var= is a setter for @var and self.var is a getter for @var
<banisterfiend> so they'll be functionally equivalent then
<banisterfiend> but conceptually they're very different and it's impt you understand that
<phrame> yeah i'm definitely interested in the difference then
<phrame> this guy used attr_accessor :var as well
<phrame> then used the variable as a normal instance variable
<phrame> though without the @
<banisterfiend> phrame: well, all that attr_accessor :var does is generates a getter and a setter (both methods) for the @var instance variable
<banisterfiend> phrame: this is the important point, 'var' is a mehtod that simply returns @var
<banisterfiend> and 'var=(x)' is a method that sets @var to x
<Gekz> banisterfiend: I think I oversimplified my response because that's what I meant, haha
kenperkins [kenperkins!~textual@50-47-18-37.evrt.wa.frontiernet.net] has joined #ruby
<banisterfiend> k
<phrame> you're both helpful :)
<Gekz> you can do crazy stuff like def var=(x) @var = x.capitalize end
<Gekz> so self.var = "die you"
<Gekz> and @var would be "Die You"
<Gekz> banisterfiend: am I wrong?
<phrame> that would make sense
<phrame> is ivar short for anything googleable?
<Gekz> instance variable I think
<banisterfiend> Gekz: that's right
<Gekz> phrame: this is a little bit old but I found it today and it's interesting http://cbcg.net/talks/rubyidioms/
<phrame> so @var gets you the variable, and self.var invokes the method that returns the variable
<Gekz> phrame: correct.
<phrame> okay
<phrame> cool cool
<banisterfiend> phrame: but in ruby @var is private, all ivars are private, so the only way to access it from outside the object is through a getter/setter
<phrame> yeah
<phrame> are they not inherited by children then?
<Gekz> banisterfiend: can you be a tool and do something like self.x = 9
<Gekz> would that make it public
<banisterfiend> Gekz: how would that make it public
<banisterfiend> phrame: ivars are not inherited in ruby
<phrame> would that change the reference of .x away from the ivar x
<Gekz> that was _my_ question :P
<banisterfiend> no, that sets the ivar to 9
<banisterfiend> assuming u have attr_accessor :x
<Gekz> banisterfiend: oh I see, I just tested what I said
yellow5 [yellow5!~yellow5@levicole.xen.prgmr.com] has joined #ruby
<Gekz> Python is what i'd call "weakly object oriented"
<phrame> would you be able to uh
<Gekz> I like how ruby makes methods and attributes distinct
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
<phrame> change x into an alias for 9 and dereference the ivar that used to be x
<phrame> or are they essentially the same thing
<banisterfiend> phrame: i think y ou're confusing objects and variables
<phrame> probably :p
<Gekz> banisterfiend: ooh, you might be able to answer my question. I have an 136MB XML file that I want to query with a webapp. Would it be saner to just convert it into SQL or is there a nice way I could do this?
<banisterfiend> Gekz: no idea
<Gekz> blah
<banisterfiend> Gekz: ask in #ruby-lang
<Gekz> how does that differ to this channel?
<banisterfiend> it's more official
<Gekz> moar
skim1776 [skim1776!~sergey@95.56.183.160] has quit [#ruby]
zbrown [zbrown!~zbrown@rufius.xen.prgmr.com] has joined #ruby
flippingbits [flippingbits!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
palcu [palcu!~alex@89.122.187.223] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@bb220-255-36-18.singnet.com.sg] has joined #ruby
ixti [ixti!~ixti@80.31.118.40] has joined #ruby
p0y [p0y!~p0y@182.18.249.40] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
azbarcea_ [azbarcea_!~quassel@79.114.115.193] has joined #ruby
RomD` [RomD`!~Roman@nrbg-4d076620.pool.mediaWays.net] has joined #ruby
burgestrand [burgestrand!~burgestra@81-229-85-235-no66.tbcn.telia.com] has joined #ruby
need_shell [need_shell!~need_shel@122.160.42.91] has joined #ruby
<need_shell> Hi all
<need_shell> I need help, please be kind :)
<burgestrand> linduxed: you managed to get around your non-working destroy? :)
<need_shell> I am writing a small ruby script which should read first 50 words from a very long single line
<need_shell> I am trying using regex for this but am unable to write one properly
p0y [p0y!~p0y@182.18.249.40] has joined #ruby
<need_shell> So could please somebody help me with that
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
Spockz [Spockz!~Spockz@84.245.46.110] has joined #ruby
<burgestrand> need_shell: you’ll be more likely to get help if you show us a minimal example of what you’ve tried, and explain what you expect it to do and then explain what it does instead
<need_shell> ok.
whaity [whaity!~whaity@cpc13-lewi14-2-0-cust680.2-4.cable.virginmedia.com] has joined #ruby
pen [pen!~pen@140.112.30.137] has joined #ruby
<need_shell> For now, I have just three lines of code
<need_shell> these
<need_shell> file = File.read("output.txt")
<need_shell> match = file.scan(/^(...){0,50}/)
<need_shell> print match
<need_shell> output.txt contains dump from a network stream
<need_shell> I am trying to read first 50 words (or 200 characters) from the file
<need_shell> my regex is surely wrong, I need help regarding the regex
<nd___> /\w{0,50}/ <-- like this?
<burgestrand> \w is a word character, not a word in itself; you’d probably be better of matching the boundaries between words (most likely a single whitespace)
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby
<need_shell> that is the problem its a hex output..something likethis
<need_shell> ,0x58,0x5f,0x5a,0x8b,0x12,0xeb,0x86,0x5d,0x68,0x33,0x32,
<need_shell> and this is a very long line
<need_shell> the line begins and ends with a ,
<need_shell> may be first 300 characters may also do for me
<burgestrand> there’s also the case that scan will give you an array, and for a very long line this could prove to be a lot of unneeded work (and take much longer than it needs to), but it could also be the case that your very long line is not really very long at all and it might not be a problem
<nd___> Might it be easier here to just trim each line to the first x characters?
<need_shell> burgerstrand: it is really long, may be 1000 "words" in form of 0x33
<need_shell> nd___: its a single line..I intend to read first 50 words or 300 characters first, then next ones till EOF
<burgestrand> need_shell: I still don’t understand what your actual input is and what your output should be
akem [akem!~akem@unaffiliated/akem] has joined #ruby
<need_shell> my input is a file which contains a single line of hex in the form......,0xa8,0x01,0x32,0x68,0x02,0x00,0x11,0x5c,0x89,0xe6,0x6a,0x10,0x56,0x57,
<burgestrand> need_shell: okay, then in this input, what constitutes a word?
<need_shell> it is a single line which is _really_ long....may be 5000 characters
<need_shell> the commas? Am I wrong assuming that?
<need_shell> I mean ,0x5c, is a word
<burgestrand> need_shell: you’re wrong assuming us assuming that, but alright, so assuming you were looking for just five words, would the output be ['0xA8', '0x01', '0x32', '0x68', '0x02']?
<burgestrand> or do you want the commas included as well?
<burgestrand> what about if there’s multiple commas between each word?
<need_shell> there will be no multiple commas and yes the commas are required as well
<need_shell> the output is machine generated
<need_shell> it would be ok if we can read first, say 200, characters
<burgestrand> need_shell: your_string[0, 200]
jbpros [jbpros!~jbpros@d515285E6.access.telenet.be] has joined #ruby
<burgestrand> if all you want is the characters
<need_shell> I am sorry if I sound stupid but that was not working with file
<need_shell> let me quick check again
<burgestrand> then it’s not a string
<need_shell> I am reading it from a file
<need_shell> using File.read
<Nowaker> File.read returns String
<Nowaker> so you are able to make string[0, 5] on it
<need_shell> let me check
<Nowaker> irb(main):014:0> (File.read '/tmp/test')[0, 10]
<Nowaker> => "testing\n"
<Nowaker> irb(main):015:0> (File.read '/tmp/test')[0, 3]
<Nowaker> => "tes"
<need_shell> omg
<need_shell> it worked
<need_shell> thanks a lot
Tuxist [Tuxist!~quassel@dyndsl-085-016-196-179.ewe-ip-backbone.de] has joined #ruby
<need_shell> I was using File instead of file
<need_shell> damn caps
<need_shell> thanks all
<need_shell> :)
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
sinuc_ [sinuc_!~sinuc@irssi.sinuc.boxnet.eu] has joined #ruby
Sliker [Sliker!~ponies@46.208.206.144] has joined #ruby
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
_md [_md!~mduarte@cpc4-finc13-2-0-cust568.4-2.cable.virginmedia.com] has joined #ruby
freenodiz [freenodiz!~IceChat77@unaffiliated/freenodiz] has joined #ruby
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
<freenodiz> How would you compare in speed,system performance ,etc,a rails app with nginx as a proxy and unicorn vs a drupal(pressflow) install ,with nginx and varnish ?
xpot [xpot!~xpot@166-70-100-198.ip.xmission.com] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
mogria [mogria!~mogria@19-232.62-81.cust.bluewin.ch] has joined #ruby
p0y [p0y!~p0y@112.210.58.225] has joined #ruby
vmatiyko [vmatiyko!~vmatiyko@178.120.67.145] has joined #ruby
waxjar [waxjar!~waxjar@82-170-1-70.ip.telfort.nl] has joined #ruby
ikaros [ikaros!~ikaros@dslb-188-107-221-154.pools.arcor-ip.net] has joined #ruby
poseid [poseid!52877a23@gateway/web/freenode/ip.82.135.122.35] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<poseid> i am looking at a sample Rails project, where there is a class Role and a class Reference::Role
philcrissman [philcrissman!~philcriss@206.57.45.116] has joined #ruby
<poseid> i am wondering why you would have the difference....
<csmrfx> because architechture astronauts
<poseid> i have the impression that in Reference::Role there are setup some shortcuts
<poseid> e.g. you can write something like this: role.administrator?
<poseid> the code is: define_method("#{role}?") { name == role.to_s }
<poseid> in the reference class you define the initial roles: TYPES = [ :administrator, :artist, :producer, :subscriber, :visitor ]
<csmrfx> no
<csmrfx> the author of the class has predefined those
<poseid> ok, reference model predefines the roles...
<poseid> sorry for my confusion, but would it be possible to extend that class dynamically...
<csmrfx> you did notice those are in diff modules
<poseid> e.g. extending TYPES array after the classes have been loaded?
<csmrfx> I think it is possible
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<linduxed> burgestrand: yeah, i did
<linduxed> burgestrand: turns out rails wants its javascript....
<linduxed> burgestrand: i had noscript blocking scripts from localhost, which didn't exactly help
<poseid> csmrfx: what would be the implications of not using different modules?
<poseid> for that reference part and the concrete part
<poseid> that reference part looks somewhat like meta-definitions
<csmrfx> imo that would imply a different use for the classes
<linduxed> burgestrand: figuring out what the hell was going on wasn't the best time i've had... it hit me after an hour of googling when someone was speaking of the need to load some custom js to make his site work
p0y [p0y!~p0y@112.210.58.225] has joined #ruby
p0y_ [p0y_!~p0y@182.18.249.40] has joined #ruby
<poseid> ok... will do some experiments... thanks for dicussions
gen0cide_ [gen0cide_!~TigerBloo@c-76-126-176-33.hsd1.ca.comcast.net] has joined #ruby
Spockz [Spockz!~Spockz@84.245.46.110] has joined #ruby
rippa [rippa!~rippa@87-253-25-62.pppoe.yaroslavl.ru] has joined #ruby
`brendan [`brendan!~b@66-208-246-34-ubr02b-waldlk01-mi.hfc.comcastbusiness.net] has joined #ruby
<`brendan> morning folks
gen0cide_ [gen0cide_!~TigerBloo@c-76-126-176-33.hsd1.ca.comcast.net] has joined #ruby
gen0cide_ [gen0cide_!~TigerBloo@c-76-126-176-33.hsd1.ca.comcast.net] has joined #ruby
gen0cide_ [gen0cide_!~TigerBloo@c-76-126-176-33.hsd1.ca.comcast.net] has joined #ruby
jbpros [jbpros!~jbpros@d515285E6.access.telenet.be] has joined #ruby
rmenn [rmenn!cb91b57a@gateway/web/freenode/ip.203.145.181.122] has joined #ruby
tcurdt [tcurdt!~tcurdt@dslb-188-097-069-059.pools.arcor-ip.net] has joined #ruby
<rmenn> Hey i have a quick question - i have ruby wrapper script to run a particular command but i am unable to see the output generated by the execution, what is the best way to do this
kreantos [kreantos!~simon@95.232.110.3] has joined #ruby
<kreantos> v+
cousine [cousine!~cousine@196.221.242.180] has joined #ruby
flippingbits [flippingbits!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
BrianE [BrianE!~brian@87.115.115.247] has joined #ruby
<burgestrand> linduxed: :)
<burgestrand> linduxed: the reason is because you can’t send put/delete requests from most browsers at all (and even if you could, it’d be with a form with the appropriate method set); and your browser defaults to a GET request
madsgraphics [madsgraphics!~madsgraph@mail.11labo.net] has joined #ruby
hzlocky_ [hzlocky_!~me@dynamic-vpdn-93-125-15-168.telecom.by] has joined #ruby
<visof> when i run ruby code first time it run slow but when run it again it run faster than the first time, is that true? , because interpreter cache the values?
<burgestrand> visof: no
<shevy> visof ruby runs faster when it rides a pony
<`brendan> what kinda pony?
yakko [yakko!~quassel@200-140-84-9.bsace702.dsl.brasiltelecom.net.br] has joined #ruby
abstrusenick [abstrusenick!~abstrusen@bb220-255-36-18.singnet.com.sg] has joined #ruby
<linduxed> burgestrand: oh yeah... i read somewhere that someone a long time ago thought DELETE would be too dangerous to allow as a signal to send
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby
dyer [dyer!~dyer@unaffiliated/dyer] has joined #ruby
p0y [p0y!~p0y@112.210.58.225] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
akem [akem!~akem@164.15.85.79.rev.sfr.net] has joined #ruby
akem [akem!~akem@unaffiliated/akem] has joined #ruby
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
nvez [nvez!~textual@unaffiliated/nvez] has joined #ruby
jwmann [jwmann!~Adium@modemcable242.110-201-24.mc.videotron.ca] has joined #ruby
bluOxigen [bluOxigen!~noreply@unaffiliated/bluOxigen] has joined #ruby
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
Manhose_ [Manhose_!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
<burgestrand> linduxed: it would be dangerous if it was sent by merely visiting a link, same reason to why you need to use forms to send POST requests with browsers (interestingly enough, I believe many browsers support GET/POST/PUT/DELETE for XHR requests)
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
vraa [vraa!~vraa@c-76-30-135-64.hsd1.tx.comcast.net] has joined #ruby
pencilcheck [pencilcheck!~pen@dhcp1.csie.ntu.edu.tw] has joined #ruby
p0y [p0y!~p0y@182.18.249.40] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
senny [senny!~senny@77-56-67-120.dclient.hispeed.ch] has joined #ruby
provideal [provideal!~hornp@p4FFF85E5.dip.t-dialin.net] has joined #ruby
<visof> burgestrand: is ruby faster than python?
vraa [vraa!~vraa@h188.182.213.151.dynamic.ip.windstream.net] has joined #ruby
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
Yu\2 [Yu\2!~Yu@2001:638:504:f1f6:213:77ff:feb6:afb0] has joined #ruby
<shevy> burgestrand: can you shower my cat?
thecreators [thecreators!~rskagy@cpe-65-27-201-203.cinci.res.rr.com] has joined #ruby
<yakko_watch_dhh> visof: it's more OO than python
devdazed [devdazed!~russ_nyc@static-96-239-59-191.nycmny.fios.verizon.net] has joined #ruby
pietro_ [pietro_!~pietro@2-227-162-47.ip187.fastwebnet.it] has joined #ruby
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
maasha [maasha!82e1d361@gateway/web/freenode/ip.130.225.211.97] has joined #ruby
<maasha> Hi, I want to dump a data structure to disk and restore it. What fast methods do we have for that?
akem [akem!~akem@unaffiliated/akem] has joined #ruby
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
<shevy> maasha, I think marshal
<tilde`> marienz, marshal_dump and marshal_load
<tilde`> maasha*
<shevy> Marshal.dump(a) Marshal.load(b)
<maasha> yeah, I forgot about marshal
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<maasha> Perfect
<maasha> TY
_md [_md!~mduarte@cpc4-finc13-2-0-cust568.4-2.cable.virginmedia.com] has joined #ruby
arthurlockhart [arthurlockhart!~cinch@60-242-128-8.static.tpgi.com.au] has joined #ruby
michael__ [michael__!~michael@213.8.57.217] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
<michael__> hey
<michael__> anyone can advise on this problem? http://pastebin.com/ZBDCeeVp
Carmidev [Carmidev!~carmidev@BSN-61-79-200.static.dsl.siol.net] has joined #ruby
rethaw [rethaw!~textual@c-98-234-116-174.hsd1.ca.comcast.net] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
rook_flood [rook_flood!~textual@c-68-50-111-251.hsd1.dc.comcast.net] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
<maasha> michael__: looks like you are missing header files for SQLITE
<maasha> although it says: checking for sqlite3.h... yes
<maasha> something is fubar
<michael__> thanks gonna lurk around
oponder [oponder!~oponder@145-118-116-102.fttx.bbned.nl] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
pen [pen!~pen@g1pc2n249.g1.ntu.edu.tw] has joined #ruby
v0n [v0n!~v4n@2607:fad8:4:0:21e:8cff:fe4d:2f7d] has joined #ruby
rmenn [rmenn!cb91b57a@gateway/web/freenode/ip.203.145.181.122] has quit [#ruby]
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby
vmatiyko [vmatiyko!~vmatiyko@178.120.67.145] has joined #ruby
skim1776 [skim1776!~sergey@95.56.183.160] has joined #ruby
nd____ [nd____!~nd@mnhm-5f74fb72.pool.mediaWays.net] has joined #ruby
albedoa [albedoa!~albedoa@ip68-108-106-30.lv.lv.cox.net] has joined #ruby
iamjarvo [iamjarvo!~Adium@c-71-230-13-201.hsd1.nj.comcast.net] has joined #ruby
<iamjarvo> what is the & called in this example foo.sort_by(&:bar)
<confounds> iamjarvo an ampersand
<iamjarvo> but what is it doing
geaif [geaif!~geaif@AToulouse-554-1-40-57.w92-149.abo.wanadoo.fr] has joined #ruby
<skim1776> iamjarvo, reference to the Proc object
<confounds> iamjarvo look here, nice explanation http://blog.codahale.com/2006/08/01/stupid-ruby-tricks-stringto_proc/
<iamjarvo> thanks
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby
<skim1776> confounds, do you know some ruby projects on github with clean code for beginners to learn?
Blaguvest [Blaguvest!~Blaguvest@unaffiliated/blaguvest] has joined #ruby
<iamjarvo> skim1776: the ruby koans
Marco_ [Marco_!~marco@pat160.dartmouth-secure.border2-cfw.Dartmouth.EDU] has joined #ruby
<confounds> skim1776 https://github.com/benny/book-of-ruby haven't tried it but could be good
<skim1776> iamjarvo, that's now exactly what I'm searching for, I need to learn how code is structured within project, how code is tested, what are the most useful patterns, etc.
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
<confounds> ah
<confounds> there's probably not a single source for all that
<iamjarvo> ooo you just want to read source
<confounds> skim1776 maybe look at some popular, smaller gems
<skim1776> confounds, not perfect code, but close to it
Marco [Marco!~marco@pat32.dartmouth-secure.border1-cfw.Dartmouth.EDU] has joined #ruby
dch4pm4n [dch4pm4n!~d@gateway/tor-sasl/dchapman1988] has joined #ruby
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
vmatiyko [vmatiyko!~vmatiyko@178.120.67.145] has quit [#ruby]
Marco [Marco!~marco@Marco-2.Kiewit.Dartmouth.EDU] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
Silker [Silker!~ponies@46.208.206.144] has joined #ruby
Skaag [Skaag!~Skaag@cpe-67-247-51-89.nyc.res.rr.com] has joined #ruby
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
johanhsfy [johanhsfy!~johan@c-887471d5.012-52-6c756e10.cust.bredbandsbolaget.se] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
skim1776 [skim1776!~sergey@95.56.123.168] has joined #ruby
jmaister [jmaister!~jmaister@unaffiliated/jmaister] has joined #ruby
Sliker_ [Sliker_!~ponies@46.208.206.144] has joined #ruby
danheberden [danheberden!~danheberd@li225-35.members.linode.com] has joined #ruby
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby
conor_ireland [conor_ireland!~conor_ire@89.100.121.49] has joined #ruby
idarkside [idarkside!~YourNick@5e0eccf0.bb.sky.com] has joined #ruby
Pip [Pip!~Pip@pppoe-188-187-43-137.volgograd.ertelecom.ru] has joined #ruby
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
<idarkside> hi
<idarkside> im looking for some advice
p0y_ [p0y_!~p0y@112.210.58.225] has joined #ruby
provideal [provideal!~hornp@p4FFF85E5.dip.t-dialin.net] has joined #ruby
<shevy> idarkside we can help especially with sex-related issues
<idarkside> lol
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
<idarkside> im wanting get GET a url within a siriproxy plugin is this achevable?
waxjar [waxjar!~waxjar@82-170-1-70.ip.telfort.nl] has joined #ruby
<idarkside> shevy
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has joined #ruby
<shevy> I dont know what is siriproxy
Witide [Witide!~Witide@adsl-65-9-107-116.mia.bellsouth.net] has joined #ruby
dcarper_ [dcarper_!~dcarper@50-73-187-102-pennsylvania.hfc.comcastbusiness.net] has joined #ruby
<shevy> but I am going the easy route and say it is not possible
<idarkside> lol
<idarkside> i knw its possible just not entirely sure where to start
<confounds> start at the beginning
<idarkside> i can give u a copy of the example plugin for the proxy
luxurymode [luxurymode!~luxurymod@rrcs-184-75-21-21.nyc.biz.rr.com] has joined #ruby
<idarkside> ok siriproxy is for the iphone 4s allows custom commands via siri
<idarkside> i would like to GET http://address-here
<idarkside> the address would exeecute a command
<idarkside> i am wondering if i provide the example file if you could give me an example to use it with mutiple voice commands with GET?
looopy [looopy!~looopy@pool-141-156-49-128.washdc.btas.verizon.net] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
peterhellberg [peterhellberg!~peterhell@213.115.122.2] has joined #ruby
<idarkside> EG turn light off = http://address/server.aspx?=t=lightoff
<idarkside> as an example
durre [durre!~kvirc@217-212-242-4.customer.telia.com] has joined #ruby
p0y [p0y!~p0y@182.18.249.40] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
baroquebobcat [baroquebobcat!~nick@70-90-113-174-co.denver.hfc.comcastbusiness.net] has joined #ruby
<idarkside> confounds^^^
p0y_ [p0y_!~p0y@112.210.58.225] has joined #ruby
sbanwart [sbanwart!~sbanwart@99-177-126-136.lightspeed.bcvloh.sbcglobal.net] has joined #ruby
tvw [tvw!~tv@212.79.9.150] has joined #ruby
<confounds> idarkside sorry man i know nothing about siriproxy, hadn't even heard of it
<idarkside> its justthe ruby bit i need tbh
<idarkside> the example plugin explains most of it
<shevy> idarkside, do you have any data where you can extract the info you need?
<shevy> or are you blackbox coding
codefriar [codefriar!~codefriar@cpe-098-026-012-134.nc.res.rr.com] has quit ["Linkinus - http://linkinus.com"]
<idarkside> ^^ :)
<shevy> I am not sure where the info you need is there
Carmivore [Carmivore!~carmivmor@ec2-107-20-0-215.compute-1.amazonaws.com] has joined #ruby
dcarper1 [dcarper1!~Adium@50-73-187-102-pennsylvania.hfc.comcastbusiness.net] has joined #ruby
<idarkside> # When the server reports an "unkown command", this gets called. It's useful for implementing commands that aren't otherwise covered
<idarkside> def unknown_command(object, connection, command)
<idarkside> if(command.match(/test siri proxy/i))
<idarkside> self.plugin_manager.block_rest_of_session_from_server
<idarkside>
<idarkside> return generate_siri_utterance(connection.lastRefId, "Siri Proxy is up and running!")
<idarkside> end
<idarkside> if(command.match(/test siri proxy/i)) = voice command sent from iphone
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
<freenodiz> idarkside,paste it with gist dude,this is not correct
<freenodiz> gist?
<freenodiz> !gist
<idarkside> !gist
<freenodiz> how do you call the bot here?
<idarkside> return generate_siri_utterance(connection.lastRefId, "Siri Proxy is up and running!") = return command
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
<freenodiz> here https://gist.github.com/
<idarkside> id like to change it so it GETs URL then says = blah blah completed
<shevy> well I am not sure that has answered my question :P
dcarper1 [dcarper1!~Adium@50-73-187-102-pennsylvania.hfc.comcastbusiness.net] has joined #ruby
<shevy> sounds a lot like blackbox coding. you are not even sure where the URL is?
<freenodiz> shevy,what you mean with "black box" coding?
<idarkside> yeah i am its an internal address for now
skim1776 [skim1776!~sergey@95.56.123.168] has joined #ruby
<shevy> freenodiz black box coding as in having a problem you can't see and trying to continue
<shevy> and you also can't really open the box
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
<freenodiz> i see,that is very bad to do,you must know what's going on always
<idarkside> yeah
<freenodiz> probably he copied and pasted the code from somewhere
<shevy> hmm
<shevy> idarkside, if you know the URL, you'd only have to find out whether it is possible to do a GET via siriproxy at all
<shevy> I mean, it seems as if right now you either don't know if it is possible, or it simply is not possible
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby
<shevy> and btw if it is on https://github.com/plamoni/SiriProxy
<shevy> file an issue
<shevy> uh oh
<shevy> lots of open issues ;-)
thecreators [thecreators!~rskagy@cpe-65-27-201-203.cinci.res.rr.com] has joined #ruby
<idarkside> yeah there are
<freenodiz> does you guys know why nginx have 2 logos around?that one with the stars,that is on the wiki,and th\t other green one?
fluke_ [fluke_!~fluke@212.47.19.46] has joined #ruby
<shevy> hah
<shevy> I always thought nginx had no logo at all
<shevy> cheap russian thing
<shevy> http://nginx.org/ well it has the green one
<fluke_> hey everybody. Can someone explain the difference between these two? b = x.instance_eval{ binding }
<fluke_> b = x.send :binding
<shevy> on http://wiki.nginx.org/Main the logo is the same for me freenodiz
<fluke_> I thought they should be equal but apparently there is a difference
<freenodiz> star one http://wiki.nginx.org/Main
waxjar [waxjar!~waxjar@82-170-1-70.ip.telfort.nl] has joined #ruby
<shevy> well the favicon is that green one
<shevy> btw funny that the wiki is better designed than the rest
<shevy> :)
robyurkowski [robyurkowski!~robyurkow@64.254.250.82] has joined #ruby
<freenodiz> yes, :) .i prefer to use the logo in the wiki in my cv,i love that russian cheap thingy
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
janissary [janissary!405a0bb2@gateway/web/freenode/ip.64.90.11.178] has joined #ruby
<shevy> lol
<shevy> ok let's shorten that
<shevy> "<freenodiz> i love that russian cheap thingy"
_md [_md!~mduarte@cpc4-finc13-2-0-cust568.4-2.cable.virginmedia.com] has joined #ruby
<freenodiz> lol
lkba [lkba!~AndChat@bpb249.neoplus.adsl.tpnet.pl] has joined #ruby
elflyny [elflyny!513967f0@gateway/web/freenode/ip.81.57.103.240] has joined #ruby
vraa [vraa!~vraa@c-76-30-135-64.hsd1.tx.comcast.net] has joined #ruby
<fluke_> anyone?
visof [visof!~visof@41.196.196.150] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-31-238.mco.bellsouth.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
bbttxu_ [bbttxu_!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
<shevy> fluke_ no real idea but via .send you send the message to the object
<shevy> I am not even sure what you can do with Binding
rbanffy [rbanffy!~rbanffy@187.31.77.7] has joined #ruby
<fluke_> well I know roughly what it does and when trying to run a method it works. But with binding there is probably some subtlety like what is bind to self. Since I am a little bit rusty on this meta stuff I thought it will be piece of cake for you guys :-)
<fluke_> but thanks anyway
<fluke_> I will experience a little and get back here if I crack it
<shevy> aha
<shevy> fluke_, "These binding objects can be passed as the second argument of the Kernel#eval method, establishing an environment for the evaluation."
<shevy> hmm
<shevy> I guess for instance_eval it is a bit similar
<shevy> using yield I suppose
<fluke_> shevy: yes this is actually what I wanna do. I want to start a Ripl session with a particular binding
<fluke_> but these two commands obviously return different bindings and off the top of my head I do not know why
<shevy> fluke_ the man to know it all about bindings is banisterfiend, have a look at pry https://github.com/pry/pry there is a lot of magic in it
<fluke_> shevy: thanks
vraa_ [vraa_!~vraa@h136.231.29.71.dynamic.ip.windstream.net] has joined #ruby
<shevy> hmm
<shevy> anyone have a need for a ruby script that generates a xorg.conf file?
a|i [a|i!~ali@unaffiliated/ai/x-9091534] has joined #ruby
<a|i> how to test a gem from irb?
<a|i> trying load 'main-gem-file' doe snot work in irb.
<shevy> which version
<shevy> require 'rubygems' first then try again but what kind of gem is it anyway
<a|i> shevy: I'm developing a gem, and I want to test it in irb, before installing it.
<a|i> shevy: so the gem is not installed yet.
<shevy> a|i you are writing a gem yourself? you can install it locally too
joast [joast!~rick@76.178.187.164] has joined #ruby
<shevy> I usually use setup.rb
<a|i> shevy: yes, but I don't want to keep installing it.
<a|i> any other ways of requiring it in irb?
<fluke_> if it is your gem I would consider using bundler. Than you can really speed up the change use loop
Jay_Levitt [Jay_Levitt!~Jay_Levit@home.jay.fm] has joined #ruby
<fluke_> you can tell bundler to use the gem from a place on disk not from your gem library
<fluke_> bundle console will go into irb with preloaded gem
<a|i> fluke_: I do use bundler, the question is, how to load my under development gem (which is not installed locally) from irb?
lateau_ [lateau_!~lateau@KD125054233174.ppp-bb.dion.ne.jp] has joined #ruby
<fluke_> require 'bundler/setup'
<fluke_> require 'yourgem'
<fluke_> this does not work?
<a|i> thank you!
<fluke_> np
Carmivore [Carmivore!~carmivmor@ec2-174-129-144-205.compute-1.amazonaws.com] has joined #ruby
moshee [moshee!~moshee@c-50-135-229-127.hsd1.wa.comcast.net] has joined #ruby
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
stringoO [stringoO!~JLstring@CPE001346cbe31b-CM00111ae502a8.cpe.net.cable.rogers.com] has joined #ruby
<nd____> I'm using /CONTEXT[^\}]*\}/m to match several lines in a string with grep, but I get no match. Changing it to e.g. /CONTEXT[^\}]*\{/m which only matches the first of the multiple lines, it works. So does multiline-mode not work with grep?
Yu\2 [Yu\2!~Yu@ubi-1-50-40.zif.uni-bielefeld.de] has joined #ruby
ChampS_ [ChampS_!~ChampS@p54B4A3A0.dip.t-dialin.net] has joined #ruby
looopy [looopy!~looopy@static-71-166-232-207.washdc.east.verizon.net] has joined #ruby
* tnk1 is back.
bier [bier!~bier@p54A5A7AD.dip.t-dialin.net] has joined #ruby
<nd____> Ah, the »trick« is to use scan… so I assume grep works for each line…
ryan_marsh [ryan_marsh!~ryan_mars@99-160-193-138.lightspeed.hstntx.sbcglobal.net] has joined #ruby
nvez [nvez!~textual@modemcable196.193-178-173.mc.videotron.ca] has joined #ruby
nvez [nvez!~textual@unaffiliated/nvez] has joined #ruby
burgestrand [burgestrand!~burgestra@81-229-85-235-no66.tbcn.telia.com] has joined #ruby
Marco [Marco!~marco@Marco-2.Kiewit.Dartmouth.EDU] has joined #ruby
savage- [savage-!~savage-@209.118.197.220] has joined #ruby
new_ruby_program [new_ruby_program!~new_ruby_@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby
visof [visof!~visof@41.196.196.150] has joined #ruby
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
dasfugufish [dasfugufish!~Adium@174-27-233-214.slkc.qwest.net] has joined #ruby
<jmaister> I have a question regarding Nokogiri: How can I retrive the content of the HTML body (with HTML) but omit the body tags?
<jmaister> If i use @body = doc.at_xpath("//body").content, I do get the content, but all HTML is stripped as well
kenperkins [kenperkins!~textual@174-24-180-141.tukw.qwest.net] has joined #ruby
colint [colint!~ColinT@64.9.146.220] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
colint_ [colint_!~ColinT@69-11-97-130.regn.static.sasknet.sk.ca] has joined #ruby
janissary [janissary!405a0bb2@gateway/web/freenode/ip.64.90.11.178] has joined #ruby
johnduhart [johnduhart!~quassel@46.105.138.12] has joined #ruby
visof [visof!~visof@41.196.196.150] has joined #ruby
adambeynon [adambeynon!~adambeyno@82-69-1-211.dsl.in-addr.zen.co.uk] has joined #ruby
dnjaramba [dnjaramba!~dnjaramba@41.72.193.86] has joined #ruby
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby
aknagi [aknagi!~aknagi@cpc7-dals14-2-0-cust243.hari.cable.virginmedia.com] has joined #ruby
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
flippingbits_ [flippingbits_!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
syamajala [syamajala!~syamajala@c-75-68-106-118.hsd1.ma.comcast.net] has joined #ruby
Tachyon [Tachyon!~tach@81.200.61.23] has joined #ruby
p1d [p1d!~p1d@dslb-088-067-029-131.pools.arcor-ip.net] has joined #ruby
nekid [nekid!~nekid@c-24-6-170-1.hsd1.ca.comcast.net] has joined #ruby
trend [trend!~trend@97-81-69-219.dhcp.athn.ga.charter.com] has joined #ruby
apucacao [apucacao!~apucacao@thelevel.com] has joined #ruby
michael__ [michael__!~michael@213.8.57.217] has joined #ruby
savage- [savage-!~savage-@209.118.197.220] has joined #ruby
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
jthomas_ [jthomas_!~jthomas@c-98-222-28-137.hsd1.il.comcast.net] has joined #ruby
* tnk1 is away: Gone away for now
eldariof [eldariof!~CLD@79.126.106.73] has joined #ruby
IceD^ [IceD^!~iced@178.120.182.103] has joined #ruby
BrianE [BrianE!~brian@87.115.115.247] has joined #ruby
yfeldblum [yfeldblum!~Jay@c-98-218-48-253.hsd1.md.comcast.net] has joined #ruby
tomzx [tomzx!~tomzx@dsl-216-221-39-59.aei.ca] has joined #ruby
Witide_ [Witide_!~Witide@adsl-65-8-193-202.mia.bellsouth.net] has joined #ruby
notbrent [notbrent!~notbrent@67.217.136.130] has joined #ruby
somebody_ [somebody_!~notbrent@67.217.136.130] has joined #ruby
notbrent [notbrent!~notbrent@67.217.136.130] has joined #ruby
somebody_ [somebody_!~notbrent@67.217.136.130] has joined #ruby
grilix [grilix!~grilix@r201-217-153-162.ir-static.anteldata.net.uy] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
sgaedu [sgaedu!~ar@masq61.gtn.ru] has joined #ruby
<burgestrand> IceD^: I believe Array#uniq might go on #hash and #eql to compare identity of entries
jay_zawrotny [jay_zawrotny!~Jay@50-77-200-126-static.hfc.comcastbusiness.net] has joined #ruby
kakashi__ [kakashi__!~kakashi_@nltk/kakashi] has joined #ruby
nvez [nvez!~textual@unaffiliated/nvez] has joined #ruby
<rippa> burgestrand: yep, #hash
ZellFaze [ZellFaze!~Zell@pool-108-8-0-178.hgrtmd.east.verizon.net] has joined #ruby
<ZellFaze> I'm coming to Ruby from PHP. Can constants be DONELIKETHIS or do they have to be DoneLikeThis? What is the prefer means of naming constants if both are acceptable.
<shevy> ZellFaze the only convention is that the first character must be capitalized
<shevy> so Foo is a constant FOO is as is FoO
<shevy> usually though most will use a CONSTANT_LIKE_THIS for constants
<shevy> BASE_DIR = '/tmp'
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
<ZellFaze> Excellent. Just like in PHP. I was hoping for that. The Ruby book I am reading right now uses ThisMethodOfCapitalization for constants instead of THIS_ONE.
<robyurkowski> ZellFaze: most ruby books are notoriously out of date with community standards :)
<shevy> CamelCase like that is usually for ruby classes
<robyurkowski> but i've honestly never seen CamelCase for actual constants
<shevy> class FooBar # and the file is then usually called foo_bar.rb
<shevy> but ZellFaze see, class Foo <-- is also a constant
<shevy> you wont see many doing class FOO though
adnan [adnan!~king@108-215-232-154.lightspeed.hstntx.sbcglobal.net] has joined #ruby
<ZellFaze> I see. Classes are done using ThisStyle and constants that are str, int, etc. are done using THIS_STYLE?
<shevy> usually yeah
<ZellFaze> Again, just like in PHP (and also Java, and C++).
<ZellFaze> Beautiful.
<ZellFaze> Are regular variable types (int, str, etc.) done like_this or likeThis?
<shevy> downcased all
<burgestrand> ZellFaze: snake_case
<shevy> every now and then someone breaks a convention though
<shevy> qtruby for instance uses ...
<shevy> setWidth
<shevy> for method calls though
<burgestrand> ZellFaze: same with method names, they are also snake_case
Phrogz [Phrogz!~phrogz@pdpc/supporter/professional/phrogz] has joined #ruby
<shevy> ZellFaze my favourite variable name is _
<ZellFaze> I can live with that. Thank you guys again. My new job requires I learn Ruby and I want to make sure my coding style fits with convention.
<ZellFaze> That is a legal variable?
<shevy> yeah
<shevy> but I like it because I dont have to come up with any name
<shevy> I use it for throwaway stuff though
<shevy> usually variable names should make sense :)
<ZellFaze> I usually use tmp for such things.
<burgestrand> ZellFaze: only used for variables you are not going to use, but even then it’s confusing
<shevy> hehe I used to do
<shevy> at one point I even used _tmp
<shevy> until I decided I hate that
<burgestrand> (at times)
<ZellFaze> Why did you prepend a _?
<shevy> dunno, cant remember
<shevy> it made the code uglier though
ChampS_ [ChampS_!~ChampS@p54B4C906.dip.t-dialin.net] has joined #ruby
<ZellFaze> Aye.
tvo [tvo!~tvo@katapult/developer/tvo] has joined #ruby
<shevy> what kind of job is it though if I may ask? rails related?
<ZellFaze> I am the IT person for a small medical research (pathology) place.
pantsman [pantsman!~pantsman@2.25.208.118] has joined #ruby
pantsman [pantsman!~pantsman@pdpc/supporter/active/pantsman] has joined #ruby
<ZellFaze> Most of their systems are written in Ruby and they would like them to work together a bit better.
<robyurkowski> i think _ are generally used to denote variables that are temporary to a class or method in a library that may have conflicts with defined methods or instance variables
<ZellFaze> I presume I will also have to learn Rails for the frontend portion. I honestly don't yet know the scope of this project. I start work there tomorrow and their makeshift IT person is going to let me know what is going on.
<robyurkowski> i.e. if you have a class Elephant with a method called #name, you wouldn't want to use 'name' as a variable outside the context of calling that method
<ZellFaze> Is there not something like "this" in Ruby?
<shevy> coll ZellFaze
<robyurkowski> ZellFaze: self :)
<shevy> i mean
<shevy> cool, not coll
<shevy> I am surprised they were using Ruby
<robyurkowski> but a lot of times you don't need 'self'
<shevy> yeah
<shevy> def foo
<any-key> you can use @
<shevy> self.some_other_method
<shevy> end
<shevy> but you can omit it almost always
<ZellFaze> In Java and in PHP I almost always make it explicit.
<ZellFaze> Just a personal preference of mine.
<shevy> ok but how do you do it really
<shevy> it is something like ...
<shevy> $this->foo("bla");
<shevy> right?
<robyurkowski> ZellFaze: like i said, most of the time, you don't need to explicitly use it
<shevy> in ruby
<shevy> foo 'bla'
<robyurkowski> ruby uses @variable for instance variables
<ZellFaze> shevy: Yes. Like that.
<robyurkowski> it's only when you have something like... class MyClass; def foo; "foo"; end; end; and you're writing a new method that needs to assign to a temporary variable 'foo'
<robyurkowski> in that situation you might write _foo
<robyurkowski> it's bad usage, but it does happen from time to time
<shevy> def set_foo(i); @foo = i; end ... or ... via attr* shortcuts ... attr_accessor :foo (though that creates .foo=(i) and not set_
<robyurkowski> yeah, don't use set_foo, that's just gross :P
<shevy> :)
<ZellFaze> Globabl constants. Would $Constant (or $CONSTANT) be a global constant or just a global variable?
<shevy> nono
<burgestrand> $var is a global variable, constants are always global
<robyurkowski> that's just weird
<burgestrand> ZellFaze: ^
<shevy> $FOO is just a global variable
<ZellFaze> Alright.
<shevy> though I dont know anyone who uses that
<shevy> it looks ugly :/
<burgestrand> $LOAD_PATH
<shevy> OH
<shevy> oh ...
<shevy> :(
<ZellFaze> So what do you do if you need a constant inside of a class?
<burgestrand> $LOADED_FEATURES… and so on :)
<shevy> yeah I remember now ... $: $` and so on
<robyurkowski> ZellFaze: a constant specific to that class or a constant from outside the class?
<shevy> I can't remember their meaning without looking at a reference
<burgestrand> ZellFaze: modules (and classes) namespace their constants if defined inside them
<robyurkowski> as a general rule of thumb, don't use $ unless you know why you have to use it
<burgestrand> ZellFaze: http://codepad.org/NGxpJS6w
<shevy> ZellFaze, you scope to it. module Foo; Bar = "hi"; ... Foo::Bar
<shevy> or you include Foo before doing that
<shevy> or if you want to follow that convention... module Foo; BAR = "hi"
<shevy> :P
<shevy> though Foo::BAR looks kinda strange too
<robyurkowski> Foo::BAR is standard though
<burgestrand> Foo::VERSION
<robyurkowski> ActiveRecord::Base::DATE_FORMATS
<shevy> oh damn
<ZellFaze> I meant what if I need a constant for a class to use.
<shevy> a class to use a constant?
<shevy> well, wherever the constant is defined
<robyurkowski> you just define it outside of class scope
<shevy> require that file..
<robyurkowski> and then you can use it inside the class
<shevy> :)
<robyurkowski> but that is terrible encapsulation
<ZellFaze> For example: class houses { NUMBER_OF_DOORS = 2; p NUMBER_OF_DOORS;} || p NUMBER_OF_DOORS;
<ZellFaze> Output: 2, exception
<ZellFaze> Excuse my terrible looking psuedocode.
<burgestrand> ZellFaze: write it in PHP.
<shevy> that's almost valid ruby
<shevy> not sure about the exception
<ZellFaze> I just meant it would throw an error.
<shevy> I forgot how one does exception handling in PHP
<burgestrand> try/catch
<ZellFaze> Yeah.
<ZellFaze> NUMBER_OF_DOORS need to be local to the class. Also that isn't valid PHP.
<ZellFaze> But it is close enough for you to get the point.
<shevy> well just omit the const
<shevy> and get rid of the {}
<shevy> with the last } becoming "end"
<shevy> and rather than echo you would use puts
<ZellFaze> I don't want line 7 to display 2.
<shevy> ah that would not work anyway
<shevy> because the constant is defined within that class
<burgestrand> ZellFaze: http://pastebin.com/5t6S50Su
<ZellFaze> Alright.
<shevy> you need to scope to it properly in one way or the other
<ZellFaze> So constants aren't global.
<shevy> yeah, they live in namespaces... global variables seem to live everywhere
<ZellFaze> Beautiful.
<burgestrand> ZellFaze: they are, but they’re scoped when enclosed within a module/class constant
<ZellFaze> (14:03:47) burgestrand: $var is a global variable, constants are always global
akem [akem!~akem@unaffiliated/akem] has joined #ruby
<ZellFaze> /\ Had me a bit confused.
<shevy> the sentence will be right if he appends the namespace part :)
<shevy> and remember!
<shevy> the only way to learn ruby is to write ruby really
<ZellFaze> Thank god for code and the unambiguousness of it eh?
<shevy> hmm
<ZellFaze> Aye. But I need to know enough to be able to write some.
<shevy> it can get a bit complicated
<shevy> when you define methods in different modules
<shevy> and lots of subclasses
<shevy> and perhaps even use *eval*
<ZellFaze> I learned PHP by pulling apart and modding phpBB.
<shevy> hehe cool
tvw [tvw!~tv@e176005079.adsl.alicedsl.de] has joined #ruby
<ZellFaze> @@ is used to define class variables?
kirun [kirun!~kirun@78-86-154-194.zone2.bethere.co.uk] has joined #ruby
<ZellFaze> Is there a word for that as well or is @@ the only way to do that?
<shevy> @@ are class variables but I dare claim that 98% of the time you won't need them
<shevy> class variable is their name
<ZellFaze> They are static variables right?
<shevy> not sure what you mean with static
<burgestrand> ZellFaze: they are different from PHPs’ class variables in the way that they’re inherited
tvw [tvw!~tv@e176005079.adsl.alicedsl.de] has joined #ruby
<shevy> they are a bit like global variables but limited to the class
<burgestrand> ZellFaze: sorry, PHP’s static variables, I meant
<burgestrand> ZellFaze: if you want PHPs equivalent it’s just @instance_variable, but within the scope of a class, classes are also objects
<shevy> but really you dont need them 98% of the time
<burgestrand> ZellFaze: @@class_variables are inherited to subclasses
<shevy> yeah @instance_variables you will use a lot eventually
<ZellFaze> So @variable ~= $this->variable, but @@variable != self::$variable
<shevy> first part I think so, second part confuses me right now
<shevy> what is the difference between ...
<shevy> $this->variable and self::$variable ?
<ZellFaze> PHP manual has a bit that makes it clear.
<ZellFaze> One moment.
<shevy> PHP confuses me a lot :/
<shevy> actually
<ZellFaze> PHP is my best language. Sorry. :/
<shevy> I did not know self::$variable before
<shevy> I remember I used $this when I wrote PHP classes years ago
<burgestrand> ZellFaze: @variable ~= $this->variable, as well as self::$variable
<burgestrand> ZellFaze: PHP has no equivalent to the @@variable
<shevy> hmm so they are the same?
<ZellFaze> No.
<shevy> ok one moment need to get my head wrapped around it still
<ZellFaze> self::$variable is shared by all instances of a class. $this->variable is local to a particular instance.
<shevy> aha
<ZellFaze> self::$variable is a static variable (they also exist in Java in the same fashion) $this->variable is an instance variable (again, they also exist in java is you know that language)
josemota [josemota!~josemota@2.81.221.31] has joined #ruby
<ZellFaze> So there is no PHP equivalent to @@?
<burgestrand> ZellFaze: nope
<shevy> remember the 98% rule!
<shevy> hmm I should write a script that scans through github ruby scripts and counts the % of @@ used
<burgestrand> ZellFaze: it’s a bit to take in, but here: http://codepad.org/2kKkrmCp
<robyurkowski> @@ is a static variable
<robyurkowski> but yeah, inheritance
<any-key> shared between all instances of the class
<burgestrand> ZellFaze: if you can understand that there is always a ”self” in ruby you’re half way there
hacim [hacim!~micah@debian/developer/micah] has quit [#ruby]
<shevy> the word "static" should be banned from ruby, it confuses me
<robyurkowski> yeah, i always thought that was unclear
<shevy> static final public foo(int *a)
* ZellFaze is still working on understanding why the p self is there.
<ZellFaze> I'm going to try to take this line by line.
Guest44349 [Guest44349!~joey@pD9ED63C0.dip.t-dialin.net] has joined #ruby
<burgestrand> ZellFaze: it’s there to illustrate the current self at each point
Guest44349 [Guest44349!~joey@pD9ED63C0.dip.t-dialin.net] has quit [#ruby]
<burgestrand> ZellFaze: “p obj” is a method, short-hand for “puts obj.inspect”
<ZellFaze> Wait is the code inside of the classes being executed?
<burgestrand> ZellFaze: ;)
<robyurkowski> haha
<robyurkowski> p is an alias to print, no?
<robyurkowski> not puts
<burgestrand> ZellFaze: everything is an object, there’s always a self, even inside the class body like you see there
<ZellFaze> I figured they would be skipped over like they are in PHP until something calls it.
<burgestrand> robyurkowski: not sure, I just say puts because it also appends a newline to the output
<any-key> def p(obj); puts obj.inspect; end
Jarred [Jarred!~Jarred@c-71-198-139-210.hsd1.ca.comcast.net] has joined #ruby
<Jarred> Has anyone here used the ruby-mqtt library?
<robyurkowski> burgestrand: yeah, that's what I do
<ZellFaze> Alright. I think I don't get this yet.
<any-key> What don't you get?
<ZellFaze> I need paper, or to read more about how ruby works.
<robyurkowski> ZellFaze: what in particular is confusing you?
<robyurkowski> i can see why it might :)
flippingbits [flippingbits!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
<burgestrand> this is always confusing, until it clicks
<any-key> you have to understand The Ruby Way™
<ZellFaze> I understand the bottom two sections of the output and how they got there.
<robyurkowski> to wit, put your left foot in, put your left foot out, put your left foot in and shake it all about
<ZellFaze> I don't understand how we got the first two sections. The ones titled Animals and Bear.
<ZellFaze> Were the classes method's executed without being called?
<burgestrand> ZellFaze: it’s coming from lines #5, #6, #7 and #25, #26, #27
<robyurkowski> you'll get the first two when the class is first being loaded and read into memory
michael__ [michael__!~michael@213.8.57.217] has joined #ruby
<robyurkowski> it's not really idiomatic
<burgestrand> ZellFaze: you could say ruby reads it and executes it top-to-bottom
<robyurkowski> most of the time, you won't have any executing statements inside a class unless they're in the initialize method
<ZellFaze> Oh I see now.
<burgestrand> attr_* is nothing but method calls
_md [_md!~mduarte@cpc4-finc13-2-0-cust568.4-2.cable.virginmedia.com] has joined #ruby
<ZellFaze> I didn't notice that we had some statements outside of methods.
<ZellFaze> That is legal?
<robyurkowski> it's legal, but not good practice
<burgestrand> ZellFaze: yep
<robyurkowski> it's necessary for some metaprogramming though
<ZellFaze> I see.
<robyurkowski> it's an example
<ZellFaze> So how to you go about making constructor (initalize) methods?
<robyurkowski> you do def initialize
<robyurkowski> that's the magic word
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
<ZellFaze> Alright.
<ZellFaze> That makes sense.
<ZellFaze> This code makes a lot more sense now too. Now I can just look at it and know what it does.
<robyurkowski> awesome :)
<any-key> sounds like you need more regular expressions then
<any-key> and global variables
<ZellFaze> Oh I hate regular expressions....
<robyurkowski> ternary expressions, too
<any-key> yesyesyes
<robyurkowski> nested ternary expressions
<ZellFaze> I have a PERL book on my bookshelf just to reference the chapter on regexp.
<any-key> you need to net map and inject several times
<any-key> map(inject(map()))
<burgestrand> ZellFaze: http://codepad.org/Af3GztPy
<robyurkowski> my_variable = something ? this ? :onething : :otherthing : that ? :tertiary_thing : :quaternary_thing
<robyurkowski> my absolute favourite :)
<any-key> goddamn
<robyurkowski> ZellFaze: http://www.rubular.com
<idarkside> can siriproxy use GET URL to action a commad via http and respond when the page has been grabbed?
<ZellFaze> Oh I like that.
<josemota> what's the best gem to parse a Yaml file to an object/hash?
notbrent [notbrent!~notbrent@67.217.136.130] has joined #ruby
somebody_ [somebody_!~notbrent@67.217.136.130] has joined #ruby
<ZellFaze> Are Ruby regexp the same as PERL. I know PHP had something different, but switched to PERLs format a few years back.
<any-key> pretty much
<robyurkowski> josemota: YAML.load(File.read("my_file.yml"))
<idarkside> i just wanna grab a aspx pahge
<shevy> wait
<shevy> YAML.load_file("my_file.yml")
<shevy> is better
<robyurkowski> ZellFaze: pretty much identical
<robyurkowski> ah, yeah, do shevy's
<robyurkowski> learned something new today
<josemota> shevy: with `require 'yaml'` ?
<shevy> I used YAML.load(File.read( myself for a long time
<shevy> sure josemota
<idarkside> hello?
<shevy> but one day I realized that I cant stand two ( when one ( is enough
<josemota> thank you very much shevy
<idarkside> oh wrong room lol
<any-key> hello!
clockwize [clockwize!~clockwize@5ac85c0d.bb.sky.com] has joined #ruby
<ZellFaze> Good plan. Thank you.
* ZellFaze bookmarks the page.
<ZellFaze> Are {} prefered or do end? It seems to look like do end.
<robyurkowski> ZellFaze: if it's only one line long, use {}
<robyurkowski> if it's more, use do end
<waxjar> the convention is to use {} for single lines, do .. end for multiple
<waxjar> i need to learn to type faster
<robyurkowski> haha
<burgestrand> I try to use {} when I use the return value
<burgestrand> (but not always)
<ZellFaze> That is no fun, but I'll work with it. I always thought {} looked nicer.
<waxjar> you pick either, it doesn't really matter
<waxjar> *you can
<shevy> ZellFaze, I use {}
<shevy> I used to use do/end always, save for oneliners, until I decided I hate the layout of the code. it often seemed clearer to do
<shevy> def foo
<robyurkowski> ZellFaze: it takes getting used to
<shevy> array.each {
<shevy> }
<shevy> end
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<any-key> it's pretty popular to use do/end if there's no return value and {} if there is
<robyurkowski> but do use the do/end, because it's conventional
<any-key> I think the do/end syntax is much nicer for quite a few things
<shevy> oh
<any-key> especially DSLs......
Carmivore [Carmivore!~carmivmor@ec2-204-236-247-101.compute-1.amazonaws.com] has joined #ruby
<ZellFaze> Which of these is the prefered method?
<burgestrand> first one
<ZellFaze> Is the second one legal even?
<burgestrand> Not sure, try it
<robyurkowski> nope, don't think so
<robyurkowski> most of the time you won't just 'loop'
<robyurkowski> you'll iterate
<shevy> I use loop {} instead
<ZellFaze> Yeah, just wanted a simple example.
<robyurkowski> i.e. my_array.each_with_index do |member, i|
<shevy> but I have to say, I never saw the do on the next line
<shevy> you bring new elements into the scene ZellFaze ;)
<shevy> btw use # for comments
<ZellFaze> Whoa block arguments.
<ZellFaze> Those are new, but appreciated.
<burgestrand> ZellFaze: your example of loop are both blocks.
<ZellFaze> # is the comments convention?
<ZellFaze> I know. Most languages don't have |variable|
<shevy> # is a comment
<burgestrand> ZellFaze: yes, # for both single-line and multi-line comments, sometimes (but rarely) people use =begin … =end
<shevy> / would not be valid
<shevy> erww //
<shevy> damn IRC client
<robyurkowski> that is one thing about ruby that drives me nuts
<shevy> what
<ZellFaze> Aye. It will for me too.
<robyurkowski> seriously need an easier block comment format
<shevy> multiline comments?
<shevy> yeah
<ZellFaze> Is /* */ valid? How do you do multiline comments?
<robyurkowski> nope, ZellFaze
<robyurkowski> you have to use =begin to denote the start
<robyurkowski> and =end to denote the end
<robyurkowski> flush against column 0
<robyurkowski> can't be indented
<shevy> when it is code block, I often kinda group if into a block, and then do something like if 5 < 4
<shevy> :D
<burgestrand> ZellFaze: we use one # for each line
<robyurkowski> shevy: I just do CMD + /
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
<ZellFaze> I think # for each line might be best in light of =begin looking very different from # and having to not be indented.
<ZellFaze> Good for commenting blocks out for testing I guess.
\logic [\logic!~logic@unaffiliated/bitch333z] has joined #ruby
<shevy> yeah
<shevy> well using # for a while is ok
<shevy> even if you feel without /* */ the world will end
<robyurkowski> i do miss C-style comments, but I understand there are issues with regex parsing
<shevy> hmm // I dont miss... I can see the point about /* */ though ... it's also kinda nicer than =begin =end
<robyurkowski> / I miss because it's one handed
<robyurkowski> //*
<waxjar> /* */ is not even better imo, because most people would put a a * in front of every line of comments anyway.
<robyurkowski> haha
<ZellFaze> That is true.
<robyurkowski> what would be nice
<robyurkowski> would be heredoc style comments with triple hashes
<robyurkowski> i.e. ### starts, and ### ends a comment
<ZellFaze> Actually sometime they even put ** or *** and if they are crazy they build a box around the outside.
<waxjar> i used to do that
somebody_ [somebody_!~notbrent@67.217.136.130] has joined #ruby
notbrent [notbrent!~notbrent@67.217.136.130] has joined #ruby
<shevy> I kinda got used to #
<ZellFaze> /*************
<ZellFaze> ** **
<ZellFaze> *************/
<shevy> yeah I build a box via #
<shevy> # ========================================================================= #
<shevy> # === name_of_method
<shevy> # bla bla bla bla bla blalkasjklalksd
<shevy> # ========================================================================= #
<waxjar> i found out about TomDoc recently, really nice
logic [logic!~logic@unaffiliated/bitch333z] has joined #ruby
<shevy> but I also got tired of describing every method... so these days, I document when the method is important, or when a design decision was made, and explaining that
<shevy> and I dont document the really small methods
<ZellFaze> Do block inherit variables from outside them?
<ZellFaze> Or do they have to be explicitly passed with ||
<shevy> what do you mean with inherit
<waxjar> yes
<shevy> you can scope to the variable outside
<robyurkowski> ZellFaze: they scope outside but not vice versa
<shevy> a = "foo"; array.each {|i| puts a }
<robyurkowski> a method defined inside the block is in a deeper scope
<shevy> vs.
<shevy> a = "foo"; array.each {|a| puts a }
paissad [paissad!~paissad@89-92-16-151.hfc.dyn.abo.bbox.fr] has joined #ruby
<shevy> you should give block arguments good names ZellFaze
iamjarvo [iamjarvo!~Adium@c-71-230-13-201.hsd1.nj.comcast.net] has joined #ruby
<shevy> wait wait wait always remember the ||
<shevy> ah
<shevy> you mean, if you want to reassign a variable inside the block
<ZellFaze> Or just in general.
wilhelmn [wilhelmn!~textual@ablm233.neoplus.adsl.tpnet.pl] has joined #ruby
<ZellFaze> Do I have to pass X or will the first version work?
<ZellFaze> But yes, also for reassigning.
rbanffy [rbanffy!~rbanffy@187.31.77.7] has joined #ruby
<ZellFaze> I guess it was two questions in one.
<robyurkowski> ZellFaze: I don't think line 3-7 will work
<shevy> ZellFaze, http://pastie.org/3114234 you reassigned y
<robyurkowski> you can't arbitrarily declare a code block without something triggering it
<ZellFaze> You can't?
<ZellFaze> Good to know. Will keep in mind.
<robyurkowski> nope
<ZellFaze> I've never had to do so honestly, but I know in PHP they are legal.
<shevy> well, a code block is passed to a method usually
<shevy> def foo ...
<shevy> foo { do_something_here }
<burgestrand> robyurkowski: what do you mean?
<robyurkowski> i don't mean like a lambda, shevy
<shevy> ZellFaze, inside your method, you can use the keyword "yield" to access what is inside the block
<robyurkowski> i mean specifically like a section of code arbitrarily wrapped inside two {}
banisterfiend [banisterfiend!~baniseter@118.82.185.158] has joined #ruby
<burgestrand> Ah.
<ZellFaze> shevy: Can I have an example?
<robyurkowski> {} doesn't mean an anonymous function without a keyword
SegFaultAX [SegFaultAX!~SegFaultA@c-98-248-241-85.hsd1.ca.comcast.net] has joined #ruby
<robyurkowski> you either need lambda, Proc.new, or a do, implicit or explicit
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
<robyurkowski> line 3 of ZellFaze's example would complain because it would try to read the {} as a hash
<ZellFaze> Also shevy: What is the value of e?
logic [logic!~logic@unaffiliated/bitch333z] has joined #ruby
<shevy> ZellFaze, http://pastie.org/3114247 <--- example with yield
<shevy> e is the element of .each applied on the array
<shevy> .each is defined in module Enumerator I think. http://www.ruby-doc.org/core-1.9.3/Enumerator.html
<shevy> Enumerables are really cool
<ZellFaze> Wouldn't that be better done with () instead of yield? When would one make use of yield?
daniel_hinojosa [daniel_hinojosa!~danno@67-0-103-21.albq.qwest.net] has joined #ruby
<shevy> hmm
<shevy> you can continue to use () without a problem
<shevy> but you can additionally use a block to any method as well
<shevy> I dunno really
<ZellFaze> Also so the function defines what can be put into ||, you just get to name it. You can't pass arbitrary items. (But you needn't either because the block uses the same vars as outside it).
<shevy> I just know I love them
<shevy> you can use a subset of Ruby without any problem
<shevy> oh yeah good point from robyurkowski
<shevy> {} is also a hash
<shevy> hash = { 'cat' => 'mouse' }
jbpros [jbpros!~jbpros@122-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<shevy> hash['cat'] # => "mouse"
<ZellFaze> I've decided Ruby is it's own family. Usually I can classify languages into families (C, ASM, PERL, etc.) but Python and Ruby now have thrown me for a loop in being very very different from everything else.
<ZellFaze> Oh.
<ZellFaze> Gotcha. So {} is not just used for blocks but also arrays?
<robyurkowski> ZellFaze: Ruby is the result of Perl and Smalltalk making babies.
<shevy> ZellFaze hashes!
<robyurkowski> you see the perl on the first level, but the smalltalk comes out the more you use it
<shevy> array = [ "abc", "def" ]
xybre [xybre!x@minion.xeitek.com] has joined #ruby
<shevy> array[0] # => "abc"
<robyurkowski> ZellFaze: Hashes, or sometimes called Dictionaries
<ZellFaze> So hashes are associative arrays?
<robyurkowski> associative arrays
<shevy> Hashes!!!
<shevy> hehe
<ZellFaze> Beautiful.
<shevy> well yeah
<shevy> but I call them hashes all the time
<robyurkowski> datatype review:
<robyurkowski> 1. Integers / Floats
<robyurkowski> 2. Strings
idarkside [idarkside!~YourNick@5e0eccf0.bb.sky.com] has joined #ruby
<robyurkowski> 3. Symbols, which are interned strings
<shevy> PHP seems to prefer to call them arrays
<robyurkowski> 4. Arrays
<robyurkowski> 4. Hashes (assoc. arrays)
<robyurkowski> 5. Regex
<robyurkowski> day-to-day, that's it
<shevy> hey
<shevy> you have 2x 4.
<robyurkowski> oops
<robyurkowski> my bad :)
<ZellFaze> How do symbols work. I've seen you guys use them a few times.
<ZellFaze> But I don't yet quite grasp them.
<shevy> I think smalltalk has something ruby doesn't quite have
<shevy> that environment thing
<robyurkowski> ZellFaze: they're like strings that are declared once and kept in memory
<shevy> symbols are boring
<robyurkowski> you know any C?
<shevy> that's the most important point to remember about them
* ZellFaze squeezes fingers together.
<ZellFaze> About this much.
<robyurkowski> basically, they're an immutable string
<ZellFaze> Ok.
<shevy> totally boring
<robyurkowski> which makes them very memory-efficient
<ZellFaze> That much I do know.
<shevy> they are often used in hashes
Carmivore [Carmivore!~carmivmor@ec2-184-72-134-164.compute-1.amazonaws.com] has joined #ruby
<shevy> { :foo => "bla"}
jbpros [jbpros!~jbpros@54-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<ZellFaze> That makes sense.
<burgestrand> and often it does not matter if you use a symbol or a string
<robyurkowski> they're used where any sort of uncomplicated text is used repeatedly
<ZellFaze> Can you delete them from memory?
<burgestrand> no
<burgestrand> Once used, they stay.
<shevy> you cant really do much with memory & ruby
<robyurkowski> there'd be no point in doing so anyway
<ZellFaze> Can you delete regular vars?
<burgestrand> 1_000_000.times { |i| i.to_s.to_sym }
<shevy> I think the GC will collect unusued variables sometimes
Cyrus [Cyrus!~Cyrus@cpe-173-173-106-235.satx.res.rr.com] has joined #ruby
Cyrus [Cyrus!~Cyrus@unaffiliated/cyrus] has joined #ruby
<shevy> or unreferenced ones
<robyurkowski> ZellFaze: most times you won't have to delete variables
<robyurkowski> GC will grab it pretty quick
<shevy> but I guess if you really have a need for speed, there is no way around C anyway
<shevy> and remember! perl is faster than ruby anyway
<ZellFaze> I know, but occasionally I've run into situations where it is useful (don't ask me for any offhand, I just remember looking up how to do it once in PHP).
<shevy> and boy, lua!!! that's travelling at lightning speed
<ZellFaze> x86 assembly is the way to go.
<ZellFaze> :P
<robyurkowski> eff x86
<shevy> MenuetOS!
<robyurkowski> direct bytecode
<burgestrand> ZellFaze: there’s no way to explicitly free an object, banisterfiend made a gem for it but as far as I know it’s a hack
<robyurkowski> ZellFaze: most of the time, setting a variable to nil will be sufficient
<shevy> I'd like a RubyOS ... which would also have to be super fast though... which is kinda not quite possible
<ZellFaze> .....
<burgestrand> ZellFaze: objects are automatically collected by rubys’ garbage collector when they can no longer be reached
<robyurkowski> I haven't ever run into a situation where I needed to do more
<robyurkowski> shevy: http://rush.heroku.com/
<robyurkowski> not an OS, but close enough for most people
<shevy> it's a little bit a hybrid model
<shevy> grep -v <-- uses C grep
<robyurkowski> any other specific questions, ZellFaze?
<ZellFaze> Not at the moment, but I'm sure I will have more.
<shevy> imagine if all the language on an OS could be contained in a ruby-like fashion
<shevy> oops
<shevy> I mean
<shevy> if all the *LOGIC
xybre [xybre!~xybre@minion.xeitek.com] has joined #ruby
<ZellFaze> I'm reading a book on Ruby and also trying to keep up on #bitcoin-dev, so it might be a bit before I have another question. But I'm sure I will have more.
<shevy> would be easier to understand than the underlying C, if you have a good convention that makes sense
<ZellFaze> Nothing beats having someone explain something to you for learning. (Especially with code examples)
<shevy> remember! the only way to learn ruby is to write ruby
<burgestrand> One thing does; writing it yourself
<shevy> :)
<ZellFaze> Indeed.
<waxjar> hah, i wrote a little bit coin tool in ruby
<robyurkowski> best thing to do is to challenge yourself
<robyurkowski> make me a program that picks teams of two from a random array of players in no more than 7 lines.
<robyurkowski> I've done it in 5
<robyurkowski> that wasn't the most efficient it could be done either :D
<banisterfiend> u could do it in 1 i think
<robyurkowski> well, yes, but not using semicolons.
<banisterfiend> team1, team2 = array.shuffle.each_slice(2).to_a
<robyurkowski> .
<robyurkowski> nah
<robyurkowski> teams of two, not two teams
<ZellFaze> We had a program that said the current temperature in the room was 70 degrees in PHP.
virunga [virunga!~virunga@151.64.36.72] has joined #ruby
<ZellFaze> We got it down to 56 characters I think.
<ZellFaze> Something crazy.
<robyurkowski> haha, nice
<burgestrand> robyurkowski: each_slice(2), [1, 2, 3, 4, 5, 6] becomes [[1, 2], [3, 4], [5, 6]]
<robyurkowski> nice
Cervajz_ [Cervajz_!~Cervajz@ip-85-161-212-237.eurotel.cz] has joined #ruby
<robyurkowski> see, i always learn something
<banisterfiend> Yeah, so get rid of the team1/team2 and just keep array.shuffle.each_slice(2).to_a and there u go
<robyurkowski> i need to know string and enumerable better :/
<josemota> quit
<josemota> oops, sorry....
andrewhl [andrewhl!~andrew@CPE000d6048a601-CM00080dff304c.cpe.net.cable.rogers.com] has joined #ruby
cousine [cousine!~cousine@196.221.242.180] has joined #ruby
monban [monban!~gatekeepe@awesome-opossum.com] has joined #ruby
kevinbond [kevinbond!~kevinbond@112.50.204.68.cfl.res.rr.com] has joined #ruby
<ZellFaze> How do you do includes/requires?
<waxjar> generally people use `require 'file/gem'`
<waxjar> there's also load, which allows reloading files (require doesn't)
<ZellFaze> http://mislav.uniqpath.com/poignant-guide/book/ <-- Currently reading this.
<ZellFaze> Which is significantly more humourous.
<ZellFaze> I saw the line " require 'net/http'" and wanted to know exactly how that worked.
<burgestrand> ZellFaze: it’ll look through the array of $LOAD_PATH, which is a list of directories, and then try to find the file relative to any of those directories
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
<ZellFaze> Was it like Java in that we assume a certain directory structure? Or was that just a core library type thing so we don't need to specify its location.
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<ZellFaze> Beautiful.
<burgestrand> ZellFaze: require will look through $LOADED_FEATURES before trying to require the file, if it’s in there it will not be loaded again, otherwise it will load (and execute) the file, and then put it into $LOADED_FEATURES
<burgestrand> ZellFaze: load does not check $LOADED_FEATURES, and it also does not automatically append file extension to required files, require will use any valid extension and try to load it if found
<ZellFaze> That explains the lack of file extension.
<ZellFaze> And Gems from what I gathered are a type of library? Kind of like PEAR is for PHP?
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
<burgestrand> ZellFaze: yeah, fairly similar
<burgestrand> ZellFaze: http://guides.rubygems.org/
s0ber_ [s0ber_!~s0ber@114-36-236-160.dynamic.hinet.net] has joined #ruby
y3llow_ [y3llow_!~y3llow@114-36-236-160.dynamic.hinet.net] has joined #ruby
<robyurkowski> ZellFaze: actually, similar to PEAR, but better because they don't require root user access
<robyurkowski> so long as rubygems is installed globally, you're laughing
<ZellFaze> Beautiful.
<ZellFaze> I hate asking for PEAR packages that aren't installed to be installed.
<robyurkowski> it's also used more frequently and has a wider variety of packages
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby
y3llow [y3llow!~y3llow@114-36-236-160.dynamic.hinet.net] has joined #ruby
trivol [trivol!~aurelien@ip-178.net-89-2-84.rev.numericable.fr] has joined #ruby
y3llow [y3llow!~y3llow@114-36-236-160.dynamic.hinet.net] has joined #ruby
elliot98 [elliot98!~elliot@IGLD-84-229-15-130.inter.net.il] has joined #ruby
flippingbits_ [flippingbits_!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
Cervajz_ [Cervajz_!~Cervajz@93.99.93.150] has joined #ruby
elliot98 [elliot98!~elliot@unaffiliated/elliot98] has joined #ruby
madsgraphics [madsgraphics!~madsgraph@labs.madsgraphics.com] has joined #ruby
indeterminate [indeterminate!~sei@user-3c2h3m6.cable.mindspring.com] has joined #ruby
skmidry [skmidry!~skmidry@c-50-132-95-135.hsd1.wa.comcast.net] has joined #ruby
monban [monban!~gatekeepe@awesome-opossum.com] has joined #ruby
pietro__ [pietro__!~pietro@2-227-162-47.ip187.fastwebnet.it] has joined #ruby
Drakx [Drakx!~dunno@unaffiliated/drakx] has joined #ruby
<ZellFaze> shevy, robyurkowski, burgestrand: I mentioned a PHP challenge we did some months ago.
<ZellFaze> I found one of the solutions. <?php $temperature = 23;($i="temperature")&&$$i<20|$$i>25||print"Room $i is between 20 and 25";?>
jbpros [jbpros!~jbpros@54-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<ZellFaze> The rules were, $temperature had to == 23. And the output had to be "Room temperature is between 20 and 25"
monban [monban!~gatekeepe@awesome-opossum.com] has joined #ruby
axl_ [axl_!~axl@97-127-66-239.mpls.qwest.net] has joined #ruby
al3xnull [al3xnull!~al3xnull@cpe-76-188-178-7.neo.res.rr.com] has joined #ruby
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby
monban [monban!~gatekeepe@awesome-opossum.com] has joined #ruby
<pantsman> what was the challenge? to obfuscate the code?
<mattyohe> heh
<ZellFaze> To make it as compact as possible.
<ZellFaze> You were talking about making a team thing in under 7 lines, this was something similar we did.
<ZellFaze> We measured out solution in characters though.
<ZellFaze> Er rather they.
<waxjar> use echo instead of print, save one character
youdonotexist [youdonotexist!~youdonote@c-67-166-121-94.hsd1.ut.comcast.net] has joined #ruby
<ZellFaze> Aye, this wasn't the final solution. Just the first one that someone found.
<pantsman> turn on short tags, and open with just <?
senny [senny!~senny@77-56-67-120.dclient.hispeed.ch] has joined #ruby
<ZellFaze> In the final solution we did some crazy stuff with <?=
<ZellFaze> Thus eliminating echo even.
<waxjar> clever
somebody_ [somebody_!~notbrent@67.217.136.130] has joined #ruby
notbrent [notbrent!~notbrent@67.217.136.130] has joined #ruby
<ZellFaze> We had it down to 50 some odd characters I think.
<ZellFaze> It was afew months ago.
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<banisterfiend> ZellFaze: isn't it humiliating to do somethign likethat in PHP though, cos even if you win, you lose
<banisterfiend> ;)
<banisterfiend> s/something like that/anything at all
<ZellFaze> I enjoy PHP a lot. I'm coming to Ruby from PHP because of my new job.
<ZellFaze> It was just a coding challenge between some friends.
<mattyohe> well, hopefully you've learned that PHP is a pretty crummy language
<ZellFaze> It has its faults.
<banisterfiend> i dont know much about php other than the worst programmers in the world use it
<ZellFaze> Nah, they use BASIC. :P
<ZellFaze> But lets not bash languages. Ruby is good, PHP is good, they are all good (with very few exceptions, see mindfuck). But all languages have faults.
<mattyohe> ZellFaze: no, they use PHP :)
<al3xnull> ZellFaze: Agreed. Crummy programmers in general write crummy code.
<banisterfiend> ZellFaze: isn't the only thing going for php that it's ubiquitous not that it's good?
<banisterfiend> i.e it's found everywhere, popularity is not a measure of whether something is good
<mattyohe> All that needs to happen is someone needs to make a ruby version of a "drupal
<mattyohe> and then ruby becomes the most popular
<mattyohe> that's the only reason php is so "widely used"
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-31-238.mco.bellsouth.net] has joined #ruby
<ZellFaze> Also phpBB and MediaWiki. :P
<mattyohe> right
<mattyohe> and joomla etc
<mattyohe> Just need a platform that people can easily install.
Zanacross [Zanacross!~Serenity@adsl-178-78-86-205.karoo.kcom.com] has joined #ruby
<al3xnull> WordPress. phpMyAdmin
<mattyohe> That's the only reason. Not because it's a good language.
<ZellFaze> It is good for what it is meant to do.
<mattyohe> I think you're missing the point.
<mattyohe> but meh.
<ZellFaze> Just as Ruby is good for it is meant to do.
rramsden [rramsden!~rramsden@s64-180-62-209.bc.hsia.telus.net] has joined #ruby
<banisterfiend> ZellFaze: that kitsch argument "everything is good" is kind of lame. I don't think people say the particular PHP libraries/frameworks are necessarily bad, but that the language itself is badly designed.
<banisterfiend> you can kind of muddle your way through even if the language is bad, just so long as teh frameworks/libraries are OK
<ZellFaze> I just don't feel like arguing about whether PHP is a good language.
<mattyohe> yeah, honestly I really think something like Drupal now is really pretty good nowadays (version 7), but being built on PHP is really a hinderance. It would be wonderful if there was a "drupal" on top of ruby/rails, but there isn't?
<ZellFaze> I personally enjoy it. But that doesn't mean others will.
<banisterfiend> ZellFaze: what other languages do you know well beside php?
<ZellFaze> VisualBasic (had to learn for a previous job) and I used to know PERL well, but at this point I am very rusty from lack of use.
<ZellFaze> I also know MUSH Code fairly well. Although that language is insane and very single purpose.
<mattyohe> Ew. Yeah, you might change your mind about php and others after you use a language like Ruby :)
<ZellFaze> I used to tutor Java as well.
kaos379 [kaos379!~kaos@39-54.202-68.tampabay.res.rr.com] has joined #ruby
milkpost_ [milkpost_!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
<banisterfiend> ZellFaze: hehe, well if visualbasic is your primary experience i'm sure you'll think php is ok, perhaps teh same is true with perl. If you knew a decent language such as python, c#, even C maybe you'd be less apt to settle for php
<ZellFaze> Perhaps.
Morkel [Morkel!~Morkel@xdsl-87-78-206-32.netcologne.de] has joined #ruby
<mattyohe> Enjoy Ruby :D
chrisja [chrisja!~chris@5ac7d92c.bb.sky.com] has joined #ruby
<pantsman> PHP was great in the early web when dynamic sites only needed to be individual pages put through an interpreter to add some scripting. To make anything 'modern' with PHP involves a huge amount of bootstrapping on the web server side, e.g. apache rewrites. That smells a bit.
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby
brownies [brownies!~brownies@unaffiliated/brownies] has joined #ruby
<kaos379> Grrr, trying to make an engine for a 2d platformer game.
* kaos379 bangs head on desk
bbttxu [bbttxu!~adam@nt8rsctf1.unt.ad.unt.edu] has joined #ruby
Marco [Marco!~marco@Marco-2.Kiewit.Dartmouth.EDU] has joined #ruby
<banisterfiend> kaos379: what library are you using
<kaos379> gosu
vraa [vraa!~vraa@99-20-202-44.lightspeed.hstntx.sbcglobal.net] has joined #ruby
<banisterfiend> ZellFaze: sorry i have an aversion to PHP, whenever i've met PHP programmers at parties or whatever they've always been supreme idiots; and a nuber of them appear to have stumbled into programming by accident on their way as designers; as a result they seem to lack basic programming knowledge (that a compsci degree would give them) and just have a general lack of interest or appreciation for programming in general.
<banisterfiend> kind of annoyed me
<ZellFaze> I learned my first programming language at 8 (it was a form of BASIC). I don't have a compsci degree yet, but I do have a very technical background.
<ZellFaze> I am A+, CCENT, and CCNA. And I taught a CCNA class for 2 semesters.
<ZellFaze> I've never worked a job that wasn't some sort of IT.
<kaos379> I ws 14 when I decided to lern a programming language. It was very basic. It was called ROBO programming. Megazuex had it in its system.
<kaos379> *was, learn. (my keyboard is messed up.)
vitoravelino [vitoravelino!~rockhampt@unaffiliated/vtr] has joined #ruby
<kaos379> anyone here into software developement?
<yxhuvud> nope. most people in here like gemstones and geology.
<kaos379> really? I like gemstones, too.
<waxjar> geology is for nerds. i'm hardcore into linguistics.
moshee [moshee!~moshee@unaffiliated/moshee] has joined #ruby
monban [monban!~gatekeepe@awesome-opossum.com] has joined #ruby
<kaos379> I saw this book in Amazon.com. The book of ruby seems different from what people code in the understanding style.
<pantsman> which book?
kjs3 [kjs3!~kseefried@174.47.62.3] has joined #ruby
flippingbits [flippingbits!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
youdonotexist [youdonotexist!~youdonote@c-67-166-121-94.hsd1.ut.comcast.net] has joined #ruby
<any-key> I learned programming from TI83 calculator BASIC
<burgestrand> kaos379: book of ruby? ninja on the front?
canton7 [canton7!50e59235@gateway/web/freenode/ip.80.229.146.53] has joined #ruby
h4mz1d [h4mz1d!~hamfz@99-0-57-199.lightspeed.tsclal.sbcglobal.net] has joined #ruby
<robyurkowski> any-key: TI86 basic; high-five.
<any-key> o/
<any-key> I still instictively remember the menu shortcuts for all the commands...
<any-key> prgm -> 7 was END
<any-key> prgm -> 4 was FOR (I think)
<any-key> prgm -> left -> 3 was DISP
<any-key> prgm -> left -> 2 was OUTPUT
* any-key stops
<robyurkowski> haha
<robyurkowski> it's been ten years
<robyurkowski> all i did was program games in calc
<ZellFaze> It was right.
<ZellFaze> Not left.
<ZellFaze> :P
nekid [nekid!~nekid@c-24-6-170-1.hsd1.ca.comcast.net] has joined #ruby
<any-key> ZellFaze: heh, I suck at directions
<ZellFaze> Left would bring you into the programs list so that you could call other programs as functions.
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
<any-key> yep
<any-key> I'm pretty sure programming on that little screen had negative effects on my eyesight
<any-key> probably why I'm nearsighted :P
mmokrysz1 [mmokrysz1!~mmokrysz@5e04b38f.bb.sky.com] has joined #ruby
* any-key wonders if someone has ported Vim to the TI83
milkpost_ [milkpost_!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
trend [trend!~trend@97-81-69-219.dhcp.athn.ga.charter.com] has joined #ruby
Spockz [Spockz!~Spockz@84.245.46.110] has joined #ruby
berkes [berkes!~ber@a83-163-58-51.adsl.xs4all.nl] has joined #ruby
<shevy> hehe
<shevy> I'd wish there would be a ruby-vim editor
enikar [enikar!~gil@cl-140.mrs-01.fr.sixxs.net] has joined #ruby
mmokrysz1 [mmokrysz1!~mmokrysz@5e04b38f.bb.sky.com] has quit [#ruby]
waxjar [waxjar!~waxjar@ip11-49-212-87.adsl2.static.versatel.nl] has joined #ruby
* tnk1 is back.
looopy [looopy!~looopy@static-71-166-232-207.washdc.east.verizon.net] has joined #ruby
geaif [geaif!~geaif@AToulouse-554-1-40-57.w92-149.abo.wanadoo.fr] has joined #ruby
sross [sross!~sross@cpe-66-66-19-90.rochester.res.rr.com] has joined #ruby
j3r0m3 [j3r0m3!~j3r0m3@173-160-19-241-Sacramento.hfc.comcastbusiness.net] has joined #ruby
sross [sross!~sross@cpe-66-66-19-90.rochester.res.rr.com] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
<linduxed> hey guys, i've got a project that i just started up, but quickly realized that i'm not good enough at ruby or rails to actually START
<linduxed> i'm not sure what to do, and how to get going
<linduxed> the project is located here https://github.com/linduxed/eve-mins-page
flippingbits_ [flippingbits_!~anonymous@ip-81-210-178-39.unitymediagroup.de] has joined #ruby
<banisterfiend> linduxed: tell your employer you're a fraud and quit voluntarily
ColdShot [ColdShot!~aColdshot@CPE0026f3a1ccc0-CM0026f3a1ccbd.cpe.net.cable.rogers.com] has joined #ruby
<banisterfiend> :D
<linduxed> banisterfiend: haha, thx
<waxjar> is it a complicated project?
<linduxed> waxjar: not very much so
<linduxed> waxjar: if you read the README on that page you should pretty much be able to envision the entire page
<banisterfiend> linduxed: hehe, just buy a book, there's a bunch of good ones, i recommend 'eloquent ruby' (if you're programmed before) or 'learn to program' (if u havent)
<linduxed> banisterfiend: hmmm, really?
<linduxed> banisterfiend: i just wanted to start coding now
<waxjar> if it's simple i suggest looking into sinatra. it's light and powerful and a lot easier than rails.
<shevy> then write ruby code!
<banisterfiend> linduxed: probably good to have a good on hand i'd say
<banisterfiend> linduxed: as a reference at least
<shevy> go find any task on your computer you want to automate and then start writing
Witide_ [Witide_!~Witide@adsl-65-8-194-102.mia.bellsouth.net] has joined #ruby
<linduxed> shevy: well the thing is that i've already written most of the logic for this once before
<linduxed> https://github.com/linduxed/eve-mins is the actual calculator, but in python
<linduxed> so i kinda know how to create the logic, but i'm not sure where to put the stuff inside a rails framework
<shevy> than it is even easier
<shevy> python is quite close to ruby in a way
<linduxed> and that's beside the point that i'm not that comfortable with ruby yet
<shevy> class Mineral: def __init__(self, name, price): # almost the same in ruby... class Mineral; def initialize(name, price), and inside initialize set the @ivars
jbpros [jbpros!~jbpros@54-178-112-217.dyn.adsl.belcenter.be] has joined #ruby
<shevy> oh
<shevy> rails
<shevy> well even then I'd recommend to dive into ruby alone for a while
<linduxed> shevy: hmm, might be ture
<linduxed> *true
<linduxed> hey!
<linduxed> if i implement that code somehow
<linduxed> in ruby that is
<shevy> I dont know where things have to be in rails... app ... model ... view ... somewhere it has to be hehe
<linduxed> basically port that python code to ruby
<linduxed> is it easy to somehow squeeze that into rails?
<shevy> it's very straight forward
<linduxed> that business logic?
<shevy> if the ruby code works, sure
<linduxed> ok
<shevy> you just keep in mind what has to be displayed, and what should stay internal
<shevy> https://github.com/linduxed/eve-mins/blob/master/calc.py but it is almost like ruby code anyway
<shevy> rather than for element in list: perhaps you'd do
<shevy> list.each
paissad [paissad!~paissad@89-92-16-151.hfc.dyn.abo.bbox.fr] has quit ["Leaving"]
<shevy> hmm what is // ?
<linduxed> i think it was division rounded down
* tnk1 is away: Gone away for now
<linduxed> shevy: yeah, it's floor division
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby
<shevy> hmm
<shevy> a floor division
<shevy> with floats? like 1.0 ?
<shevy> 1.0 / 0.5 # => 2.0
<shevy> in ruby
<shevy> or wouldn't that be the same in python too?
<linduxed> in pyhton3 this happens (my code is python2 but i do import from future on the division):
<linduxed> >>> 1.0 // 0.4
<shevy> oh yeah
<linduxed> 2.0
<linduxed> >>> 1.0 / 0.4
<shevy> I wanted to learn python too
<linduxed> 2.5
<shevy> but I got tired of the version differences
<linduxed> well
<shevy> I'd wish there would be a language like ruby, but radically simpler
<linduxed> hmmm
vbernetr [vbernetr!~vbernetr@vbr.nexen.net] has joined #ruby
<linduxed> i'd say that there still isn't much reason to care too much about python3
<shevy> hehe
<shevy> perl5 vs. perl6
alindeman [alindeman!~adml@pudge.ithought.org] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@adsl-98-85-31-238.mco.bellsouth.net] has joined #ruby
probst [probst!~probst@bumblebee.cl.cam.ac.uk] has joined #ruby
Count_Niedar [Count_Niedar!~nnscript@ip68-231-248-182.hr.hr.cox.net] has joined #ruby
xoebus [xoebus!~xoebus@193.62.81.27] has joined #ruby
kivi [kivi!~joni@ec2-79-125-13-112.eu-west-1.compute.amazonaws.com] has joined #ruby
centipedefarmer [centipedefarmer!~centipede@74-84-107-90.client.mchsi.com] has joined #ruby
chrxn [chrxn!chrxn@69.4.233.32] has joined #ruby
klaas [klaas!klaas@simply.kla.as] has joined #ruby
norm [norm!~norm@ip-128-239-142-7.v4.wm.edu] has joined #ruby
irk3z [irk3z!~irek@78.47.187.53] has joined #ruby
xsdg [xsdg!~xsdg@SIPB-VM-99.MIT.EDU] has joined #ruby
mikejw [mikejw!~mike@falcor.vm.bytemark.co.uk] has joined #ruby
mahlon [mahlon!mahlon@martini.nu] has joined #ruby
_bat [_bat!~bat@68-71-141-194.servers.zerigo.net] has joined #ruby
swi7ch_ [swi7ch_!~addamh@li204-188.members.linode.com] has joined #ruby
<linduxed> the problem (or good thing, depending on how you see it) is that shit just won't move from 2.x (which is normally 2.6 or 2.7) until the major libraries are ported
psino [psino!~psino@unaffiliated/psino] has joined #ruby
<linduxed> for instance
<linduxed> twisted, the biggest and afaik best networking library is still not ported to p3
<shevy> I'd wish making a programming language would be easier
skrewler [skrewler!~skrewler@209.213.206.58] has joined #ruby
<linduxed> and until that happens, there's a shitton of projects that won't budge
<linduxed> so there's STILL no reason to use p3
<linduxed> which in a way is unfortunate, because there are many interesting things there, and many sane corrections
<linduxed> on the other hand... you avoid the problem which i've always thought the ruby community has, which is constant movement in the versions
<linduxed> the stable in python world is _really_ stable because they're in a deadlock, sortof
<linduxed> so no movement in versions, for sure
crayfishx [crayfishx!~craig@78.129.240.7] has joined #ruby
<kjs3> Programmers want a consistent, enforced, long lived version of a language right up till the point they get it (see: Ada). :-)
<linduxed> kjs3: haha, i don't know that story, unfortunately
clockwize [clockwize!~clockwize@5ac85c0d.bb.sky.com] has joined #ruby
<shevy> hmm
<shevy> only two last things stop me from moving to 1.9.3. one is Encoding, the other are circular requires somehow breaking a project
ZellFaze [ZellFaze!~Zell@pool-108-8-0-178.hgrtmd.east.verizon.net] has quit [#ruby]
havenn [havenn!~skipper@pool-108-0-191-51.lsanca.fios.verizon.net] has joined #ruby
tesmar [tesmar!~tesmar@adsl-98-69-191-124.rmo.bellsouth.net] has joined #ruby
zbrown [zbrown!~zbrown@rufius.xen.prgmr.com] has joined #ruby
yellow5 [yellow5!~yellow5@levicole.xen.prgmr.com] has joined #ruby
MissionCritical [MissionCritical!~MissionCr@unaffiliated/missioncritical] has joined #ruby
Axsuul [Axsuul!~Axsuul@75-140-75-52.dhcp.mtpk.ca.charter.com] has joined #ruby
syamajala [syamajala!~syamajala@c-75-68-106-118.hsd1.ma.comcast.net] has joined #ruby
thomascioppettin [thomascioppettin!~thomascio@cpe-071-071-047-213.triad.res.rr.com] has joined #ruby
bosphorus [bosphorus!~bosphorus@88.235.91.7] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-250-185-38.ard.bellsouth.net] has joined #ruby
zulax [zulax!~radarwork@99-120-232-161.lightspeed.iplsin.sbcglobal.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
Manhose [Manhose!~Manhose@bl17-17-151.dsl.telepac.pt] has joined #ruby
<yfeldblum> why do you have circular requires ...
bigkm [bigkm!~bigkm@203-206-185-71.perm.iinet.net.au] has joined #ruby
kennethreitz [kennethreitz!~kennethre@c-24-127-96-129.hsd1.va.comcast.net] has joined #ruby
AndChat| [AndChat|!~AndChat@118.82.185.158] has joined #ruby
kevinbond [kevinbond!~kevinbond@91.218.205.68.cfl.res.rr.com] has joined #ruby
j3r0m3 [j3r0m3!~j3r0m3@173-160-19-241-Sacramento.hfc.comcastbusiness.net] has joined #ruby
ben_alman [ben_alman!~cowboy@awesome.benalman.com] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
<shevy> yfeldblum not sure
<shevy> I think some file is calling itself somewhere
<shevy> or some other file that is calling itself
<shevy> is there any recommendation how to layout a project including the requires?
mdel [mdel!~mdel@pool-71-175-17-16.phlapa.fios.verizon.net] has joined #ruby
wingie [wingie!~wingie@c-5eeaaa34-74736162.cust.telenor.se] has joined #ruby
wingie [wingie!~wingie@c-5eeaaa34-74736162.cust.telenor.se] has quit ["WeeChat 0.3.5"]
<yfeldblum> shevy, rule #1 is take extreme care to understand the whole project and make sure that you can represent its class-level dependencies as a directed acyclic graph, that is, throughout the whole project, if X depends on Y (even indirectly) then Y is never allowed to depend on X (even indirectly)
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
<shevy> hmm hmm hmm
<shevy> somehow it hasn't yet quite made click in my head :(
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.44] has joined #ruby
new_ruby_program [new_ruby_program!~new_ruby_@pool-173-58-89-188.lsanca.fios.verizon.net] has joined #ruby
<new_ruby_program> what does this mean: def initialize(player_name)
<new_ruby_program> @player = Player.new(player_name)
<new_ruby_program> @rooms = []
<new_ruby_program> end
iDs [iDs!~YourNick@5e0ebb4e.bb.sky.com] has joined #ruby
<new_ruby_program> i dont understand the initializee part can someone help me?
<any-key> initialize is the constructor, which takes in the player's name
<any-key> this would be inside a class; when the class is instantiated the constructor gets called and initializes @rooms to an empty array
AndChat| [AndChat|!~AndChat@118.82.185.158] has joined #ruby
<any-key> does that help?
HypnoGenX [HypnoGenX!~Unknown@5ED4F1F5.cm-7-5d.dynamic.ziggo.nl] has joined #ruby
<new_ruby_program> yea thanks you explained it well
<any-key> woo!
havenn [havenn!~skipper@pool-108-0-191-51.lsanca.fios.verizon.net] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
HypnoGenX [HypnoGenX!~Unknown@5ED4F1F5.cm-7-5d.dynamic.ziggo.nl] has quit ["Leaving"]
bnewton [bnewton!~bnewton@cpe-66-68-94-56.austin.res.rr.com] has joined #ruby
geaif [geaif!~geaif@AToulouse-554-1-40-57.w92-149.abo.wanadoo.fr] has joined #ruby
Niedar [Niedar!~nnscript@ip68-231-248-182.hr.hr.cox.net] has joined #ruby
Banistergalaxy [Banistergalaxy!~AndChat@222.153.223.46] has joined #ruby
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby
minijupe [minijupe!~benlieb@adsl-74-250-185-38.ard.bellsouth.net] has joined #ruby
<idarkside> hi is it possible to trigger a url in ruby
kevinbond [kevinbond!~kevinbond@91.218.205.68.cfl.res.rr.com] has joined #ruby
<Okasu> trigger?
<idarkside> yah ok ill paste the url n explain
<Okasu> use open-uri or Addresable::URI
<idarkside> that triggers a command
<idarkside> it tells a device to turn on
<idarkside> im hoping to achieve the same thing
<UdontKnow> idarkside: you want to be the server or the client?
<idarkside> well the server is already in place i just want my ruby script to trigger that url
<idarkside> the server dose the rest so client :)
<UdontKnow> you want to $HTTP_VERB an http url :)
<idarkside> a=on returns DeviceStatus=2
<UdontKnow> right
<UdontKnow> probably a GET or POST
<idarkside> a=off returns DeviceStatus=3
<idarkside> yeah get i thought
<UdontKnow> right. well, you can use too many things for that. open-uri is one that is pretty easy to use
Marco [Marco!~marco@Marco-2.Kiewit.Dartmouth.EDU] has joined #ruby
<UdontKnow> you can get easier, harder, more complex or simpler. too many tools for the job :)
minijupe [minijupe!~benlieb@adsl-74-250-185-38.ard.bellsouth.net] has joined #ruby
<idarkside> could you mock up an example if possible
<UdontKnow> just take a look at the rdoc from open-uri
<UdontKnow> cannot get simpler than that
<idarkside> im going to intergrate it in to a siriproxy plugin just wondering what was best for job and correct format and thanks
akem [akem!~akem@unaffiliated/akem] has joined #ruby
dagnachewa [dagnachewa!~dagnachew@modemcable142.238-179-173.mc.videotron.ca] has joined #ruby
workmad3 [workmad3!~workmad3@host-84-13-69-129.opaltelecom.net] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
milkpost_ [milkpost_!~dec@173-28-195-157.client.mchsi.com] has joined #ruby
<slide> How do I get zlib bindings for ruby? Specifically im getting an error when running a third party program, its failing saying "dyld: lazy symbol binding failed:Symbol not found: _SSL_library_init"
<UdontKnow> slide: that doesnt look like zlib, more like openssl. try using strace and catching what call failed, should be an open() to a .so* file on linux
crodas [crodas!~crodas@git.crodas.org] has joined #ruby
ly- [ly-!~ly-@unaffiliated/ly-] has joined #ruby
<slide> hrm im on a mac, not sure how to get that
<Okasu> slide: like on a linux
zakwilson_ [zakwilson_!~quassel@c-69-180-70-100.hsd1.fl.comcast.net] has joined #ruby