juarlex has quit [Remote host closed the connection]
terrellt has quit [Quit: Do fish get thirsty?]
yjmsf20_ has joined #ruby
closer has joined #ruby
jtdowney has joined #ruby
yjmsf20 has quit [Read error: Operation timed out]
Jdubs__ has quit [Remote host closed the connection]
Jdubs has joined #ruby
Wolland has quit [Ping timeout: 272 seconds]
binaryhat has joined #ruby
saarinen has quit [Quit: saarinen]
<shevy>
when I do p object
<shevy>
what method is called?
_Andres has joined #ruby
<soahccc>
Kernel#p
<soahccc>
which is "puts whatever.inspect" iirc
subbyyy_ has joined #ruby
<shevy>
hmmm
<shevy>
oh
<jtdowney>
shevy: #inspect is called on the target
havenwood has quit [Remote host closed the connection]
aspires has quit []
<shevy>
\o/
<shevy>
it works, thanks
dukz has joined #ruby
jonahR has joined #ruby
jonahR has quit [Client Quit]
freezey has quit [Remote host closed the connection]
mlpinit has joined #ruby
zxd has joined #ruby
Wolland has joined #ruby
ayumin has joined #ruby
_1_thedude has joined #ruby
chrisseaton has quit []
IceDragon has quit [Ping timeout: 245 seconds]
Megtastique has quit []
IceDragon has joined #ruby
Aryasam has quit [Ping timeout: 260 seconds]
xpirator has joined #ruby
Jdubs has quit [Remote host closed the connection]
Aryasam has joined #ruby
_1_thedude has quit [Quit: WhatsChat IRC Android APP]
thenovices has joined #ruby
<ddd>
ok this is going to sound severely convoluted because I don't think I know how to explain this right. Its an active record question. but here it is
<ddd>
lets try it this way. i want the query that populates @user.rescue_groups collection to also populate each member in that collection's associated shelters so ther eis only 1 db query to make @user.rescue_groups *and* @user.rescue_groups.each do |rg| rg.shelters populated. so both are done with a single query.
ayumin has quit [Ping timeout: 252 seconds]
freezey has joined #ruby
Es0teric has joined #ruby
<ddd>
the user will probably own just 1 rescue but some can run 3 or 4. each rescue group has a shelters collection on it. I want every RG the user owns to have their respective shelters collection loaded at the same time I populate @user.rescue_groups and do it, if possible, with the single db query that populated @user.rescue_groups
troyready has quit [Read error: Operation timed out]
<RubyPanther>
maybe it isn't finding the dynamic linked ruby?
nari has joined #ruby
szerated_ has quit [Ping timeout: 265 seconds]
dayepa has quit [Ping timeout: 276 seconds]
dayepa has joined #ruby
phutchins has joined #ruby
Deele has quit [Ping timeout: 260 seconds]
subbyyy_ has joined #ruby
Seich has joined #ruby
xpirator has joined #ruby
kenndel has joined #ruby
glaksmono has joined #ruby
darthdeus has quit [Quit: Leaving...]
eka has quit [Quit: Computer has gone to sleep.]
jlast has joined #ruby
peregrin_ has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
szerated_ has joined #ruby
<glaksmono>
anyone is using capybara?
starkhalo has joined #ruby
m00nlight has joined #ruby
Virtualize has quit [Quit: Leaving...]
dayepa has quit [Ping timeout: 276 seconds]
<pontiki>
probably
jlast has quit [Ping timeout: 252 seconds]
dayepa has joined #ruby
DrCode has joined #ruby
Virtualize has joined #ruby
alexfreidah has quit [Ping timeout: 252 seconds]
bradhe has joined #ruby
blischalk has joined #ruby
dayepa1 has joined #ruby
Lewix has joined #ruby
sungai_keruh has joined #ruby
mlpinit has quit [Remote host closed the connection]
dayepa has quit [Remote host closed the connection]
alexfreidah has joined #ruby
popl has joined #ruby
popl has joined #ruby
ayumin has joined #ruby
darthdeus has joined #ruby
dayepa has joined #ruby
Voodoofish430 has quit [Quit: Leaving.]
tt1187 has quit [Ping timeout: 246 seconds]
gja has joined #ruby
deens has joined #ruby
cj3kim has quit [Remote host closed the connection]
dayepa1 has quit [Ping timeout: 276 seconds]
dik_dak has joined #ruby
ayumin has quit [Ping timeout: 272 seconds]
michael_mbp has quit [Excess Flood]
RagingDave has quit [Quit: Ex-Chat]
michael_mbp has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
Seich has quit [Quit: Computer has gone to sleep.]
gja has quit [Client Quit]
thenovices has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
bbloom has joined #ruby
lethjakman has quit [Ping timeout: 272 seconds]
dukz has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
senayar has quit [Remote host closed the connection]
dj21 has quit [Quit: leaving]
dayepa has joined #ruby
kenndel has quit [Read error: Connection reset by peer]
gja has joined #ruby
gja has quit [Changing host]
gja has joined #ruby
meatherly has joined #ruby
thenovices has quit [Ping timeout: 245 seconds]
rickruby has quit [Remote host closed the connection]
chinkung has quit [Quit: Bye!]
dayepa1 has joined #ruby
bbloom has quit [Ping timeout: 245 seconds]
rickruby has joined #ruby
cbetta is now known as cbetta_afk
kenndel has joined #ruby
gregoriokusows-1 has quit [Quit: gregoriokusows-1]
rickruby has quit [Remote host closed the connection]
alekst has quit [Quit: Leaving...]
mocfive has quit [Remote host closed the connection]
clevermatt has quit [Remote host closed the connection]
hiall has quit [Quit: hiall]
danshultz has quit [Remote host closed the connection]
dayepa has quit [Ping timeout: 276 seconds]
clevermatt has joined #ruby
dayepa has joined #ruby
danshultz has joined #ruby
shevy has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
Aryasam has quit [Ping timeout: 276 seconds]
lioninawhat has joined #ruby
digital-ghost has quit [Remote host closed the connection]
MatthewsFace has joined #ruby
Aryasam has joined #ruby
<glaksmono>
pontiki, are you using capybara?
<glaksmono>
i've been struggling on this issue.. of not being able to execute javascript..
dayepa2 has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
deens has quit [Remote host closed the connection]
Caleb is now known as Guest40087
Butcho has joined #ruby
Butcho has quit [Max SendQ exceeded]
kenndel has quit [Read error: Connection reset by peer]
Butcho has joined #ruby
dayepa1 has joined #ruby
firewater5 has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
Targen has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby
Cephalostrum has joined #ruby
Cephalostrum has quit [Max SendQ exceeded]
<firewater5>
Hey, so currently working on a puzzle. Basically, the puzzle is related to making classes and make it pass. I am familiar with making classes. However, this one starts out with just saying @thing=Thing.new. Then does @thing.name="name" and then tests it and says @thing.name.should=="Name". I'm confused on how you do this.
jcarouth has quit [Excess Flood]
<firewater5>
Basically, I made a class called Thing.
Cephalostrum has joined #ruby
jcarouth has joined #ruby
Cephalostrum has quit [Max SendQ exceeded]
<firewater5>
Then thought of doing an def intialize method.
<bnagy>
glaksmono: are you using poltergeist?
<firewater5>
But, nothing is really initalized in the above.
Cephalostrum has joined #ruby
dayepa2 has quit [Ping timeout: 276 seconds]
<firewater5>
How do you make the thing have a name when no name is made?
<firewater5>
through an accessor :name?
binaryhat has quit [Quit: Leaving]
<bnagy>
that would do it
subbyyy_ has quit [Ping timeout: 245 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
kenndel has joined #ruby
<firewater5>
So, I did this then.
smiller has quit [Ping timeout: 272 seconds]
<firewater5>
I put accessor :name at the top of the class.
<bnagy>
attr_accessor
<firewater5>
Then how do I make the thing where it is making it equal to "name" get into the calss?
<firewater5>
Sorry, attr_accessor, that is what I put.
<firewater5>
attr_accessor :name.
randomnick_ has quit [Quit: Leaving]
<firewater5>
Do I thend do this:
<bnagy>
>> ''
<firewater5>
def initialize
Guest40087 has quit [Quit: Guest40087]
<bnagy>
crap still no eval-in
<firewater5>
@name=name
<firewater5>
end
mansi has quit [Remote host closed the connection]
sethen has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
<firewater5>
yeah, no?
<bnagy>
no you don't need to
e62 has joined #ruby
mansi has joined #ruby
<firewater5>
Then how do you mess with the attr_accessor?
<firewater5>
Sorry, I am new at this.
<bnagy>
if you class is Thing then t=Thing.new; t.name="Whatever"
<firewater5>
Yes, that is what its doing.
dayepa has joined #ruby
<bnagy>
well that's it. What remains unclear?
Spami has quit [Quit: This computer has gone to sleep]
<firewater5>
How would you then manipulate t.name?
<firewater5>
In the class itself?
Seich has joined #ruby
<firewater5>
So, lets say t.name="Whatever"
<firewater5>
You want then t.name.should=="whatever"
<firewater5>
How could you make it go .downcase?
<bnagy>
well that part is just your test
guinslym has joined #ruby
<bnagy>
t.name will ( in the example ) return "Whatever"
mikepack has joined #ruby
<bnagy>
if you want to downcase it you do it like you would downcase any other string
mansi has quit [Ping timeout: 245 seconds]
e62 has quit [Ping timeout: 260 seconds]
<firewater5>
I try to do it.
<firewater5>
So, fine, I have attr_accessor :title
<firewater5>
That gets set to whatever is passed to it.
<firewater5>
Is there a way to then play with it somehow and manipulate :title in the class?
<firewater5>
Do you set it in def initalize?
<bnagy>
no
<firewater5>
and then set it to a @variable?
<bnagy>
you access it directly
<bnagy>
you just asked both of those questions 2 minutes ago
Hanmac1 has joined #ruby
rickruby has joined #ruby
ewnd9 has joined #ruby
<firewater5>
Well, I'm playing with it and its not working. But I guess I will keep playing with it.
mikepack has quit [Ping timeout: 245 seconds]
<guinslym>
Hi! (1..9).to_a gives me an array. and [*1..9] gives me also an array but I don't understand the * character cause it's not a function where can I find the doc for * (does it have a special name cause I don't find the info in the doc)
<bnagy>
a_thing.name = "Fred"; a_thing.name = "Barry" # name is now Barry; a_thing.name.downcase! # name is now barry
<bnagy>
guinslym: magic word to google is 'splat'
mneorr has quit [Remote host closed the connection]
dayepa has quit [Ping timeout: 276 seconds]
<firewater5>
Your doing that outside the class though.
<firewater5>
How would you accomplish that within the class itself?
mneorr has joined #ruby
<bnagy>
firewater5: why would you want to do that?
<guinslym>
bnagy, thks!
<firewater5>
That is what the puzzle wants me to do.
<bnagy>
the name is an instance variable - each instance of the class has its own name
dayepa has joined #ruby
<glaksmono>
bnagy, no i'm not using poltergeist
<firewater5>
it wants me to manipulate what is passed to it.
Hanmac has quit [Ping timeout: 272 seconds]
<bnagy>
glaksmono: ok, well try that :)
gja has quit [Quit: This computer has gone to sleep]
<glaksmono>
bnagy, i tried... and i'm getting these errors...
<bnagy>
js driver for capyara. It's quite good.
<glaksmono>
bnagy, well.. something with $ isn't found..
bradhe has quit [Ping timeout: 265 seconds]
<bnagy>
firewater5: if it wants blah.name = "fred" to result in blah.name => "Fred" then you want an attr_reader and an actual setter method def name= new_name
dayepa1 has joined #ruby
Gooder` has quit [Remote host closed the connection]
<glaksmono>
bnagy, i tried.. and it had problem with something that $ isn't found..
phutchins has quit [Ping timeout: 276 seconds]
mneorr has quit [Ping timeout: 253 seconds]
<firewater5>
bnagy: Sigh, I'm lost now :/.
<firewater5>
I know attr_reader just reads it.
<firewater5>
But, basically, the test isn't calling a method like that.
<firewater5>
Its just being passed a name
<firewater5>
And it then turns it into a capital.
<firewater5>
name
alexfreidah has quit [Ping timeout: 276 seconds]
<bnagy>
firewater5: whatever you are doing to learn ruby is not sinking in. Try something else, or the same thing again
<bnagy>
you appear to have no grasp at all of instance variables and methods
<bnagy>
so find something on that
<firewater5>
I am going to keep trying at this, I already made a ruby gem.
<firewater5>
I am now learning through puzzles, yes I have a lot to learn. But I'm not stopping now.
<firewater5>
bnagy: I understand what they are. But I am trying to fit them into a puzzle.
<firewater5>
I'm used to making my own.
<firewater5>
In my own programs.
<firewater5>
Not solving a puzzle like this which requires me to code differently.
dayepa has quit [Ping timeout: 276 seconds]
carif has joined #ruby
rickruby has quit [Remote host closed the connection]
<firewater5>
For example, I am trying to do :name.upcase! and it says .upcase! not recognized for symbols.
<firewater5>
Which :name is a symbol.
wald0 has quit [Ping timeout: 252 seconds]
cashnguns has quit [Quit: I'm just an old fashioned cowboy]
kenndel has quit [Read error: Connection reset by peer]
<bnagy>
show code
Aryasam has quit [Ping timeout: 276 seconds]
jlast has joined #ruby
iamjarvo_ has joined #ruby
Aryasam has joined #ruby
dayepa1 has quit [Ping timeout: 276 seconds]
<firewater5>
bnagy: For example, I'm used to initalizing name like this. @name=Name.new("Name")
<firewater5>
I am not used to setting it as @name=Name.new
<firewater5>
THen adding a name later.
dayepa has joined #ruby
seoaqua has joined #ruby
charliesome has joined #ruby
Evixion has joined #ruby
carif has quit [Read error: Connection reset by peer]
duggiefresh has joined #ruby
<firewater5>
solved it.
<firewater5>
I did it my way too.
<bnagy>
class Person; attr_reader :name; def name= new_name; # YOUR CODE HERE; end; end
<firewater5>
You just do attr_accessor
kenndel has joined #ruby
<firewater5>
then do the initialize thing you said not to do.
<firewater5>
And then manipulate it by making a def title method.
<firewater5>
bnagy: Can I ask why my code would be bad though?
<firewater5>
Over what you are doing?
<bnagy>
you're using an accessor along with a getter
thomasxie has joined #ruby
dukz has quit [Remote host closed the connection]
<bnagy>
your attr_accessor may as well just be attr_writer
<firewater5>
Ok, and what is the def name=new_name part?
<bnagy>
and there's no reason to assign the name in initialize. Some classes that makes sense, some others it is cumbersome to set every single thing in initialize
<firewater5>
new_name isn't anything is it? It doesn't seem like a way to pass a parameter.
Butcho has quit [Client Quit]
<bnagy>
it's a method arg
jlast has joined #ruby
teenwolf has joined #ruby
amacgregor_ has joined #ruby
thomasxie has left #ruby [#ruby]
Hobogrammer has joined #ruby
thenovices has joined #ruby
browndawg has quit [Ping timeout: 245 seconds]
Butcho has joined #ruby
<firewater5>
#YOUR CODE HERE. Should that be new_name.capitalize?
<bnagy>
it should definitely be something
<firewater5>
bnagy: Because that doesn't work.
<firewater5>
That is why I am asking.
<bnagy>
there are an infinite number of things that won't work
<firewater5>
So, what does work in this case?
radic has quit [Ping timeout: 252 seconds]
<firewater5>
Your saying to do it this way, but I really am not seeing it.
<bnagy>
that's kind of the bit you're supposed to work out
sepp2k has quit [Read error: Connection reset by peer]
<firewater5>
I did, my code worked. I tried your way and its giving me a bunch of errors.
szerated_ has quit [Ping timeout: 246 seconds]
narcan has joined #ruby
dayepa has quit [Ping timeout: 276 seconds]
Butcho has quit [Client Quit]
<firewater5>
Nevermind, thanks anyways for the help bnagy.
radic has joined #ruby
<bnagy>
this is why understanding what you're doing is good
<firewater5>
bnagy: Hints why I am learning.
jlast has quit [Ping timeout: 245 seconds]
brianpWins has joined #ruby
<firewater5>
bnagy: I'm sure there are things you don't know either.
thenovices has quit [Ping timeout: 252 seconds]
firewater5 has quit [Quit: Page closed]
dayepa has joined #ruby
szerated_ has joined #ruby
szerated_ has quit [Read error: Connection reset by peer]
alvaro_o has quit [Quit: Ex-Chat]
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby
brianpWins has quit [Remote host closed the connection]
dseitz has joined #ruby
ss_ has joined #ruby
mary5030 has joined #ruby
amacgregor__ has joined #ruby
kizzx21 has quit [Quit: Leaving.]
danijoo_ has quit [Read error: Connection reset by peer]
seoaqua has joined #ruby
danijoo has joined #ruby
amacgregor_ has quit [Ping timeout: 246 seconds]
glaksmono has quit [Quit: This computer has gone to sleep]
baroquebobcat has joined #ruby
Aryasam has quit [Ping timeout: 276 seconds]
Aryasam has joined #ruby
DaZ has quit [Read error: Operation timed out]
seoaqua has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
ixti has quit [Ping timeout: 272 seconds]
seoaqua has joined #ruby
danshultz has quit [Remote host closed the connection]
vlad_starkov has quit [Read error: Connection reset by peer]
seoaqua_ has joined #ruby
nhhagen has joined #ruby
nwertman_ has quit [Read error: Connection reset by peer]
mansi has joined #ruby
duggiefresh has quit [Remote host closed the connection]
browndawg has joined #ruby
freerobby has quit [Quit: Leaving.]
carif has quit [Quit: Ex-Chat]
duggiefresh has joined #ruby
blischalk has quit [Quit: Leaving]
seoaqua has quit [Ping timeout: 252 seconds]
gja has joined #ruby
mikepack has joined #ruby
nhhagen has quit [Ping timeout: 248 seconds]
Targen has joined #ruby
thenovices has joined #ruby
mansi has quit [Ping timeout: 252 seconds]
masterkorp has joined #ruby
<masterkorp>
heu
<masterkorp>
how do i get gem to use a specific version of a gem
yacks has joined #ruby
<masterkorp>
i updated my gems but i need capistrano 2
Hanmac has joined #ruby
mikepack has quit [Ping timeout: 276 seconds]
knigitz has joined #ruby
subbyyy_ has joined #ruby
Hanmac1 has quit [Ping timeout: 272 seconds]
ttlnow has quit [Quit: Lost terminal]
avalarion has joined #ruby
<seoaqua_>
gem install xxx -v 0.0.0
mercwithamouth has quit [Ping timeout: 276 seconds]
prc has left #ruby [#ruby]
<seoaqua_>
can anyone see me? i was disconnected several times
clamstar has joined #ruby
peregrin_ has quit []
ehc has quit [Quit: ehc]
jcarouth has quit [Excess Flood]
jcarouth has joined #ruby
ss_ has quit [Remote host closed the connection]
ss_ has joined #ruby
thesheff17 has joined #ruby
shadoi has quit [Quit: Leaving.]
<masterkorp>
seoaqua_: i can
braincrash has quit [Quit: bye bye]
<masterkorp>
seoaqua_: hmm, how do i list the versions?
<masterkorp>
i basically want the lastest 2.x
<seoaqua_>
masterkorp, gem list? this is from local
joshwines_ has quit [Remote host closed the connection]
yfeldblum has quit [Remote host closed the connection]
<seoaqua_>
masterkorp, maybe `gem search`. i usually query from rubygems.org
s2013 has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
MatthewsFace has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
kenndel has joined #ruby
stryek has joined #ruby
Virtualize has quit [Quit: Leaving...]
sec^nd has joined #ruby
dku has joined #ruby
freerobby has joined #ruby
Kneferilis has quit [Ping timeout: 252 seconds]
Foomusic has quit [Read error: Connection reset by peer]
freerobby has quit [Ping timeout: 248 seconds]
mary5030 has quit [Remote host closed the connection]
frx has joined #ruby
frx has left #ruby [#ruby]
SCommette has joined #ruby
jlast has joined #ruby
masterkorp has left #ruby ["WeeChat 0.3.8"]
thenovices has quit [Remote host closed the connection]
ewnd9_ has joined #ruby
ewnd9 has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
iliketurtles has joined #ruby
redbaritone has joined #ruby
redbaritone has quit [Quit: redbaritone]
jlast has quit [Ping timeout: 276 seconds]
clevermatt has quit [Remote host closed the connection]
subbyyy_ has quit [Read error: Connection reset by peer]
speakingcode has joined #ruby
freerobby has joined #ruby
sergicles has quit [Quit: sergicles]
<speakingcode>
having a paradigm meltdown
Foomusic has joined #ruby
ehc has joined #ruby
ehc has quit [Client Quit]
<speakingcode>
i can implement a solution using just hashes/arrays, or i could go all out OO and define classes fr the actual objects and the actors on them, or some mix of the two, or...
<speakingcode>
don't really see the advantage of the OO approach in this case b/c ruby doesn't provide the static type safety of say, java... hmmm
freerobby has quit [Ping timeout: 252 seconds]
bbloom has joined #ruby
Virtualize has joined #ruby
<bnagy>
don't use classes as just containers
<bnagy>
if the classes have no methods, then you should be using a core class like Array etc
<speakingcode>
i agree. just kind of philosophically pondering, so i'll ask why not?
<bnagy>
it makes the code deceptive
<speakingcode>
maybe i will need behavior later, for instance
likemike has quit [Ping timeout: 252 seconds]
kenndel has quit [Read error: Connection reset by peer]
<bnagy>
like making a class just so you can go container.blah instead of container[:blah] is irritating to someone else trying to read your code
freezey has quit [Remote host closed the connection]
<speakingcode>
like say.. [ {name: "john doe", age: 3}, {name: "jane doe", age 4}] vs defining a person class and having an array of person objects that each have name and age
vlad_starkov has joined #ruby
<bnagy>
it just depends what else you want to do with that object
<bnagy>
I have seen people use Struct to get .. not really type safety, but a level of type-forgetfulness-protection
<bnagy>
imho I don't like it much, but it's a style
<speakingcode>
so like class Person < Struct.new(:name, :age) ?
vlad_starkov has quit [Read error: Connection reset by peer]
<bnagy>
yeah I think that's how it works
<bnagy>
you can put in classes and stuff, can't you?
<speakingcode>
not sure
<speakingcode>
not sure what you mean exactly by the question :)
duggiefresh has quit [Remote host closed the connection]
<speakingcode>
coming from a java background i lean toward the class approach, but then coming from javascript i lean toward "literal" objects (hashes/arrays)
<bnagy>
hm, no maybe I just dreamed that
<speakingcode>
of course hash and array members can't be behavior, that i know of.. maybe procs? heh.
mansi has joined #ruby
<speakingcode>
so many style possibilities with ruby
<agent_white>
ciwolsey: Just to make you think about it like you're doing now?
<agent_white>
mt
aagdbl has joined #ruby
ambushsabre has left #ruby ["rip"]
<Sawbones>
Eh
Sawbones has quit [Remote host closed the connection]
<speakingcode>
Sawbones: ruby koans will get you familiar with the mechanics of the language and common functions of std lib. so things like assignment, comparisons, arrays, hashes, and so forth
Liothen has quit [Quit: System of a down……]
tejas has quit [Quit: This computer has gone to sleep]
Deele has joined #ruby
<speakingcode>
strings, loops, ranges, enummerables, yadda yadda
danshultz has quit [Ping timeout: 276 seconds]
thenovices has quit [Ping timeout: 272 seconds]
alexfreidah has quit [Ping timeout: 252 seconds]
sensen has joined #ruby
diegoviola has joined #ruby
lifestream has joined #ruby
godd2 has quit [Ping timeout: 272 seconds]
phansch has joined #ruby
axl_ has quit [Quit: axl_]
amclain has joined #ruby
Virtualize has quit [Quit: Leaving...]
phansch has quit [Client Quit]
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
sparrovv has joined #ruby
subbyyy_ has joined #ruby
audle has joined #ruby
bubbajones has quit [Ping timeout: 260 seconds]
sailias has quit [Read error: Operation timed out]
rakm has quit [Quit: Connection closed for inactivity]
IceDragon has quit [Quit: Space~~~]
Soliah has quit [Quit: Soliah]
CodeBunny has quit [Read error: Connection reset by peer]
sparrovv has quit [Ping timeout: 276 seconds]
ahmedelgabri has joined #ruby
diegoviola has quit [Quit: WeeChat 0.4.2]
subbyyy_ has quit [Ping timeout: 272 seconds]
meatherly has quit [Remote host closed the connection]
bombsite has joined #ruby
<bombsite>
hello!
Jdubs has joined #ruby
<bombsite>
I'm trying to learn ruby on rails
<audle>
hi. I was trying to make a html table from an array of arrays. I tried to nest inside of my erb file like this: https://gist.github.com/anonymous/b02c99fa4c26bfde455a but it didn't work. what is a good way to accomplish this kind of task?
<bombsite>
what would be a good point to start from?
<bombsite>
like make a website with heroku and stuff?
<pontiki>
audle: the inner loop variable, sub_list, should not have an instance variable @ on it
seoaqua has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
pu22l3r_ has joined #ruby
freerobby has joined #ruby
<pontiki>
gregf: that's a nice way to do that
fgo has quit []
KicStart has joined #ruby
<audle>
oh :p thank you
Spami has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<gregf>
pontiki: good enough, thanks
yasushi has quit [Remote host closed the connection]
yacks has quit [Read error: Operation timed out]
magoo has quit [Ping timeout: 265 seconds]
thenovices has joined #ruby
bubbajones has joined #ruby
stryek has quit [Quit: Leaving]
juarlex has joined #ruby
aqua__ has quit [Ping timeout: 246 seconds]
clamstar has quit [Quit: Computer has gone to sleep.]
teenwolf has quit [Quit: Leaving...]
e62 has joined #ruby
seoaqua has quit [Ping timeout: 272 seconds]
freerobby has quit [Ping timeout: 246 seconds]
seoaqua has joined #ruby
duggiefresh has quit [Remote host closed the connection]
thenovices has quit [Ping timeout: 252 seconds]
lifestream has left #ruby ["Leaving"]
seoaqua__ has joined #ruby
seoaqua_ has quit [Ping timeout: 272 seconds]
e62 has quit [Ping timeout: 252 seconds]
Guest17428 has quit [Ping timeout: 260 seconds]
seoaqua has quit [Ping timeout: 246 seconds]
Es0teric has joined #ruby
seoaqua has joined #ruby
seoaqua__ has quit [Ping timeout: 260 seconds]
CodeBunny has joined #ruby
audle has quit [Quit: Leaving]
Red_Onyx has quit [Quit: Leaving]
browndawg has quit [Quit: Leaving.]
seoaqua has quit [Ping timeout: 245 seconds]
seoaqua has joined #ruby
bbloom has quit [Ping timeout: 272 seconds]
KicStart has left #ruby [#ruby]
rickruby has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
bubbajones has quit [Ping timeout: 276 seconds]
mikepack has joined #ruby
fijimunkii has joined #ruby
rickruby has joined #ruby
<ddd>
woo, i learned something new tonight. you can pass in vars to a block that are block-lock. def my_meth ; x = 0; 5.times { |i;x| x =+ i ; puts x } ; puts x ; end # the TIL is the ;x
<ddd>
didn't know you could do that in ruby. never seen that done until tonight
likemike has joined #ruby
<centrx>
ddd, It's the same with a comma
vlad_starkov has quit [Read error: Connection reset by peer]
seoaqua has quit [Ping timeout: 272 seconds]
mikepack has quit [Ping timeout: 248 seconds]
<ddd>
oh? i thought the comma was for any additionals like for a hash.each {|k,v| } so if there aren't enough args to tjhe block to fill all the requested params, it makes it into a block-local?
seoaqua has joined #ruby
dukz has joined #ruby
rickruby has quit [Ping timeout: 260 seconds]
meatherl_ has quit [Remote host closed the connection]
gja has joined #ruby
sLi_ has joined #ruby
<centrx>
ddd, I just tested it and I get the same result..
seoaqua_ has joined #ruby
<ddd>
nice!
nanoyak has joined #ruby
BrixSat has quit [Remote host closed the connection]
aagdbl has quit [Quit: Leaving]
<ddd>
so to get a 3rd var for the block with a has just add a , and a var like |k,v,accum|
aagdbl has joined #ruby
BrixSat has joined #ruby
<ddd>
i can find use for that. ruby always finds ways to teach me something. i love this language!
funburn has joined #ruby
seoaqua has quit [Ping timeout: 245 seconds]
gja has quit [Client Quit]
fijimunkii has quit [Ping timeout: 276 seconds]
gja has joined #ruby
gja has joined #ruby
gja has quit [Changing host]
OdNairy has joined #ruby
vlad_starkov has joined #ruby
whomp has quit [Ping timeout: 276 seconds]
<bnagy>
don't do it
seoaqua has joined #ruby
mocfive has joined #ruby
<bnagy>
it's a stupid 'feature'
<bnagy>
it's really just an arity abuse
fijimunkii has joined #ruby
<bnagy>
it's for optional block args afair
sLi_ has quit [Ping timeout: 248 seconds]
<bnagy>
if you want to declare a block local for yourself then do it in the body
seoaqua_ has quit [Ping timeout: 245 seconds]
<ddd>
what is the diff? why is it not good to use the block args?
gja has quit [Client Quit]
<ddd>
i know its an optional non-default, but i don't get why not to declare them there
diegoviola has joined #ruby
<centrx>
ddd, What would the use case be?
seoaqua has quit [Ping timeout: 246 seconds]
<centrx>
ddd, Why not use a different variable name? Seems like it would be a misleading feature (I didn't know about this)
<ddd>
only one i can think of off the top of my head (since I just learned it tonight) would be an in-block accumulator
gja has joined #ruby
<bnagy>
declare it outside the ||
top4o has quit [Read error: Connection reset by peer]
gja has quit [Changing host]
gja has joined #ruby
<ddd>
like either for integer math, or possibly for contatentation built from each successive element (string).
<centrx>
ddd, That is a perfect use case for inject/reduce
<ddd>
bnagy got it.
<ddd>
centrx i was just commenting on a neat little feature i didn't know you could do with blocks
<bnagy>
oh you mean an accum over multiple invocations of the block? Pretty sure it won't do that
<centrx>
Sorry I wasn't trying to get on your case
<bnagy>
that's what inject's for
<centrx>
ddd, Ruby 1.8 used to do this for variables defined in the block
<ddd>
bnagy 5.times {|i;x| } # it will stick around through the 5 times then die when the block actually ends
<ddd>
interesting.
top4o has joined #ruby
<centrx>
ddd, So when that was changed in Ruby 1.9, I guess they added this semicolon feature to support both
Spami has quit [Quit: This computer has gone to sleep]
<ddd>
i just learned the difference tonight between each and map as well. each returns the original collection unmodified, map returns the modified by default
<ddd>
little things i'm picking up along the way.
danijoo has quit [Read error: Connection reset by peer]
<ddd>
centrx got it. i guess its just a little feature i didn't know about and thought was cool mainly because i didn't know it *could* do that
<bnagy>
ddd: demonstrate?
danijoo has joined #ruby
<bnagy>
5.times {|i;x| p i; x||=0; x+=i;p x} that seems to do what I expect?
<ddd>
little tight in the grouping. gimme a sec to read that
<ddd>
first iteration i would be 0, x would be initialized to 0, x would be 0, and x would be 0
<ddd>
2nd iteration i would be 1, x would be 0 already, x would be set to 1, p x would output 1
<ddd>
or should if the book is right
seoaqua_ has joined #ruby
<ddd>
yeah its right
<ddd>
according to pry at least
<centrx>
x = 0; 1.times { |i;x| x = 2; puts x }; puts x
narcan has quit [Read error: No route to host]
<ddd>
0 and 2
OdNairy has quit [Ping timeout: 272 seconds]
<bnagy>
that's just scope
<ddd>
0 outside, 2 inside, 0 outside
<bnagy>
but x doesn't accumulate at all
fijimunkii has quit [Ping timeout: 245 seconds]
<centrx>
but it seems to do that with the comma too...
<ddd>
bnagy oh yeah, not implying that it jumps scope
<ddd>
oh i see what you're saying
sensen has quit [Ping timeout: 272 seconds]
<bnagy>
every iteration in the thing I pasted it is initialized to 0 and the x+=i
<ddd>
yeah you're right. it should be 10 right if it did?
<ddd>
or higher actually
iamjarvo_ has quit [Ping timeout: 265 seconds]
<bnagy>
10
<ddd>
ok i see your point.
<bnagy>
sum of 0..4 is 4*5 / 2
bricker`LA has quit [Ping timeout: 276 seconds]
<ddd>
hrmm. so there is no way to accumulate through block iterations?
bricker`LA has joined #ruby
<ddd>
inside the block i mean
<bnagy>
not afaik
<ddd>
its just always zzt fresh run, fresh reinitialized block
<ddd>
gotcha
<bnagy>
well the block will use local vars in its scope, that's the most common way, you can also use inject
aagdbl0 has joined #ruby
aagdbl1 has joined #ruby
<centrx>
a = 1; [2].each { |;a| p a }; a
<bnagy>
but inject cheats by passing in the return value of each yield
aagdbl1 has quit [Client Quit]
aagdbl has quit [Disconnected by services]
seoaqua_ has quit [Ping timeout: 245 seconds]
<ddd>
ah, so its basically a trap/wrapper to snag the return value for injection
<ddd>
doesn't do anything.. special
Evixion has quit [Ping timeout: 252 seconds]
mspah_ has quit [Quit: This computer has gone to sleep]
<ddd>
supposed to be a ? at the end of that. hit enter too fast
OdNairy has joined #ruby
<ddd>
ok the ri docs say it creates a accum var named memor, or if you use a symbol instead it creates a method named 'memo'. so does that mean you can overwrite or extend that method? i take it that would be a monkey patch to Enumerable directly
seoaqua has joined #ruby
<ddd>
s/memor/memo/
<bnagy>
cannot parse
Barrin6 has quit [Quit: Leaving]
sLi_ has joined #ruby
agent_white has quit [Ping timeout: 272 seconds]
<ddd>
docs say that with inject, it creates an accumulator var named 'memo'. which does what you said. sticks the return value from the last iter into 'memo'. but it says that if you specify a symbol instead, it makes a method named 'memo'
<ddd>
so in order to modify (since ruby lets you mod just about anything) that memo method would be to monkey patch Enumerable directly, correct?
yacks has joined #ruby
<ddd>
so if i wanted to do .. whatever (some work).. on that value passed into the memo method, i'd have to MP the Enmerable declaration for that memo method
<bnagy>
ohh you just mean like inject :+
Scient has quit [Ping timeout: 246 seconds]
<ddd>
yeah
Martxel has quit [Ping timeout: 252 seconds]
mnemon has quit [Remote host closed the connection]
mnemon has joined #ruby
vadviktor_ has joined #ruby
seoaqua has quit [Ping timeout: 245 seconds]
Haegin has quit [Ping timeout: 260 seconds]
<bnagy>
it sends whatever method to the memo obj with the current elem as an arg
Martxel has joined #ruby
vadviktor has quit [Ping timeout: 264 seconds]
rickruby has joined #ruby
Martxel is now known as Guest22852
Scient has joined #ruby
agent_white has joined #ruby
sLi_ has quit [Remote host closed the connection]
<bnagy>
erm [1,2,3,4].inject([9], :push) for example
Haegin has joined #ruby
mr_red has quit [Ping timeout: 272 seconds]
<agent_white>
What's the point of using |a;b| over |a,b| ?
sLi_ has joined #ruby
<agent_white>
What's the point of using |a;b| over |a,b| ?
<ddd>
i got it. thanks for that bnagy
<agent_white>
Whoa
<agent_white>
Sorry for the triple posting there, timed out and didn't notice.
jlast has joined #ruby
mr_red has joined #ruby
<agent_white>
ddd/bnagy: Either of you guys respond to that by chance?
Spami has joined #ruby
<ddd>
yeah hate to say it but in a way i don't get the diff between , and ;. i thought with the , the block args?/params? would slurp up any args like the splat did, while ; *specifically* created a block-local var
<bnagy>
I didn't - afaik, none
<ddd>
but centrx said different, that it didn't matter which 'style' you used
<bnagy>
I think it's there for optional args for some forms of block proc lambda whatever
<bnagy>
like some of them aren't strict on arity
<agent_white>
Hmmm... so comma separated-anything in Ruby can be separated by newlines instead?
<agent_white>
Or is that taking it too far? ;P
<bnagy>
but I don't use that, ever, so I don't know for sure / in detail :)
<ddd>
no this is specifically for block args
<agent_white>
Rather, comma-separated args
<ddd>
bnagy whats the right word for that? arg right?
<agent_white>
Ahhh
<ddd>
|arg, arg|
<centrx>
|grr, grr|
<ddd>
hehe
seoaqua_ has joined #ruby
sensen has joined #ruby
<ddd>
arg is whats passed in, the actual value, param is the placeholder?
rickruby has quit [Ping timeout: 272 seconds]
<agent_white>
param is what's expected, arg is what is sent?
bricker`LA has quit [Remote host closed the connection]
<ddd>
there's a technical diff, i just don't remember the exactness of the diff
<agent_white>
ddd: yes! (?) :D
bricker`LA has joined #ruby
sLi_ has quit [Ping timeout: 272 seconds]
<ddd>
yeah thats what i thought. param is expected, arg is the actual
jlast has quit [Ping timeout: 246 seconds]
<agent_white>
ddd: I think that's it, an argument has no basis without parameters to argue against.
mocfive has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<ddd>
hehe good way to put it ;)
<agent_white>
Or agree upon, I suppose. #matzisnice_wearenice
mocfive has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
<ddd>
i know what folks mean when they use either word, just couldn't remember the exact difference
<ddd>
but i like the way you put it. makes it really clear in a short sentence
seoaqua has joined #ruby
<ddd>
anyways, that was my TIL for the early morning :)
amacgregor__ has quit [Ping timeout: 245 seconds]
freerobby has joined #ruby
seoaqua_ has quit [Ping timeout: 252 seconds]
yfeldblum has joined #ruby
<agent_white>
ddd: Hahah me too, except for the late night! ;)
dazeddev has joined #ruby
mocfive has quit [Ping timeout: 252 seconds]
h_kon has joined #ruby
seoaqua_ has joined #ruby
thenovices has joined #ruby
<ddd>
i've been pulling a crapload of them lately.
<ddd>
my wife's ticked, but i'm an insomniac. whatami supposed to do? just stare at the walls?
nfk has quit [Read error: Operation timed out]
seoaqua has quit [Ping timeout: 260 seconds]
tyl has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
iamjarvo has joined #ruby
thenovices has quit [Ping timeout: 248 seconds]
seoaqua_ has quit [Ping timeout: 248 seconds]
bubbajones has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
seoaqua_ has joined #ruby
top4o has quit [Read error: Connection reset by peer]
pranny has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
zipper has joined #ruby
zipper is now known as urbanslug
yasushi has joined #ruby
<agent_white>
Hahah exactly. I try to explain that it's the only time for 'computer stuff', but that flys like a brick D:
bricker`LA has quit [Ping timeout: 246 seconds]
pu22l3r_ has quit [Remote host closed the connection]
nhhagen has joined #ruby
bricker`LA has joined #ruby
<ddd>
pretty much
mercwithamouth has quit [Ping timeout: 246 seconds]
seoaqua_ has quit [Ping timeout: 252 seconds]
seoaqua has joined #ruby
amclain has quit [Quit: Leaving]
tylersmith has quit [Remote host closed the connection]
<speakingcode>
is there a value that can be sent to an object via #send that will make the object return itself?
<speakingcode>
so like, x.send('field') returns x.field, can i pass something to x.send to get x back?
mansi has joined #ruby
juarlex has quit [Remote host closed the connection]
yasushi has quit [Ping timeout: 260 seconds]
nhhagen has quit [Ping timeout: 252 seconds]
gja has joined #ruby
heftig has quit [Quit: Quitting]
iamjarvo has quit [Ping timeout: 246 seconds]
<bricker`LA>
speakingcode: Object#tap
seoaqua has quit [Ping timeout: 260 seconds]
mansi has quit [Ping timeout: 245 seconds]
Spami has quit [Quit: This computer has gone to sleep]
Jake232 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aagdbl1 has joined #ruby
xpirator has quit [Ping timeout: 272 seconds]
<speakingcode>
bricker`LA: elaborate?
yacks has quit [Quit: Leaving]
apeiros_ has quit [Remote host closed the connection]
<ddd>
ah you'd have to do a @obj.tap {} to get @obj back. blank block
b00stfr3ak has quit [Ping timeout: 272 seconds]
apeiros has joined #ruby
sassamo has joined #ruby
dawkirst has quit [Ping timeout: 260 seconds]
<speakingcode>
no it must be something i can pass to .send()
<popl>
why?
monkegjinni has joined #ruby
<popl>
what are you trying to do?
<speakingcode>
well, i have a kind of special generalized 'sorting' method that will 'sort' items based on value of a field, the field being a parameter to the method, but i want to handle the case where the value of the object itself can be the value to 'sort' on (i'm not actually sorting but close enough in concept)
<bricker`LA>
speakingcode: x.tap { |x| x.send('field') } #=> x
alexfreidah has joined #ruby
aagdbl0 has quit [Ping timeout: 276 seconds]
<bricker`LA>
speakingcode: "it must be something I can pass to .send()" in that case you can override send()
himsin has joined #ruby
<speakingcode>
bricker`LA: but then that defeats the other cases
<speakingcode>
i can't override send
<speakingcode>
x can be any type, it's unknown
monkegjinni has quit [Remote host closed the connection]
<popl>
What are you trying to do?
<speakingcode>
i've explained what i'm trying to do
<popl>
No, not really.
wildroman2 has joined #ruby
<speakingcode>
i have a generic method that does an operation on a collection of items, based on the value of one of the fields of those items, the field itself being a parameter of the method
apeiros has quit [Ping timeout: 252 seconds]
<popl>
This is your idea for implementing a solution to your problem. What is your problem?
<speakingcode>
works fine, using item.send(field) (where again field is a local var/param to the method), except in the case of say strings or numbers
<speakingcode>
the problem - as i said - is generalizing a method that does a particular operation on a collection of items
<speakingcode>
tpo be specific it is for generating a directed graph where all nodes in the graph have in and out degree of 1 and no node is connected to another node in it's group, where its group is determined by the value of the parameterized field
alexfreidah has quit [Ping timeout: 245 seconds]
<popl>
Do you know about RGL?
<speakingcode>
in the case of simple objects like strings and numbers, tho, the grouping should be on the "value of the item itself" and not a subfield. all things in ruby being objects, i figured 'primitive' types have a special field that gives the 'literal' value... perhaps inspect or to_s ?/
sungai_keruh has quit [Quit: Leaving]
sassamo has quit [Ping timeout: 252 seconds]
<speakingcode>
i'm not asking for advice on design decisions
dukz has joined #ruby
<speakingcode>
the goal of the exercise isn't to find a library or package to include
<popl>
Is that a no or a yes?
<speakingcode>
it's a division by 0
<speakingcode>
the purpose here is for analysis and study of particular algorithms and making a generic method in this way allows me to analyze behavior on different sets of data interchangeably
monkegjinni has joined #ruby
dawkirst has joined #ruby
<speakingcode>
i'm not interested in using any abstraction because by very definition that defeats the goal of mechanical analysis
<popl>
So you haven't heard of RGL?
Aryasam has quit [Ping timeout: 276 seconds]
m4rcu5 has joined #ruby
<speakingcode>
yes, but again that's irrelevant
nhhagen has joined #ruby
nhhagen has quit [Remote host closed the connection]
<speakingcode>
olve an application of graphing
<speakingcode>
whoops. i'm not trying to solve an application of graphing*
<bricker`LA>
speakingcode: "but then that defeats the other cases" what?
<speakingcode>
bricker`LA: referring to using #tap
<speakingcode>
i don't _always_ want to return the object itself
<bricker`LA>
speakingcode: to answer the last question in the gist, every object respond to to_s
<bricker`LA>
responds*
<bricker`LA>
in most cases it's useless for grouping though (memory address)
sec^nd has quit [Remote host closed the connection]
rezzack has quit [Ping timeout: 272 seconds]
<bricker`LA>
In the case of strings, it would be okay, because string.to_s just returns itself
<bricker`LA>
Would be okay for integers too
subbyyy_ has joined #ruby
sec^nd has joined #ruby
nathancahill has joined #ruby
<speakingcode>
bricker`LA: right. so what i am asking is if there is some message that can go to send that will return the object itself for _any_ object, of any type
<bricker`LA>
speakingcode: no.
jprovazn has joined #ruby
sLi_ has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
MissionCritical has quit [Ping timeout: 252 seconds]
_tpavel has joined #ruby
DaZ has joined #ruby
Aryasam has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
dagobah has quit [Remote host closed the connection]
_tpavel has quit [Client Quit]
skaflem has joined #ruby
dagobah has joined #ruby
meatherly has joined #ruby
wildroman2 has quit [Remote host closed the connection]
camilasan has joined #ruby
wallerdev has quit [Quit: wallerdev]
gsvolt has quit [Ping timeout: 265 seconds]
Guest53099 has quit [Ping timeout: 272 seconds]
Mission-Critical has joined #ruby
wildroman2 has joined #ruby
John445 has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
wildroman2 has quit [Remote host closed the connection]
existensil has quit [Quit: leaving]
Hobogrammer has quit [Read error: Connection reset by peer]
Hobogrammer has joined #ruby
<bricker`LA>
lul
Mission-Critical is now known as MissionCritical
<agent_white>
I need moar meta in my whiskey to understand this
mansi has quit [Ping timeout: 260 seconds]
gsvolt has joined #ruby
<bricker`LA>
agent_white: he a) Wants a method to return itself, b) can't use tap, c) must use #send, d) can't override #send
mikepack has quit [Ping timeout: 272 seconds]
kobain has quit []
<popl>
e) doesn't want design decisions, f) has a silly design
<popl>
:P
<bricker`LA>
you know, simple!
cbetta is now known as cbetta_afk
<popl>
s/decisions/suggestions/
cbetta_afk is now known as cbetta
Sid05 has joined #ruby
tylersmith has joined #ruby
andikr has joined #ruby
sassamo has joined #ruby
<speakingcode>
it was a rather simple question, but it is the likeness of arrogance to complicate and circumvent a simple question in lack of a simple answer.
<speakingcode>
and your criteria for a is inaccurate. it's not a method to return itself, it was asking if there is a value that can be passed ot send that will cause the receiving object to return itself, in order to more generalize a method which is using send to achieve its task
<bricker`LA>
speakingcode: I told you the answer: Not without overriding send, which you say you can't do.
samsonasu has quit [Quit: samsonasu]
<bricker`LA>
speakingcode: #send takes certain arguments, the documentation is there, you can go look at it.
<speakingcode>
if someone asks a question about something and you don't understand their motivations or criteria, don't just assume they don't know wtf they are doing simply because you don't know wtf they are doing. heh
<bricker`LA>
speakingcode: Did you look at the documentation for Object#send?
Kneferilis has joined #ruby
<speakingcode>
bricker`LA: yes
Lewix has quit [Remote host closed the connection]
<bricker`LA>
Then why are you asking us if it takes an argument that will cause it to return the object?
tylersmith has quit [Ping timeout: 272 seconds]
sassamo has quit [Ping timeout: 245 seconds]
Macaveli has joined #ruby
<bricker`LA>
speakingcode: Do you not understand the documentation? Object#send takes a symbol or string (the name of the method to send), and a variable number of arguments to send to that method. That's it. You can't change that without overriding #send.
XenoWolf_ has quit [Read error: Operation timed out]
<speakingcode>
ok i could rephrase it as. do objects have a method which returns themself? i.e. an identity function. better?
<bricker`LA>
speakingcode: Yes. Object#tap .
senayar has joined #ruby
senayar has quit [Remote host closed the connection]
<agent_white>
speakingcode: It sounds more like you haven't really provided 'motivations or criteria', other than assuming graph-logic is too difficult for people in this room.
<speakingcode>
foo.send('tap') => no block given
<bricker`LA>
speakingcode: Did you look at the documentation for Object#tap ?
amundj has quit [Read error: Connection reset by peer]
zipper has quit [Client Quit]
<speakingcode>
yes, i see it takes a block but i cant infer how to pass the block when calling tap via send
amundj has joined #ruby
sergicles has joined #ruby
puppeh has joined #ruby
blackmesa has joined #ruby
<speakingcode>
ah, foo.send('tap') {} works
<puppeh>
what exactly is the "ruby heap"?
<bricker`LA>
speakingcode: you do it the same way tht you do it with #tap
<puppeh>
^^ so where is this heap implemented? at which level?
txdv has quit [Read error: Connection reset by peer]
jlast has quit [Ping timeout: 252 seconds]
<speakingcode>
depends on context puppeh
<bnagy>
there is no one single heap implementation
txdv has joined #ruby
<bnagy>
heap is just a catch-all term for 'dynamic memory that is not stack'
<puppeh>
hm I see..
freerobby has joined #ruby
agent_white has quit [Quit: gnight]
<speakingcode>
hm yeah actually i may have mispoke saying a heap is like the heap data structure, which is a true where every node is > it's children or whatever
ferr has quit [Quit: Lost terminal]
<speakingcode>
s/true/tree
<bnagy>
if you want broad brush concepts, stack is usually used for stuff like static variables ( say you call a method with '3' as an arg ) heap is used for bigger allocations, like a string or an image in memory or whatever
heftig has joined #ruby
snyp has joined #ruby
<speakingcode>
no i think static variables are usually in heap actually
<speakingcode>
stack is local variables
<bnagy>
yeah ok, I meant func args :)
<snyp>
Can I add a member variable anytime I want, like thru a member function, by prefixing @ to the var's name?
<speakingcode>
yes snyp
<snyp>
ah thanks
<puppeh>
so when we say 'heap' we 're talking about the region of the memory that a runtime/VM implements? for ex. ruby heap, the C heap, the Java heap etc.?
<bnagy>
doesn't have to be
<bnagy>
an app can just roll its own heap
<bnagy>
which used to ( sadly ) be quite common
<speakingcode>
so when you call a method, what is happening is a block of memory on the stack gets reserved and a pointer moves up to that blocks beginning, and on that block you have some data - local variables to that method, the memory address of the calling method's stack block (return pointer), and pointers to any data on the heap (like static vars and such) and pointers to program code (i think program code goes in heap too, can't recall)
<puppeh>
what confuses me is a concrete definition of the 'ruby heap' vs all the other possible 'heaps'
<bnagy>
stack grows 'down'
<puppeh>
like the 'OS heap'..I'm having a hard time understanding where exactly it's implemented
freerobby has quit [Ping timeout: 252 seconds]
<speakingcode>
puppeh: think of it like ruby is a virtual machine
<puppeh>
I know about static and dynamic allocations and the stack
<speakingcode>
and that virtual machine has it's own stack and heap
<puppeh>
aha
subbyyy_ has quit [Ping timeout: 260 seconds]
<speakingcode>
may not be entirely correct, but easy enough to think about it that way
<speakingcode>
at any rate, consider it logically 'isolated' from the 'system heap' that like, c programs, are using
guinslym has quit [Ping timeout: 252 seconds]
<bnagy>
uh
thenovices has joined #ruby
<bnagy>
no
<puppeh>
yeah, but this talks like it's something concrete, no? "Memory requests are satisfied by allocating portions from a large pool of memory called the heap"
kewubenduben has quit [Read error: Connection reset by peer]
<puppeh>
that's a confusing article..
brtdv has joined #ruby
kewubenduben has joined #ruby
<speakingcode>
ultimately it depends on implementation of the language compiler/interpreter, and implementation of the OS. details vary
<speakingcode>
bnagy: was that uh no @ my C comment?
<bnagy>
yeah.. a lot of the things you said tbh
Jetchisel has quit [Ping timeout: 256 seconds]
<bnagy>
but it's not really important
<speakingcode>
yeah, i mean, i'm fudging it up to make it conceptually digestible for him, but also b/c i don't know much about ruby implementation. kind of projecting JVM detials onto it ;-p
freakcult has quit [Remote host closed the connection]
freakcult has joined #ruby
<bnagy>
like, stack is much easier
<bnagy>
because of how closely it's related to the machine language
<bnagy>
whether that actually x64 etc or a VM
dfranciosi has joined #ruby
<bnagy>
well any vm / machine that has a stack pointer :<
thenovices has quit [Ping timeout: 246 seconds]
<speakingcode>
hmm not sure about that. i think dalvik VM is stackless, for instance
<speakingcode>
oh nm
<speakingcode>
misread your comment. saw "any has" not "any that has"
<puppeh>
aren't there also register-based VMs?
<bnagy>
well the stack pointer is just a register as well
Es0teric has quit [Quit: Computer has gone to sleep.]
<bnagy>
but you can have VMs with arbitrary numbers of registers
<bnagy>
in which case they can just use register addressing for anything you'd use a stack for on say x86
<speakingcode>
i would imagine the actual 'ruby heap' is pretty closely "mapped" to the 'system heap' esp considering ruby is implemented in c
John445 has quit [Quit: John445]
<bnagy>
makes it easier to reason about code on those vms
Es0teric has joined #ruby
<bnagy>
MRI is in C
<speakingcode>
yeah referring to MRI of course
renklaf_ is now known as falkn0r
<puppeh>
speakingcode: what is the "system heap"?
<bnagy>
but I think that the ruby C vm uses its own heap
<bnagy>
last I checked anyway :(
<bnagy>
there really isn't one
falkn0r is now known as renklaf
bluOxigen has joined #ruby
<bnagy>
unless you mean like kernel pool
<puppeh>
bnagy: yes it does
<speakingcode>
bnagy: but where does that live in the big scheme of memory from the OS point of view?
<bnagy>
userland processes can kind of do wtf they want
<bnagy>
the wonder of virtual addressing
<speakingcode>
nod
jonahR has quit [Quit: jonahR]
<bnagy>
puppeh: do you want to know for any actual reason?
<speakingcode>
so even something that appears as a contiguous block of memory to a java application, may not be? i dunno maybe it is. fuckit. you learn this stuff, then you realize you don't care anymore :-)
jonahR has joined #ruby
jonahR has quit [Client Quit]
<bnagy>
cause that makes it easier to answer :D
<bnagy>
well a contiguous block of _virtual_ memory could be, yeah, anywhere
holderbaum has joined #ruby
holderbaum has quit [Client Quit]
michael_mbp has quit [Excess Flood]
<bnagy>
also a contiguous heap block could be kind of anywhere :/
michael_mbp has joined #ruby
<bnagy>
cause of chunks blah blah
<bnagy>
depending on impl
mansi has joined #ruby
<bnagy>
BASICALLY IT'S HARD OK
<speakingcode>
WRITE ALL THE THINGS IN ASSEMBLY
<speakingcode>
lol
Xeago has joined #ruby
<Takumo>
write all the things in COBOL!
hiall_ has joined #ruby
yasushi has joined #ruby
<bnagy>
which assembly? :<
troessner has joined #ruby
<bnagy>
man arm is so amazing
apeiros has joined #ruby
<speakingcode>
x86 at&t-flavored asm
<bnagy>
and then you get to thumb, and the new instructions, and then intel gets involved
<bnagy>
and then.. shitty death
<bnagy>
x86 is just flat out awful
<speakingcode>
why arm amazing? risc?
<bnagy>
yeah and more logical registers and assignable pc and and and
Spami has quit [Quit: This computer has gone to sleep]
<speakingcode>
cool
snyp has quit [Quit: Leaving]
mansi has quit [Ping timeout: 252 seconds]
<bnagy>
also fwiw at&t syntax is crap
<bnagy>
only linux hippies use it :D
<popl>
:(
<bnagy>
shit be backwards
seoaqua_ has joined #ruby
<bnagy>
right I had better go troll elsewhere
<speakingcode>
i mean, i didn't say it with any kind of claim of intimate understanding or praise lol. just came to mind. i really only touched asm in school, and most of that was actually on a made-up architecture called 'ASM - A Simple Machine' with like 16 instructions
hiall_ has quit [Quit: hiall_]
kreantos has joined #ruby
alexfreidah has joined #ruby
relix has joined #ruby
Muslim has joined #ruby
<Muslim>
Selamun Aleikum
<Muslim>
Support the movement of having Muslim holidays recognized in the school year, throughout the United States of America. https://petitions.whitehouse.gov/ (Surely join this important survey) CLiK: Email this link to your friends and family: http://wh.gov/l8f51 Elhamdullillah
seoaqua_ has quit [Ping timeout: 265 seconds]
jhaals has joined #ruby
timonv has joined #ruby
seoaqua has joined #ruby
Muslim was kicked from #ruby by apeiros [political agendas are not welcome here]
Muslim has joined #ruby
<speakingcode>
gtfo. church n state bro.
sassamo has joined #ruby
Muslim was kicked from #ruby by apeiros [political agendas are not welcome here]
<speakingcode>
apeiros: sorry. that was meant as a jestful cheer for the kick
<apeiros>
np, just telling :)
kitak has quit [Remote host closed the connection]
<apeiros>
things sometimes escalate quickly
timonv has quit [Read error: Connection reset by peer]
timonv_ has joined #ruby
alexfreidah has quit [Ping timeout: 276 seconds]
wdiechmann has joined #ruby
seoaqua has quit [Ping timeout: 252 seconds]
sassamo has quit [Ping timeout: 248 seconds]
marr has joined #ruby
seoaqua has joined #ruby
Deejay_ has joined #ruby
roolo has joined #ruby
claymore has joined #ruby
dukz has quit [Remote host closed the connection]
seoaqua_ has joined #ruby
seoaqua_ has quit [Client Quit]
mehlah has joined #ruby
puppeh has quit [Quit: Leaving...]
seoaqua has quit [Ping timeout: 248 seconds]
Deejay_ has quit [Client Quit]
dawkirst has quit [Ping timeout: 248 seconds]
guinslym has joined #ruby
camilasan has quit [Remote host closed the connection]
klaut has quit [Remote host closed the connection]
gancl has joined #ruby
mklappstuhl has joined #ruby
seoaqua has joined #ruby
Aryasam has joined #ruby
mircoblitz has joined #ruby
bricker`LA has quit [Ping timeout: 246 seconds]
kate_r has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dukz has joined #ruby
holderbaum has joined #ruby
Deejay_ has joined #ruby
seoaqua_ has joined #ruby
weems has quit [Read error: Connection reset by peer]
nvrch has joined #ruby
<mircoblitz>
Hi, I am no programming noob, but a ruby noob and I need to finish some communication with the Jira6 REST-API. So far so good. But I don't get it managed to send a working POST to the API. Here are the parts on my code. Can someone please tell me what I am doing wron? http://pastebin.com/ygwmEYX5
seoaqua has quit [Ping timeout: 265 seconds]
camilasan has joined #ruby
meatherly has joined #ruby
ohwhoa has joined #ruby
<juo>
so i have questions about .. and ....
<juo>
* ...
<juo>
on a range
<juo>
are these methods in standard library?
<juo>
I can't find them in the documentation
<juo>
and was wondering if they're just aliases for upto
<juo>
because it seems odd that i can't do (9..5).to_a
<speakingcode>
yeah they are
<speakingcode>
... excludes the end value, .. includes it
camilasan has quit [Remote host closed the connection]
<speakingcode>
(they are in standard lib, i mean)
<juo>
so that means they're implemented in C ?
camilasan has joined #ruby
<speakingcode>
to_a works fine for me
<apeiros>
juo: ... and .. are not methods, mind you
<apeiros>
it's syntax
<juo>
(9..5).to_a work for you?
seoaqua_ has quit [Ping timeout: 272 seconds]
<tobiasvl>
>> (9..5).to_a
<juo>
1.9.3-p125 :001 > (9..5).to_a => []
* juo
tries in ruby-2.0.0-p353
<juo>
nope
<apeiros>
it will return an empty array there too
<juo>
still doesn't work
<apeiros>
yes, it does work. it just doesn't do what you want from it.
<speakingcode>
juo: that's empty because your range is
<Hanmac1>
use that: 9.downto(5).to_a #=> [9, 8, 7, 6, 5]
Hanmac1 is now known as Hanmac
Es0teric has quit [Quit: Computer has gone to sleep.]
<speakingcode>
juo: try (5..9).to_a
meatherly has quit [Ping timeout: 246 seconds]
<juo>
[5, 6, 7, 8, 9]
<juo>
as expected
<juo>
why can't a range go backwards?
<apeiros>
ranges with begin > end will always return an empty array with to_a
<apeiros>
because there's no way to get from begin to end using .succ
seoaqua_ has joined #ruby
<apeiros>
which is what Range uses to enumerate the discrete values in the range
<speakingcode>
what does .succ stand for?
<juo>
ah, ok
Jetchisel has joined #ruby
<apeiros>
succeeding, successor, whatever
<juo>
successive ?
yasushi has quit [Remote host closed the connection]
<speakingcode>
some of the abreviated method names in the std lib annoy me
<speakingcode>
one that isn't clear. may be normal but i've never seen it before
camilasan has quit [Ping timeout: 265 seconds]
* Hanmac
knows that Symbols can Succ too ,P
<apeiros>
tobiasvl: well, too bad that in ruby it's not a bijective function
<tobiasvl>
true ;)
<apeiros>
so none of those listed in the WP article apply :)
<tobiasvl>
hang on yes it is
<tobiasvl>
what
kate_r has joined #ruby
<apeiros>
no, it's not
<apeiros>
Integer#succ is
<apeiros>
String#succ is not
<tobiasvl>
ah. yeah
<apeiros>
and Whatever#succ might do whatever it pleases
ephemerian has joined #ruby
<tobiasvl>
yep
<tobiasvl>
gotcha
<Hanmac>
like Symbol#succ does whatever it pleases ;P
<apeiros>
I'm not a fan of String#succ not being bijective btw.
olivier_bK has joined #ruby
seoaqua_ has quit [Ping timeout: 260 seconds]
camilasan has joined #ruby
wdiechmann has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
jlast has quit [Ping timeout: 248 seconds]
freerobby has joined #ruby
<Hanmac>
the problem is that Integer#prev makes sense ... String#prev not so much
wdiechmann has joined #ruby
seoaqua_ has joined #ruby
shaunbaker has joined #ruby
<Hanmac>
apeiros: for sample "1.2.9".succ and "1.2.09".succ works a bit different ...
gregoriokusowski has joined #ruby
hiall_ has joined #ruby
mircoblitz has quit [Quit: mircoblitz]
<popl>
That's interesting.
<popl>
'.' is unaffected
freerobby has quit [Ping timeout: 252 seconds]
<popl>
Is that explicitly with versioning in mind?
nari has quit [Ping timeout: 276 seconds]
mircoblitz has joined #ruby
seoaqua_ has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
<Hanmac>
popl: yeah i think it has todo with version magic ;P
mojjojo has joined #ruby
<Hanmac>
popl: "-" "/" ":" and other non alpha numeric are ignored too
<popl>
interesting
habanany has quit [Ping timeout: 248 seconds]
w1xz has joined #ruby
postmodern has quit [Quit: Leaving]
<mircoblitz>
Hi, I am no programming noob, but a ruby noob and I need to finish some communication with the Jira6 REST-API. So far so good. But I don't get it managed to send a working POST to the API. Here are the parts on my code. Can someone please tell me what I am doing wron? http://pastebin.com/ygwmEYX5
<popl>
>> "***".succ
<popl>
Is eval-in broken or just ignoring me?
blaxter_ has joined #ruby
Es0teric has joined #ruby
echevemaster has quit [Remote host closed the connection]
Es0teric has quit [Max SendQ exceeded]
<Hanmac>
popl: your string returns "***".succ #> "**+" it seems it only works if it looks like a version number
<apeiros>
Hanmac: String#pred makes no sense in terms of current String#succ implementation
mansi has joined #ruby
<apeiros>
Hanmac: it's incorrect that there's no meaningful String#pred implementation.
timonv_ has quit [Ping timeout: 252 seconds]
<Hanmac>
yeah thats what i tryed to show with my samples
<apeiros>
popl: eval-in is moody in recent days
<popl>
Moody does not compute. What's wrong with it?
ferr has joined #ruby
<apeiros>
no idea, it's not my bot
<popl>
Whose bot is it?
<Hanmac>
its charliesome 's bot
dik_dak has quit [Quit: Leaving]
<popl>
I was about to ask if it belonged to one of the absentee founders. ;P
<popl>
but I reminded myself there's only one founder of #ruby
mikepack has quit [Ping timeout: 260 seconds]
<popl>
"
mansi has quit [Ping timeout: 252 seconds]
speakingcode has quit [Ping timeout: 276 seconds]
jibi has quit [Ping timeout: 264 seconds]
wildroman2 has joined #ruby
<joonty>
apeiros, Hanmac, popl: I have my own eval bot if you would like?
<apeiros>
only if it has provisions against channel spamming
<joonty>
apeiros: no, it's pretty basic atm
<apeiros>
then preferably not
<joonty>
but it's open sourced
jibi has joined #ruby
<joonty>
so you could grab the code and play with it
fella5s has joined #ruby
Zai00 has joined #ruby
<nvrch>
:(
<nvrch>
miss
<apeiros>
I don't really have the time to play with foreign projects
<charliesome>
is my broken again
<charliesome>
my bot*
<apeiros>
charliesome: yopp
<charliesome>
fuckckckck
<charliesome>
ok
<charliesome>
lets fix this for good
virt|away has quit [Read error: Connection reset by peer]
TMM has joined #ruby
<charliesome>
fuck using activerecord in a threaded program it ends in tears
cascalheira has joined #ruby
Hobogrammer has quit [Read error: Connection reset by peer]
<apeiros>
worker thread?
ArchBeOS-work has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
kenndel_ has joined #ruby
sassamo has joined #ruby
virt|away has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
ArchBeOS-work has joined #ruby
Hobogrammer has joined #ruby
Xeago has quit [Remote host closed the connection]
<apeiros>
def ar(&job); @ar_jobs << job); end
chomskiii has joined #ruby
mircoblitz has quit [Quit: mircoblitz]
<apeiros>
ar do SomeModel.whatever end
<charliesome>
apeiros: oh yes that could work
<charliesome>
i'll do that
Xeago has joined #ruby
<charliesome>
less effort
<apeiros>
well, if you need the return value it gets more complex, but I think I've built stuff like that
ahmedelgabri has quit [Remote host closed the connection]
mostlybadfly has quit [Ping timeout: 245 seconds]
<Hanmac>
charliesome: i have a feature request for the bot ... would it be possible to allow that i can send the bot private messages (so it does not answer into the channel?)
njs126 has quit [Read error: Operation timed out]
Xeago has quit [Read error: Connection reset by peer]
<apeiros>
charliesome: but I thought AR was thread safe? ping tenderlove about it?
mgorbach has quit [Ping timeout: 260 seconds]
robbyoconnor has quit [Read error: Operation timed out]
Xeago has joined #ruby
justsee has quit [Ping timeout: 246 seconds]
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
Xeago has quit [Remote host closed the connection]
<charliesome>
apeiros: maybe but I'd have to do some serious digging to make a useful bug report
wdiechmann has quit [Quit: wdiechmann]
robbyoconnor has joined #ruby
<charliesome>
i'll get around to it at some point
phansch has joined #ruby
kenndel has quit [Ping timeout: 245 seconds]
Xeago has joined #ruby
mostlybadsky has joined #ruby
wdiechmann has joined #ruby
rootshift has joined #ruby
njs126 has joined #ruby
<apeiros>
charliesome: good luck ;-)
wildroman2 has quit [Remote host closed the connection]
sassamo has quit [Ping timeout: 272 seconds]
mgorbach has joined #ruby
<popl>
put the source on github, charliesome :)
<charliesome>
popl: who's to say it isn;t?
<charliesome>
(it's private)
TejasDinkar has joined #ruby
<popl>
Sorry, I meant to imply that you should make it publicly available on github (my bad).
m00nlight has quit [Quit: Konversation terminated!]
Xeago has quit [Ping timeout: 245 seconds]
gja has quit [Ping timeout: 245 seconds]
maycon has quit [Ping timeout: 252 seconds]
AndChat| has joined #ruby
<charliesome>
i'm considering it
<charliesome>
it has a bunch of creds in it at the moment lol
eval-in has quit [Remote host closed the connection]
eval-in has joined #ruby
camilasan has quit [Remote host closed the connection]
Fractional has quit [Remote host closed the connection]
<apeiros>
Fractional: they don't. only in selectionsort you actually modify the array.
<Bekey>
apeiros, runs through a python library, but essentially only opens up files like .sh and .rb and listens for print messages
<mikecmpbll>
Bekey: {"Bekey"} is a syntax error
jonathanwallace has joined #ruby
<Bekey>
oh I need a key because it's a hash not an array.. mikecmpbll ?
<mikecmpbll>
yes.
<Bekey>
Thank you!
wdiechmann has quit [Quit: wdiechmann]
<mikecmpbll>
do you want a hash, or an array?
<apeiros>
Bekey: {"Bekey"} is not a valid hash
<Bekey>
more of an array really
<apeiros>
ah
Hanmac1 has joined #ruby
<apeiros>
mikecmpbll: already answered
<mikecmpbll>
then use ["Bekey"]
<apeiros>
-:
<mikecmpbll>
:)
wdiechmann has joined #ruby
marcgg_ has joined #ruby
<Bekey>
Thank you, another question.. Any idea how sevabot might pass arguments to my .rb files? Like "!command <arg>"
jonathanwallace has quit [Client Quit]
Hanmac has quit [Ping timeout: 245 seconds]
meatherly has joined #ruby
MrPopinjay has joined #ruby
DaZ has quit [Read error: Operation timed out]
<MrPopinjay>
Hi all. Can someone explain how the $1 after a regexp works please? Or tell me what they are called so I can google it? :)
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
MrPopinjay: it's a C function which pretends to be a global variable
<MrPopinjay>
Hi again apeiros
mojjojo has quit [Quit: mojjojo]
<MrPopinjay>
So effectly when we do a regexp we get a load of global variables that consist of the parts of the regex? And they are replaced each time a new one is run?
marcgg has quit [Ping timeout: 245 seconds]
<DouweM_>
yup
<mikecmpbll>
the capture groups.
<MrPopinjay>
Sounds fiddly. I'm not a huge fan of global variables
<mikecmpbll>
but like apeiros said, they're not global variables.
<apeiros>
mikecmpbll: not just. there's also $`, $', $& and $~
<MrPopinjay>
Oh?
<mikecmpbll>
they're defined per thread
<MrPopinjay>
Ah, that's nicer
<apeiros>
they're afaik even more local than thread
<mikecmpbll>
yeah i dunno too much about them tbh
<apeiros>
they've some kind of stackframe scoping too. I haven't bothered to figure the details.
<MrPopinjay>
Do they have a name?
Jetchisel has joined #ruby
<apeiros>
MrPopinjay: "globals"
<DouweM_>
yeah, the stackframe scoping is the worst
<MrPopinjay>
Thanks
<apeiros>
MrPopinjay: and `ri Regexp` probably >> google
chrisseaton has quit [Ping timeout: 272 seconds]
mengu has quit [Remote host closed the connection]
meatherly has quit [Ping timeout: 245 seconds]
Hanmac has joined #ruby
telling_ is now known as telling
telling has quit [Changing host]
telling has joined #ruby
synergy_ has quit [Remote host closed the connection]
ahmedelgabri has quit [Remote host closed the connection]
<popl>
thank you DouweM_
thenovices has joined #ruby
Hanmac has quit [Ping timeout: 272 seconds]
<popl>
Oh brother
<DouweM_>
popl: ;)
<apeiros>
mikecmpbll: um, yes, it's true
<apeiros>
TrueClass only has a single instance
<tobiasvl>
yeah it is true
<tobiasvl>
irb(main):003:0> TRUE.object_id
<tobiasvl>
=> 2
<tobiasvl>
irb(main):004:0> true.object_id
<tobiasvl>
=> 2
<mikecmpbll>
but true, and TRUE?
<apeiros>
that you can assign that instance to multiple variables doesn't change that
<mikecmpbll>
orly
<mikecmpbll>
yeah
<mikecmpbll>
good point.
<apeiros>
I assume TRUE existed before true
<apeiros>
since true is a special syntax construct, while TRUE is an ordinary constant
<popl>
DouweM_: This is my first time looking at the source code for MRI.
<LiohAu>
when executing this line : "bundle_id = %x[defaults read '#{ENV["APP_BUNDLE_PATH"]}/Info.plist' CFBundleIdentifier]" it seems that "bundle_id" contains a newline char, how can I tell %x to do not include the new line ?
<Hanmac1>
"TRUE was true before it was cool" ;P
<DouweM_>
popl: it means that if your original object is tainted, so will the resulting object be
Hanmac1 is now known as Hanmac
<DouweM_>
popl: rxr.whitequark.org will come in very handy
<apeiros>
LiohAu: you can't. but you can do string manipulation on the result.
<LiohAu>
apeiros: isn't there another way ?
<LiohAu>
like not using %x but using something else that would not return the new line ?
<mikecmpbll>
:\
nomenkun has joined #ruby
<apeiros>
LiohAu: why'd you want another way?
<apeiros>
what's wrong with processing the result you get?
<mikecmpbll>
yeah that's from the module which also adds a method to remove the word "cat" from any string.
<mikecmpbll>
heh..
<popl>
the cats theme is becoming a serious problem
<LiohAu>
because I don't like triming a string that comes from another binary
<apeiros>
LiohAu: well, too bad then.
<popl>
That sounds vaguely euphemistic.
<LiohAu>
the \n is not part of the result, it's the shell that is adding it (i guess ?)
<apeiros>
actually it is
<apeiros>
`` returns the stdout as is
gwb3 has quit [Quit: leaving]
<apeiros>
if it ends with a newline, it's part of the output
jtdowney has quit [Remote host closed the connection]
mikepack has quit [Ping timeout: 246 seconds]
krz has quit [Ping timeout: 246 seconds]
mansi has quit [Ping timeout: 272 seconds]
diegoviola has quit [Quit: WeeChat 0.4.2]
mklappst_ has joined #ruby
TejasDinkar has quit [Quit: This computer has gone to sleep]
mostlybadsky is now known as mostlybadfly
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
dblessing has joined #ruby
XenoWolf has joined #ruby
TejasDinkar has joined #ruby
arefaslani has joined #ruby
wildroman2 has joined #ruby
mklappstuhl has quit [Ping timeout: 252 seconds]
QKO has quit [Read error: Operation timed out]
jprovazn has quit [Read error: Operation timed out]
sassamo has joined #ruby
jprovazn has joined #ruby
jprovazn is now known as jprovazn_
QKO has joined #ruby
nari has joined #ruby
mikecmpbll has joined #ruby
diegoviola has joined #ruby
<shevy>
hmmm guys
<shevy>
in LPC, methods on objects will by default return 0 (should equal to false)
wald0 has quit [Ping timeout: 272 seconds]
<shevy>
I mean even when the method does not exist
Thanatermesis has quit [Ping timeout: 260 seconds]
MrPopinjay has quit [Quit: leaving]
<shevy>
in ruby, how to best simulate this behaviour? method_missing defaultung to return false? I dont really like that hmmmm
<shevy>
*defaulting
iamjarvo has joined #ruby
mircoblitz has joined #ruby
wald0 has joined #ruby
monkegjinni has quit []
sassamo has quit [Ping timeout: 272 seconds]
<mircoblitz>
Hi, I have an array full of strings and i want to join it to one String with an EOL (End of line) after each Line. How can I do this in ruby. I found that @arr.join("\n") does not work.
dkamioka has quit [Remote host closed the connection]
fedez77 has joined #ruby
phansch has joined #ruby
Aryasam has joined #ruby
g0bl1n has joined #ruby
<ArchBeOS-work>
How do I post data to an existing sinatra route within another sinatra route? i dont want to re-write the route since the code in it works perfectly, and the calling route is just a "batch" version of the call
Liothen has joined #ruby
sassamo has joined #ruby
ahmedelg_ has joined #ruby
dkamioka has joined #ruby
phutchins has quit [Quit: Lost terminal]
habanany has quit [Ping timeout: 245 seconds]
huttan- has joined #ruby
ahmedelgabri has quit [Ping timeout: 245 seconds]
funburn has quit [Quit: funburn]
<maasha>
puppeh hurray for password reuse
dkamioka has quit [Remote host closed the connection]
<shevy>
maasha haha
<shevy>
as if anyone would really care ;P
sassamo has quit [Ping timeout: 276 seconds]
yasushi has joined #ruby
jovon has joined #ruby
mircoblitz has joined #ruby
mircoblitz has quit [Client Quit]
pranny has quit [Quit: Leaving.]
Lewix has joined #ruby
<maasha>
shevy: at least you can get a really cool nickname ...
<shevy>
when I have a choice between method_missing() returning false and nil (either of one)
psst is now known as Guest7655
Guest7655 has quit [Killed (asimov.freenode.net (Nickname regained by services))]
<shevy>
what would be better? I could default to nil, or to false, but perhaps false conflicts with other methods already defined, or perhaps nil conflicts with other methods already defined
marcofernandez has joined #ruby
thejoecarroll has joined #ruby
Guest7655 has joined #ruby
<shevy>
I suppose true and false both contain more information than nil from a design point of view
<shevy>
as true and false would be a togglable switch state (on / off), nil however would be more like off but not even similar to off
MrZYX|off is now known as MrZYX
sailias has quit [Ping timeout: 252 seconds]
<Hanmac>
maasha: why using mkfifo and not IO::pipe ?
huttan-_ has joined #ruby
brtdv has quit []
<apeiros>
14:16 shevy: I suppose true and false both contain more information than nil from a design point of view
puppeh has joined #ruby
<apeiros>
interesting statement
huttan- has quit [Ping timeout: 260 seconds]
puppeh has left #ruby ["Leaving..."]
<maasha>
Hanmac: I read somewhere that anonymous pipes (i.e. IO::pipe) is for communication between parent and child processes only.
camilasa_ has quit [Remote host closed the connection]
<apeiros>
never really considered it, but I think intuitively I'd have categorized nil as a scalar too. curious whether that holds.
huttan-_ has quit [Read error: Connection reset by peer]
marcofernandez has quit [Quit: 전 이만 갑니다.]
<maasha>
Hanmac: and I have no idea is IO::pipe will work with Parallel.
<maasha>
s/is/if
<Hanmac>
maasha: its used like that in the sample ... but i think it works without child processsess too ... (hm you could split your Pipe class into many little child processes but i dont its what you want)
dachi_ has left #ruby [#ruby]
dachi_ has joined #ruby
<shevy>
apeiros yeah I did not think about it so far yet, but I want to simulate LPC, and I am not sure how to do it. mikecmpbll gave me one way, the other way is with method_missing defaulting to false. But my MUD-objects already have some methods ... some can return true, some false, if they return false, the method_missing false would possibly mask that... perhaps I could let method_missing return nil instead hmm
ringaroses has quit [Quit: Leaving]
<shevy>
I think I am going back to pencil and paper and draw a structure
senayar has quit [Remote host closed the connection]
Speed has joined #ruby
ahmedelg_ has quit [Remote host closed the connection]
<maasha>
Hanmac: anyways, I suspect there is a design flaw causing the hang because the pipe is not being cleared - and I suspect that would be the same with mkfifo or IO::Pipe (if the latter works in this case)
<maasha>
Hanmac: but sometimes it works - so that is a start.
<maasha>
_must_ _be_ _positive_
kreantos has quit [Ping timeout: 272 seconds]
vlad_starkov has quit [Read error: Connection reset by peer]
kreantos has joined #ruby
Virtualize has joined #ruby
ringaroses has joined #ruby
Virtualize has quit [Client Quit]
mark_locklear has joined #ruby
ahmedelgabri has joined #ruby
sLi_ has joined #ruby
jlast has joined #ruby
zegerjan has quit [Quit: WeeChat 0.4.2]
Xeago has quit [Remote host closed the connection]
Xeago has joined #ruby
freerobby has joined #ruby
askz has joined #ruby
Xeago_ has joined #ruby
RaCx has joined #ruby
julweber has quit [Remote host closed the connection]
cbetta_afk is now known as cbetta
Fractional has joined #ruby
kpshek has joined #ruby
sLi_ has quit [Ping timeout: 245 seconds]
krawchyk has joined #ruby
lioninawhat has joined #ruby
sassamo has joined #ruby
senayar has joined #ruby
jlast has quit [Ping timeout: 272 seconds]
breakingthings has joined #ruby
clamstar has joined #ruby
skattyadz has joined #ruby
freerobby has quit [Ping timeout: 252 seconds]
Xeago has quit [Ping timeout: 252 seconds]
dennis__ has joined #ruby
kaldrenon has joined #ruby
Gonzih has joined #ruby
deavidsedice has quit [Ping timeout: 252 seconds]
coder_neo has joined #ruby
lioninawhat has quit [Remote host closed the connection]
mary5030 has joined #ruby
thenovices has joined #ruby
pu22l3r_ has joined #ruby
Xeago_ has quit [Remote host closed the connection]
duggiefresh has joined #ruby
<maasha>
Hanmac: IO.pipe works nicely
Xeago has joined #ruby
pu22l3r_ has quit [Read error: Connection reset by peer]
pu22l3r_ has joined #ruby
Lorn_ has joined #ruby
mary5030 has quit [Remote host closed the connection]
<Hanmac>
maasha: did you already updated the gist with IO.pipe?
<Hanmac>
Quote: "Portal uses logic to solve puzzles. This game throws logic out of the window and asks you to solve the puzzles. - Oh also, the window is now a wall."
<shevy>
can a module add instance variables to a class?
maycon has quit [Ping timeout: 246 seconds]
<shevy>
when it is mixed in
<cout>
sure
pranny has joined #ruby
Es0teric has joined #ruby
<Hanmac>
in ruby everything can do everything ... and also can be everything ;D
araujo has joined #ruby
araujo has quit [Read error: Connection reset by peer]
Es0teric has quit [Max SendQ exceeded]
Lewix has quit [Ping timeout: 245 seconds]
enebo has joined #ruby
Fractional has quit [Remote host closed the connection]
<Hanmac>
shevy the module can have an initialize method too ... but then the class initialize method does need to call super
<shevy>
lemme try the self.included one, that would seem the most elegant
<workmad3>
shevy: that would obviously set instance variables on the class you included it in though
<workmad3>
shevy: not set them on all created instances (which would require an initialize method)
lioninawhat has joined #ruby
lioninawhat has quit [Remote host closed the connection]
dblessing has quit [Quit: dblessing]
lioninawhat has joined #ruby
freerobby has joined #ruby
dkamioka has quit [Ping timeout: 272 seconds]
coder_neo has quit [Quit: This computer has gone to sleep]
jlast has joined #ruby
Gonzih has joined #ruby
lioninawhat has quit [Remote host closed the connection]
shaunbaker has joined #ruby
RaCx has quit [Ping timeout: 252 seconds]
RaCx has joined #ruby
marr has quit [Ping timeout: 252 seconds]
razibog has joined #ruby
MarcWeber has joined #ruby
freerobby has quit [Ping timeout: 276 seconds]
pranny has joined #ruby
<MarcWeber>
which module is providing 4.days so that I can subtsract from now easily?
<workmad3>
MarcWeber: that's part of activesupport
<shevy>
I think this is in Activ... ah :)
<workmad3>
MarcWeber: it also has 4.days.ago
bluenemo has quit [Remote host closed the connection]
<workmad3>
MarcWeber: rather than having to do Time.now - 4.days
freerobby has joined #ruby
<MarcWeber>
Time.now - 4.days would be just good enough..
burlyscudd has quit [Quit: Leaving.]
fantazo has joined #ruby
Gonzih has quit [Ping timeout: 245 seconds]
t0m0_ has joined #ruby
shime has quit [Ping timeout: 272 seconds]
<t0m0_>
Hey guys
<t0m0_>
does anyone here use vim as an IDE?
wildroman2 has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<MarcWeber>
t0m0_: Just put your specific question.
<MarcWeber>
Eventually join #vim ..
arefaslani has quit [Ping timeout: 245 seconds]
<t0m0_>
I'm aleady on #vim
yasushi has quit [Remote host closed the connection]
<t0m0_>
no one is on that could help :(
wildroman2 has joined #ruby
chrisseaton has joined #ruby
pixelgremlins has quit [Read error: Connection reset by peer]
<t0m0_>
I'm having issues with the neocomplete plugin and it loading the 'rails' candidates via rubyComplete
RaCx has quit [Quit: Computer has gone to sleep.]
<MarcWeber>
neocomplete also has github page (if you think its a bug) - otherwise try the mailinglist of Vim - its very helpful often - but may require to wait up to 2 days.
g3orge has joined #ruby
timonv_ has quit [Remote host closed the connection]
peregrin_ has joined #ruby
<t0m0_>
I don't think it's a bug
Rennex_ is now known as Rennex
sailias has joined #ruby
mansi has joined #ruby
arefaslani has joined #ruby
Megtastique has quit []
<Hanmac>
t0m0_: it could be a rails bug ;P
jlast has quit [Remote host closed the connection]
pixelgremlins has joined #ruby
<t0m0_>
:P nah definitely me being a nub
<t0m0_>
It's picking up the ruby stuff
<t0m0_>
and I can get rails candidates by Ctrl X Ctrl O
wald0_ has joined #ruby
<t0m0_>
but the fuzzy autocomplete never loads them automatically
<t0m0_>
I can link to my vimrc if anyone has the time to help me out.
wald0_ has quit [Client Quit]
skattyadz has quit [Read error: Connection reset by peer]
skattyadz has joined #ruby
yacks has joined #ruby
duggiefresh has joined #ruby
_maes_ has joined #ruby
lioninawhat has joined #ruby
yacks has quit [Read error: Connection reset by peer]
yacks has joined #ruby
meatherly has joined #ruby
shaunbaker has quit [Remote host closed the connection]
Bira has quit [Remote host closed the connection]
Bira has joined #ruby
pixelgremlins_ba has joined #ruby
burlyscudd has joined #ruby
DouweM has joined #ruby
burlyscudd has quit [Changing host]
burlyscudd has joined #ruby
nifty has joined #ruby
momomomomo has joined #ruby
MattStratton has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
pixelgremlins has quit [Ping timeout: 246 seconds]
nicklink483 has joined #ruby
nicklink483 is now known as godd2
<shevy>
eeeks vim
<godd2>
Eeeek: The Cat
lioninawhat has quit [Ping timeout: 245 seconds]
mlpinit_ has joined #ruby
gja has joined #ruby
<Hanmac>
using rails in vim ... yet another way to make the own life more painful ;P
ahmedelgabri has joined #ruby
<workmad3>
Hanmac: nothing wrong with rails + vim :P
gja has quit [Quit: This computer has gone to sleep]
kiri has quit [Ping timeout: 245 seconds]
jeskola has quit [Quit: Leaving]
LjL-Alps has quit [Disconnected by services]
phansch has joined #ruby
jacobat_ is now known as jacobat
<Takumo>
that did it MrZYX , should've remembered to pass a block for that
<wonderworld>
hi, i am new to ruby. i want to include HTML from an external file. it works, but ruby escapes the HTML so it doesn't show up correct in the browser. this is what i did: <div id="custom-header"><%= IO.read("/tmp/page.htm") %></div> . results in: <div id="custom-header"><h1>ok</H1></div> how would i disable the escaping of the file? tnx.
mojjojo has joined #ruby
zipper has joined #ruby
zipper is now known as urbanslug
<MrZYX>
<%!= %>
<MrZYX>
(I assume s/ruby/rails/)
kiri has joined #ruby
subbyyy_ has quit [Ping timeout: 248 seconds]
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
ss_ has quit [Ping timeout: 272 seconds]
<wonderworld>
MrZYX: yes, its Ruby on Rails
kreantos has quit [Ping timeout: 272 seconds]
<MrZYX>
in the future check #rubyonrail
<MrZYX>
s
<wonderworld>
ok
vlad_starkov has quit [Remote host closed the connection]
<Takumo>
MrZYX: Let's see how my test coverage goes now, should be 100% now
arefasla_ has joined #ruby
shime has joined #ruby
mlpinit_ has quit [Remote host closed the connection]
arefaslani has quit [Ping timeout: 246 seconds]
camilasan has quit [Remote host closed the connection]
camilasa_ has joined #ruby
kobain has joined #ruby
kpshek has joined #ruby
mlpinit has joined #ruby
wildroman2 has quit [Remote host closed the connection]
kreantos has joined #ruby
browndawg has quit [Quit: Leaving.]
arefaslani has joined #ruby
nari has quit [Read error: Operation timed out]
jedimind has joined #ruby
jonathanwallace has quit [Quit: ZNC - http://znc.in]
arefasl__ has joined #ruby
burlyscudd has quit [Quit: Leaving.]
mklappst_ has quit [Remote host closed the connection]
arefasla_ has quit [Ping timeout: 246 seconds]
gja has joined #ruby
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nwertman has joined #ruby
ahmedelgabri has quit []
OdNairy has joined #ruby
arefaslani has quit [Ping timeout: 260 seconds]
mlpinit_ has joined #ruby
momomomomo has quit [Ping timeout: 245 seconds]
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
chrisseaton has quit []
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
coder_neo has quit [Ping timeout: 252 seconds]
ahmedelgabri has joined #ruby
Macaveli has quit [Ping timeout: 260 seconds]
wildroman2 has joined #ruby
momomomomo has joined #ruby
kiri has quit [Read error: Connection timed out]
kpshek has quit []
mlpinit has quit [Ping timeout: 246 seconds]
kiri has joined #ruby
<shevy>
100% tests
<shevy>
PERFECTIon
<shevy>
NO BUGS
shaunbak_ has joined #ruby
huttan- has joined #ruby
interactionjaxsn has joined #ruby
<Takumo>
99.13% so far, but the untested method isn't used and probably won't be.
<momomomomo>
>:o won't 100% coverage eat your brains/
CogitoErgoSum has quit [Ping timeout: 276 seconds]
CogitoErgoSum has joined #ruby
julweber has joined #ruby
godd2 has quit [Ping timeout: 272 seconds]
<shevy>
yes
<shevy>
better aim for 99,99% coverage only
julweber has quit [Remote host closed the connection]
<momomomomo>
or better yet, be pragmatic about it
<momomomomo>
and don't aim for 100% coverage
julweber has joined #ruby
Pixels_ has joined #ruby
devdazed has quit [Ping timeout: 265 seconds]
<shevy>
can I go for 0.1% coverage?
Hobogrammer has quit [Ping timeout: 272 seconds]
huttan- has quit [Ping timeout: 272 seconds]
tobago has joined #ruby
Pixels has quit [Ping timeout: 246 seconds]
<zxd>
Hanmac: if I remove rvm user_installs hash from this file it dosen't crash with can't convert string into integer, but as you can see it is hash is it not? http://pastebin.com/3Pg469uL it's json format
devdazed has joined #ruby
tobago has quit [Remote host closed the connection]
<zxd>
it isn't array is it?
<apeiros>
zxd: that paste is not json
<Hanmac>
json strings should be parsed with json
<apeiros>
not valid one at least
deavid has quit [Ping timeout: 252 seconds]
mklappstuhl has joined #ruby
tylersmith has joined #ruby
<zxd>
the editor removed the quotes maybe that's what's missing
<apeiros>
odd editor…
vlad_starkov has joined #ruby
burlyscudd has joined #ruby
<shevy>
that's what you get when you use emacs
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
duggiefresh has quit [Read error: Connection reset by peer]
SCommette has joined #ruby
arefasl__ has quit [Remote host closed the connection]
<Takumo>
shevy: I use emacs, its wonderful :)
<zxd>
it's a weird json higlight syntax in vim the double quotes can only be seen when I hover my cursor over the line
duggiefresh has joined #ruby
<Takumo>
switched to it from Vi
<zxd>
very annoying in fact going to remove that now
<DouweM>
even then, shouldn't copying include the quotes :/
himsin has quit [Quit: himsin]
MatthewsFace has joined #ruby
renklaf has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
gja has quit [Quit: This computer has gone to sleep]
Cephalostrum has joined #ruby
<zxd>
the terminal dosen't see it I copied with the Mice
samsonasu has joined #ruby
<shevy>
how many mice do you have
rippa has joined #ruby
* apeiros
off for commute
<shevy>
I keep a few in reserve myself :-)
shime has quit [Ping timeout: 248 seconds]
* Hanmac
has somewhere reserve mice too ... and a mace also somewhere ;D
<zxd>
* *This requires Vim 7.3+.* To disable it add `let g:vim_json_syntax_conceal = 0` to your `.vimrc`.
shaunbak_ has quit [Remote host closed the connection]
browndawg has joined #ruby
<soahccc>
shevy: I recently repaired why scroll wheal but you can't imagine how much crap is in there... 2 times worse than my keyboard and I crumble a lot :D
<soahccc>
s/why/my
chrisseaton has joined #ruby
<shevy>
hehe
<shevy>
my mother has a non-functioning scroll wheel, whenever I have to fix her win-7 computer, it drives me crazy
mercwithamouth has quit [Ping timeout: 265 seconds]
<soahccc>
shevy: scroll wheel on windows is always broken without KatMouse if you ask me :)
RaCx has joined #ruby
jprovazn is now known as jprovazn_afk
deavid has joined #ruby
IceDragon has joined #ruby
mojjojo has quit [Quit: mojjojo]
ss_ has quit [Ping timeout: 272 seconds]
troyready has joined #ruby
heftig has quit [Ping timeout: 272 seconds]
e62 has quit [Ping timeout: 264 seconds]
nari has joined #ruby
mojjojo has joined #ruby
rickruby has quit [Remote host closed the connection]
guinslym has joined #ruby
rayners has joined #ruby
rudisimo has joined #ruby
gja has joined #ruby
samsonasu has quit [Quit: samsonasu]
shaunbaker has quit [Remote host closed the connection]
<sweeper>
shevy: christmas present opportunity :v
pranny has quit [Quit: Leaving.]
umje has quit []
wald0 has joined #ruby
spyderman4g63 has quit []
maasha has quit [Ping timeout: 272 seconds]
mark_locklear has quit [Ping timeout: 246 seconds]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
kreantos has quit [Ping timeout: 252 seconds]
samsonasu has joined #ruby
Cephalostrum has joined #ruby
kevind has joined #ruby
iamjarvo has quit [Quit: leaving]
mercwithamouth has joined #ruby
iamjarvo has joined #ruby
senayar has quit [Remote host closed the connection]
wald0 has quit [Client Quit]
senayar has joined #ruby
kreantos has joined #ruby
shaunbaker has joined #ruby
teddyp1cker has joined #ruby
teddyp1cker has quit [Client Quit]
razibog has quit [Quit: Leaving.]
baroquebobcat has quit [Quit: baroquebobcat]
sambao21 has quit [Quit: Computer has gone to sleep.]
Jdubs has quit [Remote host closed the connection]
dangerousdave has joined #ruby
dkamioka has joined #ruby
nari has quit [Ping timeout: 245 seconds]
godd2 has joined #ruby
mikepack has joined #ruby
Fraeon has quit [Remote host closed the connection]
RaCx has quit [Quit: Computer has gone to sleep.]
_bart has joined #ruby
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
mhenrixon has joined #ruby
nwertman has quit [Remote host closed the connection]
julweber has quit [Remote host closed the connection]
<canton7-mac>
Fractional, work through it with a pen and paper. it'll become obvious
claymore has quit [Ping timeout: 272 seconds]
<Fractional>
canton7, isn't nr the same as array[i]?
e62 has joined #ruby
<canton7-mac>
Fractional, it's the line 4 difference which is causing the problem methinks
burlyscudd has joined #ruby
atmosx has joined #ruby
sputnik13 has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
Neomex has joined #ruby
<Fractional>
canton7-mac: If I change it all the numbers in the array is set to 1
ahmedelgabri has quit [Remote host closed the connection]
sputnik13 has joined #ruby
nathancahill has quit [Quit: nathancahill]
brtdv has quit [Ping timeout: 276 seconds]
jlebrech has joined #ruby
FScottFitzgerald has left #ruby [#ruby]
deens has quit []
guinslym has quit [Ping timeout: 272 seconds]
claymore has joined #ruby
Neomex has quit [Client Quit]
ctp has quit [Quit: Leaving...]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
shaunbaker has quit [Read error: Connection reset by peer]
<mikecmpbll>
shevy: there's other ways, dunno about better.
<DouweM_>
depends on what you want to do. if you want to check whether the ivar's defined, that's the way to do it. better depends on what you wanna do
phansch has joined #ruby
camilasa_ has quit []
<mikecmpbll>
instance_variables.include?(:some_ivar_here) for example.
rmorello has joined #ruby
<shevy>
hmm
<mikecmpbll>
:@some_ivar_here*
brisbin has joined #ruby
shaunbaker has joined #ruby
urbanslug has quit [Quit: Lost terminal]
bricker`LA has joined #ruby
albertgrala has quit [Quit: Leaving]
nwertman has quit [Remote host closed the connection]
<apeiros>
doesn't need to generate an array and then search it
alexfreidah has quit [Ping timeout: 272 seconds]
Zai00 has quit [Quit: Zai00]
mjc_ has quit [Client Quit]
<mikecmpbll>
apeiros: oh yeah, forgot about that one
mjc_ has joined #ruby
<mikecmpbll>
i'd use that, shevy.
e62 has joined #ruby
<shevy>
so many ways
maletor has quit [Client Quit]
<mikecmpbll>
instance_variable_set too if you needed that
shaunbaker has quit [Remote host closed the connection]
nomenkun has quit [Ping timeout: 246 seconds]
shaunbaker has joined #ruby
roolo has quit [Remote host closed the connection]
danijoo has quit [Read error: Connection reset by peer]
bricker`1A has joined #ruby
tvw has quit []
tvw has joined #ruby
ephemerian has left #ruby [#ruby]
<apeiros>
shevy: IMO having to test for ivar presence (not in debugging) is an anti-pattern (there are legitimate situations, but those are quite rare)
danijoo has joined #ruby
g0bl1n has quit [Ping timeout: 245 seconds]
<apeiros>
it usually indicates that you're either not properly initializing your object, or that you abuse the ivar system as a Hash
<Hanmac>
shevy & apeiros: you can also do this: o.instance_exec { defined?(@a) } ;D
LekeFly has joined #ruby
<apeiros>
Hanmac: yeah, he had plain defined? before
bricker`LA has quit [Ping timeout: 248 seconds]
mengu has joined #ruby
blueOxigen has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
kreantos has quit [Ping timeout: 272 seconds]
timonv has quit [Remote host closed the connection]
jhaals has joined #ruby
<shevy>
apeiros what if I want to be flexible, where input can be (a) missing (b) a string (c) a hash, and depending on this type of input I wish to automatically deduce a change in certain of these @ivars?
rubyracer has joined #ruby
<apeiros>
shevy: that usually doesn't change *which* ivars are set
senayar has quit [Remote host closed the connection]
jrist_ has joined #ruby
dangerousdave has joined #ruby
kreantos has joined #ruby
FScottFitzgerald has quit []
LekeFly has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ckrailo_ is now known as ckrailo
maletor has joined #ruby
huttan- has joined #ruby
maycon has quit [Ping timeout: 272 seconds]
Zess has quit [Quit: Leaving]
julweber has quit [Remote host closed the connection]
frog0909 has joined #ruby
tvw has quit []
havenwood has joined #ruby
burlyscudd has joined #ruby
tvw has joined #ruby
allaire has joined #ruby
einarj has quit [Remote host closed the connection]
tvw has quit [Read error: Connection reset by peer]
g0bl1n has joined #ruby
tvw has joined #ruby
RaCx has quit [Quit: Computer has gone to sleep.]
rootshift has quit [Quit: My MacBook has decided to go to sleep. Zzzz..]
heftig has joined #ruby
spyderman4g63 has joined #ruby
huttan- has quit [Ping timeout: 272 seconds]
sambao21 has joined #ruby
mansi has quit [Remote host closed the connection]
glaksmono has joined #ruby
jhaals has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mansi has joined #ruby
senayar has joined #ruby
Fractional has quit [Quit: Leaving]
_aeris_ is now known as [_aeris_]
canton7-mac has quit [Quit: Leaving]
<soahccc>
oha now they're pushing :) , Support for Ruby version 1.9.3 will end on February 23, 2015.
joshu has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
lioninawhat has quit [Remote host closed the connection]
Xeago_ has quit [Read error: Connection reset by peer]
<soahccc>
DouweM_: Interesting... I do "yield presenter if block_given?" and that block gets the proxy. presenter.tap{|rec| rec.is_not_the_proxy }
Xeago has joined #ruby
RaCx has joined #ruby
<DouweM_>
tap could've been overridden or delegated to what the presenter is presenting
<soahccc>
ahh okay got it. it uses self which doesn't hit the proxy but the record
Xeago_ has joined #ruby
Jdubs has quit [Ping timeout: 245 seconds]
<DouweM_>
not quite
Czupa has quit [Remote host closed the connection]
<DouweM_>
presenter#tap calls record#tap, so self ends up being the record
Xeago__ has joined #ruby
Xeago has quit [Read error: Connection reset by peer]
mocfive has joined #ruby
mhenrixon has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
heidi has joined #ruby
melfy has quit [Quit: Whoops!]
melfy has joined #ruby
zxd has quit [Ping timeout: 248 seconds]
njs126 has joined #ruby
Deejay_ has quit [Quit: Computer has gone to sleep.]
Hobogrammer has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
SCommette has quit [Quit: SCommette]
Xeago_ has quit [Ping timeout: 276 seconds]
moppersmurf has joined #ruby
moppersmurf has quit [Max SendQ exceeded]
enebo has joined #ruby
moppersmurf has joined #ruby
moppersmurf has quit [Max SendQ exceeded]
mansi_ has quit [Read error: Connection reset by peer]
mansi has joined #ruby
moppersmurf has joined #ruby
moppersmurf has quit [Max SendQ exceeded]
moppersmurf has joined #ruby
moppersmurf has quit [Max SendQ exceeded]
mneorr has quit [Remote host closed the connection]
mansi_ has joined #ruby
e62 has quit [Ping timeout: 272 seconds]
mansi has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
moppersmurf has joined #ruby
coderhs has quit [Read error: Connection timed out]
RaCx has quit [Quit: Computer has gone to sleep.]
clamstar has quit [Quit: Computer has gone to sleep.]
vky has joined #ruby
f0ster has joined #ruby
fire has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
w4pm has joined #ruby
<f0ster>
hello.. i am trying to use bundler with a small piece of ruby code (one small script), but i can't see to get it to work, I assume this should be possible with bundler? https://gist.github.com/f0ster/8460940
Macaveli has joined #ruby
ephemerian has joined #ruby
g0bl1n has quit [Ping timeout: 245 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
<canton7>
f0ster, done a bundle install?
mneorr has quit [Ping timeout: 245 seconds]
thenovices has joined #ruby
godd2 has joined #ruby
chrisseaton has quit []
QKO has quit [Ping timeout: 272 seconds]
<canton7>
and you shouldn't need to bundle exec unless you're on your deployment machine
<f0ster>
i already read this, i'm just trying to be overly explicit since it's not working
blaxter has quit [Quit: foo]
samsonasu_ has quit [Quit: samsonasu_]
apeiros has quit [Remote host closed the connection]
<soahccc>
f0ster: Not sure but the only difference I see between mine and yours is that I do Bundle.require(:default)
<f0ster>
okay
apeiros has joined #ruby
<soahccc>
Bundler.require(:default, :development) to be precise
<soahccc>
default takes all gems not in a group I think
<f0ster>
I also tried explicitly doing , require 'guard-haml'
darthdeus has joined #ruby
mneorr has joined #ruby
<iugin>
Hi guys! sorry for the disturb.. I have built a webapp for videocall using voip... I need someone to perform a test of communication using chrome and firefox! Please I do not know how to do! If someone is interested please contact me in pvt! sorry for the disturb!
clamstar has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
thenovices has quit [Ping timeout: 248 seconds]
<f0ster>
soahccc: that helped.. looks like i am not using guard properly somehow, watch_haml.rb:9:in `<main>': undefined method `guard' for main:Object (NoMethodError)
hiall_ has quit [Ping timeout: 245 seconds]
<RubyPanther>
iugin: you need to find or build a loopback for your voip solution so you can test.
jtdowney has quit []
rh1n0 has joined #ruby
brianpWins has joined #ruby
<f0ster>
lol, because i don't have 'guard'
* f0ster
facepalms
<RubyPanther>
Then you can even automate tests, and let the computer handle all of the "can I hear myself now?" stuff
<iugin>
ahahah yes, but the problem is that I have never tested it trough internet
<iugin>
always from my Pc in my room and the other pc in the kitchen :) anyway no problem :)
<RubyPanther>
You don't need to test things through the internet, you only need to test them through TCP/UDP/whatever
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
kotk has quit [Ping timeout: 272 seconds]
DouweM_ has quit [Read error: Connection reset by peer]
<RubyPanther>
automation is what you're lacking
Cephalostrum has joined #ruby
<RubyPanther>
As long as there are kittens in the tubes, the internet will be forced forwards
<iugin>
uhmm and for the speed?
jprovazn has quit [Quit: Odcházím]
<iugin>
I can install a squid proxy for decrease the connection speed..
<RubyPanther>
You can throttle the speed you get in an automated tool
<iugin>
ah ok
<RubyPanther>
Even if you're looking at it by hand to test the video quality you need to throttle the speed so you can find out the minimum "acceptable" bandwidth
coderhs has joined #ruby
<RubyPanther>
You save time by investing in automation, it isn't a luxury
thenovices has joined #ruby
RaCx has joined #ruby
kirun has joined #ruby
mojjojo has joined #ruby
tyl has joined #ruby
alexfreidah has joined #ruby
CodeBunny has quit [Quit: CodeBunny needs a carrot. Be back later.]
gja has quit [Quit: This computer has gone to sleep]
Hobogrammer has quit [Ping timeout: 272 seconds]
momomomomo has joined #ruby
mneorr has quit [Remote host closed the connection]
tvw has joined #ruby
mneorr has joined #ruby
alexfreidah has quit [Ping timeout: 245 seconds]
katterstrophe has joined #ruby
julweber has joined #ruby
zeeraw has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
sambao21 has quit [Quit: Computer has gone to sleep.]
SCommette has joined #ruby
nathancahill has joined #ruby
mneorr has quit [Ping timeout: 245 seconds]
mehlah has quit [Quit: Leaving...]
Advocation has quit [Quit: Advocation]
kreantos has quit [Read error: Connection reset by peer]
gja has joined #ruby
nanoyak has joined #ruby
kiri has quit [Ping timeout: 272 seconds]
Neomex has joined #ruby
nwertman has joined #ruby
Neomex has quit [Client Quit]
kreantos has joined #ruby
sambao21 has joined #ruby
kreantos has quit [Remote host closed the connection]
katterstrophe has quit [Remote host closed the connection]
katterstrophe has joined #ruby
burlyscudd has joined #ruby
fusi0n has joined #ruby
julweber has quit [Remote host closed the connection]
Macaveli has quit [Ping timeout: 245 seconds]
kiri has joined #ruby
yfeldblum has quit [Quit: Leaving...]
vlad_starkov has joined #ruby
sparrovv has joined #ruby
coderhs has quit [Read error: Connection timed out]
i_s has joined #ruby
godd2 has quit [Ping timeout: 272 seconds]
colonolGron has joined #ruby
senayar has quit [Ping timeout: 252 seconds]
ewnd9_ has quit [Ping timeout: 260 seconds]
dblessing has quit [Quit: dblessing]
huttan- has joined #ruby
yfeldblum has joined #ruby
dfranciosi has quit [Remote host closed the connection]
mojjojo has quit [Quit: mojjojo]
i_s has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
mansi has joined #ruby
mansi_ has quit [Read error: Connection reset by peer]
jasonwebster has joined #ruby
dblessing has joined #ruby
heftig has joined #ruby
Hanmac has joined #ruby
mneorr has joined #ruby
rubyracer has quit [Quit: Konversation terminated!]
huttan- has quit [Ping timeout: 252 seconds]
freerobby has quit [Quit: Leaving.]
mehlah has joined #ruby
chomskiii has quit [Read error: Connection reset by peer]
mojjojo has joined #ruby
freerobby has joined #ruby
Hanmac1 has quit [Ping timeout: 252 seconds]
chomskiii has joined #ruby
mehlah has quit [Client Quit]
mocfive has quit [Remote host closed the connection]
crazymykl has quit [Remote host closed the connection]
<TheLarkInn>
I'm doing good. Living life between struggling with cocoa/obj-c bindings and convincing my friend to learn ruby via www.codacademy.com
gja has quit [Quit: This computer has gone to sleep]
<TheLarkInn>
So he can stop bugging me for help :-P
<Fractional>
I wish my friends would be interested in learning Ruby. They are not =/
lethjakman has quit [Ping timeout: 272 seconds]
pskosinski has quit [Quit: Til rivido Idisti!]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest7655 has quit [Ping timeout: 276 seconds]
<TheLarkInn>
Most of my dev friends are all Obj-C/cocoa since I work for a company that makes Mac apps. But this one likes ruby and wants to learn it. Howver he's too lazy to just read a course or tutorial.
<TheLarkInn>
I had the most success with codacademy.com as far as free goes.
gja has joined #ruby
maletor has joined #ruby
mikepack has quit [Remote host closed the connection]
rakm has joined #ruby
<soahccc>
I wish my friends would know Obj-C :(
whomp has joined #ruby
lethjakman has joined #ruby
_tpavel has joined #ruby
<Hanmac>
i wish i would have never seen obj-c code ... ;P
samsonasu has joined #ruby
chrisseaton has quit []
<shevy>
I wish Obj-C would die in a fire
DaZ has quit [Ping timeout: 246 seconds]
reset has quit [Quit: Leaving...]
_tpavel has quit [Client Quit]
drumusician has quit [Ping timeout: 260 seconds]
SirCmpwn has quit [Ping timeout: 260 seconds]
Jake232 has joined #ruby
<cout>
shevy: why?
interactionjaxsn has quit [Remote host closed the connection]
<cout>
shevy: I mean it could be worse (it could be c++)
<soahccc>
Wasn't apple interested in macruby or whatever it was? I read an article that they have invested and that there might be some interesting outcomes in the future
danijoo has quit [Remote host closed the connection]
<shevy>
cout c++ should also die
<cout>
soahccc: yes, they hired laurent to work on it
danijoo has joined #ruby
<cout>
shevy: not gonna happen though. C++ is too good at what it does.
Xiti has joined #ruby
heidi has quit [Quit: Leaving.]
mehlah has joined #ruby
<shevy>
the same can be said about any other C-like language
Cicatrice1 has joined #ruby
Cicatrice1 has left #ruby [#ruby]
<lupine>
reducing developers to sobbing messes?
<jtdowney>
soahccc: they sponsored macruby development at one point
heidi has joined #ruby
<shevy>
does macruby work?
<jtdowney>
now those guys moved to work on rubymotion
<jtdowney>
it did/does
crazymykl has joined #ruby
<jtdowney>
think it is mostly used in rubymotion now
lxsameer has quit [Quit: Leaving]
pushpak has joined #ruby
dangerousdave has joined #ruby
<soahccc>
hmm unfortunately... ios or not I really hope they don't do the MS way in merging it completely together
ce_afk is now known as cescalante
chomskiii has quit [Read error: Connection reset by peer]
DaZ has joined #ruby
chomskiii has joined #ruby
magoo has quit [Quit: WeeChat 0.4.2]
Trickydee has joined #ruby
jlast_ has joined #ruby
DrShoggoth has quit [Quit: Leaving]
crazymykl has quit [Remote host closed the connection]
mocfive has quit [Remote host closed the connection]
<TheLarkInn>
There are some things that I shamelessly love about objective-C, methods tell you right when you read them, exactly what object type should be returned when using that method
<lupine>
a type system?
jerius has quit [Ping timeout: 245 seconds]
<lupine>
how very vulgar :p
jlast has quit [Ping timeout: 245 seconds]
i_s has joined #ruby
i_s has quit [Remote host closed the connection]
burlyscudd1 has joined #ruby
gja has quit [Quit: This computer has gone to sleep]
jerius has joined #ruby
burlyscudd has quit [Read error: Connection reset by peer]
jedimind has quit [Quit: heading home, back in a bit]
aspires has joined #ruby
dkamioka has quit [Remote host closed the connection]
SirCmpwn has joined #ruby
_bart has quit []
timonv has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
asteros has joined #ruby
ctp has joined #ruby
petertretyakov has quit [Remote host closed the connection]
aaronmcadam has quit [Quit: Leaving...]
burlyscudd has joined #ruby
MatthewsFace has quit [Quit: This computer has gone to sleep]
chrisseaton has joined #ruby
ctp has quit [Client Quit]
Jetchisel has joined #ruby
jlast_ has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
<zumba_addict>
so guys, i'm confused with rack. Is rack part of ruby or rails?
snath has joined #ruby
<MrZYX>
rack is used by ruby on rails
<zumba_addict>
got it
<MrZYX>
it's an interface between your ruby application and your application server
<zumba_addict>
it's because, i'm encountering an issue regarding https
senayar has joined #ruby
<zumba_addict>
i read that rack can be used to listen on SSL
tvw has quit []
<zumba_addict>
oops
<zumba_addict>
can't be used
<zumba_addict>
right now, our localhost listens on port 9292
<zumba_addict>
I execute our app locally by typing rack
<zumba_addict>
rackup
RaCx has joined #ruby
<MrZYX>
rackup starts webrick for me
<zumba_addict>
on our app, we have an env.rb file and it has our endpoint. We have 2 remote REST api servers, one listens on http only and the other one listens on https. It only works when it points to http
<zumba_addict>
yes, same thing here, webrick 1.3.1
freezey has quit [Remote host closed the connection]
<zumba_addict>
once I change my endpoint in env.rb file to point to our remote https server, accessing our local app via IE will fail
<MrZYX>
then apply the fix
burlyscudd1 has joined #ruby
<zumba_addict>
I was told to make rackup listen on https
burlyscudd1 has quit [Read error: Connection reset by peer]
<MrZYX>
(quality of problem description = quality of answers)
<zumba_addict>
but from my research, it can't be
fantazo has joined #ruby
yalue has quit [Quit: Leaving]
thenovices has joined #ruby
<MrZYX>
you know we can't magically know what "accessing our local app via IE will fail" or "we have an env.rb file and it has our endpoint" could even mean?
sambao21 has quit [Quit: Computer has gone to sleep.]
alexfreidah has joined #ruby
Spami has joined #ruby
bean has joined #ruby
<blandflakes>
i've been digging around through various libraries - anybody know of a solid gem that adds kerberos authentication to a rack service? using sinatra if that helps
burlyscudd has quit [Read error: Operation timed out]
<zumba_addict>
oh, sorry, I didn't know i was confusing
<zumba_addict>
We access our local application via http://localhost:9292. When our env.rb's REST api endpoint varible points to https://api.abc.com and when we try to sign in to http://localhost:9292 using IE9, we think that IE9 doesn't like accessing resources when protocols are different, http -> https. However, it works fine in Chrome but we need to make it work in IE9. I was thinking that I should configured rackup so that it liste
<zumba_addict>
on HTTPs. However, the research(stackoverflow) I did yesterday says that rackup can't be configured to listen on HTTPS.
klaut_ has joined #ruby
danshultz has quit [Read error: Connection reset by peer]
alexfreidah has quit [Ping timeout: 272 seconds]
deception has quit [Quit: Goodbye]
danshultz has joined #ruby
jlast has joined #ruby
<MrZYX>
you're still assuming that we know how your app works. I can't imagine how the protocol used by your backend to talk to an API should affect the frontend
<zumba_addict>
When I configure env.rb to point to our regular http REST api server,http://api2.abc.com, it works fine on IE9
mhenrixon has joined #ruby
<jtdowney>
also there are quite a few rack servers that can support ssl, such as thin
yaymukund has joined #ruby
<zumba_addict>
I read thin yesterday
<MrZYX>
even webrick does
<jtdowney>
or rather HTTPS
<zumba_addict>
ah, that's great news MrZYX
<MrZYX>
rackup probably just doesn't provide the interface
<zumba_addict>
i want to try it
<zumba_addict>
o
fedez77 has quit [Ping timeout: 272 seconds]
<zumba_addict>
oh
<MrZYX>
no one forces you to run your application via rackup
<jokke>
hello
<yaymukund>
I'm dealing with a dumb soap api and have to get things like `response[:a][:b][:c][:d]` where a,b,c,d are really long. What's the cleanest way to do that?
<zumba_addict>
but it's been started by rackup for many months and I'm not very good in ruby
yoshie902a has joined #ruby
<zumba_addict>
I was just hoping i can help with the fixing
<zumba_addict>
the guys have been troubleshooting it for 3 weeks now with no luck
<yoshie902a>
any recommendations on how to trouble shoot and fix it would be helpful
<zumba_addict>
would it be a huge task to migrate from rackup to thin?
<MrZYX>
no
<yaymukund>
I probably just try to split response[:a]oh I can do response[:a]\(newline)[:b]\(newline)[:c]
<MrZYX>
that's what rack is for
<MrZYX>
to make that pluggable
<zumba_addict>
will the build be migrated?
<yaymukund>
yuck
klaut_ has quit [Ping timeout: 252 seconds]
<MrZYX>
zumba_addict: again. stop assuming that we know how the hell your system looks like. we have no idea. zero.
<zumba_addict>
ok, please point me to some documents about thin that I can start reading
nickakavic has joined #ruby
<zumba_addict>
do you want to see it? I can pm it to you
<MrZYX>
no, if you can't make up a proper problem description it's not worth my time
<jokke>
i'm having a hard time to figure out a solution for the following problem: i have methods which all in the end call another method (same for all) with different parameters. I also want all of these methods to be able to be passed a block so that the params will be passed to the block instead of the other method.. Are you following? Hard to explain maybe.. Anyway, i want to prevent code duplication and don't
<jokke>
know how..
<zumba_addict>
I think I described it properly
tvw has joined #ruby
<zumba_addict>
jtdowney: did you understand the problem I was having when I explained it above?
colonolGron has left #ruby [#ruby]
yoshie902a has quit [Client Quit]
<zumba_addict>
I'll try again :)
hiall has joined #ruby
<zumba_addict>
1. When accessing http://localhost:9292 using IE9 and when endpoint is pointing to https, IE9 complains with invalid character. But I think it's complaining about cross origin resource sharing (http -> https)
<zumba_addict>
However, when I access http://localhost:9292 using Chrome and when endpoint is pointing to https, it's fine
<zumba_addict>
No changes in the code and it works fine in Chrome.
<zumba_addict>
i think there is a problem with the way our Apache was configured'
olivier_bK has joined #ruby
<zumba_addict>
the apache responds with 302 - Moved temporaritly and provides another https link
mneorr_ has joined #ruby
guinslym has joined #ruby
freezey has joined #ruby
<MrZYX>
is the fact that your rails app is a rails app actually not of interest and it's merely serving a javascript app and injects your "endpoint" into it?
<zumba_addict>
yup, that's correct
<MrZYX>
see there's your problem
<MrZYX>
I needed to make a lot of assumptions you never provided
<zumba_addict>
k
ckinni has joined #ruby
<MrZYX>
that's why it never was a proper problem description
bamdad has joined #ruby
<zumba_addict>
k
mneorr_ has quit [Remote host closed the connection]
justinxreese has quit [Ping timeout: 246 seconds]
bamdad has quit [Client Quit]
rburton- has joined #ruby
mneorr_ has joined #ruby
<jokke>
MrZYX: thing is, i would have to write that every time
<zumba_addict>
it's really weird that when endpoint is pointing to our https link, IE9 doesn't like it. It's fine with Chrome
<MrZYX>
jokke: don't see what's there more to abstract than the if/elese
<jokke>
mh
justinxreese has joined #ruby
<jokke>
yeah i guess so..
mneorr has quit [Ping timeout: 245 seconds]
<zumba_addict>
I want to try using https in rack but don't know where to start
<MrZYX>
if you want to avoid the &block in method def, you can do &Proc.new when calling the helper, though that's a bit more opague IMO
klaut has quit [Read error: Connection reset by peer]
<zumba_addict>
or I thin Thin was suggested earlier
<zumba_addict>
thin/think
klaut has joined #ruby
<MrZYX>
zumba_addict: I think your app just needs to server a proper CORS header
<MrZYX>
but the people at #rubyonrails certainly have more experience with that
<zumba_addict>
ok
mercwithamouth has quit [Ping timeout: 252 seconds]
dallasm_ has quit [Remote host closed the connection]
Macaveli has quit [Ping timeout: 245 seconds]
Zai00 has left #ruby [#ruby]
SCommette has joined #ruby
reebs has joined #ruby
b00stfr31k has joined #ruby
mocfive has quit [Remote host closed the connection]
clamstar has quit [Quit: Computer has gone to sleep.]
jtdowney has quit []
rayners has quit [Ping timeout: 272 seconds]
rayners has joined #ruby
colonolGron has left #ruby [#ruby]
senayar has quit [Remote host closed the connection]
Guest7655 has joined #ruby
vky has joined #ruby
sayan has joined #ruby
senayar has joined #ruby
jovon has quit [Quit: Leaving]
aspires has joined #ruby
Guest7655 has left #ruby [#ruby]
Guest7655 has joined #ruby
tannerburson_ has joined #ruby
tannerburson has quit [Ping timeout: 260 seconds]
tannerburson_ is now known as tannerburson
bjhaid has joined #ruby
burlyscudd has joined #ruby
sparrovv has quit [Remote host closed the connection]
mneorr_ has quit [Remote host closed the connection]
iamsean has joined #ruby
Gonzih has joined #ruby
mneorr has joined #ruby
araujo has joined #ruby
vky has quit [Ping timeout: 246 seconds]
Cephalostrum has quit [Remote host closed the connection]
Cephalostrum has joined #ruby
predator117 has joined #ruby
reset has quit [Quit: Leaving...]
funburn has joined #ruby
dreinull has joined #ruby
b00stfr31k has quit [Ping timeout: 246 seconds]
phansch has quit [Quit: Leaving]
claymore has quit [Ping timeout: 245 seconds]
Gonzih has quit [Ping timeout: 252 seconds]
<dreinull>
Array#map question: If I skip an entry in my enumerator, it inserts nil. Is there a way to still skip without creating a nil value? (I can comapact, no problem, just asking)
tyl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
freakcult has quit [Ping timeout: 272 seconds]
iamjarvo has quit [Ping timeout: 252 seconds]
<shevy>
dreinull perhaps via next? I am not sure it can skip though, as it passes all values to that block
claymore has joined #ruby
<apeiros>
dreinull: no. map's contract is that it maps each element
<MrZYX>
dreinull: select before you map
freakcult has joined #ruby
<apeiros>
i.e., the resulting array has the same size as the input array
<soahccc>
dreinull or compact after
rankine has joined #ruby
<Hanmac>
shevy "next" does not work i tested it
lkba has joined #ruby
Sawbones has joined #ruby
CogitoErgoSum has quit [Quit: Leaving]
<shevy>
Hanmac I am listening to old 1990s music right now!
end_guy has quit [Remote host closed the connection]
momomomomo has joined #ruby
<Sawbones>
Ok, so if symbols are values then why in capistrano is this a thing: `set :user, 'deploy'`
mark_locklear has quit [Ping timeout: 276 seconds]
kaldrenon has quit [Remote host closed the connection]
<mjc_>
system, yuck
<brisbin>
aka you're using the wrong tool
mocfive has joined #ruby
farn has quit [Read error: Connection reset by peer]
nanoyak has quit [Ping timeout: 272 seconds]
tziOm has quit [Read error: Operation timed out]
gasbakid has joined #ruby
clamstar has joined #ruby
ValicekB has joined #ruby
tziOm has joined #ruby
claymore has quit [Quit: Leaving]
farn has joined #ruby
<miah>
i'd much rather use FileUtils than system(cp)
<miah>
i write softawre for systems automation (mostly chef, but lots of other things too)
nanoyak has joined #ruby
<miah>
recently i wrote a class that uses the Rubygems TarPackage class because you can never trust tar to be tar
<miah>
its different in gnu, bsd, sysv, etc
sambao21 has joined #ruby
<shevy>
Yes!
<miah>
my code isn't perfect, and could certainly use some improvements. but i can test it and verify that it will work correctly across platforms much easier
mercwithamouth has quit [Ping timeout: 252 seconds]
darthdeus has quit [Quit: Leaving...]
<shevy>
your code is perfect!
<miah>
i think that its always good to note that you (or your code) are not perfect. also that you occassionally fail at things.
<shevy>
I am motivating everyone today!
<miah>
it helps beginners who are new see that even people who seem to know what they are talking about are also human
<miah>
well <3 i appreciate it
mercwithamouth has joined #ruby
brianpWins has quit [Quit: brianpWins]
<miah>
people are sometimes too mean on the internet (myself included)
<shevy>
Indeed!
spider-mario has quit [Remote host closed the connection]
chrisseaton has quit [Ping timeout: 252 seconds]
allaire has joined #ruby
mklappstuhl has joined #ruby
<shevy>
brisbin if you want your scripts to run on windows too, FileUtils is the way to go!
<miah>
indeeds
sparrovv has joined #ruby
yoshie902a has quit [Quit: yoshie902a]
<miah>
also, make sure you use File.join rather than "/my/file/path" as File.join will use the correct FILE_SEPPERATOR
kristiandelay has quit [Remote host closed the connection]
failshell has quit []
reset has joined #ruby
<canton7>
(not that windows cares about using forward slashes)
<apeiros>
miah: just that so far on all known OSes FILE_SEPARATOR is "/"
<apeiros>
that includes windows
maveonair has joined #ruby
maveonair has quit [Client Quit]
freezey has quit [Remote host closed the connection]
freezey has joined #ruby
<miah>
interesting
chrisseaton has joined #ruby
<canton7>
the main advantage imo of File.join is that it doesn't matter if you have leading/trailing slashes - File.join('one/', '/two') is the same as File.join('one', 'two'), etc
ss_ has joined #ruby
<miah>
canton7: true
<apeiros>
I used to use File.join, but given the above fact, I stopped
<apeiros>
string interpolation is IMO less annoying
allaire has quit [Client Quit]
<miah>
i tend to just pass my var's to file.join to render what i want
<canton7>
horses for courses
<apeiros>
especially if your parts are not full names, e.g. "foo_#{id}/bar_#{name}"
<miah>
you can still pass a interpolated string to file.join
<miah>
file.join("foo_#{id}", "bar_#{name}") is valid
Jetchisel has joined #ruby
<apeiros>
that said, I still want to make a path template class, to have things like turning an ID 4085954778 into f3/8a/b8/da
<apeiros>
miah: I know. but more work for no gain
<miah>
i agree mostly
yoshie902a has joined #ruby
<shevy>
hmm
bbloom has quit [Ping timeout: 272 seconds]
rubyracer has quit [Quit: Konversation terminated!]
<edwardthefma>
change the frome and to to the filename and dir
mercwithamouth has quit [Ping timeout: 252 seconds]
<Sawbones>
What I wanted to ask was, what is being passed to this method:
<Sawbones>
validates :name, presence: true
<Sawbones>
what is presence: true?
<apeiros>
a hash
<shevy>
Sawbones that looks like a hash but a bit fucked up
<apeiros>
`validates :name, presence: true` is sugar for `validates(:name, {presence: true})`
<shevy>
been simpler in the old days with =>
<Sawbones>
That's right out of a Rails snippets
<apeiros>
and `{presence: true}` is an alternative to writing `{:presence => true}`
<shevy>
Sawbones guess who pioneered the whole foo: bla syntax ... the railsers! ;)
<terrellt>
Hash rockets ftw.
<Sawbones>
hmm interesting, now that I know the code might make more sense
<apeiros>
oh dear deary me…
<shevy>
the railsers are innocent on the stabby lambda though
<shevy>
that was after matz had some sake already
<shevy>
big ufo => small ufo ->
yoshie902a has quit [Quit: yoshie902a]
<shevy>
complete ufo <=>
iamjarvo has quit [Ping timeout: 246 seconds]
aryaching has quit [Ping timeout: 246 seconds]
binw has quit [Read error: Connection reset by peer]
yoshie902a has joined #ruby
<jokke>
i'm having some trouble with a sinatra url-shortener i hacked together.. Seems to have problems with ampersands in the passed urls. Can you spot the possible problem? https://paste.jreinert.com/eQqJuB/
nanoyak has quit [Quit: Computer has gone to sleep.]
nifty has quit [Ping timeout: 245 seconds]
<jokke>
ah
<jokke>
makes sense now
<shevy>
hehe
Wolland has quit [Remote host closed the connection]
Xeago has quit [Read error: Connection reset by peer]
<shevy>
we don't need rdoc anyway
Xeago has joined #ruby
Xeago_ has joined #ruby
shime has quit [Ping timeout: 252 seconds]
_bart has joined #ruby
<shevy>
Hanmac if I manage to compile glibc and have it run, I will switch to ruby-2.1 even if my yaml files won't work!
doodlehaus has quit [Remote host closed the connection]
Cephalostrum has quit [Quit: Aim higher. Try this: why am I here? Why do I exist, and what is my purpose in this universe? (Answers: 'Cause you are. 'Cause you do. 'Cause I got a shotgun, and you ain't got one.)]
olivier_bK has quit [Ping timeout: 252 seconds]
Xeago has quit [Read error: Operation timed out]
doodlehaus has joined #ruby
Cephalostrum has joined #ruby
Hobogrammer has quit [Quit: Leaving]
Hobogrammer has joined #ruby
r0bby_ has joined #ruby
justsee has quit [Quit: leaving]
justsee has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
robbyoconnor has quit [Ping timeout: 252 seconds]
<shevy>
hmm
<shevy>
is there a simple way to alias class methods, without class << self ?
terrellt has quit [Quit: Always try to be modest, and be proud about it!]
drumusician has quit [Ping timeout: 252 seconds]
doodlehaus has quit [Ping timeout: 246 seconds]
ffranz has quit [Quit: Leaving]
nanoyak has joined #ruby
Guedes0 has joined #ruby
mansi has quit [Remote host closed the connection]
<Hanmac>
lethjakman: in 2.0+ you can use def fun(**args);end for hash options
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<lethjakman>
Hanmac: does that have an advantage?
<Hanmac>
shevy watch it and comment later
strabcz has joined #ruby
<shevy>
apeiros hmm. I used to modify many parts of the ruby stdlib in the past, I still do that for local use. A problem I eventually had was that when I package up things into a gem, I'd have to distribute these modifications at well, which isn't that good, so I kinda stopped doing that
<Hanmac>
lethjakman: yes when using with other option args
<lethjakman>
ahhh ok
<shevy>
5 years ago I thought the facets gem was cool, now I am no longer so sure
<apeiros>
shevy: then no, there's no nicer way than class << self
strabcz has quit [Client Quit]
mercwithamouth has joined #ruby
<shevy>
Hanmac this is SICK, what is that thing doing
<ddd>
shaving a yak with a butter knife
<shevy>
apeiros ok
r0bby_ has quit [Read error: No route to host]
mocfive has quit [Ping timeout: 245 seconds]
<shevy>
Hanmac I don't get these things, I grew up with tom and jerry. that's just grusome there!
maroloccio has quit [Quit: WeeChat 0.4.2]
<ddd>
hanmac shevy is absolutely on point. you want some STRANGE shit
EngierkO has joined #ruby
<ddd>
s/want/watch/
<ddd>
maybe want too, idk
alexfreidah has quit [Ping timeout: 245 seconds]
freezey has quit [Ping timeout: 248 seconds]
<shevy>
the japanese tend to be on the extreme scales. either it's extremely awesome or extremely STRANGE
<Hanmac>
shevy did you already watched the whole scene? (this ball was a nuclear weapon ... directly pointing to the MC's head ;P and the girl thought the only way against it was to hit the ball with a bat)
yasushi has quit [Ping timeout: 272 seconds]
<shevy>
Hanmac my head hurts
<Hanmac>
shevy or both
lockweel has quit [Ping timeout: 245 seconds]
peregrin_ has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yoshie902a has left #ruby [#ruby]
senayar has quit [Remote host closed the connection]
<ddd>
i have such weird friends, lol
chrismerrill has joined #ruby
rezzack has joined #ruby
rayners has quit [Remote host closed the connection]
w4pm has joined #ruby
rburton- has quit [Quit: Leaving...]
mocfive has joined #ruby
prc has joined #ruby
bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<lethjakman>
but when I have "if item_id.nil?" it tells me that it can't find item_id, but when I remove that validation it's clearly there
<lethjakman>
any clue what's going on?
sec^nd has quit [Remote host closed the connection]
Sawbones has joined #ruby
ss_ has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
<Sawbones>
hey guys what's the question mark that comes after some methods?
geggam has quit [Quit: commute]
ss has joined #ruby
sec^nd has joined #ruby
ss is now known as Guest3512
burlyscudd has joined #ruby
<lethjakman>
Sawbones: in methods it's just a question. with attributes you can use it to verify truthiness
<lethjakman>
s/question/question mark/
lmickh has quit [Remote host closed the connection]
<Sawbones>
so like....isvalid?
mocfive has quit [Remote host closed the connection]
yoshie902a has joined #ruby
klaut has quit [Remote host closed the connection]
rudisimo has quit []
danshultz has joined #ruby
mocfive has joined #ruby
mojjojo has joined #ruby
Sawbones has quit [Remote host closed the connection]
<DouweM>
lethjakman: the if is now evaluated when the class itself is loaded for the first time
<DouweM>
lethjakman: you need the :if option with a lambda
freerobby has quit [Quit: Leaving.]
<lethjakman>
DouweM: just found that actually! thank you :)
<DouweM>
that's why the error says there's no item_id on Class!
Guest3512 has quit [Ping timeout: 252 seconds]
<lethjakman>
it seems to work in a string too...
<DouweM>
what seems to what?
<soahccc>
Sawbones: yeah methods ending with a question mark indicates a boolean return value. the "is" prefix is not common in the ruby world though
<yoshie902a>
I'm getting a " Inappropriate ioctl for device" error, and it has something to do with permissions. I'm not sure how to trouble shoot this. I've googled and googled, but not getting anywhere. any recommendations?