fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
rakl has quit [Quit: sleeping]
<blazes816>
what do you mean reference?
Jake232 has joined #ruby
<bperry>
I am assuming use this string to access the object'
<ablew_>
bperry: yes
<bperry>
ablew_: perhaps you should store these in a hash
<ablew_>
sorry, vocab isn't very good this time of day
<bperry>
and use the string as the key
joofsh has joined #ruby
<bperry>
and then the value is th eobject
<ablew_>
i was doing that before, but this is a heavily threaded application so i couldn't take the hit on mutex
<bperry>
ah
<bperry>
use C :)
<ablew_>
doh!
pdtpatrick has quit [Quit: pdtpatrick]
<ablew_>
:P
atmosx has quit [Quit: WeeChat 0.3.8]
Agis__ has quit [Quit: Agis__]
_nitti has quit [Ping timeout: 246 seconds]
bradhe has joined #ruby
<bperry>
(you can write ruby gems in C fwiw)
<bperry>
it is easy enough
<ablew_>
heh, trying to avoid that
verto is now known as verto|off
<bperry>
meh it isn't voodoo, it is useful, I am not sure why so many peopl are against
rakl has joined #ruby
<ablew_>
this is a queue consumer that does analysis and then pushes stuff into graphite. it's built to support N worker threads to do the processing
<ablew_>
for me it's just scope creep
lggr has quit [Ping timeout: 260 seconds]
Tearan has quit [Quit: Sleepy Badger....]
<bperry>
ah
<ablew_>
i want to get this thing working and then move on to other stuff
dkastner has quit [Quit: dkastner]
duracrisis_ has joined #ruby
recycle has joined #ruby
bradhe has quit [Ping timeout: 240 seconds]
fortysixandtwo has joined #ruby
lggr has joined #ruby
DaniG2k has joined #ruby
hsbt_away is now known as hsbt
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
<DaniG2k>
guys I am writing a pretty bare class in ruby now (I'm a total n00b so bear with) and i'm wondering how can I define a method that returns true if the object is from that same class?
<DaniG2k>
say the class is IceCream
lggr has quit [Ping timeout: 240 seconds]
<DaniG2k>
and I want to write a method that returns true if the object is of class IceCream
duracrisis_ has quit [Changing host]
duracrisis_ has joined #ruby
baroquebobcat has joined #ruby
starship has quit [Killed (adams.freenode.net (Nickname regained by services))]
duracrisis_ is now known as starship
recycle has quit [Ping timeout: 246 seconds]
Guest36719 has joined #ruby
<Vinz_>
objet.class would give you the object class i think
<Vinz_>
DaniG2k
robbyoconnor has joined #ruby
baroquebobcat has quit [Client Quit]
samphippen has quit [Quit: Computer has gone to sleep.]
<DaniG2k>
Vinz_: I know but, I am writing the class now and I'm wondering how I can write a def so that it returns true if object.class == the class that def is in
falieson_ has left #ruby [#ruby]
<DaniG2k>
for instance
<DaniG2k>
class Apple
<DaniG2k>
sorry
<DaniG2k>
class Fruit
lggr has joined #ruby
<DaniG2k>
and inside that
<DaniG2k>
def apple
<DaniG2k>
it has to return true if its a fruit object
punkrawkR has quit [Read error: Connection reset by peer]
<swarley>
I think that could e potentially dangerous though
<swarley>
Be*
SegFaultAX|work has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<jwallace>
swarley: yeah it sounds a bit aggressive
bradleyprice has joined #ruby
rabidpraxis has joined #ruby
<swarley>
Maybe you need to just reevaluate the loop and see what memory modifications you can make
lggr has joined #ruby
<jwallace>
the even loop starts an EM::Connection server, which acts as a simple proxy (fires off a request, and sends the content to the original request) - because we are behind a version of nginx that doesn't support http 1.1 proxying, we can't stream the response
kenneth has joined #ruby
<kenneth>
hey there, i was wondering, can a block have a variable arity
<kenneth>
like, can i do do |something, *more| …
<blazes816>
yep
<jwallace>
kenneth: i think in 1.9 you can
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
<swarley>
By airity do you mean argument count?
<blazes816>
lol
<blazes816>
that's what arity means swarley
<swarley>
def test_a(&block); block.arity; end
<blazes816>
it's a fancy academic word
<bperry>
arity is a math term
BMF has joined #ruby
<bperry>
though it can be an english term as well
<bperry>
verbal I suppose
<swarley>
Oh variable arity
<swarley>
Yes
<bperry>
the amount of nouns a verb requires to make sense
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
<blazes816>
i've never heard that; that's interesting
pydave6357 has joined #ruby
<bperry>
I think the correct verbal term is valency
<bperry>
but you can get by calling it the arity of the verb
mahmoudimus has quit [Quit: Computer has gone to sleep.]
chrishunt has quit [Ping timeout: 260 seconds]
<Kovensky>
speaking of datamapper; is there an easy way to implement expiration in it? (for use as a cache)
mahmoudimus has joined #ruby
lggr has joined #ruby
icole has quit [Remote host closed the connection]
pydave6357 has quit [Ping timeout: 240 seconds]
slicslak has quit [Ping timeout: 246 seconds]
poindontcare has joined #ruby
<poindontcare>
quick question how do ensure that present directory is always on the load path so i can require files in in
<poindontcare>
*it
<Kovensky>
in perl you could do `use '..';`, but that's relative to the CWD instead of relative to script
<Kovensky>
err, `use lib '..';`
<poindontcare>
yeah i need it to be CWD relative
<Kovensky>
isn't that kinda bad
<poindontcare>
oh this is for irb work
lggr has quit [Ping timeout: 240 seconds]
Banistergalaxy has quit [Ping timeout: 255 seconds]
<Kovensky>
`irb -I..` ? :>
mahmoudimus has quit [Quit: Computer has gone to sleep.]
falieson has quit [Ping timeout: 246 seconds]
bradleyprice has joined #ruby
gmci has quit [Ping timeout: 260 seconds]
<poindontcare>
Kovensky: ah I guess i can create an alias thanks
oldB has quit [Quit: oldB]
apok has quit [Ping timeout: 244 seconds]
<poindontcare>
another question for a files in my tree is require_relative preferred over require ?
brian-_ has quit [Ping timeout: 240 seconds]
<Kovensky>
poindontcare: seems you can export RUBYLIB to a certain path
<Kovensky>
but yeah, the envvar wouldn't really do what you want
brian- has joined #ruby
lggr has joined #ruby
falieson has joined #ruby
<poindontcare>
Kovensky: yup thanks
Hanmac1 has joined #ruby
AndChat|159600 has joined #ruby
JoshWines has quit [Ping timeout: 246 seconds]
josh^ has quit [Ping timeout: 246 seconds]
alvaro_o has quit [Quit: Ex-Chat]
wuiqed has quit [Quit: Leaving]
AndChat|159600 has quit [Client Quit]
Hanmac has quit [Ping timeout: 256 seconds]
icole_ has joined #ruby
mmitchell has joined #ruby
josh^ has joined #ruby
falieson has quit [Ping timeout: 246 seconds]
_nitti has joined #ruby
icole__ has joined #ruby
JoshWines has joined #ruby
<bnagy>
poindontcare: yes, require_relative is the preferred solution
dagobah has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 246 seconds]
<bnagy>
some people push '.' onto the load path, but it kind of defeats the purpose of taking it out in the first place
ZubKonst has joined #ruby
ncr100 has quit [Ping timeout: 246 seconds]
Ruler_Of_Heaven_ has quit [Ping timeout: 246 seconds]
dagobah has joined #ruby
icole_ has quit [Ping timeout: 256 seconds]
ZubKonst_ has quit [Ping timeout: 252 seconds]
pipopopo has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
Axsuul has quit [Ping timeout: 240 seconds]
shadoi has joined #ruby
ebragaparah has quit [Remote host closed the connection]
FifthWall has joined #ruby
quazimodo has joined #ruby
ebragaparah has joined #ruby
dpk has joined #ruby
puff has joined #ruby
<puff>
Would it be reasonable to say that block/yield basically lets you define an anonymous function (i.e. the block) which is passed to some other function as an implicit variable (i.e. not as a parameter in the function call) and invoked via yield?
mikepack has quit [Remote host closed the connection]
icole__ has quit [Read error: Connection reset by peer]
stephenjudkins has joined #ruby
nari has joined #ruby
<heftig>
puff: pretty much
<puff>
Okay... not disparaging it, but I guess I'm still missing what makes it so groovy.
reuf has quit [Quit: Leaving]
<puff>
E.g. my reflex would be to prefer the more explicit approach.
m3pow has quit [Quit: ChatZilla 0.9.89 [Firefox 15.0.1/20120907231657]]
Kuhni has quit [Quit: ?????]
<seanstickle>
puff: then by all means do so
berserkr has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 248 seconds]
gmci has joined #ruby
gmci is now known as Guest32153
eignerchris has joined #ruby
eignerchris has quit [Remote host closed the connection]
Chryson has quit [Quit: Leaving]
hgf has joined #ruby
ekristen has quit [Quit: ekristen]
lggr has joined #ruby
<puff>
seanstickle: It's not an argument, I'm just trying to see the advantages of the conventional approach.
soulisson has quit [Quit: Quitte]
soulisson has joined #ruby
wpaulson has joined #ruby
<bnagy>
just read some idiomatic code
<bnagy>
#each #map etc
awarner has quit [Remote host closed the connection]
<bnagy>
done right you get code that's easy to read because it's all in one place and easy to chain together
<soulisson>
when a method calls an another method of the same object is it considered a message passing from the object to itself ?
icole has joined #ruby
<puff>
So could you say it basically replaces (for example) java-style iterators with a more fundamental concept that can be used to easily implement such iterators, as well as other useful things?
<bnagy>
well lots of the ways they're used are 'internal' iterators, but they'll work as external ones as well
<bnagy>
most of the Enumerable methods will return an Enumerator if you don't give it a block
robertotauille has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Guest32153 has quit [Ping timeout: 260 seconds]
<bnagy>
there are also Fibers for 'purer' continuatiojns, but that's getting a bit off track
deadalus has joined #ruby
<bnagy>
soulisson: I wouldn't consider it that way, no
<bnagy>
not without seeing some evidence of what would be a very weird design
<bnagy>
like you could have an object that handled a couple of threads / processes and allowed them to talk using LPC
<bnagy>
but a standard method call, no, it's not
lggr has joined #ruby
dmiller has quit [Remote host closed the connection]
<soulisson>
bnagy, so the message passing paradigm is only valid for different objects trying to interact with each other, if i understand correctly ?
kiyoura has quit [Quit: Leaving]
chimkan has joined #ruby
mahmoudimus has joined #ruby
<waxjar>
is a method not an object as well?
<bnagy>
actually LPC is a crap example
gmci_ has joined #ruby
<bnagy>
I meant something like 0mq inproc transport but that wouldn't have been obvious
<bnagy>
point is that 'calling a method' even on _another_ object is not message passing
<bnagy>
all stuff like LPC/RPC/DRb/SOAP etc are not message passing, they're [RL]PC
<bnagy>
waxjar: yeah it is, but that's irrelevant
robbyoconnor has quit [Quit: Konversation terminated!]
<bnagy>
so which you could somehow contrive to implement an Actor model within one object, it would be weird and possibly dumb
notVert has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 240 seconds]
ianblenke1 has joined #ruby
deadalus has quit [Quit: Leaving]
chendo_ has quit [Ping timeout: 240 seconds]
gmci_ has quit [Ping timeout: 260 seconds]
SJrX has joined #ruby
chendo_ has joined #ruby
reset has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
gmci_ has joined #ruby
ryanf has quit [Ping timeout: 240 seconds]
falieson has joined #ruby
havenn has quit [Remote host closed the connection]
gccostabr has quit [Remote host closed the connection]
<codebrah>
i ben doin embedded C all day, im gonnaa learn som Ruby
<codebrah>
ttyl
codebrah has quit [Client Quit]
lggr has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Ping timeout: 248 seconds]
dmiller has joined #ruby
lggr has joined #ruby
jer1ko_away is now known as jer1ko
Dreamer3 has joined #ruby
Cache_Money1 is now known as binary3d
<soulisson>
bnagy, sorry about my earlier question it was vague, i was talking about message passing in the context of core oo principles
ttt has joined #ruby
binary3d has quit [Quit: Leaving]
<bnagy>
soulisson: yeah, so was I
<bnagy>
calling a method is not message passing
elux has joined #ruby
illogically_soun has joined #ruby
illogically_soun is now known as IllogicallySound
seanstickle has quit [Quit: seanstickle]
<IllogicallySound>
I'm using Nokogiri. An invalid url returns a 404 and stops my script from running. What do I need to do to have the script move on to the next url?
<soulisson>
ok, but if i quote the PixAxe Book : "The answer has to do with the way Ruby determines which method should be called when you send a message to an object"
Banistergalaxy has joined #ruby
<bnagy>
soulisson: I'm not really interested in debating with random quotes taken out of context from a old book
<bnagy>
IllogicallySound: rescue that exception
lggr has quit [Ping timeout: 246 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
tommyvyo has joined #ruby
cbuxton has joined #ruby
Banistergalaxy has quit [Ping timeout: 246 seconds]
F1skr has quit [Quit: WeeChat 0.3.9]
lggr has joined #ruby
parzorep has quit [Quit: parzorep]
soulisson has left #ruby ["Quitte"]
maletor has quit [Quit: Computer has gone to sleep.]
_nitti has joined #ruby
IllogicallySound has quit [Quit: Leaving]
lggr has quit [Ping timeout: 245 seconds]
nick_h has quit [Ping timeout: 240 seconds]
awarner has joined #ruby
gmci_ has quit [Ping timeout: 246 seconds]
_nitti has quit [Ping timeout: 260 seconds]
gmci has joined #ruby
minijupe has joined #ruby
lggr has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
cburyta_ has quit [Remote host closed the connection]
WanderingGlitch has quit [Ping timeout: 256 seconds]
<waxjar>
couldn't you call calling a method message passing though? you send the object a message to "get me this, with these arguments". the name of the method becomes the message. that's how i always understood it, at least. i'm no CS student tho.
soulisson has joined #ruby
<bnagy>
you could, but it would be wrong, because the term has a specific meaning
linoj has quit [Quit: linoj]
<bnagy>
like you could call it 'computer prayers' cause like, you ask the receiver for something
<waxjar>
a term can have more meanings than one.
Elico1 has joined #ruby
nick_h has joined #ruby
<waxjar>
i'm just a bit puzzled because in most intros to ruby the message passing aspect of it is pointed out
<bnagy>
waxjar: commonly understood terms and principles are COMMON as in the same everywhere
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<bnagy>
using them wrong is not 'a point of view' it's 'wrong'
<bnagy>
that quote uses 'message' in the informal, teaching people who can't code to code, sense
<waxjar>
i see. i'm not trying to argue with you, i genuinely don't know :)
apok has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
c0rn_ has joined #ruby
cableray has quit [Quit: cableray]
awarner has quit [Remote host closed the connection]
ismaelga has quit [Remote host closed the connection]
rvandervort has joined #ruby
lggr has joined #ruby
Axsuul has joined #ruby
* rvandervort
looks around.
rvandervort has quit [Client Quit]
WanderingGlitch has joined #ruby
WanderingGlitch has quit [Changing host]
WanderingGlitch has joined #ruby
Bosox20051 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
cbuxton has quit [Ping timeout: 240 seconds]
Bosma has joined #ruby
hgf has quit [Quit: hgf]
bradleyprice has quit [Remote host closed the connection]
joofsh has quit [Quit: Leaving]
lggr has joined #ruby
cbuxton has joined #ruby
<RubyPanther>
and in the C api a Ruby method look like rb_funcall( receiver, class, rb_intern("method_aka_message_name"), n_args, arg_n, ... )
cableray has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
syamajala has quit [Remote host closed the connection]
robertotauille has quit [Quit: Leaving...]
maletor has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
icole has quit [Remote host closed the connection]
starship has quit [Read error: Connection reset by peer]
<falieson>
not super interesting, but at least a basis
starship has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Changing host]
g0bl1n has joined #ruby
jer1ko_away is now known as jer1ko
g0bl1n has quit [Read error: Connection reset by peer]
jer1ko has quit [Remote host closed the connection]
jer1ko has joined #ruby
chrxn has joined #ruby
cbuxton has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 246 seconds]
ndboost has quit [Remote host closed the connection]
steffes has joined #ruby
cbuxton has joined #ruby
lggr has joined #ruby
manizzle has quit [Ping timeout: 244 seconds]
steffes has quit [Remote host closed the connection]
macmartine has joined #ruby
mahmoudimus has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
rakunHo has joined #ruby
lggr has joined #ruby
icole has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
crankycoder has quit [Remote host closed the connection]
icole has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
elux has quit [Quit: Leaving...]
lggr has joined #ruby
cbuxton has joined #ruby
moshee has quit [Ping timeout: 255 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
manizzle has joined #ruby
ada2358_ is now known as adamblackwell
mercwithamouth has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
g0bl1n has joined #ruby
_nitti has joined #ruby
mmitchell has joined #ruby
lggr has joined #ruby
ryanlecompte has joined #ruby
love_color_text_ has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 246 seconds]
mmitchell has quit [Ping timeout: 246 seconds]
ananthakumaran has quit [Quit: Leaving.]
keyvan has joined #ruby
mercwithamouth has joined #ruby
icole has joined #ruby
elico has quit [Quit: elico]
lggr has quit [Ping timeout: 260 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
keyvan has quit [Remote host closed the connection]
carlyle has quit [Remote host closed the connection]
lggr has joined #ruby
Elico1 has quit [Quit: Elico1]
fredjean has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
dmiller has quit [Remote host closed the connection]
lggr has joined #ruby
ChampS666 has joined #ruby
sweet_kid has quit [Ping timeout: 260 seconds]
KindOne has quit [Ping timeout: 255 seconds]
bradleyprice has joined #ruby
elico has joined #ruby
raul782 has quit [Remote host closed the connection]
tekacs has quit [Ping timeout: 268 seconds]
quest88 has joined #ruby
AlbireoX`Laptop has joined #ruby
xuser has quit [Ping timeout: 245 seconds]
hoelzro|away has quit [Ping timeout: 260 seconds]
hoelzro|away has joined #ruby
Eplemosen has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
xuser has joined #ruby
tekacs has joined #ruby
KindOne has joined #ruby
changedNicks has joined #ruby
AlbireoX has quit [Ping timeout: 248 seconds]
g0bl1n has quit [Quit: Ex-Chat]
lggr has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
Eplemosen has quit [Client Quit]
minijupe has quit [Quit: minijupe]
tagrudev has joined #ruby
fyolnish has joined #ruby
AlbireoX`Laptop has quit [Ping timeout: 256 seconds]
ananthakumaran has joined #ruby
macmartine has joined #ruby
jameshyde has joined #ruby
swarles has quit [Read error: Operation timed out]
lggr has quit [Ping timeout: 244 seconds]
n_blownapart has joined #ruby
lggr has joined #ruby
carlyle has joined #ruby
<roadt>
hi, does T_ICLASS macro in ruby mean 'internal class'?
jrist is now known as jrist-afk
aces23up has quit [Remote host closed the connection]
aces1up has joined #ruby
<n_blownapart>
hi. interested to know about the second argument here, '\1 \1' . Is this code for the global variable $1 outputted from a capture? thanks: http://pastie.org/4906423
slicslak has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
khakimov has joined #ruby
n_blownapart has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
reset has joined #ruby
n_blownapart has joined #ruby
<ryanf>
it's specific to gsub, but it's the same idea, yeah
<ryanf>
you can't use $1 because the order of evaluation would be wrong
KindOne has quit [Changing host]
KindOne has joined #ruby
dmiller has joined #ruby
<rking>
n_blownapart: Note that '\1' comes out as "\\1". The backslash is a literal, interpreted specially by the gsub
minijupe has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
bradleyprice has quit [Remote host closed the connection]
lggr has joined #ruby
otters has quit [Ping timeout: 248 seconds]
slicslak has quit [Ping timeout: 240 seconds]
<n_blownapart>
ryanf: rking: not sure I understand. the (\w+) "captures" and ascribes the capture to a global variable, right?
<ryanf>
that is a side effect of the regex match
<n_blownapart>
but there is only one capture for the entire string (4 words) ^^
<n_blownapart>
ryanf: rking i.e. when I do puts $1 it returns 'here'
<rking>
n_blownapart: What's your question?
<roadt>
n_blownapart, 4 captures actually. final one is that 'here'.
colinbm has joined #ruby
stephenjudkins has joined #ruby
<Paradox>
heh
<Paradox>
i just wrote a ruby irc server in eventmachine
JC_SoCal has quit [Quit: Connection closed for inactivity]
<n_blownapart>
thanks roadt rking ryanf one second baffled here
<Paradox>
that ALSO has built in websockets
* rking
congratulates the /^r.{4}$/ posse.
<n_blownapart>
thing is roadt if I enter puts $2 I get nil
dmiller has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 260 seconds]
zigomir has joined #ruby
arturaz has joined #ruby
JonnieCache has joined #ruby
<n_blownapart>
wait rking is that the regex for rking roadt and ryanf or am I tripping?
chrishunt has joined #ruby
starship has quit [Ping timeout: 246 seconds]
<roadt>
n_blownapart, yeah, since you regex is '\b(\w+)', note that has only one capture.
<rking>
n_blownapart: Yeah, sorry.
_nitti has joined #ruby
<n_blownapart>
rking brilliant that is cool
lggr has joined #ruby
c0rn_ has joined #ruby
<n_blownapart>
roadt: thanks will ponder the '\1 \1' bit
<roadt>
n_blownapart, ["double every word here.".gsub(/\b(\w+) (\w+)/, "\\1 \\2") ,$1, $2]
colinbm has quit [Quit: colinbm]
<roadt>
btw, does channel have evalbot ?
<n_blownapart>
roadt looks cool will try it
<rking>
>>> "there was an evalbot. Do we still have him around?"
<rking>
Hrm
sarmiena_ has joined #ruby
<rking>
jrajav had it.
<ryanf>
>> "I thought it was two >>s"
<sarmiena_>
I would like to store a lambda in a class constant, then use it to call an instance method
_nitti has quit [Ping timeout: 246 seconds]
haxrbyte has joined #ruby
<sarmiena_>
however, defining the lambda at the class level doesn't allow me to call instance methods. how do i change the binding?
<roadt>
ok, i can see..
<rking>
ryanf: Yep, you're right.
fortysixandtwo has quit [Quit: fortysixandtwo]
vitor-br has quit [Ping timeout: 260 seconds]
<roadt>
n_blownapart, it didn't nothing, just show the point. $n is mapped to the regx's capture syntax (i.e. parenthesis).
<roadt>
s/ it didn't nothing/it did nothing/
lggr has quit [Ping timeout: 245 seconds]
monkegjinni has joined #ruby
<n_blownapart>
roadt I'm a bit confused but working on it. why the brackets?
<sarmiena_>
but obviously the block's binding is set to the class, not the instance of the class
cburyta has joined #ruby
haxrbyte has quit [Remote host closed the connection]
lggr has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
cburyta has quit [Ping timeout: 246 seconds]
<roadt>
sarmiena_, how can you call a instance method without any created instance , i mean, thru that class constant you defined..
arturaz has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 246 seconds]
<sarmiena_>
roadt: hmmm well the method isn't defined at the class level. but it is at the instance
<n_blownapart>
roadt: I still don't see why the capture is mapped from the right side (i.e. why is double and every in the $1 and $2 place?)
<n_blownapart>
why are they not* in the $1 and $2 places? ^^
ryanlecompte has quit [Remote host closed the connection]
maesbn has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
<roadt>
sarmiena_, then how you call lambda FOO? i mean Foo.FOO this is constant without any given instance.
<sarmiena_>
roadt: Foo.new.call_foo
ForevernadeAFK has joined #ruby
<sarmiena_>
roadt: as per the pastie
vitor-br has joined #ruby
<roadt>
sarmiena_, sorry. hmm..
Liquid_X has joined #ruby
lggr has joined #ruby
<sarmiena_>
roadt: it was suggested that i pass in the current instance to the lambda. which definitely solves the problem
<sarmiena_>
however, i thought there was a snazzy way to change a binding for a proc/lambda
falieson has quit [Quit: you're awesome!]
Mon_Ouie has quit [Ping timeout: 260 seconds]
HashNuke has joined #ruby
<HashNuke>
hey guys.
Forevernade has quit [Ping timeout: 244 seconds]
<HashNuke>
I'm trying to port a C library to Ruby. I found this line ((void)(x)). What does that do? set x to nil or unset the var?
maletor has joined #ruby
<roadt>
sarmiena_, seems lambda 's self is binded to class object. so.. don't see better way yet. unless context of lambda can be altered in someway .
seoaqua has joined #ruby
<sarmiena_>
roadt: yeah that's what i thought ruby allowed you to do. not that i wanted to necessarily do it. was more curious
<roadt>
n_blownapart, i'm not quite sture where you are stuck. '\b(\w+) (\w+)' have two brackets, 1st () gives $1, 2nd () gives $2. it is quite straightforward from my point of view.
lggr has quit [Ping timeout: 256 seconds]
dmiller has joined #ruby
<ryanf>
sarmiena_: yes, instance_eval
<ryanf>
would also solve your problem
<sarmiena_>
ryanf: i tried that, didn't seem to work
aganov has joined #ruby
<roadt>
ryanf, instance_eval 's receiver is still undeterimined in class body.
<ryanf>
did you change your pastie?
<sarmiena_>
ryanf: yeah. crap :O i can remake it for the sake of conversation, if you'd like
<sarmiena_>
sec
lggr has joined #ruby
<n_blownapart>
roadt sorry but why are the 3rd and 4th words of the string getting captured, and not the 1st and 2nd words: 'double' 'every'
<n_blownapart>
roadt thanks I guess its a strange quirk that needs to be memorized. many thanks
arturaz has joined #ruby
ryanlecompte has joined #ruby
chendo_ has quit [Ping timeout: 240 seconds]
diverdude has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<roadt>
n_blownapart, yeah, the point gsub is global substitution, it will search many times to replace every matched items. so $1 $2 have to show values of final match.
<sarmiena_>
ryanf: so should instance_eval work here, too?
<ryanf>
instance_eval would work fine except that you can't pass parameters into the block
<ryanf>
that's why you need instance_exec in this case
<sarmiena_>
ahhh i see
chendo_ has joined #ruby
ChampS666 has quit [Ping timeout: 255 seconds]
<sarmiena_>
thanks for the info. <3 metaprogramming
<n_blownapart>
roadt: got it that helps a lot. thank you
<roadt>
n_blownapart, np.
bartj3 has joined #ruby
FifthWall has quit [Quit: Zzzzzzzzzzzzz]
lggr has joined #ruby
<roadt>
instance_exec ,cool.
iamjarvo has quit [Ping timeout: 240 seconds]
mahmoudimus has joined #ruby
ChampS666 has joined #ruby
_mak has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
awestroke has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
n_blownapart has quit [Remote host closed the connection]
workmad3 has joined #ruby
bricker has quit [Quit: leaving]
lggr has joined #ruby
chendo_ has quit [Ping timeout: 244 seconds]
amskah has joined #ruby
amskah has quit [Client Quit]
margle has joined #ruby
chendo_ has joined #ruby
love_color_text has quit [Remote host closed the connection]
sspiff has joined #ruby
sspiff has joined #ruby
ryanf has quit [Quit: leaving]
ryanlecompte has quit [Remote host closed the connection]
love_color_text has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
zommi has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
verto|off is now known as verto
ForevernadeAFK is now known as Forevernade
lggr has joined #ruby
havenn has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
oz has quit [Ping timeout: 268 seconds]
havenn has quit [Ping timeout: 246 seconds]
_nitti has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
chimkan has quit [Quit: chimkan]
rubious has quit [Quit: Leaving...]
fortysixandtwo has joined #ruby
zii has quit [Read error: Connection reset by peer]
c0rn_ has quit []
_nitti has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
cezar has joined #ruby
cburyta has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
workmad3 has joined #ruby
_TB_ has joined #ruby
khakimov has joined #ruby
havenn has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
JonnieCache|work has joined #ruby
cburyta has quit [Ping timeout: 240 seconds]
verto is now known as verto|off
stephenjudkins has quit [Quit: stephenjudkins]
senny has joined #ruby
lggr has joined #ruby
minijupe has quit [Quit: minijupe]
luckyruby has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
daniels` has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
eubide has joined #ruby
piotr_ has joined #ruby
dhruvasagar has joined #ruby
maletor has joined #ruby
luckyruby has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
bartj3 has quit []
Virunga has joined #ruby
Virunga has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
ryanf has joined #ruby
heftig has quit [Quit: leaving]
bartj3 has joined #ruby
lggr has joined #ruby
elico has quit [Quit: Elico]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
elsifaka has joined #ruby
dr_bob has joined #ruby
_bart has quit [Ping timeout: 260 seconds]
xorgnak has joined #ruby
Morkel has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
luckyruby has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
eubide has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
leehambley has joined #ruby
fortysixandtwo_ has joined #ruby
maletor has joined #ruby
hoelzro|away is now known as hoelzro
und3f has joined #ruby
chimay has joined #ruby
leehambley has quit [Client Quit]
Banistergalaxy has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
xorgnak has quit [Remote host closed the connection]
fortysixandtwo has quit [Ping timeout: 256 seconds]
xorgnak has joined #ruby
fortysixandtwo_ has quit [Ping timeout: 240 seconds]
awestroke has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
fixl has joined #ruby
xorgnak has joined #ruby
Bosox20051 has quit [Remote host closed the connection]
Hamed-R has joined #ruby
xorgnak has quit [Remote host closed the connection]
JonnieCache|work has quit [Ping timeout: 248 seconds]
<A124>
Visual Basic.. wtf.
lggr has joined #ruby
awestroke has joined #ruby
<rking>
I couldn't care less about things like TIOBE rankings.
alem0lars has joined #ruby
<rking>
Just look at the garbage that ranks high.
moshee has quit [Ping timeout: 246 seconds]
<hoelzro>
+1
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<hoelzro>
TIOBE is full of crap
<rking>
I don't know how they do their polling, but whatever it is it really isn't a measurement of what languages are worth knowing.
xorgnak has quit [Remote host closed the connection]
prtksxna has joined #ruby
Elhu has joined #ruby
fortysixandtwo has joined #ruby
fortysixandtwo has quit [Read error: Connection reset by peer]
fortysixandtwo has joined #ruby
bluOxigen has joined #ruby
<ryanf>
I think it has to do with like google counts
jameshyde has quit [Remote host closed the connection]
<ryanf>
I forget, it is really dumb though
jimeh2 has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<hoelzro>
it uses search terms and such
ChampS666 has quit [Ping timeout: 240 seconds]
<A124>
It's only TIOBE related, nothing more.
quazimodo has quit [Ping timeout: 244 seconds]
flype has joined #ruby
lggr has joined #ruby
colinbm has joined #ruby
Banistergalaxy has joined #ruby
<shevy>
but it's the best we got!
<shevy>
second best is to count how many folks are in #ruby
<shevy>
then compare this to #perl and #python
<shevy>
the numbers there right now absolutely reflect the TIOBE ranking :(
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<A124>
Heh.
<shevy>
#ruby 627, #perl 634, damn #python 986
<shevy>
I don't know why python has so many more
<jokar>
shevy: hi
DrWhax has quit [Ping timeout: 264 seconds]
<jokar>
how are you?
<shevy>
hi jokar
<jokar>
:)
<shevy>
dunno, thinking about what to add
<shevy>
to a shell
Banistergalaxy has quit [Remote host closed the connection]
<hoelzro>
shevy: #python is always really busy when I'm in there
lggr has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
<shevy>
damn snakes
<shevy>
I wanna smoke em out
_nitti has joined #ruby
lggr has joined #ruby
<hoelzro>
why does it matter?
<hoelzro>
some people happen to prefer Python, some happen to prefer Perl
<hoelzro>
who cares what language they prefer?
<shevy>
a language with a lot momentum behind will become better
<hoelzro>
so as long as the Ruby community isn't stagnating, isn't that ok?
<shevy>
the language Io had some momentum ~4 years ago, now it's kinda dead
<hoelzro>
keep in mind: it's still ok to steal ideas from other communities =)
<jokar>
shevy : i want send an email for you
<shevy>
I dunno, rails changed a lot
fortysixandtwo_ has joined #ruby
<hoelzro>
meh, I wouldn't say Io had that much momentum...
_nitti has quit [Ping timeout: 246 seconds]
<shevy>
I mean, the rails community is not the same as the ruby community. there are partial overlaps
<shevy>
hehe
<shevy>
well it had around 50 people on #io :)
<shevy>
#gobolinux is funny, about 10-15 people on it although it is kinda dead. it's now more chatter about the good old days...
<shevy>
Title: "How Gobolinux failed to change the world."
<hoelzro>
I thought gobo was a cool idea
skogis has joined #ruby
Jork1 has joined #ruby
<shevy>
yeah
<jokar>
shevy: is it OK?
<shevy>
but it stagnated when the main developers started to work full time
fortysixandtwo__ has joined #ruby
fortysixandtwo_ has quit [Read error: Connection reset by peer]
<shevy>
jokar I'll read my mail only at late evening
fortysixandtwo has quit [Read error: Connection reset by peer]
fortysixandtwo__ is now known as fortysixandtwo
<shevy>
jokar you can write but I won't reply until it is late here
<jokar>
shevy :OK
<hoelzro>
shevy: that happens a lot =)
<shevy>
yeah :(
<hoelzro>
I worked on an RPG for two years...then I got a job.
<hoelzro>
and a girlfriend.
_bart has joined #ruby
<hoelzro>
double anti-development whammy.
<_bart>
hi
<hoelzro>
although I'm happy to have both ;)
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
d3vic3 has joined #ruby
<shevy>
what
<shevy>
you first got the job, then the girl?
<hoelzro>
yes
sarmiena_ has quit [Quit: sarmiena_]
<shevy>
pffft
<shevy>
women... always looking for men with jobs!
<hoelzro>
haha
<shevy>
about RPGs, I think that takes a LOT of time to develop and maintain
<hoelzro>
oh my yes
<_bart>
so I have two nokogiri documents, one has only the structure of the document and all the //text() removed, and one is just the original document parsed, now I'm looping through all levels using /*/*/*…etc on the second (original) document, but from time to time I want to check the structure of the element/node I'm currently on, which is in the other document? How do I loop through both the same time to keep track of the exact position of the node in
<_bart>
both documents or is there another way?
<hoelzro>
I made a *lot* of bad decisions in developing it
<hoelzro>
doing it in C++, doing it as a 3D game...
<_bart>
(be causing removing all the //text() on every single node separately is a performance-killer)
<shevy>
I once had an idea to use our own custom RPG, with the fantasy world we did (for almost 20 years by now, it has a lot of details), to also use a 3D world model of it and create a MUD... but it is way way way too much work for me
<_bart>
because*
<hoelzro>
my eyes were bigger than my stomach
<shevy>
hah I made bad decisions too, I rewrote it twice, then abandoned it
Xeago has quit [Remote host closed the connection]
<shevy>
but slowly I am beginning to believe that the only way to build something big is to focus on the smallest possible step first and advance from there
<hoelzro>
it was fun to work on though =)
<shevy>
_bart still clinging to XML?
lggr has joined #ruby
<_bart>
shevy: yes, this is quite a big project
<shevy>
_bart I can tell you, abandoning XML made my life better :)
<shevy>
ewww
<hoelzro>
it's still the largest piece of code I've ever written not for work, and I learned a lot in the process
<shevy>
sounds as if you will need a lot of XML
<shevy>
I think PHP got me into XML back then, when I iterated through the XML nodes
<_bart>
shevy: refactoring some parts too now, because I was lazy on the TDD and some bad decisions.
<shevy>
hoelzro, did you turn it into a gem? :)
<_bart>
shevy: but hey, I'm close to a perfect project now, but I only have to speed up the performance.
<hoelzro>
shevy: it was written in C++ and Lua =)
<shevy>
_bart, hehe
<shevy>
perfection is hard to reach
<shevy>
I try to go for 80% "perfection" usually
Hanmac has joined #ruby
Hanmac1 has quit [Ping timeout: 246 seconds]
<_bart>
shevy: let's say I'm in a random /*/*/*/* fourth level node, now how do I get the .inner_html of that node from the other document?
<shevy>
hmm
<_bart>
shevy: or should I just loop through both at the same time to never lose track
<shevy>
I usually write down things like that for my local knowledge-base
<shevy>
but I used REXML back then
<shevy>
nokogiri did not work for me
<_bart>
ah wait I think I already got it
daniels` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
DrWhax has joined #ruby
<shevy>
does this not use .each ??
<_bart>
just talking about things helps
<_bart>
maximum.times do |i|
<_bart>
so I can just use the index on both documents, silly me
josh^ has quit [Ping timeout: 240 seconds]
JoshWines has quit [Ping timeout: 240 seconds]
manizzle has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
josh^ has joined #ruby
JoshWines has joined #ruby
elaptics`away is now known as elaptics
lggr has joined #ruby
triptec has quit [Quit: triptec]
Vainoharhainen has joined #ruby
ephemerian has joined #ruby
wallerdev has quit [Quit: wallerdev]
parzorep has quit [Quit: parzorep]
Zai_ has joined #ruby
ryanf has quit [Quit: leaving]
Rochefort has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
monkegjinni has quit [Remote host closed the connection]
<hoelzro>
thanpolas: what kind of error gets raised in that situation?
morozovm has joined #ruby
leehambley has joined #ruby
lggr has joined #ruby
<thanpolas>
`read': unable to open file `v….` @ error/png.c/ReadPNGImage/3665 (Magick::ImageMagickError)
Hanmac has quit [Remote host closed the connection]
pskosinski has joined #ruby
burgestrand has joined #ruby
timmow has joined #ruby
Iszak has joined #ruby
parzorep has joined #ruby
tvw has joined #ruby
Xeago has joined #ruby
maasha has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
frogstarr78 has quit [Ping timeout: 256 seconds]
slava_dp has joined #ruby
slava_dp has joined #ruby
<slava_dp>
hey people. is there a way to trace script execution in the manner of ''bash -x'' ?
havenn has joined #ruby
<thanpolas>
hoelzpro got it, it wanted "rescue Exception => bang" instead of "SystemCallError"
<slava_dp>
or I could use loading file in irb with on-screen immediate execution. do you know a way?
<maasha>
I need something explained here. (0...n).each { |i| } is a slower way of iterating than a for loop because the first way is allocating an array?
frogstarr78 has joined #ruby
<hoelzro>
maasha: no array is allocated for that expression
<hoelzro>
0...n is a Range object
* maasha
cant find ruby book - suspect it is being used as support for the projector in the meeting room.
<hoelzro>
which is a lightweight enumerable
lggr has joined #ruby
workmad3 has joined #ruby
JonnieCache|work has joined #ruby
jokar has quit [Read error: Connection reset by peer]
icole has quit [Remote host closed the connection]
ephemerian has quit [Quit: Leaving.]
<slava_dp>
I found a way. irb < script.rb
havenn has quit [Ping timeout: 244 seconds]
leehambley has quit [Quit: leehambley]
claymore has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<claymore>
is gem supposed to be run as root?
<hoelzro>
claymore: it doesn't need to be
<claymore>
I'm trying to install rspec on opensuse 12.2, but running "gem install rspec" throws up "You don't have write permissions into the /usr/lib/ruby/gems/1.9.1 directory"
catphish has joined #ruby
<claymore>
running as root, it just hangs
<claymore>
there's an rspec package available, but I should surely be able to install it through gem... hmm
lggr has joined #ruby
timmow has quit [Quit: has left the building]
<maasha>
hoelzro: someone must be telling me lies. Benchmark shows that the range.each is a tad faster than a regular for loop.
timmow has joined #ruby
<hoelzro>
maasha: what does your for loop look like?
<hoelzro>
also, the compiler may optimize range.each because it's so common
<Kovensky>
on datamapper, but I'm getting the equivalent of 'undefined method 'new' for nil::NilClass'
fir_ed has quit [Read error: Connection reset by peer]
<Kovensky>
(equivalent because I'm uising create =p)
fir_ed has joined #ruby
AndChat| has joined #ruby
lkba has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
parzorep has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 244 seconds]
g-ram_ has quit [Quit: Computer has gone to sleep.]
otters has joined #ruby
<Kovensky>
hm nvm; it was an one-to-one relationship and apparently you don't get the convenience of a many-to-one =p
lggr has joined #ruby
JonnieCache has quit [Ping timeout: 240 seconds]
roadt has quit [Ping timeout: 252 seconds]
<JonnieCa1he>
calling all sublime users: cmd+U is "movement undo"
<JonnieCa1he>
youre welcome
yshh has joined #ruby
JonnieCa1he is now known as JonnieCache|work
<JonnieCache|work>
actually its "soft undo" apparently
resure has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<Kovensky>
it does seem that rsrc.many_to_many_relationship.create(...) isn't actually saving the created object though (the related SQL isn't printed to console until I call save on the return value) :S
Criztian has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
deadghost has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
Gal3rielol has quit [Ping timeout: 252 seconds]
F1skr has joined #ruby
flype has joined #ruby
duracrisis_ has joined #ruby
_nitti has joined #ruby
deryl has left #ruby [#ruby]
zommi has quit [Ping timeout: 265 seconds]
beiter has quit [Quit: beiter]
pgpkeys has joined #ruby
fyolnish has joined #ruby
pgpkeys has quit [Client Quit]
lggr has quit [Ping timeout: 244 seconds]
margle has joined #ruby
deryl has joined #ruby
deryl is now known as ddd
kjellski has joined #ruby
DuoSRX has joined #ruby
nari has joined #ruby
slainer68 has joined #ruby
ddd has quit [Client Quit]
_nitti has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
ddd has joined #ruby
fyolnish has quit [Ping timeout: 246 seconds]
mark_locklear has joined #ruby
frogprince_mac has quit [Ping timeout: 246 seconds]
justinmcp has joined #ruby
S3kx has quit [Quit: Leaving]
awestroke has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
cburyta has joined #ruby
lggr has joined #ruby
[Neurotic] has quit [Remote host closed the connection]
cburyta has quit [Ping timeout: 240 seconds]
iamjarvo has joined #ruby
jamaa has joined #ruby
cburyta has joined #ruby
fyolnish has joined #ruby
<jamaa>
hi all, I'm trying to use Logger, to write to screen and file messages. I wrote: logger = Logger.new(STDOUT);logger = Logger.new("mylog.log");logger.info "some text"; I connect through terminal to linux box, run my script but I don't get logging to the screen, only to the file. Can anyone help me with this ?
Takehiro has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
mohits has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
carlyle has joined #ruby
parzorep has joined #ruby
jcoglan has joined #ruby
DuoSRX_ has joined #ruby
DuoSRX has quit [Ping timeout: 260 seconds]
fixl has quit [Remote host closed the connection]
<invisime>
jamaa: the second time you assign to the logger variable, you overwrite the first one.
bartj3 has quit []
lggr has quit [Ping timeout: 252 seconds]
ndboost has joined #ruby
<jamaa>
invisime: I'm such a donkey! thanks. checking how to add different outputs to same logger
<invisime>
jamaa: yep. :-)
<invisime>
jamaa: (on the new approach, not on you being a donkey.)
lggr has joined #ruby
joofsh has joined #ruby
thillux has joined #ruby
Takehiro has quit [Remote host closed the connection]
roadt has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
ndboost has quit [Remote host closed the connection]
Takehiro has joined #ruby
<gregharvey>
this is something of a shot in the dark, but does anyone in here do commercial RoR development who would be interested in writing a Redmine plug-in?
iamjarvo has quit [Ping timeout: 240 seconds]
<JonnieCache|work>
gregharvey: ive had success on odesk with that kind of thing
<gregharvey>
JonnieCache|work: thanks for the tip, that might be worth a shot
ndboost has joined #ruby
<gregharvey>
hadn't occured to me :)
lggr has joined #ruby
<JonnieCache|work>
people often cite bad experiences with those sites, but that tends to be when theyre looking for php monkies
morozovm_ has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
frogprince_mac has joined #ruby
ndboost has quit [Remote host closed the connection]
<JonnieCache|work>
the quality of rails devs on those sites tends to be higher
<gregharvey>
well, we're an OSS company, so we should be able to pretty accurately spec what we want … we just don't have *any* Ruby people internally
<JonnieCache|work>
especially if you stipulate that they must supply a full test suite, that weeds out the clueless
<gregharvey>
so need to outsource this
nwest has joined #ruby
<gregharvey>
it's to link a scrum management tool we use that has a SOAP interface to Redmine, basically
morozovm has quit [Ping timeout: 246 seconds]
morozovm_ is now known as morozovm
MikeyV27 has joined #ruby
iamjarvo has joined #ruby
<gregharvey>
aaanyway, I'll pen a listing I guess :)
<JonnieCache|work>
you might have success here as well, it seems a bit quiet right now
<JonnieCache|work>
also theres the rubyonrails channel
undersc0re97 has quit [Quit: i use linux l o l]
jamaa has quit [Quit: Page closed]
<gregharvey>
ohhh, I should duck my head in there as well then
jokar has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 245 seconds]
oldB has joined #ruby
bartj3 has joined #ruby
joast has quit [Quit: Leaving.]
Criztian has quit [Remote host closed the connection]
lggr has joined #ruby
nanderoo has joined #ruby
joast has joined #ruby
ABK has quit [Ping timeout: 240 seconds]
mensvaga has joined #ruby
morozovm_ has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
dpk has joined #ruby
_nitti has joined #ruby
Asher has quit [Ping timeout: 260 seconds]
sebastorama has joined #ruby
pseudo has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
hgf has joined #ruby
ltsstar has joined #ruby
<pseudo>
Can someone that knows how ruby SSL works, help me figure out what is going wrong here?
<JonnieCache|work>
they extract it from the firefox source
AndChat| has quit [Quit: Bye]
tekacs has quit [Ping timeout: 245 seconds]
<pseudo>
it is a self signed cert
<heftig>
pseudo: then you need to add the cert to the cert store
lkba has joined #ruby
thecreators has quit [Remote host closed the connection]
<heftig>
or use http.verify_mode = OpenSSL::SSL:VERIFY_NONE
<heftig>
er, ::VERIFY_NONE
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
undersc0re97 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
EddieS_ has joined #ruby
<pseudo>
heftig: i was using that before, but i keep getting http bad requests back, even though my payload format is valid. this led me to think that my ssl was incorrect
<pseudo>
#<Net::HTTPBadRequest:0x0000000139ce88>
<pseudo>
and there is no body in the return message
hoelzro has quit [Ping timeout: 260 seconds]
hoelzro has joined #ruby
nigelb has quit [Ping timeout: 260 seconds]
verto|off is now known as verto
<steakknife>
pseudo: check that you're talking HTTPS to an HTTPS port. often that's the code for HTTP/HTTPS mismatch.
tekacs has joined #ruby
<pseudo>
steakknife: postive that 8444 is the right port
xiexie_11 has joined #ruby
dhruvasa1ar has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
nigelb has joined #ruby
Spooner has joined #ruby
<steakknife>
Can you curl it with the same headers / etc?
dhruvasagar has joined #ruby
timrom has joined #ruby
klaas has quit [Read error: Connection reset by peer]
changedNicks has joined #ruby
AndrzejK1zywda has joined #ruby
AndrzejKrzywda has quit [Ping timeout: 268 seconds]
timrom_ has quit [Ping timeout: 264 seconds]
klaas_ has joined #ruby
<pseudo>
I am fairly new to web programming, how can i curl over https?
<workmad3>
steakknife: or, more accurately, -k ignores *validating* the server cert
ramusara has quit [Client Quit]
<steakknife>
whatever
<workmad3>
steakknife: so if the common name is wrong, or the signing CA is unknown, -k ignores that, it still uses the cert for encryption
justinmcp has joined #ruby
lggr has joined #ruby
<steakknife>
anyone that knows how ssl works gets that, but thanks for the clarification.
<steakknife>
pseudo: any luck?
S1kx has joined #ruby
<pseudo>
not really getting anywhere with it. this is the command i am using: curl -v -k --key /var/lib/oat/APIclient.pem:password https://oat.unhwildhats.com:8444
<pseudo>
still failing with sslv3 alert bad certificate
timrom has joined #ruby
asuka has quit [Ping timeout: 255 seconds]
* workmad3
shudders
<workmad3>
I just googled that error, top results were about shibboleth
timrom_ has quit [Ping timeout: 246 seconds]
clocKwize has quit [Remote host closed the connection]
<workmad3>
pseudo: a quick check indicates that the error is from the server being unable to verify your client cert
bartj3 has joined #ruby
fredjean has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 252 seconds]
ananthakumaran1 has quit [Quit: Leaving.]
<steakknife>
pseudo: you need to run curl with more debug output, possibly need to fire up wireshark as well.
Neomex has joined #ruby
ananthakumaran has joined #ruby
elico has joined #ruby
timrom_ has joined #ruby
timrom has quit [Ping timeout: 240 seconds]
reuf has joined #ruby
<pseudo>
steakknife: i know that the certificates are valid. someone must have used ruby to do this before.
whitenoise has joined #ruby
<steakknife>
pseudo: Check the code in the SO link, it looks sensible.
asuka has joined #ruby
<steakknife>
pseudo: take out the bits about generating a cert, you already have that.
lggr has joined #ruby
xclite has joined #ruby
timrom has joined #ruby
JustinCampbell has joined #ruby
justinmcp has quit [Remote host closed the connection]
justinmcp has joined #ruby
timrom_ has quit [Ping timeout: 256 seconds]
awarner has joined #ruby
JonnieCache has joined #ruby
bmxpert1 has joined #ruby
haxrbyte has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
cdzombak has joined #ruby
<pseudo>
steakknife: changing the code around to make a request like that SO gives a slightly more meaningful error, but essentially the same thing.
<pseudo>
#<Net::HTTPBadRequest 400 Bad Request readbody=true>
<steakknife>
JonnieCache|work: perhaps a few hand-audits of a separate libscrypt would make it more palatable.
MikeyV27_ has quit [Ping timeout: 246 seconds]
<steakknife>
by few, that means like a $300k bug bounty
Criztian has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 248 seconds]
_Amen_Makaveli_ has quit [Remote host closed the connection]
gmci has quit [Ping timeout: 245 seconds]
ismaelga has joined #ruby
_Undeveloped_Con has joined #ruby
oldB has joined #ruby
_Undeveloped_Con has quit [Remote host closed the connection]
Undeveloped_Cont has joined #ruby
sent-hil has joined #ruby
lggr has joined #ruby
<matti>
steakknife: ?
<steakknife>
300k reward = lots of audits.
Hanmac has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
timrom_ has joined #ruby
<JonnieCache|work>
how the way i remember it colins implementation on that page was just a proof of concept
<JonnieCache|work>
maybe things have changed or maybe i misremembered
kjellski has joined #ruby
daniel_- has quit [Ping timeout: 240 seconds]
<steakknife>
JonnieCache|work: He bets his reputation and business upon it.
timrom has quit [Ping timeout: 256 seconds]
asteve has joined #ruby
ismaelga has quit [Remote host closed the connection]
<JonnieCache|work>
oh im not knocking colin percival. im not supid ;)
<JonnieCache|work>
*stupid
<JonnieCache|work>
:(
<steakknife>
Colin's a genius in the nerd's nerd sense.
<JonnieCache|work>
indeed
zigomir has quit [Ping timeout: 248 seconds]
<pseudo>
hey guys. i am getting there with this REST api. My next question is - how to I alter HTTP headers in a ruby http request. for example, i need to change Content-Type: application/x-www-form-urlencoded to Content-Type: application/json
<JonnieCache|work>
steakknife: know anything about the ruby wrapper for it?
<steakknife>
JonnieCache: There's two, I'm using gem scrypt
timrom has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
<JonnieCache|work>
iirc bcrypt-ruby has been audited
haxrbyte has joined #ruby
punkrawkR has joined #ruby
<JonnieCache|work>
i doubt that applies to the scrypt gem
<steakknife>
The fatal flaw in the HN comment logic is that 'nobody has ever hardware-optimized a bcrypt cracker' is a fallacy claiming an unknowable.
oldB has quit [Quit: oldB]
Elico1 has quit [Ping timeout: 248 seconds]
iori has quit [Remote host closed the connection]
pricees has joined #ruby
<rbennacer>
how can i grab with a regex all the text between '[' ']', example: [test1] [text1], i want to grab test1 and text1
haxrbyt__ has quit [Remote host closed the connection]
<JonnieCache|work>
steakknife: with the nsa comment i was referring to that incident where they forced intel (?) to use specific numbers in a crypto scheme
minijupe has joined #ruby
x82_nicole has joined #ruby
<JonnieCache|work>
everyone thought it was a backdoor, but decades later it turned out they were hardening it against a then unknown attack
lggr has quit [Ping timeout: 248 seconds]
<JonnieCache|work>
proving the nsa are decades ahead with crypto
<steakknife>
Lots of things work like that.
<steakknife>
Yeah, the nsa isn't all evil.
haxrbyte has joined #ruby
Elico1 has joined #ruby
<JonnieCache|work>
i reckon theyre more trustworthy than the other american three letter agencies
<steakknife>
Most of the good crypto research is classified.
leehambley has joined #ruby
<steakknife>
There's an enormous corpus of classified research most people have no clue about.
nightfalcon has joined #ruby
oz has joined #ruby
Poapfel has quit [Quit: WeeChat 0.3.7]
<JonnieCache|work>
have you seen some of it or is this second hand information?
<steakknife>
I'm not going to comment either way.
xiexie_11 has quit [Ping timeout: 260 seconds]
<JonnieCache|work>
those NDAs are pretty wideranging in their terms arent they
<JonnieCache|work>
although thats probably above a normal nda
lggr has joined #ruby
Ankhers has joined #ruby
locriani has quit [Remote host closed the connection]
pricees has quit [Quit: leaving]
haxrbyte_ has joined #ruby
drbawb has joined #ruby
_bart has quit [Quit: _bart]
baroquebobcat has joined #ruby
<rbennacer>
helkp plz
<xclite>
rbennacer: not fully tested. \[([^\[\]]*)\]
<steakknife>
There are NDAs and then are relationships. The latter hold more weight.
ataher has joined #ruby
margle has quit [Quit: Computer has gone to sleep.]
<iamjarvo>
what's the difference between "the".each_char and "the".chars
<JonnieCache|work>
indeed
Russell^^ has quit [Quit: Russell^^]
<steakknife>
each_char would probably imply it needs a block to iterate over.
<JonnieCache|work>
or returns an enumerator
haxrbyte has quit [Ping timeout: 246 seconds]
<iamjarvo>
chars withour a block returns an enumerator also
<rbennacer>
it is giving me the right result
imami|afk is now known as banseljaj
vieq_ has joined #ruby
<xclite>
rbennacer, in the limited playing i've done it seems to work. I didn't test nesting of [] or anything like that
<rbennacer>
i don't understand you regex though
Undeveloped_Cont has quit [Remote host closed the connection]
_bart has joined #ruby
Elico1 has quit [Ping timeout: 252 seconds]
_nitti has quit [Remote host closed the connection]
<rbennacer>
why does \[(.*)\] not work?
no_worries has joined #ruby
<hoelzro>
rbennacer: because that will match ] inside of [...] as well
<xclite>
rbennacer, because . is any char, so it will be greedy and except the brackets
baroquebobcat has quit [Client Quit]
<xclite>
rbennacer, that's why I used the character class [^\[\]]
<steakknife>
needs to be something like [^\]]
lggr has quit [Ping timeout: 240 seconds]
<steakknife>
try it on rubular
<rbennacer>
i am on rebular
_nitti has joined #ruby
nari has quit [Ping timeout: 256 seconds]
mercwithamouth has joined #ruby
<xclite>
rbennacer, my regexp is similar to yours, except that the grouping between () matches anything but the "[]" characters
MikeyV27 has joined #ruby
havenn has joined #ruby
_nitti has quit [Remote host closed the connection]
<rbennacer>
i though ^ was used to define the begining of the word
<ataher>
is there a way to specify what data types are in an array
<Hanmac>
imjarvo each_char and chars are the same on 1.9.+
_bart has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
lolmaus has quit []
<xclite>
rbennacer, it is outside of character classes
<xclite>
I use [] to create a character class
<xclite>
and ^ to negate it
<xclite>
a character class says "match anything in here"
<xclite>
so I said "Match anything that isn't '[' or ']'" using ^
rasbonics has joined #ruby
<rbennacer>
ooo
_nitti has joined #ruby
<rbennacer>
i didn't know we can do that
<rbennacer>
this is awesome
Elico1 has joined #ruby
<rbennacer>
thanks man
awestroke has quit [Remote host closed the connection]
<steakknife>
If the intention is to grab a pattern including nested [] exclusive of the outer: \[(.*)\]
<xclite>
rbennacer, regexps are nice. careful of overusing them, they can be a pain to decipher
CannedCorn has joined #ruby
_bart has joined #ruby
<CannedCorn>
hey guys, is yardoc fundamentally incompatable with github
<CannedCorn>
i want to put things like a tutorial in my project
<CannedCorn>
but github doens't have repo relative links
argoneus has joined #ruby
<argoneus>
Hello
mikepack has joined #ruby
<argoneus>
is it any easier to learn ruby / RoR if I know python/php?
<rbennacer>
so you are using this feature : [^ ] any single character NOT of set
awestroke has joined #ruby
<steakknife>
argoneus: yep
dhruvasagar has quit [Quit: Lost terminal]
<steakknife>
argoneus: check out rubymonks or ruby koans.
lggr has quit [Ping timeout: 240 seconds]
maesbn has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
slava_dp has quit [Quit: Bye]
mars__ has joined #ruby
maesbn has joined #ruby
drbawb has quit [Quit: WeeChat 0.3.9]
mucker has joined #ruby
chimkan has joined #ruby
dpk is now known as hmm
cardoni has joined #ruby
hmm is now known as dpk
rasbonics has left #ruby [#ruby]
indel has quit [Ping timeout: 252 seconds]
sspiff has quit [Remote host closed the connection]
jprovazn has quit [Remote host closed the connection]
<steakknife>
For the grand-prize trip for 2 to tahiti, what's the calling convention using ruby ffi to an objective c function: https://gist.github.com/3833327
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
rasbonics has joined #ruby
sspiff has quit [Remote host closed the connection]
bbttxu has quit [Read error: Connection reset by peer]
cardoni has quit [Client Quit]
cardoni has joined #ruby
<Hanmac>
i didnt even know that FFI support objective C :D
lggr has joined #ruby
<steakknife>
I've made some calls to other frameworks
booginga has joined #ruby
Elico1 has quit [Read error: Operation timed out]
dangerousdave has quit [Quit: Leaving...]
<steakknife>
but the objective-c styled ones don't seem to support any of the dozen or so permuations syntices i've tried.
colinbm has quit [Quit: colinbm]
indel has joined #ruby
<steakknife>
i might actually have the wrong framework as well.
maesbn has quit [Ping timeout: 260 seconds]
mahmoudimus has joined #ruby
<Hanmac>
i may not helpful for using FFI .... i wrote my ruby gems with c++ ...
colinbm has joined #ruby
bmxpert1_ has joined #ruby
<steakknife>
:D
<steakknife>
I'm trying to call standardUserDefaults, which has a signature of:
davidcelis has quit [Quit: K-Lined.]
<steakknife>
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation: 000000000000aac4 t +[NSUserDefaults(NSUserDefaults) standardUserDefaults]
_bart has quit [Ping timeout: 246 seconds]
multi_io has joined #ruby
beit has joined #ruby
Elico1 has joined #ruby
bmxpert1 has quit [Ping timeout: 246 seconds]
jcaudle has quit [Quit: jcaudle]
sebastorama has quit [Quit: Computer has gone to sleep.]
<multi_io>
have there ever been plans to somehow retain the API documentation at runtime (attach it to the respective runtime artifacts like classes, methods etc.), so they could easily be made available to tools like interactive shells and editors?
lggr has quit [Ping timeout: 240 seconds]
fredjean has joined #ruby
bmxpert1_ has quit [Client Quit]
jcaudle has joined #ruby
indel has quit [Read error: Operation timed out]
<multi_io>
have other languages done this?
argoneus has left #ruby ["Leaving"]
<steakknife>
multi_io: e.g., docstrings?
<Hanmac>
multi_io or do you mean something like "ri Array#map" ?
<ataher>
http://pastie.org/4909232 why am I getting a "rb:11:in `getNextPrime': undefined method `+@' for nil:NilClass (NoMethodError)" error
<steakknife>
pseudo: i bet net:http is adding the content type back
<pseudo>
steakknife: can i just make my own request without it?
<steakknife>
pseudo: this is the time to bust out the ruby source
carloslopes has quit [Quit: Leaving.]
lggr has joined #ruby
awarner has quit [Remote host closed the connection]
Elico1 has joined #ruby
ttt has quit [Ping timeout: 240 seconds]
bbttxu has joined #ruby
IrishGringo has joined #ruby
Takehiro has quit [Remote host closed the connection]
<steakknife>
pseudo: doesnt the client use a content-encoding header in the response and the server send a content-type in the response?
<steakknife>
s/response/request/
<Xeago_>
Accept: encodings
rubious has joined #ruby
aganov has quit [Remote host closed the connection]
Criztian has joined #ruby
leehambley has quit [Read error: Connection reset by peer]
DaniG2k has joined #ruby
<shevy>
Reject: liabilities
lggr has quit [Ping timeout: 246 seconds]
<DaniG2k>
can someone help me figure out what I'm supposed to look up on google to answer this question plz?
<DaniG2k>
Define a method attr_accessor_with_history that provides the same functionality as attr_accessor but also tracks every value the attribute has ever taken.
<pseudo>
page 9 shows what the http header should look like
<matti>
steakknife: I've seen some cruft there ;p You'd be surprised if it did ;]
<steakknife>
:)
<steakknife>
pseudo: the doc looks dodgy, might be a typo.
slainer6_ has joined #ruby
<pseudo>
ive tried with content-type, get a 400 error
fram has joined #ruby
Elico1 has quit [Ping timeout: 248 seconds]
<steakknife>
There's enough UML screen caps to choke an elephant. ;)
irleif has joined #ruby
<pseudo>
for that matter, everything i have tried has gotten a 400 error, so idk...
<pseudo>
they like their diagrams
<Hanmac>
ataher: look at this: ((lastPrime+lastPrime%2+1)..Float::INFINITY).step(2).find {|i| 3.step(i-1,2).none?{|ii|i%ii==0 }}.to_i
<Hanmac>
shevy you could look too
ndboost has quit [Remote host closed the connection]
<steakknife>
pseudo: alright, let's reenigne their crappy api :)
<ataher>
jebus thats hard to read lol
_mak has quit [Read error: Connection reset by peer]
Morkel has quit [Quit: Morkel]
ryanlecompte has quit [Remote host closed the connection]
<steakknife>
it's doable. beer to the first one that gets it.
<pseudo>
:P
<steakknife>
is there a sandbox somewhere to play with non-prod stuff?
jwallace has left #ruby [#ruby]
lggr has quit [Ping timeout: 260 seconds]
slainer68 has quit [Ping timeout: 246 seconds]
<pseudo>
i can open up a port
<steakknife>
as long as it's not going to get anyone intro trouble
ananthakumaran has joined #ruby
<steakknife>
you did a whois on my address, right? ;)
nignaztic has quit [Quit: WeeChat 0.3.2]
fram has quit [Ping timeout: 244 seconds]
<pseudo>
its on my home network, and its definately not production ;)
tnk1 has quit [Remote host closed the connection]
<steakknife>
good times
tnk1 has joined #ruby
morozovm has quit [Ping timeout: 256 seconds]
Virunga has joined #ruby
lggr has joined #ruby
drmegahertz has quit [Quit: leaving]
<ataher>
can I do a % mod on a bignum?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
wallerdev has joined #ruby
fram has joined #ruby
<steakknife>
ataher: try it in pry or irb. 1111111111111111111111111111111111111111111111111111111111111 % 6
irleif has quit [Quit: Computer has gone to sleep.]
_nitti has quit [Quit: Leaving...]
tnk1 has quit [Read error: Connection reset by peer]
zommi has quit [Quit: Leaving.]
tnk1 has joined #ruby
<ataher>
http://pastie.org/4909392 getting an error "rb:7:in `%': nil can't be coerced into Fixnum (TypeError)"
deadghost has joined #ruby
philcrissman has quit [Remote host closed the connection]
bartavelle has joined #ruby
bartavelle has left #ruby ["couic"]
<matti>
ataher: (x % i) == 0
<ataher>
oh
<ataher>
I got it
lggr has quit [Ping timeout: 248 seconds]
philcrissman has joined #ruby
<ataher>
my getNextPrime was not returning the next prime but printing it
tnk1 has quit [Read error: Connection reset by peer]
<matti>
Ah
<matti>
LOL
<matti>
;]
chimkan has quit [Quit: chimkan]
<ataher>
super ruby noob
tnk1 has joined #ruby
QKO_ has joined #ruby
<ataher>
I have a feeling ruby is going to mess up my coding in other languages. No semicolons, some methods can return the last evaluated item
<ataher>
...
xiexie_11 has quit [Ping timeout: 244 seconds]
chrishunt has quit [Ping timeout: 260 seconds]
<Xeago_>
everything returns the last evaluated thing
rbennacer has left #ruby ["Leaving"]
<matti>
ataher: I am doing C as of late.
<matti>
ataher: And was puting "end" everwhere.
<ataher>
lol
blazes816 has joined #ruby
lggr has joined #ruby
QKO has quit [Ping timeout: 240 seconds]
irleif has joined #ruby
jgrevich has joined #ruby
Jork1 has quit [Quit: Jork1]
<Hanmac>
its funny ... ruby has methods for gcd and lcm but no method to get the Prime factors ... very funny
colinbm has quit [Quit: colinbm]
tnk1 has quit [Read error: Connection reset by peer]
Trioke has joined #ruby
mahmoudimus has joined #ruby
tnk1 has joined #ruby
d3vic3 has quit [Ping timeout: 252 seconds]
lggr has quit [Ping timeout: 255 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
oldB has joined #ruby
d3vic3 has joined #ruby
Jork1 has joined #ruby
<tos9>
matti: I made sure to use endwise.vim to make sure they don't start popping up in my other languages :)
RJ3000_ has quit [Remote host closed the connection]
nat2610 has joined #ruby
lggr has joined #ruby
nat2610 has quit [Read error: Connection reset by peer]
nat2610 has joined #ruby
Jork1 has quit [Client Quit]
SegFaultAX|work has joined #ruby
bradleyprice has joined #ruby
jakzale has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
RJ3000_ has joined #ruby
tnk1 has quit []
<DaniG2k>
can someone help me understand what i need to do for this question plz
tnk1 has joined #ruby
<DaniG2k>
Define a method attr_accessor_with_history that provides the same functionality as attr_accessor but also tracks every value the attribute has ever taken.
<DaniG2k>
apparently I need to use class_eval for this
chimkan_ has joined #ruby
ataher has quit [Remote host closed the connection]
rehat has joined #ruby
deadghost has quit [Ping timeout: 244 seconds]
<matti>
tos9: ? ;]
<matti>
tos9: Oh... ends ;d
<matti>
Haha
lggr has quit [Ping timeout: 246 seconds]
aantix has joined #ruby
c0rn_ has joined #ruby
aantix has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
aantix has joined #ruby
saedelaere has joined #ruby
aantix has quit [Read error: Connection reset by peer]
NiteRain has joined #ruby
lggr has joined #ruby
samphippen has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
Xeoncross has joined #ruby
<saedelaere>
hi, I want to count words in a string. I am using a hash to do this but my keys do not seem to be strings but arrays with one string.
<leifmadsen>
afternoon all. I'm trying to track down an issue where the following line (http://bit.ly/QJHUyE) is called with 2 arguments and not 1. I think the issue is in an external library, but I'm having issues tracking down "what" is calling it incorrectly. The issue and backtrace are here (http://bit.ly/QKG4KE). Someone suggested pry-rescue the other day which looks really cool, but I wasn't able to figure out exactly how to modify
<leifmadsen>
the file.rb resource to make it work.
seoaqua has joined #ruby
Trioke_ has joined #ruby
<leifmadsen>
any pointers on how I can trace back what is calling 'diff' incorrectly would be incredibly helpful
c0rn_ has quit []
<Xeago_>
fields.each {|field| dataset=dataset.select field }
<Xeago_>
can I write that easier?
BadLarry has joined #ruby
<Xeago_>
asin, each iteration takes uses the previous result and calls select on it
chrishunt has joined #ruby
Trioke has quit [Ping timeout: 260 seconds]
Xeoncross has joined #ruby
<Xeago_>
s/takes/
Criztian has quit [Remote host closed the connection]
irleif has joined #ruby
cantonic_ has joined #ruby
ncr100 has joined #ruby
Elico1 has joined #ruby
fantazo has joined #ruby
gregharvey has left #ruby [#ruby]
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
lggr has quit [Ping timeout: 244 seconds]
davidcelis has joined #ruby
vlad_starkov has joined #ruby
lggr has joined #ruby
Trioke_ has quit [Ping timeout: 248 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
irleif has quit [Quit: Computer has gone to sleep.]
D4T has quit [Quit: Computer has gone to sleep.]
Elico1 has quit [Ping timeout: 256 seconds]
Trioke has joined #ruby
Eplemosen has joined #ruby
Xeoncross has quit [Quit: Ex-Chat]
khakimov has quit [Quit: Computer has gone to sleep.]
seoaqua has quit [Ping timeout: 256 seconds]
Elico1 has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
cardoni has quit [Quit: cardoni]
stim371 has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
<bnagy>
inject, by the sounds
mrsolo has joined #ruby
beit has quit [Quit: beit]
Elico1 has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
xiexie_11 has joined #ruby
Takehiro has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
<nyuszika7h>
any idea why require_relative gives this error?
<fbernier>
and try playing with the <=> operator in irb
Elico1 has joined #ruby
nwertman has quit [Quit: nwertman]
booginga5000 has quit [Ping timeout: 245 seconds]
Asher has joined #ruby
baphled has quit [Ping timeout: 260 seconds]
haxrbyte_ has quit [Ping timeout: 246 seconds]
elaptics is now known as elaptics`away
vieq_ has quit [Quit: Leaving]
lggr has quit [Ping timeout: 246 seconds]
<Hanmac>
fbernier & jakzale: "crazier it seems".split(" ").sort_by(&:length).join(" ")
vitoravelino is now known as vitoravelino`afk
Asher has quit [Client Quit]
gruwl has joined #ruby
<fbernier>
Hanmac: yup, that's better. Was just reading about sort_by
fram has quit [Ping timeout: 260 seconds]
frogprince has joined #ruby
<jakzale>
Hanmac: thanks
gruwl has quit [Client Quit]
h4mz1d has joined #ruby
leehambley has joined #ruby
fram has joined #ruby
Elico1 has quit [Ping timeout: 256 seconds]
Jamone has quit [Read error: Connection reset by peer]
<shevy>
hmm
<shevy>
guys
<shevy>
what is the difference between:
<shevy>
"5".to_i and Integer "5"
carloslopes has joined #ruby
Monie has joined #ruby
lggr has joined #ruby
<shevy>
the first one seems so much more natural to use...
<xclite>
shevy, I recall reading about there actually being a different, semantically
<xclite>
difference*
<Hanmac>
shevy: try both with "0xFF"
<fbernier>
shevy: try with non-number
Elico1 has joined #ruby
eldar has joined #ruby
<shevy>
aha
<shevy>
so via .to_i more information can potentially be lost than with Integer()
<Hanmac>
yeah, Float("1.0e-100") is cool too
nwertman has joined #ruby
<awestroke>
shevy: I use to_i when I want an integer no matter what, and I want 0 when the value isn't an integer
<awestroke>
if you want an exception when it's not a valid integer format, use to_int / Integer()
Takehiro has quit [Remote host closed the connection]
<awestroke>
oops there is no to_int
<Hanmac>
the methods like Float(), Integer(), Reational() can parse so freaking strings like "0xFF" and "1.0e-100" ... the to_* cant do it
gruwl has joined #ruby
<Hanmac>
awestroke there are to_int but they are for the numeric childs
lggr has quit [Ping timeout: 260 seconds]
gruwl has quit [Client Quit]
icole has joined #ruby
gruwl has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
bbttxu has quit [Quit: bbttxu]
sepp2k has quit [Ping timeout: 245 seconds]
samphippen has joined #ruby
sepp2k has joined #ruby
lggr has joined #ruby
djdb has quit [Remote host closed the connection]
kjellski has quit [Quit: This computer has gone to sleep]
Takehiro has joined #ruby
rakm has joined #ruby
fredjean has quit [Quit: Computer has gone to sleep.]
sent-hil has joined #ruby
wpaulson has joined #ruby
Asher has joined #ruby
My_Hearing has quit [Read error: Connection reset by peer]
arturaz has quit [Ping timeout: 246 seconds]
Elico1 has quit [Ping timeout: 245 seconds]
c0rn__ has joined #ruby
Elico1 has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 252 seconds]
My_Hearing has joined #ruby
darthdeus has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
iNerd has joined #ruby
gruwl has quit [Quit: Computer has gone to sleep.]
<lectrick>
How do I tell a block what a call to "self" inside it should refer to?
havenn has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
<lectrick>
In this case the block is saved as an instance attribute, but I want any call to "self" in the block to refer to the instance itself that the attribute is defined on
mikepack has quit [Remote host closed the connection]
Elico1 has quit [Read error: Operation timed out]
Criztian has quit []
lggr has joined #ruby
<Hanmac>
@obj.instance_eval{ ... }
alfism has joined #ruby
daniel_hinojosa has quit [Read error: No route to host]
cpetzold has joined #ruby
cpetzold has left #ruby [#ruby]
leehambley has quit [Quit: leehambley]
steffes has joined #ruby
cj3kim has joined #ruby
<lectrick>
So @obj.instance_eval{ @obj.attribute_containing_a_block.call } ?
Elico1 has joined #ruby
daniel_hinojosa has joined #ruby
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
skaczor has quit [Ping timeout: 246 seconds]
IrishGringo has quit [Ping timeout: 240 seconds]
samphippen has quit [Ping timeout: 246 seconds]
snearch has joined #ruby
steffes_ has joined #ruby
cardoni has joined #ruby
fyolnish has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
steffes_ has quit [Remote host closed the connection]
daniel_hinojosa has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
mercwithamouth has quit [Ping timeout: 244 seconds]
jgrevich_ has joined #ruby
jcoglan has quit [Ping timeout: 245 seconds]
steffes has quit [Ping timeout: 248 seconds]
jgrevich has quit [Ping timeout: 240 seconds]
jgrevich_ is now known as jgrevich
Elico1 has quit [Quit: Elico1]
fyolnish has quit [Ping timeout: 260 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
irleif has joined #ruby
daniel_hinojosa has joined #ruby
mikepack has joined #ruby
vlad_starkov has quit [Ping timeout: 245 seconds]
pdtpatrick has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
samphippen has joined #ruby
gruwl has joined #ruby
<rehat>
is there a onliner to convert an array of string numbers into an array of numbers
xiexie_11 has joined #ruby
<steakknife>
%w|1 2 3 4|.map(&:to_i)
fyolnish has joined #ruby
gruwl has left #ruby [#ruby]
<TTilus>
lectrick: no, @obj.instance_eval @obj.attribute_containing_a_block
<TTilus>
lectrick: iirc
<rehat>
steakknife: thanks
iamjarvo has joined #ruby
ndboost has joined #ruby
<rehat>
what is this operator called "$:"
whaley has quit [Remote host closed the connection]
<ndboost>
in ruby how can i properly do the following code, without it adding two sets of quotes around class="frontend-page"
Rydefalk has quit [Read error: Connection reset by peer]
<TTilus>
rehat: unary ampersand in param list tells ruby thet the particular param is to be treated the block param
<TTilus>
rehat: even if it is not a block
samphippen has quit [Ping timeout: 246 seconds]
<lectrick>
rehat: google "method to proc"
<blazes816>
ndboost: try #rubyonrails, but probably you want to call #html_safe on the string
<TTilus>
rehat: and in case it is not, #to_proc is called on it to make it one
sarmiena_ has joined #ruby
ken_barber has joined #ruby
<steakknife>
uncut theatrical version: ["1", "2", "3", "4"].map do |x| x.to_i end
<rehat>
TTilus: thanks dude
<steakknife>
do ... end is a proc
fyolnish has quit [Ping timeout: 264 seconds]
Rydefalk_ has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
mgates has joined #ruby
nightfalcon has quit [Quit: Lost terminal]
<TTilus>
rehat: and Symbol#to_proc does Proc.new { |x| x.send self }
g-ram has joined #ruby
<canton7>
steakknife, it's a block, surely?
Takehiro has quit [Remote host closed the connection]
Jay_Levitt has joined #ruby
<steakknife>
And what type is a &block?
whaley has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
Asher has quit [Ping timeout: 246 seconds]
<canton7>
steakknife, I'm getting lambdas and procs muddled in my tiredness - ignore me!
Vainoharhainen has joined #ruby
<TTilus>
steakknife: there is a suble difference, do ... end is a block and it gets converted to proc on the way
pfaff has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 264 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk_ has joined #ruby
ChampS666 has joined #ruby
<steakknife>
And there are a whole bunch of non-closure lexical anomalies between { } and do end
Ankhers has quit [Remote host closed the connection]
<steakknife>
Don't get me started, or i'm liable to submit a patch
Asher has joined #ruby
<steakknife>
;)
leehambley has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<TTilus>
canton7: lambda returns the block given to it as proc
Rydefalk has joined #ruby
graft has quit [Quit: leaving]
Vainoharhainen has quit [Client Quit]
ChampS666 has quit [Client Quit]
cardoni has quit [Quit: cardoni]
senny has joined #ruby
<canton7>
really? I had it in mind the main proc/labmda difference was the scope of break/return, and some subtle stuff to do with argument omissions
Rydefalk_ has quit [Read error: Connection reset by peer]
<steakknife>
Proc binding should be faster, they are uses so often.
samphippen has joined #ruby
<steakknife>
used*
<steakknife>
Yeap.
ForevernadeAFK has joined #ruby
leehambley has quit [Read error: Connection reset by peer]
lggr has joined #ruby
<steakknife>
There are i think 5 different lambda/proc/Proc constructions that result in about 3 thingies (technical term), depending on ruby ver/platform.
_nitti has quit [Remote host closed the connection]
niklasb has joined #ruby
<canton7>
so the 'proc' and 'Proc.new' methods turned a block into a proc (in 1.9, 'proc' in 1.8 did something different), but a lambda behaved more like a method
<steakknife>
Anyone every write a combinator library out of procs?
Asher has quit [Client Quit]
<steakknife>
I'm looking for a combinator table, esp the universal combinator.
<steakknife>
iota preferred.
ltsstar has joined #ruby
<TTilus>
canton7: you are right, i was confused, too late apparently
sarmiena_ has quit [Quit: sarmiena_]
asuka has quit [Ping timeout: 244 seconds]
My_Hearing has quit [Read error: Connection reset by peer]
Forevernade has quit [Ping timeout: 260 seconds]
pfaff has joined #ruby
<steakknife>
ι = λ x . x (λ f g y . f y (g y)) (λ y z . y) :D
Rydefalk_ has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
GoGoGarrett has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
<notbrent>
what is the difference between self.class.new and just new?
enroxorz-work has quit [Read error: Connection reset by peer]
Rydefalk_ has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 248 seconds]
<TTilus>
steakknife: jimweirich did his ycombinator talk at frozenrails, saw it there
Rydefalk has joined #ruby
<steakknife>
ycombinator, bah, too simple ;)
<blazes816>
zcombinator
<steakknife>
yc was a joke, now it's a business school
<TTilus>
notbrent: self.class.new and self.new (which "just new" is) call new on diffderent objects, except when self is Object
Takehiro has joined #ruby
<steakknife>
TTilus: anyhow, pg needs a good jab every now and then.
Rydefalk has quit [Read error: Connection reset by peer]
Rydefalk has joined #ruby
<TTilus>
steakknife: pg? (sorry im slow now)
ken_barber has quit [Remote host closed the connection]
SegFaultAX|work has quit [Ping timeout: 260 seconds]
<tbrock>
anyone?
daniel_-_ has joined #ruby
ledao1 has quit [Read error: Connection timed out]
<TTilus>
rakm: ah, sorry, its syntactic sugar, you should be looking for pipe operator
apok_ has joined #ruby
apok has quit [Remote host closed the connection]
apok_ is now known as apok
bmxpert1 has joined #ruby
advorak has joined #ruby
bmxpert1 has quit [Client Quit]
<rakm>
ahh thanks TTilus googleing "single pipe equals ruby" did the trick.
daniel_- has quit [Ping timeout: 240 seconds]
<rakm>
although still most of the resluts are for double pipe equals
lggr has joined #ruby
jcaudle is now known as jcaudle_
<steakknife>
rakm: trick to remembering double operator || is logical, single operator | is binary.
g-ram has quit [Quit: Computer has gone to sleep.]
irleif has quit [Quit: Computer has gone to sleep.]
<steakknife>
x = 2 ; x |= 1 ; x # => 3
Asher has quit [Quit: Leaving.]
jcaudle_ is now known as jcaudle
irleif has joined #ruby
<rakm>
right. I'm new to this whole programming thing so I don't quite understand binary operators yet, but my question was more about how to look these up since you can't just google the actual operator
skaczor has joined #ruby
<rakm>
thanks the for the tip
<Hanmac>
steakknife: i = 4; [1,2,3].each {|i| }; i #=> quess i after the loop
gazler has joined #ruby
heftig has joined #ruby
robustus has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
soulisson has joined #ruby
<steakknife>
rakm: binary usually means dealing with integers, boolean means true, false
Rydefalk has quit [Read error: Connection reset by peer]
kirun has joined #ruby
philcrissman has quit [Remote host closed the connection]
<steakknife>
Hanmac, go troll someone else that's not busy.
<steakknife>
But thanks anyhow :)
xorigin has joined #ruby
macmartine has joined #ruby
<steakknife>
Ignore banhammer complete.
sarmiena_ has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
philcrissman has joined #ruby
<TTilus>
rakm: check web.njit.edu/all_topics/Prog_Lang_Docs/html/ruby/syntax.html#assign on self assignment
xorigin has left #ruby [#ruby]
<wmoxam>
Hanmac: I would guess 3
rbennacer has joined #ruby
<fbernier>
4
<steakknife>
wmoxam ignored
<TTilus>
rakm: a op= b is a shorthand for a = a op b
awarner has quit [Ping timeout: 252 seconds]
chimay has quit [Quit: WeeChat 0.4.0-dev]
pseudo has quit [Ping timeout: 246 seconds]
<wmoxam>
lolwat
<rakm>
got it. thanks TTilus
fyolnish has joined #ruby
<rbennacer>
i am using CSV library to generate a csv file , the problem is in some attribute the character ',' exist and it is creating problems when i try to open it with excel. ex: "rege ,greg re " wil be devided in 2 column and it shoudl be in one
<steakknife>
needs escaping
<Hanmac>
wmoxam & fbernier you are both right, depending on the ruby version
awarner has joined #ruby
<steakknife>
excel IIRC quotes csv in that case
lggr has joined #ruby
<wmoxam>
Hanmac: that changed in 1.9?
<steakknife>
"a, a, a",b,"c, ,c ,c c"
c0rn__ has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
<fbernier>
I started ruby and 1.9 was already out :)
<booyakah>
sqlite.rb:9:in `<main>': undefined method `>' for [[7]]:Array (NoMethodError)
Rydefalk_ has quit [Read error: Connection reset by peer]
<booyakah>
it complains on the operator greater then
<booyakah>
what am i doing wrong?
irleif has joined #ruby
Rydefalk has joined #ruby
_nitti has joined #ruby
<wmoxam>
booyakah: exactly what the error message says
<wmoxam>
booyakah: you're invoking '>' on an array
<wmoxam>
booyakah: on line 9
<booyakah>
oohhh of course
<booyakah>
it's been a while since I coded
<booyakah>
i'm rusty as shit
Rydefalk_ has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
<booyakah>
(and i've never done ruby)
wpaulson has quit [Ping timeout: 256 seconds]
Rydefalk has quit [Read error: Connection reset by peer]
relative has quit [Quit: Page closed]
<awestroke>
booyakah: Use irb ALOT. It's awesome
<awestroke>
just paste in the line that doesn't work, play around with it until it works, copy it back
Jork1 has quit [Quit: Jork1]
<booyakah>
i know irb is great i haven't learned it properly yet though
Rydefalk has joined #ruby
Rydefalk_ has quit [Read error: Connection reset by peer]
<booyakah>
but i couldn't just post that line in my example?
Rydefalk has quit [Read error: Connection reset by peer]
My_Hearing has quit [Ping timeout: 260 seconds]
Vainoharhainen has joined #ruby
Rydefalk has joined #ruby
ledao has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
_nitti has joined #ruby
<steakknife>
booyakah: get pry. it's better.
Chryson has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
<booyakah>
steakknife, thanks will look into it
<steakknife>
booyakah: gem install pry pry-gist
carloslopes has joined #ruby
Meon has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
<wmoxam>
steakknife ignored
jenrzzz has quit [Ping timeout: 246 seconds]
mercwithamouth has quit [Ping timeout: 260 seconds]
rippa has quit [Ping timeout: 256 seconds]
ananthakumaran has quit [Quit: Leaving.]
rburton- has joined #ruby
lggr has joined #ruby
irleif has quit [Quit: Computer has gone to sleep.]
iNerd has quit [Quit: iNerd]
invisime has quit [Quit: Leaving.]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
jcaudle has quit [Quit: jcaudle]
Juul has joined #ruby
SegFaultAX|work has joined #ruby
<lectrick>
If I pass a block to object.instance_eval, and that block takes 1 parameter, why is the 'object' yielded to the block, when 'self' inside the block refers to the object, anyway?
<lectrick>
Hanmac: ^
<lectrick>
Basically I want to instance_eval a block which takes an arg, but I want it to take MY arg and not yield self by default
elux has quit [Quit: Leaving...]
scx has quit [Ping timeout: 240 seconds]
fredjean has joined #ruby
johnmilton has joined #ruby
lggr has quit [Ping timeout: 264 seconds]
scx has joined #ruby
ndboost has quit [Remote host closed the connection]
stim371 has joined #ruby
<Hanmac>
and what arg are you want to yield?
lggr has joined #ruby
burgestrand has joined #ruby
<heftig>
lectrick: use instance_exec
c0rn_ has joined #ruby
asuka has quit [Ping timeout: 256 seconds]
<lectrick>
Hanmac: I am storing a block which takes an arg, and I want to be able to call it later with an arg, and have self be the instance with the instance variable holding the block.
cj3kim has quit [Quit: This computer has gone to sleep]
cj3kim has joined #ruby
asuka has joined #ruby
<lectrick>
heftig: oh wow, i think that's the answer. "Unfortunately, instance_eval does not currently allow you to pass parameters.". You know, if I had a way to beer people over the Internet, I'd be poor.
JonnieCache|work has joined #ruby
mgates has quit [Quit: mgates]
mgates has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
sspiff has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
cj3kim has quit [Client Quit]
asuka has quit [Remote host closed the connection]
asuka has joined #ruby
pseudo has joined #ruby
elux has joined #ruby
Asher has joined #ruby
rbennacer has left #ruby ["Leaving"]
lggr has joined #ruby
skaczor has quit [Ping timeout: 252 seconds]
<lectrick>
heftig: I made it work thanks to that. Tests pass :) Hanmac: what heftig said worked. I basically needed an instance_eval that takes params, which is what instance_exec is.
<lectrick>
ok is it 'params' or 'args' because I seem to use those interchangeably but I know there is a zealot out there who will happily correct me
_Mon_Ouie_ has joined #ruby
piotr_ has joined #ruby
heftig has quit [Quit: leaving]
Jork1 has joined #ruby
_Mon_Ouie_ is now known as Mon_Ouie
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
piotr__ has quit [Ping timeout: 246 seconds]
c0pp3rnick has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
My_Hearing has quit [Ping timeout: 260 seconds]
<c0pp3rnick>
how can I send POST request with arguments shoved in the request body, and not query params (GET-like behaviour)
Mon_Ouie has quit [Read error: Connection reset by peer]
<hoelzro>
c0pp3rnick: sorry, could you repeat that?
<hoelzro>
EPARSE
JonnieCache|work has quit [Ping timeout: 260 seconds]
Zai_ has joined #ruby
tbrock has quit [Quit: Leaving]
<c0pp3rnick>
hoelzro, I'm using 'net/http' to send POST/GET requests
xiexie_11 has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 256 seconds]
<hoelzro>
ok
geekbri has quit [Remote host closed the connection]
<c0pp3rnick>
GET request params are shoved in URL, like in google ?q=<something>&lang=en&somethingelse=<somethingelsest>
Mon_Ouie has joined #ruby
iamjarvo has joined #ruby
dekroning has joined #ruby
<c0pp3rnick>
but the problem is that I get 414 errors when using POST too
<c0pp3rnick>
(URL too long)
whaley has quit [Remote host closed the connection]
<c0pp3rnick>
so I'd like to send POST params in a request body
<hoelzro>
I'm sorry; I don't follow. How is that different from a regular POST?
whaley has joined #ruby
steffes has joined #ruby
yoklov has joined #ruby
lggr has joined #ruby
heftig has joined #ruby
<workmad3>
c0pp3rnick: simple, set the body for a post request rather than the query string
<workmad3>
c0pp3rnick: check out the docs for net/http, it's in there :P
<c0pp3rnick>
okay, so it was RTFM after all, thanx workmad3 =)
<workmad3>
(which I know, because that's where I have to go every time I want to use the f***ing library because it's annoying)
macmartine has quit [Quit: Computer has gone to sleep.]
ken_barber has joined #ruby
<workmad3>
c0pp3rnick: you could also consider a library like httparty, which wraps net/http in a nicer, more ruby-esque syntax that's easier to write :)
<lectrick>
ok, how many use cases are better off using each_with_object instead of inject? FIGHT!
<c0pp3rnick>
workmad3, thanx, will check it out
snearch has quit [Quit: Verlassend]
skaczor has joined #ruby
* lectrick
is relieved that he can wave his nerd flag all over the fucking place in here, thank you all
chimkan_ has joined #ruby
stephenjudkins has joined #ruby
<dekroning>
I've got a question about what type of variable "random_num" is in the following example: http://pastie.org/4910569
<workmad3>
lectrick: all the use cases where each_with_object is right
<hoelzro>
dekroning: yes?
iamjarvo has quit [Ping timeout: 245 seconds]
Takehiro has quit [Remote host closed the connection]
thillux_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Targen has joined #ruby
Xeago has joined #ruby
Roa has quit [Ping timeout: 256 seconds]
iNerd has joined #ruby
<lectrick>
workmad3: Of course.
cakehero has quit [Quit: Computer has gone to sleep.]
Guedes is now known as Guedes_out
nanderoo has quit [Quit: Leaving.]
g-ram has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
<dekroning>
hoelzro: is there a specific name for such variable? it's not an instance variable right? local class variable perhaps ?
skaczor has quit [Ping timeout: 246 seconds]
<kenneth>
hey, how would you spec something with spec as "not throwing an exception"
DrShoggoth has joined #ruby
thillux has quit [Ping timeout: 260 seconds]
<hoelzro>
I'd say it's a local variable
<rehat>
do I need to know about ruby dbi if I am using rails?
iamjarvo has joined #ruby
adamkittelson has quit [Remote host closed the connection]
lggr has joined #ruby
<Hanmac>
rehat yes you should
<dekroning>
hoelzro: local variable in which scope?
<hoelzro>
dekroning: the class body
fermion has quit [Ping timeout: 256 seconds]
s0ber_ has joined #ruby
<dekroning>
hoelzro: so what's the difference in variable type between random_num and RANDOM (besides that it's a constant)
steffes_ has joined #ruby
<dekroning>
hoelzro: because line #9 I can't replace it with "random_num" it will say undefined local variable
<hoelzro>
dekroning: afaik, random_num goes out of scope after the class body is done
johnmilton has quit [Quit: peace]
<hoelzro>
whereas RANDOM will not
<workmad3>
dekroning: 'class', 'module' and 'def' are all ruby keywords that create a new scope for local variables
<booyakah>
I've tried for like 30 minutes now googling and stuff but I can't figure it out
lggr has quit [Ping timeout: 260 seconds]
_bart has joined #ruby
nat2610 has quit [Quit: Leaving.]
steffes has quit [Ping timeout: 248 seconds]
sqlbyme has joined #ruby
<Hanmac>
booyakah:change "if result > 0" to "if result[0][0] > 0"
lteo has quit [Quit: leaving]
<booyakah>
wtf really?
<booyakah>
i did "if result[0] > 0"
piotr__ has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
lupine_85 has quit [Ping timeout: 260 seconds]
nat2610 has joined #ruby
sqlbyme has quit [Client Quit]
MikeyV27 has quit [Ping timeout: 246 seconds]
piotr_ has quit [Ping timeout: 260 seconds]
sqlbyme has joined #ruby
fyolnish has joined #ruby
lggr has joined #ruby
the_jeebster1 has joined #ruby
dmiller_ has joined #ruby
Coolhand has quit [Ping timeout: 246 seconds]
iamjarvo has quit [Ping timeout: 245 seconds]
sarmiena_ has quit [Quit: sarmiena_]
Araxia has joined #ruby
g-ram has joined #ruby
<the_jeebster1>
I've got an array x = [1, 2, 3]. Is there any same-line shorthand notation to assign the returned values of a detect to another variable x.detect { |n| n > 2 }
<the_jeebster1>
in other words, can I say if a value is returned from x.detect { |n| n > 2 }, assign it to y all in one line?
nat2610 has quit [Client Quit]
fram has quit [Remote host closed the connection]
minijupe has joined #ruby
Rydefalk has quit [Ping timeout: 264 seconds]
<Hanmac>
like this?
<Hanmac>
y = x.detect { |n| n > 2 }
MikeyV27_ has quit [Ping timeout: 246 seconds]
minijupe has quit [Client Quit]
Asher has quit [Quit: Leaving.]
fyolnish has quit [Ping timeout: 260 seconds]
_nitti has quit [Remote host closed the connection]
Rydefalk has joined #ruby
<the_jeebster1>
yeah. that was dumb :)
<the_jeebster1>
mid-day brainfart
<iNerd>
hmm
<iNerd>
bundler is being a dick, won't find a locally installed gem
lggr has quit [Ping timeout: 255 seconds]
colinbm has joined #ruby
Eplemosen has quit [Quit: NOPE]
samuel02 has joined #ruby
daniel_hinojosa has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
irleif has joined #ruby
lggr has joined #ruby
a_a_g has quit [Quit: Leaving.]
wallerdev has quit [Quit: wallerdev]
_bart has quit [Quit: _bart]
<booyakah>
Hanmac, that seems to work in that example. Thank you
bbttxu has quit [Ping timeout: 248 seconds]
<booyakah>
However, I have another weird problem
<workmad3>
iNerd: is the gem added to your Gemfile?
<booyakah>
I am trying to make a IRC bot with Cinch
<iNerd>
sigh
wedtm is now known as wedtm|away
Sulaweyo1 has joined #ruby
<iNerd>
forgot the comma before version number
<iNerd>
it's always something simple that takes you ages
<rehat>
do I need to do something special for the require 'socket' when running it through the command line?
stan_man_can has joined #ruby
nat2610 has joined #ruby
Sulaweyo1 is now known as informatician
yoklov has joined #ruby
<stan_man_can>
Is there anything similar in Ruby to PHP's strtotime? I have a bunch of times that are formatted kind of randomly, it could be "5 mins" "5 minutes" "1 hour" ect.
lggr has joined #ruby
<booyakah>
Hanmac, no more ideas?
<Hanmac>
i dont know :(
<booyakah>
okay
<booyakah>
thanks anyway
hoelzro is now known as hoelzro|away
informatician is now known as zenformatics
<booyakah>
this is so weird
robustus has quit [Ping timeout: 255 seconds]
<stan_man_can>
PHP I could do something like time() - strtotime("+$delay") and it returns the time in seconds
<stan_man_can>
so if $delay = "1 hour" then it reruns 3600, $delay = "5 mins" it returns 300
zenformatics has quit [Client Quit]
mark_locklear has quit [Remote host closed the connection]
<blazes816>
stan_man_can: active support has a bunch of junk of that volition
zenformatics has joined #ruby
<blazes816>
stan_man_can: actually, check out Chronic
chrisja has quit [Quit: leaving]
_nitti_ has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
<Hanmac>
but i think if you want php like stuff you need chronic ...
<blazes816>
yes!
baphled has joined #ruby
gqlewis has quit [Remote host closed the connection]
wargasm1 has joined #ruby
wargasm has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 244 seconds]
slainer68 has joined #ruby
steffes_ has quit [Remote host closed the connection]
robertotauille has quit [Quit: Leaving...]
t0rc has joined #ruby
sarmiena_ has joined #ruby
lggr has joined #ruby
adamkittelson has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
adamkittelson has quit [Remote host closed the connection]
zii has joined #ruby
griffindy has joined #ruby
jenrzzz has joined #ruby
gmci has quit [Ping timeout: 246 seconds]
Mon_Ouie has quit [Ping timeout: 245 seconds]
gmci has joined #ruby
Mon_Ouie has joined #ruby
asteve has quit []
Araxia has quit [Read error: Connection reset by peer]
_nitti has joined #ruby
cakehero has joined #ruby
BinaryMaster has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
cj3kim has joined #ruby
mgates has quit [Quit: mgates]
<BinaryMaster>
Question: /usr/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED) … I can hit the url in a browser any ideas what may cause this?
<blazes816>
do you work for them? i.e. are you on their network?
<BinaryMaster>
Yes
<blazes816>
talk to ops
<blazes816>
you guys are down
<BinaryMaster>
lol … Okay but I don't know if I will listen to myself :)
<blazes816>
also sitemap.xml is actually html
linoj has quit [Quit: linoj]
<blazes816>
haha
<BinaryMaster>
can you hit the root
<blazes816>
you ops people
<blazes816>
nope
<blazes816>
not at all
<BinaryMaster>
interesting
cantonic has quit [Read error: Connection reset by peer]
<BinaryMaster>
thank you
<blazes816>
np
<blazes816>
good luck
IrishGringo has joined #ruby
cantonic has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
irleif has quit [Quit: Computer has gone to sleep.]
sarmiena_ has quit [Quit: sarmiena_]
sarmiena_ has joined #ruby
Virunga has quit [Remote host closed the connection]
darule has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
_bart has left #ruby [#ruby]
pseudo has quit [Ping timeout: 255 seconds]
<BinaryMaster>
well that was fun is it up for you now?
aetaric has quit [Quit: Got ZNC?]
sent-hil has joined #ruby
<blazes816>
BinaryMaster: you're up!
gmci has quit [Ping timeout: 240 seconds]
g-ram has joined #ruby
<BinaryMaster>
good :)
solidus-river has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<solidus-river>
if i wanted to regex checking for the end of a string to match a specific string how would i do that using ruby
<solidus-river>
i'm used to *endname
<solidus-river>
but that seems invalid according to rails regex
<solidus-river>
er, ruby regex, sorry
lggr has joined #ruby
<solidus-river>
1.9.3
irleif has joined #ruby
<blazes816>
"this string should end in a dance party".match /a dance party$/
<blazes816>
$ anchors a regex to the end of a string
<blazes816>
(not sure if this answers your questions, I didn't totally understand it)
<Hanmac>
"abcde".end_with?("de")
pcarrier_ is now known as pcarrier
<solidus-river>
cool thanks! those are both it, which is preferred, is .end_with faster because it can assume your just checing for the end, or does it really matter at all
tommyvyo has quit [Quit: Computer has gone to sleep.]
<bperry>
Hanmac: I would be interested to see which of those was the fester one
<canton7>
blazes816, actually $ is the end of the line in ruby, confusingly
poindontcare has quit [Remote host closed the connection]
poindontcare has joined #ruby
<BinaryMaster>
what kind of quoting do I need to use with mysql statements in ruby
catphish has joined #ruby
<blazes816>
canton7: wtf
catphish has left #ruby [#ruby]
<blazes816>
anybody have any idea why that decision was made?
zenformatics has quit [Quit: Leaving.]
<canton7>
it's caused a number of security holes I believe. \A and \Z or \z match the beginning and end of the entire string
elux has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 256 seconds]
the_jeebster1 has left #ruby [#ruby]
skaczor has joined #ruby
zenformatics has joined #ruby
lggr has joined #ruby
und3f has joined #ruby
<blazes816>
i'm interested to find out more. googling now. but it seems like a massive php-ism
whitenoise has quit [Quit: This computer has gone to sleep]
lggr has quit [Ping timeout: 255 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
rabidpraxis has joined #ruby
timrom_ has joined #ruby
timrom has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
williamcotton has quit [Quit: williamcotton]
gmci has joined #ruby
xclite has quit [Quit: Leaving]
Xeoncross has joined #ruby
recycle has quit [Remote host closed the connection]
workmad3 has joined #ruby
ltsstar has quit [Quit: ltsstar]
cj3kim has joined #ruby
chrishunt has quit [Read error: Operation timed out]
iNerd has quit [Quit: iNerd]
sailias has joined #ruby
Hanmac has quit [Ping timeout: 255 seconds]
dekroning has quit [Ping timeout: 240 seconds]
cj3kim has quit [Client Quit]
cbuxton has quit [Quit: Leaving.]
cj3kim has joined #ruby
emmanuelux has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
soulisson has quit [Ping timeout: 260 seconds]
irleif has quit [Quit: Computer has gone to sleep.]
awestroke has quit [Remote host closed the connection]
Hanmac has joined #ruby
mrck has quit [Ping timeout: 245 seconds]
tommyvyo has joined #ruby
lggr has joined #ruby
tomku has quit [Quit: WeeChat 0.3.7]
_nitti has quit [Remote host closed the connection]
cuminmyanus has joined #ruby
thone has joined #ruby
jimeh2 has quit [Ping timeout: 256 seconds]
mrck has joined #ruby
IrishGringo has quit [Ping timeout: 240 seconds]
cardoni has quit [Quit: cardoni]
_nitti has joined #ruby
Asher has quit [Read error: No route to host]
josh^ has joined #ruby
jakzale has joined #ruby
thone_ has quit [Ping timeout: 260 seconds]
dekroning has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
stim371 has quit [Quit: stim371]
notVert has quit [Ping timeout: 252 seconds]
tomku has joined #ruby
margle has quit [Ping timeout: 256 seconds]
evilsushi has joined #ruby
evilsushi has joined #ruby
deadghost has quit [Ping timeout: 252 seconds]
theRoUS has quit [Ping timeout: 244 seconds]
lupine_85 has joined #ruby
xyzodiac has joined #ruby
lggr has joined #ruby
cardoni has joined #ruby
iamjarvo has joined #ruby
jgwong_ has joined #ruby
xyzodiac has quit [Client Quit]
gregorg has quit [Ping timeout: 260 seconds]
dekroning has quit [Ping timeout: 244 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
ryanlabouve has quit [Quit: Computer has gone to sleep.]
kyb3r has joined #ruby
c0pp3rnick has joined #ruby
dpk has quit []
xyzodiac has joined #ruby
xyzodiac has quit [Max SendQ exceeded]
<roychri>
I am writing a class and I need the same code to be executed before any method and after any methods. I could copy and paste in all those methods... but... Is there another way?
jgwong has quit [Ping timeout: 246 seconds]
<roychri>
Another class that wraps it?
xyzodiac has joined #ruby
<bperry>
the latter is a correct solution
joshman_ has quit [Ping timeout: 246 seconds]
xyzodiac has quit [Max SendQ exceeded]
<roychri>
with missing_methods ?
g-ram has quit [Quit: Computer has gone to sleep.]
xyzodiac has joined #ruby
<blazes816>
def execute_with_wrap(meth); before(); send(meth); after(); end
JustinCampbell has quit [Remote host closed the connection]
stkowski has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
sent-hil has quit [Remote host closed the connection]
<blazes816>
obviously I wouldn't call it that
<roychri>
hehe
sent-hil has joined #ruby
sent-hil is now known as x13\x00\x00\x00\
x13\x00\x00\x00\ has left #ruby [#ruby]
JustinCampbell has quit [Read error: Connection reset by peer]
alanp_ has quit [Ping timeout: 240 seconds]
JustinCampbell has joined #ruby
cdzombak has quit []
lggr has quit [Ping timeout: 244 seconds]
philcrissman has quit [Remote host closed the connection]
frogprince_mac has quit [Ping timeout: 246 seconds]
Asher has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
binaryplease has joined #ruby
lggr has joined #ruby
<roychri>
Could I have some kind of method that redefines all the existing (and perhaps future) methods of my class? "à la rails before_filter"
no_worries has quit [Remote host closed the connection]
<Spooner>
roychri : Yeah, you need to use alias_method on the old methods and replace them with a wrapper method and it can be done magically pretty easily.
brianpWins has quit [Read error: Connection reset by peer]
<Spooner>
roychri : But I have to wonder why you really need that...
CodeFriar has quit [Quit: Leaving...]
brianpWins has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
emdub has quit [Quit: new kernel time]
jgwong has joined #ruby
tommylommykins has joined #ruby
<roychri>
Spooner: The context: a class which uses redis in every method. But I want a specific database to be selected for all of them and restore db 0 after each method.
jgwong_ has quit [Read error: Connection reset by peer]
<roychri>
Spooner: All db 5 for example. I`d rather not have to do $redis.select(5) in every method.
yoklov has quit [Quit: computer sleeping]
emdub has joined #ruby
samuel02 has quit [Remote host closed the connection]
<Spooner>
Well, you could use a block to save having to restore it at the end, but that only halves the effort.
<tommylommykins>
if if change String's initializer to be.. def initialize; puts "foo" end
<tommylommykins>
if there's a string literal in my code
thillux_ has quit [Remote host closed the connection]
<tommylommykins>
how come it never prints foo when the interpreter evaluates that string literal?
<solidus-river>
if i wanted to take a string in from a form like 'jack, steve, jason, osby' and then split it and find users by that name whats the best way to give an input form for that?
jgwong has joined #ruby
kirun has quit [Quit: Client exiting]
<Spooner>
tommylommykins : Probably uses magic to create a String from plain "frog", but not from String.new "frog"
<bperry>
Spooner: I would expect because it is using ::String and not YourClass:String
<bperry>
willing to eat my words
lggr has joined #ruby
<tommylommykins>
::String?
<blazes816>
:: means the root namespace
<bperry>
::String is the absolute base class string
<bperry>
yes
<blazes816>
well, :: as a prefix
<tommylommykins>
si this something that I can't get to?
<Spooner>
bperry : If you monkeypatch String, then it changes String. Strings, like a lot of built in stuff aren't regular Ruby objects though.
<bperry>
ah
<tommylommykins>
ah
<blazes816>
ah
<tommylommykins>
that doesn't break my mental model any more :)
<Spooner>
So I'm guessing *guessing* that "frog" doesn't call String.new internally.
<tommylommykins>
I guess I'd be inviting infinite recursion by instantiating another new string in the initializer for strings
<bperry>
tommylommykins: perhaps :)
_nitti has quit [Remote host closed the connection]
<Spooner>
See, Mon_Ouie Is filled with proof as well as guesses.
manizzle has quit [Ping timeout: 245 seconds]
jgwong_ has joined #ruby
<roychri>
blazes816,bperry, Spooner: Thanks for your help :)
scx has joined #ruby
cuminmyanus has quit [Read error: Connection reset by peer]
<Spooner>
roychri : You maybe want to look at #alias_method and #define_method to create a method chain. Not pretty, but it could do the job if you are particularly keen.
lggr has quit [Ping timeout: 248 seconds]
<roychri>
Spooner: cool, thanks. I'll explore that option
chrishunt has joined #ruby
<Spooner>
I'd worry, however, since you are either a) going to have to list all your methods manually (maintenance issues) or b) grab all the public methods and hope you never have a method that doesn't need wrapping in that way.
jgwong has quit [Ping timeout: 240 seconds]
<roychri>
Spooner: And I do not think that would cover methods that are defined after the aliases are done
<Spooner>
roychri : Nope.
Zai_ has quit [Quit: Zai_]
lggr has joined #ruby
Kovensky has quit [Ping timeout: 245 seconds]
daniel_hinojosa has quit [Ping timeout: 264 seconds]
cardoni has quit [Quit: cardoni]
mrck has quit [Remote host closed the connection]
deadghost has joined #ruby
thanpolas_ has joined #ruby
emmanuelux has quit [Quit: emmanuelux]
thanpolas has quit [Ping timeout: 256 seconds]
brianpWins has quit [Ping timeout: 240 seconds]
SJrX has quit [Ping timeout: 252 seconds]
nat2610 has quit [Quit: Leaving.]
mmitchel_ has quit [Ping timeout: 246 seconds]
pseudo has joined #ruby
theRoUS has quit [Read error: Operation timed out]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
roadt has quit [Ping timeout: 260 seconds]
JonnieCache|work has joined #ruby
nat2610 has joined #ruby
mahmoudimus has joined #ruby
<solidus-river>
can you use cacans ability on something thats only a controller?
Kovensky has joined #ruby
<solidus-river>
i want to set up a restriction on something that doesn't have a model
c0rn_ has joined #ruby
<tommylommykins>
hmmm
manizzle has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
<tommylommykins>
puts foo.bar {some_block} #=> no error
<tommylommykins>
puts foo.bar do some_block end #=> no clock supplied
<tommylommykins>
D:
<tommylommykins>
b
<Spooner>
tommylommykins It is the way they bind.
carlyle has quit [Remote host closed the connection]
<tommylommykins>
Usually the choice is governed by whether the block is multi-line or not?
<tommylommykins>
:s
jeffreybaird has quit [Quit: jeffreybaird]
JustinCampbell has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<tommylommykins>
so why would there need to be a difference in parser precedence?
Kuhni has joined #ruby
<Kuhni>
how do I tell ruby to check if a specific item is inside an array?
<Spooner>
That is purely a stylistic choice and we like to keep one for single line and one for multi-line. I don't know _why_ they need to have different precedence.
<Kuhni>
like, [1,2,3] and have it check if 3 is inside the array
<Spooner>
Kuhni : [1, 2, 3].include? 3
vitoravelino`afk is now known as vitoravelino
<Kuhni>
thanks!
sailias has quit [Quit: Leaving.]
c0rn_ has joined #ruby
JonnieCache|work has quit [Ping timeout: 240 seconds]
jakzale has quit [Remote host closed the connection]
lggr has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
sepp2k has quit [Remote host closed the connection]
vitoravelino is now known as vitoravelino`afk
verto is now known as verto|off
<BinaryMaster>
with Net::HTTP.get_response is there a way to find out what url a redirect is bringing you?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
gmci has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 256 seconds]
vitoravelino`afk is now known as vitoravelino
monkegjinni has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 240 seconds]
gmci has joined #ruby
lggr has joined #ruby
dpk has joined #ruby
<aces1up>
hey = dude.map{ |key, value| key.to_s.include?('dec') } how do I return the whole hash that matches? so basically I want to extract into a second hash some hashes from the first hash.. a sub hash.
<blazes816>
wat
<blazes816>
Hash#select?
whitenoise has joined #ruby
vitor-br has quit [Quit: Saindo]
<tommylommykins>
dud.each_with_object(Hash.new) {|(k, v) new_hash| new_hash[k] = v if your_condition}
<patrick99e99>
I get the error "undefined method 'render'" because I guess the context is wrong... How do I properly execute that block but have it be within the context of the controller ?
<blazes816>
patrick99e99: try #rubyonrails
gmci has joined #ruby
cj3kim has joined #ruby
dEPy has quit []
<patrick99e99>
blazes816: but this isn't a rubyonrails problem really, blazes816
<patrick99e99>
it's a context + block execution problem
lggr has quit [Ping timeout: 245 seconds]
mercwithamouth has joined #ruby
<blazes816>
patrick99e99: good point, you win this round patrick99e99
dekroning has joined #ruby
<patrick99e99>
great, now how about some help?
<rb1980>
ok, total ruby noobie question: in a case/when statement, does it abort on the first match, or does it continue down the line evaluating each when clause till it gets to the end?
ozette has joined #ruby
<tommylommykins>
it aborts on first match
<rb1980>
cool, thanks. just wanted to be sure :-)
rb1980 has left #ruby [#ruby]
<tommylommykins>
it's as if Ruby secretly inserted a break statement at the end of each thing
<blazes816>
ah
lggr has joined #ruby
<blazes816>
b = case 'b'; when 'b'; 'b'; when 'c'; 'c'; end
<blazes816>
I prepared that example. and he just leaves
<blazes816>
:(
rasbonics has quit [Quit: rasbonics]
gmci has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
recycle has joined #ruby
dekroning has quit [Ping timeout: 248 seconds]
stephh has joined #ruby
jimeh2 has quit [Ping timeout: 260 seconds]
recycle has quit [Remote host closed the connection]
_nitti has joined #ruby
gmci has joined #ruby
<patrick99e99>
blazes816: what is the problem exactly?