roamingdog has quit [Remote host closed the connection]
kobain has quit [Ping timeout: 260 seconds]
aupadhye has joined #ruby
JoshGlzBrk has quit [Ping timeout: 276 seconds]
symm- has quit [Quit: Leaving...]
mleung has quit [Quit: mleung]
stannard has quit [Ping timeout: 240 seconds]
ByronJoh1son is now known as ByronJohnson
CloCkWeRX has joined #ruby
ByronJohnson is now known as Guest42826
bronson has joined #ruby
skalfyfan has joined #ruby
Guest42826 has quit [Changing host]
Guest42826 has joined #ruby
Guest42826 is now known as ByronJohnson
stannard has joined #ruby
hutch34 has joined #ruby
skweek has joined #ruby
roamingdog has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
finisherr has quit [Quit: finisherr]
johnmilton has joined #ruby
hutch34 has quit [Ping timeout: 272 seconds]
zeroDi has quit [Quit: WeeChat 1.5]
kobain has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
craigp has joined #ruby
anna` has left #ruby ["-"]
Cohedrin has quit [Ping timeout: 264 seconds]
santiago_ has quit [Quit: Page closed]
swills has joined #ruby
ur5us has quit [Remote host closed the connection]
skalfyfan has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nettoweb has quit [Ping timeout: 276 seconds]
ramfjord_ has quit [Ping timeout: 244 seconds]
kies has quit [Ping timeout: 244 seconds]
ensyde has joined #ruby
skalfyfan has joined #ruby
tjohnson has quit [Quit: Connection closed for inactivity]
marr has quit [Ping timeout: 276 seconds]
Rodya_ has joined #ruby
jenrzzz has joined #ruby
skalfyfan has quit [Client Quit]
Cohedrin has joined #ruby
amclain has quit [Quit: Leaving]
skalfyfan has joined #ruby
znz_jp0 has quit [Remote host closed the connection]
znz_jp has joined #ruby
skalfyfan has quit [Client Quit]
insanedreamer has quit [Quit: insanedreamer]
lukec has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
davids3 has joined #ruby
davedev24 has quit []
hutch34 has joined #ruby
roamingdog has quit [Remote host closed the connection]
skalfyfan has joined #ruby
<davids3>
Hey everyone, I'm trying to define a new class that inherits from another class and want it to maintain the parent singleton's instance variables. The only way I've discovered works for me is doing the standard `class B < A` and then running `instance_variable_get` on the parent and `instance_variable_set` on the child class each instance var
<davids3>
Is there something that I'm just completely overlooking that can accomplish this without leaving me feeling dirty?
skalfyfan has quit [Client Quit]
hutch34 has quit [Ping timeout: 260 seconds]
<davids3>
The only other way I could accomplish similar was by doing `B = A.clone` then monkey patching B, but that leaves me without A as the superclass, so I can't call `super` on anything
<jhass>
davids3: how about extracting that logic into a module and extend it into both?
skalfyfan has joined #ruby
<davids3>
jhass: I don't have access to alter the source of the parent class, so I can't take that path
JoshGlzBrk has joined #ruby
<davids3>
And the parent class has some DSL usage/other setup that sets a number of instance variables on the singleton that break the subclass if not present
TheNet has joined #ruby
<jhass>
are you still sure subclassing it at all is your best route?
skalfyfan has quit [Client Quit]
TheNet has left #ruby [#ruby]
<jhass>
considered wrapping it instead?
<jhass>
for example with a SimpleDelegator subclass
roamingdog has joined #ruby
diegoaguilar has quit [Read error: Connection reset by peer]
RegulationD has joined #ruby
skalfyfan has joined #ruby
diegoaguilar has joined #ruby
ropeney has joined #ruby
roamingdog has quit [Remote host closed the connection]
gtsai has joined #ruby
skalfyfan has quit [Client Quit]
<davids3>
jhass: I'm not entirely up to speed with the DelegatorClass stuff
jtdowney_ is now known as jtdowney
jtdowney has quit [Changing host]
jtdowney has joined #ruby
<davids3>
I'll have a look into it now and see if it helps what I'm doing
skalfyfan has joined #ruby
skalfyfan has quit [Client Quit]
roamingdog has joined #ruby
skalfyfan has joined #ruby
jancel has joined #ruby
RegulationD has quit [Ping timeout: 276 seconds]
stannard has quit [Remote host closed the connection]
<davids3>
jhass: From the SimpleDelegator docs, I'm not sure it will work as I may or may not have usage over the creation of instances for the class
<davids3>
To be safe, I'm fairly certain I need the singleton's instance variables to be accessible from the beginning of the new class's defintion
Vingador has joined #ruby
dkms has joined #ruby
roamingdog has quit [Remote host closed the connection]
skalfyfan has quit [Ping timeout: 260 seconds]
dkms has quit [Client Quit]
jancel has quit [Ping timeout: 272 seconds]
nankyokusei has joined #ruby
roamingdog has joined #ruby
<jhass>
in a SimpleDelegator subclass you can simply override def initialize(*args); super(A.new(*args)); end
<jhass>
davids3: ^
<davids3>
jhass: Are class methods still delegated to the original singleton class? Ie. `B.perform_action` is delegated to `A.perform_action`?
duckpuppy has joined #ruby
<jhass>
no
xue has quit [Ping timeout: 260 seconds]
<davids3>
Yeah, I don't think that SimpleDelegator will be suitable then
xue has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
<davids3>
I still need the new class' class methods to have access to the parent class singleton's original instance variables
<tgeeky>
man, I'm in so deep I can't see the waterline.
elementaru has quit [Ping timeout: 276 seconds]
<jhass>
was worth a shot, given you're so vague about your usecase it's hard to give any recommendations and I can't assess whether I agree with your judgment either
<tgeeky>
is there a way to... how the hell do I even ask this question.
ur5us has joined #ruby
<jhass>
tgeeky: with thinking before writing preferably ;)
<davids3>
The use case is essentially-- we have a Rails app and have a set of engines and routes included
<tgeeky>
is there a way to replicate the behavior of: if (...); elseif (...); elseif (...); else ...; end
<tgeeky>
but dynamically
jaguarmagenta has joined #ruby
<jhass>
?xy
<ruby[bot]>
it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<tgeeky>
i could just paste the code
<tgeeky>
but it's really rough
<jhass>
?gist
<ruby[bot]>
https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<davids3>
And we need to be able to replace controllers with versions inheriting from the original, same with models, serializers, etc.
<tgeeky>
can I delete gists?
<tgeeky>
i don't want to be forever embarassed by this
smathy_afk is now known as smathy
<tgeeky>
evidently, yes
<jhass>
on your account, yes. You can also make them secret. I think anonymous gists you can delete for some time, as long as you have the cookie
roamingdog has quit [Remote host closed the connection]
<tgeeky>
i have a (nested, multi) - hash at the top
<tgeeky>
more importantly, it's ORDERED.
<tgeeky>
for a particular field in the source database, ie: has['customer','name']
jaguarmagenta has quit [Ping timeout: 240 seconds]
<tgeeky>
the 3rd key is an ordered list of regular expressions
<tgeeky>
that should be processed like the middle paste in my gist
dhk has quit [Quit: Leaving]
<tgeeky>
the (if match=(...)) ; elsif (match =(...))
yude has quit [Read error: Connection timed out]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arescorpio has joined #ruby
GodFather_ has quit [Ping timeout: 276 seconds]
<tgeeky>
but I don't know ahead of time how many different possible regex matches there will be, and I'm certain it won't always be the same.
<tgeeky>
but an important component here is that the regexes must be processed in that specific order, ie, I must first test using last_first_last_first, THEN @partners
<tgeeky>
THEN @last_first_opt_extra
yude has joined #ruby
<tgeeky>
then a default one
<smathy>
So iterate over them. with either an all? or any? depending on whether you want AND or OR
<tgeeky>
smathy: but then the elsif component is broken
<tgeeky>
basically, I need to short circuit and skip ALL further hash['customer','name'] entries after one matches
davedev24 has joined #ruby
<jhass>
sounds like .any? or .find
chopin has joined #ruby
<tgeeky>
hm...
<tgeeky>
it actually sounds like my outermost loop (@nmm.each) can't be that.
roamingdog has joined #ruby
<jhass>
btw I would strongly recommend to use constants for your patterns
<jhass>
there's no reason for instance variables or reassigning them in each call of the method
<tgeeky>
jhass: I originally did, but I switched due to something, and haven't switched back
<tgeeky>
jhass: though to make sure we're talking about the same hting
<tgeeky>
can you point to one wrong line?
SilverKey has quit [Quit: Halted.]
<jhass>
line 3
<tgeeky>
oh, so drop the @?
<jhass>
to 7
jaguarmagenta has joined #ruby
<tgeeky>
they were originally not in that function, they were in another class. That's why they have the @ still.
<jhass>
I'd go further and make them constants of the module/class you define that method in
<tgeeky>
ok, constants are the allcaps things?
<jhass>
they most likely shouldn't have been instance variables there either
<jhass>
yes
<tgeeky>
ok
<tgeeky>
I need a different .each method. This one will never work.
<jhass>
then next step to more readable code would be to stop using so many abbreviations
<tgeeky>
jhass: fair warning, everything that is a string must be exactly that string
<tgeeky>
caps and all
<jhass>
sure
<jhass>
but, @c, nmm,
<tgeeky>
oh yeah
<jhass>
k, v
<tgeeky>
you can't even see where that comes from
<jhass>
and you'll forget in a week
<tgeeky>
well, k,v screams what it is to me :)
<tgeeky>
but yes, I'll change that stuff
<tgeeky>
what I want to avoid at all costs, is ever using eval()
<jhass>
well here comes my third tip: avoid generic names like hash, key, value
<tgeeky>
ok
mozzarel1 is now known as mozzarella
<jhass>
try to find names corresponding to your data
<tgeeky>
jhass: several of these nits that you are picking are actually due to the fact that I was deciding what kind of data structure to use
<tgeeky>
and i just named them after the data structure
<tgeeky>
until I selected one
<tgeeky>
but I agree with them all
<jhass>
IME following these things from the starts makes it incredibly easier to think about the code
<jhass>
including finding the right data structures
Coldblackice has quit [Ping timeout: 264 seconds]
Coldblackice_ has joined #ruby
<jhass>
for example I have no clue how your NestedMultimap thing even works
<jhass>
so no clue what its each yields
<tgeeky>
jhass: it's 1 yield per line in the map; it's from yehuda katz's multimap library
idefine has quit [Remote host closed the connection]
<tgeeky>
jhass: 1 source to many targets is allowed
SilverKey has joined #ruby
lacuna has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
but you only get one at a time, no?
<tgeeky>
with this loop, yes; but that is exactly the problem
<tgeeky>
with this loop, has[...,@last_first_last_first] will be executed 3 times, when it only needs to be executed once.
<tgeeky>
ie, the regex will be matched 3 times
<jhass>
btw I'd probably just use plain nested arrays
JesseH has joined #ruby
<tgeeky>
perhaps I will move in that direction.
davedev24 has quit []
<jhass>
[source, [target, ...]] with source and target being your 2-3 element arrays
diegoviola has quit [Quit: WeeChat 1.5]
<jhass>
er, [[source, [target, ...]], ...] of course
Dimik has joined #ruby
<jhass>
will work the same on your current call side and boom no more domain knowledge of some gem required
<jhass>
and I'd argue equally readable when properly formatted
chipotle has quit [Quit: cheerio]
chipotle has joined #ruby
roamingdog has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
e4xit has quit [Ping timeout: 246 seconds]
rbennacer has joined #ruby
mistermocha has joined #ruby
<jhass>
so then you'd just use mappings.each do |source, targets| # unpack source; match = pattern.match(row[:name]); next unless match; targets.each do |target| #unpack target; contact[to_column] = case template; when nil; ...; row[:name]; when Proc; template.call(match); when String; template % match; end etc
<jhass>
tgeeky: ^
Seich has quit [Ping timeout: 250 seconds]
gfvcastro has joined #ruby
Seich has joined #ruby
Vingador has quit [Remote host closed the connection]
mdw_ has quit [Ping timeout: 246 seconds]
<tgeeky>
jhass: inspecting that
Biopandemic has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 250 seconds]
gfvcastro has quit [Client Quit]
gfvcastro has joined #ruby
roamingdog has joined #ruby
CorOne has joined #ruby
jenrzzz has joined #ruby
benlieb has joined #ruby
davedev24 has joined #ruby
chipotle has quit [Ping timeout: 244 seconds]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
idefine has joined #ruby
chipotle has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
<nofxx>
oh, and my robot will give me "brand - four or five words product name" that are not always in the same order or is truncated, hence the weight... there's human verification later
konsolebox has joined #ruby
AK-47_ has joined #ruby
<AK-47_>
hi all for overclocking join ##securify and press f9 and for interpol channel go to ##beyondtime and for governor and UNITED NATIONS GO TO ##un.org , for SU FEDORA OS COME TO ##su.os
<apeiros>
iow, yaml does have a regex type. but it's not just //
<jhass>
s/YAML/Psych/, no?
anenigma has joined #ruby
<PaulePanter>
apeiros: Awesome. Thank you.
<PaulePanter>
jhass: > You can choose from one of two YAML engines that ship with Ruby 1.9. By default Psych is used but the old unmaintained Syck may chosen.
<apeiros>
jhass: psych is the name of the parser (or rather libyaml wrapper) in ruby, yaml is the language. and yaml the language can have arbitrary custom types, which psych makes use of
<apeiros>
18>> require 'yaml'; /foo/.to_yaml # just curious how it was with syck
<jhass>
yeah, my point is that it's not YAML having "a regex type", but Psych using/supporting a custom YAML type for regexes
<jhass>
IMO the important difference is: will break/work differently with other YAML parsers
skade has joined #ruby
<PaulePanter>
jhass: Ah, thank you!
<apeiros>
any yaml parser should be capable of parsing all custom types. i.e. it should not break. but it might not have a sensible representation for the custom type.
alexherbo2 has joined #ruby
<jhass>
"YAML has a regex type" just sounds like something portable to me, which it isn't
<apeiros>
afaik there's a fallback definition, something akin getting at least a string, an array or a k/v collection. but I never tried.
Snowy has quit [Read error: Connection reset by peer]
<apeiros>
true
Snowy has joined #ruby
<apeiros>
even languages which support regular expressions might have a different engine, so a regex may not translate 1:1. so you might not even be able to write an adapter for the custom type.
benlieb has quit [Quit: benlieb]
skade has quit [Read error: Connection reset by peer]
iMadper` has joined #ruby
saneax_AFK is now known as saneax
myntcake has joined #ruby
tristanp_ has joined #ruby
aupadhye has joined #ruby
<myntcake>
Is there a sample like method applicable to hashes?
joonty has quit [Ping timeout: 244 seconds]
iMadper has quit [Ping timeout: 244 seconds]
skade has joined #ruby
tristanp has quit [Ping timeout: 250 seconds]
Jet4Fire_ has quit [Ping timeout: 244 seconds]
<Zarthus>
Hash#keys.sample?
joonty has joined #ruby
<Zarthus>
(the question mark there is not parth of the method)
Jet4Fire has joined #ruby
kgrz_ has joined #ruby
<Zarthus>
alternatively #values if you don't need the key
aupadhye has quit [Ping timeout: 260 seconds]
myntcake has quit [Ping timeout: 252 seconds]
kgrz has quit [Ping timeout: 272 seconds]
nankyokusei has joined #ruby
tristanp has joined #ruby
tristanp_ has quit [Ping timeout: 250 seconds]
n1x-nz has quit [Quit: Computer says no]
anisha has joined #ruby
Weavel has joined #ruby
zyzioziom has quit [Ping timeout: 258 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
tristanp_ has joined #ruby
gtsai has joined #ruby
tristanp has quit [Ping timeout: 250 seconds]
mlehrer has joined #ruby
Devalo has joined #ruby
zyzioziom has joined #ruby
startupality has joined #ruby
mistermocha has joined #ruby
tristanp has joined #ruby
CROOKED^HILLARY^ has quit [Ping timeout: 260 seconds]
tristanp_ has quit [Ping timeout: 250 seconds]
gtsai has quit [Ping timeout: 258 seconds]
terlar has quit [Quit: WeeChat 1.5]
mistermocha has quit [Ping timeout: 244 seconds]
workmad3 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
nadir has quit [Quit: Connection closed for inactivity]
mdw_ has joined #ruby
bluOxigen has quit [Ping timeout: 244 seconds]
bluOxigen has joined #ruby
conta has quit [Ping timeout: 246 seconds]
ocbtec has joined #ruby
Coldblackice_ has quit [Ping timeout: 260 seconds]
mdw has quit [Ping timeout: 276 seconds]
rrichardsr3 has quit [Quit: He who dares .... wins.]
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 276 seconds]
CROOKED^HILLARY^ has joined #ruby
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
Devalo has quit [Remote host closed the connection]
tristanp has quit [Ping timeout: 250 seconds]
startupality has quit [Read error: Connection reset by peer]
conta has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
madgen has joined #ruby
Darkwater has joined #ruby
Oog has joined #ruby
tristanp has joined #ruby
jackjackdripper has joined #ruby
johnmilton has quit [Ping timeout: 260 seconds]
SirCmpwn has quit [Ping timeout: 260 seconds]
SirCmpwn has joined #ruby
m8 has joined #ruby
andrewvos has joined #ruby
staticfox has quit [Read error: Connection reset by peer]
startupality has joined #ruby
staticfox has joined #ruby
rideh- has quit [Ping timeout: 260 seconds]
Fire-Dragon-DoL has quit [Ping timeout: 260 seconds]
User458764 has joined #ruby
antgel has joined #ruby
glcx has joined #ruby
glcx has quit [Changing host]
glcx has joined #ruby
tax has quit [Read error: Connection reset by peer]
eGGshke has quit [Remote host closed the connection]
rideh has joined #ruby
stardiviner has joined #ruby
skade has quit [Ping timeout: 260 seconds]
Fire-Dragon-DoL has joined #ruby
ptx0 has quit [Ping timeout: 246 seconds]
neanderslob has quit [Ping timeout: 250 seconds]
neanderslob has joined #ruby
eGGshke has joined #ruby
ur5us has quit [Remote host closed the connection]
tristanp_ has joined #ruby
tristanp has quit [Ping timeout: 250 seconds]
trista___ has joined #ruby
bronson has joined #ruby
Macaveli has quit [Ping timeout: 244 seconds]
tristanp_ has quit [Ping timeout: 252 seconds]
glcx has quit [Quit: Quitte]
Macaveli has joined #ruby
Weavel has quit [Quit: IceChat - It's what Cool People use]
tristanp has joined #ruby
GodFather_ has joined #ruby
trista___ has quit [Ping timeout: 250 seconds]
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
myntcake has joined #ruby
Macaveli has quit [Ping timeout: 240 seconds]
alfie_max15 has quit [Ping timeout: 252 seconds]
Ch4rAss has quit [Ping timeout: 244 seconds]
Oog has quit []
Macaveli has joined #ruby
Ch4rAss has joined #ruby
CROOKED^HILLARY^ has quit [Ping timeout: 250 seconds]
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
moeSeth has quit [Quit: Connection closed for inactivity]
<myntcake>
Is there a sample like method applicable to hashes?
<apeiros>
hash.to_a.sample(n).to_h
jancel has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
alfie_max15 has joined #ruby
jaguarmagenta has joined #ruby
sepp2k has joined #ruby
startupality has quit [Ping timeout: 240 seconds]
jaruga___ has quit [Ping timeout: 240 seconds]
Nice_BikeMaN has quit [Quit: Leaving]
<jhass>
I usually keep stuff as [[a, b], ...] if that need arises though
<myntcake>
hmm
<jhass>
chances are big you don't need the key value lookup property of Hash at all
<myntcake>
I'm building a 21 like game
RegulationD has joined #ruby
<myntcake>
so i was thinking of organizing the hearts,diamonds, etc. with its 2,3,4,5,6... cards
GodFather_ has quit [Read error: Connection reset by peer]
jancel has quit [Ping timeout: 272 seconds]
<myntcake>
and so make 4 keys as symbols, and the values as an array of numbers
aleskandro has joined #ruby
<jhass>
when will you lookup all cards by its symbol?
jaguarmagenta has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
<jhass>
let me rephrase
<jhass>
when will you need to fetch all cards of a color, knowing the color?
<myntcake>
no, i would just need a card with its head
<myntcake>
*type
<myntcake>
that would be randomized
k3rn31 has joined #ruby
GodFather_ has joined #ruby
dangerousdave has joined #ruby
<myntcake>
so a nested array is better for that occasion?
<jhass>
when you say type you mean color + value ?
<myntcake>
yea
<aleskandro>
Hi all, i'm using the i18n gem on a rails project. In one form I have a nested form for room with fields_for (roomFeature) and the label of the fields are translated from the yaml. But when I make a validation error the field name is not translated. I receive "Roomfeatures description non puo` essere bianca". How can I set "Roomfeatures description" in the yaml?
GodFather has quit [Remote host closed the connection]
habitullence has quit [Quit: habitullence]
GodFather_ has quit [Read error: Connection reset by peer]
<jhass>
myntcake: so why not just [[:hearts, 2], [:hearts, 3], ..., [:hearts, 14], ..., [:diamonds, 5], ...]?
RegulationD has quit [Ping timeout: 244 seconds]
GodFather has joined #ruby
<myntcake>
so a nested array is a better option?
<myntcake>
jhass: idk.. haha i just wanted to type less
<jhass>
probably, I don't know all your requirements to the data structure
<jhass>
generate it
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
<myntcake>
so iwas thinking CARDS=[2,3,4,5..] and deck{hearts: CARDS}
marr has quit [Ping timeout: 246 seconds]
GodFather has quit [Remote host closed the connection]
GodFather has quit [Remote host closed the connection]
mrgrieves has quit [Remote host closed the connection]
<jhass>
?rails aleskandro
<ruby[bot]>
aleskandro: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
trista___ has joined #ruby
tristanp_ has quit [Ping timeout: 272 seconds]
habitullence has joined #ruby
<eGGshke>
#RubyOnRails
<alfie_max15>
eGGshke, trying to join???
tristanp_ has joined #ruby
<eGGshke>
+(
kgrz_ has quit [Ping timeout: 260 seconds]
tristanp has quit [Ping timeout: 252 seconds]
madgen has quit [Ping timeout: 252 seconds]
GodFather has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
trista___ has quit [Ping timeout: 252 seconds]
GodFather_ has joined #ruby
chipotle has quit [Quit: cheerio]
GodFather has quit [Read error: Connection reset by peer]
craigp has quit [Quit: WeeChat 1.5]
craigp has joined #ruby
johnmilton has joined #ruby
tristanp_ has quit [Ping timeout: 250 seconds]
gnufied has joined #ruby
cyclonis_ has quit [Ping timeout: 276 seconds]
craigp has quit [Client Quit]
craigp has joined #ruby
tristanp_ has joined #ruby
startupality has joined #ruby
<Darkwater>
what do the cool kids these days use for ruby doc generation?
iMadper` has quit [Remote host closed the connection]
fujinuma has quit [Quit: WeeChat 1.4]
zyzioziom1 has joined #ruby
<workmad3>
Darkwater: hand-written with beautiful caligraphy
finnnnnnnnnnn has joined #ruby
zyzioziom has quit [Ping timeout: 244 seconds]
zyzioziom1 is now known as zyzioziom
mistermocha has joined #ruby
d0lph1n98 has joined #ruby
doodlehaus has joined #ruby
doodlehaus was kicked from #ruby by ruby[bot] [was banned before]
chipotle has joined #ruby
griffindy has joined #ruby
shellie_ has joined #ruby
madgen has joined #ruby
<finnnnnnnnnnn>
Hello! I’m trying to use an array as a reference to a location in a RecursiveOpenStruct object. It’s probably a bad idea. I’ve asked a question on stack overflow if anyone cares to have a look - http://stackoverflow.com/questions/37411889
hutch34 has joined #ruby
<shellie_>
I'm new to ruby, I'm working with rspec. I have this global variable I'm setting in a before all context, which I can't seem to use later in my describe, it goes empty (maybe nil) - any idea what I could do to be able to access it from the describe context?
<Darkwater>
shellie_: in that code, ruby tries to resolve @somevar before it's set by something
<shellie_>
oh, that's because it interpretes the code, before the 'before context' gets executed?
<Darkwater>
on like 6, you're really calling describe with the result ofsomeresource(@somevar) and a block
<Darkwater>
yeah
ldnunes has joined #ruby
<Darkwater>
if my knowledge of rspec is ok I think you need to pass a string to describe
<Darkwater>
describe 'some functionality' do ...
<Darkwater>
same with it
craigp has quit [Quit: WeeChat 1.5]
<shellie_>
Darkwater: oh, this is serverspec, not pure rspec, I think
<Darkwater>
iirc it and describe are equivalent, just some semantic changes
finnnnnnnnnnn has quit [Quit: finnnnnnnnnnn]
craigp has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
kus has joined #ruby
kus has quit [Max SendQ exceeded]
<Darkwater>
ooh I see what yuo're trying to do
<jhass>
not quite, no
c355e3b has joined #ruby
craigp has quit [Client Quit]
Azure has quit [Remote host closed the connection]
<shellie_>
Darkwater: what do you think the solution here could be?
craigp has joined #ruby
<Darkwater>
I think removing the before :all block might do
<Darkwater>
like, set @somevar directly in the describe block
craigp has quit [Client Quit]
<Darkwater>
since you're using it to define the tests, instead of actually using them in the tests
<Darkwater>
but then again I don't use rspec
<Darkwater>
it would at least work
<shellie_>
this is my issue. I depend on a function that does some remote execution, which I can call from within a before block, but not outside it, and I'm not too sure how to go about fixing that
<jhass>
no need to make it an instance variable even
roamingdog has quit [Remote host closed the connection]
craigp has joined #ruby
<jhass>
perhaps you just shouldn't call it outside
<Darkwater>
then I think you need to look for a different approach
Ishido has quit [Remote host closed the connection]
myntcake has joined #ruby
nadir has joined #ruby
hanmac has quit [Ping timeout: 260 seconds]
vondruch_ has quit [Quit: Ex-Chat]
vondruch has joined #ruby
<shellie_>
how can I print the full name space of a given function?
craigp has quit [Client Quit]
<apeiros>
functions don't have namespaces :-p
<apeiros>
of a method - depends, do you have a Method or an UnboundMethod instance?
craigp has joined #ruby
<apeiros>
oh, actually both support .owner
<shellie_>
I think it is bound, but I would need some help in figuring that out :)
<shellie_>
let me try owner
<apeiros>
so: see Method/UnboundMethod#owner
evidex has joined #ruby
Ishido has joined #ruby
<jhass>
and see Object#method
<apeiros>
and Module#instance_method
<apeiros>
though I assumed you already had gone that far.
<jhass>
click on the paste :P
<apeiros>
ze paste?
<jhass>
yeh!
<apeiros>
wher's ze paste?
<apeiros>
oh, this is a follow-up question?
davedev24 has joined #ruby
<Darkwater>
why do the headers from `ri -T String` contain backspaces? is it so you can't grep them?
tristanp has joined #ruby
anenigma has quit [Quit: Goodbye]
trista___ has joined #ruby
<giz|work>
Darkwater: the commit messages for this is: "Prevent Darkwater from grepping strings on 24.May.2016".... the commit is one year old though Oo
LoneHermit has joined #ruby
tristanp_ has quit [Ping timeout: 272 seconds]
aleskandro has quit [Quit: Konversation terminated!]
<Darkwater>
lmao
netcho has joined #ruby
<netcho>
hi all
<netcho>
using whenever gem to create crons, it works fine if i have only one app per server. If i host multiple apps on one server i rewrites crons so only last app deployed has crons in crontab
tristanp has quit [Ping timeout: 252 seconds]
<jhass>
systemd timers time!
<jhass>
scnr
strigon33 has joined #ruby
<jhass>
netcho: run your apps as different users? probably a good idea either way
trista___ has quit [Ping timeout: 250 seconds]
<netcho>
not an option
LoneHermit has quit [Ping timeout: 246 seconds]
<netcho>
all apps are ran as the same user
<Darkwater>
append to cron
tristanp has joined #ruby
<Darkwater>
or rather replace the correct one
<Darkwater>
as in, the corerct line(s)
hanmac has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
|2701 has joined #ruby
strigonLeader has quit [Ping timeout: 246 seconds]
roamingdog has joined #ruby
tristanp_ has joined #ruby
maucar has joined #ruby
trista___ has joined #ruby
jaruga___ has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
roamingdog has quit [Remote host closed the connection]
CJKinni has joined #ruby
chouhoulis has joined #ruby
skade has quit [Ping timeout: 272 seconds]
tristanp_ has quit [Ping timeout: 252 seconds]
synthroid has joined #ruby
roamingdog has joined #ruby
duncannz has quit [Remote host closed the connection]
beauby has joined #ruby
trista___ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
<jhass>
"are" != "must"
roamingdog has quit [Remote host closed the connection]
umdstu has joined #ruby
Macaveli has quit [Ping timeout: 258 seconds]
moeabdol has quit [Ping timeout: 276 seconds]
Gasher has quit [Quit: Leaving]
swills has quit [Ping timeout: 276 seconds]
Devalo has joined #ruby
hahuang61 has joined #ruby
CJKinni has quit [Read error: Connection reset by peer]
ksmutthu_ has joined #ruby
kus has joined #ruby
kus has quit [Max SendQ exceeded]
kgrz has joined #ruby
ksmutthu has quit [Ping timeout: 244 seconds]
<lxsameer>
is there any alternative for redcarpet gem for jruby ?
hahuang61 has quit [Ping timeout: 260 seconds]
zenlot has joined #ruby
mauricar has joined #ruby
moeabdol has joined #ruby
skade has joined #ruby
eGGshke has joined #ruby
auzty has quit [Quit: Leaving]
zenlot6 has quit [Ping timeout: 276 seconds]
<netcho>
jhass: it is not my call :D
<netcho>
how is identifier ser?
<netcho>
how is identifier set?
LoneHerm_ has joined #ruby
<Darkwater>
what/
maucar has quit [Ping timeout: 264 seconds]
ctp has joined #ruby
mikecmpb_ has joined #ruby
<Darkwater>
what/
<Darkwater>
whoops
startupality has quit [Read error: Connection reset by peer]
<Darkwater>
no matter how fitting that was it was 100% an accident i swear
aegis3121 has joined #ruby
mikecmpbll has quit [Ping timeout: 264 seconds]
matp has quit [Ping timeout: 260 seconds]
moeabdol has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
nettoweb has joined #ruby
ptx0 has joined #ruby
tristanp has quit [Ping timeout: 250 seconds]
<nettoweb>
hey guys, is there a way to not set the full pah of this gem in order to work: :To fix a bug, Im using lie this today: WickedPdf.config = { :exe_path => '/Users/netto/.rvm/gems/
tristanp has joined #ruby
<nettoweb>
I'd like to know if there is a variable to get the gem folder directory and dont need to pass my user folder
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nofxx has quit [Ping timeout: 260 seconds]
nofxx has joined #ruby
tristanp has joined #ruby
kies has joined #ruby
startupality has joined #ruby
gtsai has joined #ruby
tristanp_ has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
wwwbukolaycom has joined #ruby
trista___ has quit [Ping timeout: 252 seconds]
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
wwwbukolaycom has quit [K-Lined]
chouhoulis has quit [Remote host closed the connection]
mdih has joined #ruby
gtsai has quit [Ping timeout: 244 seconds]
iooner has quit [Ping timeout: 260 seconds]
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 46.0.1/20160502172042]]
<dreinull>
!!"x" => true but generates a warning. How else should I check for true/false?
iooner has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
<netcho>
jhass: i set appname as identifier and update instead of write.... all good now
BTRE has quit [Ping timeout: 276 seconds]
CJKinni has joined #ruby
BTRE has joined #ruby
gheegh has quit [Ping timeout: 260 seconds]
<tobiasvl>
dreinull: why do you need to check for true/false and not truthiness/falsiness?
<dreinull>
tobiasvl I do
tristanp has quit [Read error: Connection reset by peer]
<tobiasvl>
dreinull: ok. why do you need to have a string literal in the test then?
<tobiasvl>
with a string literal you could literally (!) replace !!"x" with true
tristanp has joined #ruby
johnmilton has quit [Read error: Connection reset by peer]
<tobiasvl>
this is a basic XY problem if ever I saw one
last_staff has quit [Quit: last_staff]
<dreinull>
tobiasvl example. I check the mapped return of method evals. Just need the true/false results to check if any enumerated value returned a negative response.
johnmilton has joined #ruby
<tobiasvl>
dreinull: and you can't check if the enumerated value is truthy or falsy instead?
nobitanobi has quit [Remote host closed the connection]
<dreinull>
it is send to a method which returns an array. If array is sent it's true, if not it's false. So I have sth like set.map{|s|!!s.meth}.all?
<dreinull>
which works for me
<tobiasvl>
but that shouldn't give a warning?
<tobiasvl>
there's no string literal there
<dreinull>
tobiasvl I assumed the double bang would give a warning nonetheless
<tobiasvl>
well it shouldn't
<dreinull>
ok then. I'm happy.
nobitanobi has joined #ruby
nobitanobi has quit [Remote host closed the connection]
skade has quit [Ping timeout: 258 seconds]
LoneHerm_ has quit [Remote host closed the connection]
skade has joined #ruby
Biopandemic has joined #ruby
jaguarmagenta has joined #ruby
nobitanobi has joined #ruby
<Cork>
anyone know how to exit from Dir.chroot ?
dstarh has joined #ruby
nobitanobi has quit [Remote host closed the connection]
duckpuppy has joined #ruby
<adaedra>
Should not be possible, that's the point of chroot
<Cork>
adaedra: not always no
zyzioziom has quit [Ping timeout: 272 seconds]
<Cork>
in this case it is cause i need to run some programs in that context
<Cork>
ah
<workmad3>
Cork: I don't believe you can... once you chroot a process you can't unjail it
<Cork>
it takes a block
tristanp_ has joined #ruby
ramortegui has joined #ruby
<workmad3>
Cork: the idea would normally be to fork then chroot the forked process
ChiefAlexander has joined #ruby
jaguarmagenta has quit [Ping timeout: 244 seconds]
rkoller has joined #ruby
skade has quit [Read error: Connection reset by peer]
pawnbox has quit [Remote host closed the connection]
startupality has quit [Read error: Connection reset by peer]
koooge has quit [Quit: Leaving...]
tristanp has quit [Ping timeout: 250 seconds]
<workmad3>
Cork: you can do that fairly easily though... `fork { Dir.chroot "blah"; exec "whatever" }`
<Cork>
ah, good idea
<Cork>
but the main process won't wait for it right?
dhk has joined #ruby
matp has joined #ruby
pandaant has joined #ruby
<workmad3>
Cork: not by default, no... but `fork` will return the PID, iirc, so you can capture that and wait for it later
<apeiros>
naming question - how'd you call an attribute which stores whether you're "not yet born", "alive" or "deceased"?
maloik56 has joined #ruby
<andrewvos>
#unborn?
<andrewvos>
oh
<andrewvos>
er
tristanp_ has quit [Ping timeout: 250 seconds]
<Darkwater>
#stage
<apeiros>
andrewvos: does not fit, as unborn? does not not cover the distinction of alive and deceased
<DylanJ>
Anyone here know Sequel, Postgres and used TSRANGE types? Great! How can I pass a Time range `(Time.now..Time.now+1)` directly to an instance of a Sequel::Model without wrapping it in Sequel.pg_range. I see there's an option to register types `DB.register_range_type('timerange')
<Darkwater>
:unborn/alive/deceased
<apeiros>
stage/status are IMO too unspecific
<DylanJ>
` but the function does not exist.
<Darkwater>
life-stage/
<apeiros>
Darkwater: those are the *values*, I ask for the name of the *property* ;-)
<Darkwater>
?
<apeiros>
(and yes, "not yet alive" is indeed "unborn" in that code)
zyzioziom has joined #ruby
tristanp_ has joined #ruby
<andrewvos>
apeiros: do you need the destinction between not yet born and deceased?
<andrewvos>
cause #alive? might do
<apeiros>
phase_of_life, vitality, …?
<andrewvos>
sentience
<apeiros>
andrewvos: yes, very much so :)
<andrewvos>
if !h.alive? && age < 0
<andrewvos>
hehe sorry
<apeiros>
that's code. I need to store a property in a db ;-)
tristanp has quit [Ping timeout: 250 seconds]
<apeiros>
and now I'm looking for a good column name
<andrewvos>
#antenatal?
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
Devalo has quit [Remote host closed the connection]
stannard has joined #ruby
<jhass>
constitution?
chipotle has joined #ruby
<andrewvos>
natality -> %w{antenatal postnatal}
andrewvos has quit [Quit: WeeChat 0.4.2]
maloik_ has joined #ruby
startupality has joined #ruby
<apeiros>
that only seems to cover unborn/alive and misses deceased
<UAS91>
I'm trying to have text after a link_to in my conditional. link_to("text", path(user))
<UAS91>
and I'm trying to add text right at the end of the link_to
<UAS91>
It's not working if I just put a string on the next line, or at the end of this line
<smathy>
?rails UAS91
<ruby[bot]>
UAS91: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<UAS91>
And I don't want my entire string to be a link
<UAS91>
yeah
<UAS91>
rails 3
crystal77 has quit [Client Quit]
<umdstu>
jhass: yes… it’s on by default in Colloquy.app
<umdstu>
is that confusing to you?
ByronJohnson has joined #ruby
Coldblackice_ has joined #ruby
freerobby has quit [Quit: Leaving.]
synthroi_ has joined #ruby
synthroid has quit [Ping timeout: 244 seconds]
<jhass>
sounds very annoying in normal use already
aufi has quit [Ping timeout: 240 seconds]
<umdstu>
oh i have no doubt. but historically i had my computer muted
evidex has quit [*.net *.split]
dhollinger has quit [*.net *.split]
rippa has quit [*.net *.split]
centrx has quit [*.net *.split]
jrafanie has quit [*.net *.split]
umdstu has quit [*.net *.split]
myntcake has quit [*.net *.split]
habitullence has quit [*.net *.split]
GarethAdams has quit [*.net *.split]
UserInNeed has quit [*.net *.split]
EdwardIII has quit [*.net *.split]
yude has quit [*.net *.split]
DanKnox_ has quit [*.net *.split]
nertzy has quit [*.net *.split]
Asher has quit [*.net *.split]
ujjain has quit [*.net *.split]
joevandy1 has quit [*.net *.split]
_ht_ has quit [*.net *.split]
mozzarella has quit [*.net *.split]
themightyabby has quit [*.net *.split]
patrick_star_3 has quit [*.net *.split]
triangles2 has quit [*.net *.split]
Zackio has quit [*.net *.split]
malcolmva has quit [*.net *.split]
canton7 has quit [*.net *.split]
idefine has quit [Remote host closed the connection]
freerobby has joined #ruby
amclain has joined #ruby
UAS91 has quit [Quit: Page closed]
moeabdol has quit [Quit: WeeChat 1.4]
idefine has joined #ruby
norc has joined #ruby
Guest38 has joined #ruby
nando293921 has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
isene2 has joined #ruby
andikr has quit [Remote host closed the connection]
whathappens has joined #ruby
whathapp_ has joined #ruby
tristanp_ has joined #ruby
yardenbar has quit [Quit: Leaving]
weemsledeux has joined #ruby
aegis3121 has quit [Ping timeout: 260 seconds]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
idefine has quit [Ping timeout: 272 seconds]
tristanp has quit [Ping timeout: 252 seconds]
kareeoleez has quit [Remote host closed the connection]
fergal_ has joined #ruby
evidex has joined #ruby
myntcake has joined #ruby
dhollinger has joined #ruby
rippa has joined #ruby
centrx has joined #ruby
jrafanie has joined #ruby
umdstu has joined #ruby
habitullence has joined #ruby
GarethAdams has joined #ruby
UserInNeed has joined #ruby
yude has joined #ruby
EdwardIII has joined #ruby
DanKnox_ has joined #ruby
nertzy has joined #ruby
Asher has joined #ruby
ujjain has joined #ruby
mozzarella has joined #ruby
joevandy1 has joined #ruby
_ht_ has joined #ruby
themightyabby has joined #ruby
Zackio has joined #ruby
patrick_star_3 has joined #ruby
triangles2 has joined #ruby
canton7 has joined #ruby
malcolmva has joined #ruby
whathappens has quit [Ping timeout: 240 seconds]
tristanp_ has quit [Read error: Connection reset by peer]
moeabdol has joined #ruby
dionysus69 has joined #ruby
<fergal_>
hi guys, i have a rake file within which i have a task defined to output current status to stdout, using puts. however, i have noticed that when i run the task via my build system, the output is not displayed during execution, but rather, when the task finishes, all the output is displayed at once. how can i get rake to output the status as the task is running?
gizmore has joined #ruby
Alayde has joined #ruby
tristanp has joined #ruby
jmignault has joined #ruby
felipejose has joined #ruby
<felipejose>
someone here this need to host a site, if you send me a message I'm offering 10 acconts for free
Couch has quit [Ping timeout: 246 seconds]
Alayde has left #ruby [#ruby]
jmignault has quit [Client Quit]
jmignault has joined #ruby
edwinvdgraaf has quit [Ping timeout: 272 seconds]
ksmutthu has joined #ruby
<gizmore>
felipejose: ssh?
madgen has joined #ruby
tomphp has quit [Ping timeout: 264 seconds]
allcentury has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
tristanp has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
fergal_ has left #ruby [#ruby]
smathy is now known as smathy_afk
senayar has quit []
import_this has joined #ruby
brendan- has joined #ruby
import_this has quit [Client Quit]
hutch34__ has quit [Quit: WeeChat 1.5]
hutch34 has joined #ruby
jmignault has quit [Read error: Connection reset by peer]
weckl has quit [Quit: Leaving]
rkazak has quit [Ping timeout: 260 seconds]
rbennacer has quit [Remote host closed the connection]
<myntcake>
felipejose: how come?
nettoweb has joined #ruby
<felipejose>
because I'm starting now and is a way to make it known
rbennacer has joined #ruby
skade has quit [Read error: Connection reset by peer]
skade has joined #ruby
<norc>
apeiros, got around to it. The overhead of creating a proc object bound to the functions block is really small.
import_this has joined #ruby
armyriad has quit [Quit: Leaving]
import_this has quit [Client Quit]
skweek has quit [Ping timeout: 264 seconds]
mleung has joined #ruby
smathy_afk is now known as smathy
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
benlieb has joined #ruby
<norc>
apeiros, effectively the largest overhead is just an memory allocation - there is practically no initialization done aside from setting up flags and the class pointer.
<norc>
So Im beginning to feel there is no real reason *not* to have a block argument, since it makes it much more explicit that you expect one.
davedev24 has joined #ruby
davedev24 has quit [Read error: Connection reset by peer]
<norc>
asm>> Proc.new
<ruby[bot]>
norc: I have disassembled your code, the result is at https://eval.in/576450
davedev24 has joined #ruby
davedev2_ has quit [Ping timeout: 272 seconds]
armyriad has joined #ruby
idefine has joined #ruby
startupality has joined #ruby
psf has left #ruby [#ruby]
platzhirsch has quit [Quit: WeeChat 1.4]
agent_white has joined #ruby
tvw has quit [Ping timeout: 258 seconds]
<agent_white>
Moin
Ch4rAss has quit [Quit: leaving]
blaxter has quit [Read error: Connection reset by peer]
mikecmpb_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
lictor36 has joined #ruby
ico has joined #ruby
pandaant has quit [Remote host closed the connection]
felipejose has quit []
startupality has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SilverKey has quit [Quit: Halted.]
whathapp_ has quit [Remote host closed the connection]
whathappens has joined #ruby
dimatteo has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
shinnya has joined #ruby
startupality has quit [Ping timeout: 244 seconds]
barajasfab has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 246 seconds]
skolman has joined #ruby
whathappens has quit [Ping timeout: 240 seconds]
startupality has joined #ruby
Ebok has joined #ruby
ico has quit []
gtsai has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gtsai has quit [Read error: Connection reset by peer]
gtsai has joined #ruby
conta has joined #ruby
gtsai has quit [Read error: Connection reset by peer]
<apeiros>
norc: paraphrasing: you say foo(&block) vs. foo() has almost no overhead?
gtsai has joined #ruby
lictor36 has quit [Quit: lictor36]
ChiefAlexander has quit [Remote host closed the connection]
<norc>
apeiros, yes. I didnt do any benchmarking though, but I did not see a reason this should be costly (for libraries I would still avoid it if I can)
whathappens has joined #ruby
<norc>
Though honestly anything where performance really matters is better implemented in C anyway.
blaxter has quit [Read error: Connection reset by peer]
last_staff has joined #ruby
hahuang61 has quit [Quit: WeeChat 1.5]
SilverKey has joined #ruby
TomyWork has quit [Ping timeout: 244 seconds]
tristanp_ has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
kfpratt has quit [Remote host closed the connection]
tvw has joined #ruby
kfpratt has joined #ruby
import_this has joined #ruby
startupality has quit [Read error: Connection reset by peer]
startupality_ has joined #ruby
rcvalle has joined #ruby
tacit7 has joined #ruby
tvw has quit [Remote host closed the connection]
ss_much has quit [Quit: Connection closed for inactivity]
mikecmpbll has joined #ruby
RegulationD has joined #ruby
sneakersec has joined #ruby
nobitanobi has quit [Remote host closed the connection]
Madplatypus has joined #ruby
pabloh has joined #ruby
Cohedrin has joined #ruby
nobitanobi has joined #ruby
B1n4r10 has joined #ruby
hutch34_ has joined #ruby
evidex has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
LoneHerm_ has joined #ruby
weemsledeux has joined #ruby
jaruga___ has quit [Quit: jaruga___]
evidex has joined #ruby
tristanp has joined #ruby
flopsec has joined #ruby
Guest38 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jolamb>
is `v == :a || v == :b` better or worse ruby than `[:a, :b].include? v` ?
<umdstu>
i like the first myself
<umdstu>
err second*(
tristanp_ has quit [Ping timeout: 246 seconds]
<umdstu>
include ftw!
lictor36 has joined #ruby
edwinvdgraaf has joined #ruby
Es0teric has joined #ruby
<jhass>
?better jolamb
<ruby[bot]>
jolamb: "Best" and "better" are subjective. Try to use a different term.
tristanp_ has joined #ruby
LoneHerm_ has quit [Ping timeout: 264 seconds]
<jolamb>
faster when looping over 100-300 elements
nankyokusei has joined #ruby
<umdstu>
probably the first i think
<GarethAdams>
jolamb: what is `v` in relation to the item in the loop?
tristanp has quit [Ping timeout: 272 seconds]
<jolamb>
GarethAdams: just some variable containing a symbol, which may be :a or :b
tristanp has joined #ruby
<GarethAdams>
so are you *selecting* items equal to :a or :b?
tristanp_ has quit [Ping timeout: 260 seconds]
qhan has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
<jolamb>
GarethAdams: nope
tristanp_ has joined #ruby
<jolamb>
ok, just timed it, the first form is faster
<qhan>
hey folks
<GarethAdams>
jolamb: my point is, when you're iterating, the way you're iterating (what you're trying to output) often changes the best way to write the thing in the loop
dimatteo has quit []
gtsai has quit [Remote host closed the connection]
JoshGlzBrk has joined #ruby
<GarethAdams>
so whether you're `select`ing or something else might affect your question
tristanp has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
<qhan>
anyone know does ruby maintain key ordering when iterating a hash
<jolamb>
GarethAdams: I understand and agree. This wasn't a question of selection though, I was just taking an action depending on some property of the current item in the set being iterated over
pabloh has quit [Quit: This computer has gone to sleep]
yuung has joined #ruby
<GarethAdams>
jolamb: :)
norc has quit [Ping timeout: 246 seconds]
<Zarthus>
jolamb: it may get faster if you try ary = [:a, :b]; do the loop; ary.include? v; end
codecop has joined #ruby
skade has joined #ruby
kareeoleez has joined #ruby
<Zarthus>
jolamb: all the same though, the or statement is probably faster regardless, just less easy to maintain in the future if it changes
synthroid has joined #ruby
<qhan>
hey I am new here
JoshGlzBrk has quit [Max SendQ exceeded]
<aegis3121>
I don't believe hash order is guaranteed, ^ qhan
<GarethAdams>
Hash order is guaranteed since 1.9 :)
JoshGlzBrk has joined #ruby
<aegis3121>
or that ¯\_(ツ)_/¯
jackjackdripper has joined #ruby
norc has joined #ruby
startupality_ has quit [Read error: Connection reset by peer]
<umdstu>
was there a change in ruby 1.9.x to 2.x with respect to the Hash class, where before I could access a key with `objc.entityAuths.entity` though now that results in “undefined method `entity’ for #<Hash:…”
trista___ has joined #ruby
tristanp has quit [Ping timeout: 244 seconds]
zenlot6 has joined #ruby
<apeiros>
umdstu: no
<apeiros>
either you didn't have a Hash back then, or you had a monkey patched Hash
<umdstu>
I saw HashWithIndifferentAccess somehwere
<apeiros>
that's from rails, and I don't think it had that either.
<umdstu>
yea its not, that was for a config file, just checked
zenlot has quit [Ping timeout: 276 seconds]
zeroDi has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
tristanp_ has quit [Ping timeout: 240 seconds]
trista___ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
smathy has joined #ruby
flak has joined #ruby
nertzy2 has joined #ruby
triangles3 has joined #ruby
jrafanie_ has joined #ruby
mozzarel1 has joined #ruby
yude_ has joined #ruby
umdstu_ has joined #ruby
last_staff1 has joined #ruby
centrx_ has joined #ruby
RedDwarf has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
Channel6 has joined #ruby
kgrz has quit [Ping timeout: 264 seconds]
habitullence_ has joined #ruby
Zackio has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
roamingdog has joined #ruby
norc_ has joined #ruby
last_staff has quit [Ping timeout: 258 seconds]
rippa has quit [Ping timeout: 258 seconds]
centrx has quit [Ping timeout: 258 seconds]
jrafanie has quit [Ping timeout: 258 seconds]
umdstu has quit [Ping timeout: 258 seconds]
habitullence has quit [Ping timeout: 258 seconds]
yude has quit [Ping timeout: 258 seconds]
Asher has quit [Ping timeout: 258 seconds]
nertzy has quit [Ping timeout: 258 seconds]
mozzarella has quit [Ping timeout: 258 seconds]
patrick_star_3 has quit [Ping timeout: 258 seconds]
triangles2 has quit [Ping timeout: 258 seconds]
last_staff1 is now known as last_staff
habitullence_ is now known as habitullence
centrx_ is now known as centrx
umdstu_ is now known as umdstu
patrick_star_3 has joined #ruby
norc has quit [Ping timeout: 260 seconds]
tristanp has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
<qhan>
\exit
qhan has quit [Quit: leaving]
Asher has joined #ruby
spider-mario has joined #ruby
tvw has joined #ruby
tristanp_ has joined #ruby
yfeldblum has joined #ruby
pabloh has quit [Quit: This computer has gone to sleep]
Channel6 has quit [Ping timeout: 260 seconds]
sauvin has quit [Remote host closed the connection]
trista___ has joined #ruby
tristanp has quit [Ping timeout: 276 seconds]
anisha has joined #ruby
arlek_ has joined #ruby
Channel6 has joined #ruby
whathapp_ has quit [Quit: Leaving...]
troulouliou_div2 has quit [Remote host closed the connection]
tristanp_ has quit [Ping timeout: 240 seconds]
trista___ has quit [Read error: Connection reset by peer]
JoshGlzBrk has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tristanp has joined #ruby
prestorium has joined #ruby
mikecmpbll has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
giz|work has joined #ruby
Gasher has joined #ruby
mikecmpbll has joined #ruby
Channel6 has quit [Ping timeout: 244 seconds]
arlek_ has quit [Ping timeout: 250 seconds]
tristanp_ has joined #ruby
nobitanobi has quit [Remote host closed the connection]
tristanp has quit [Read error: Connection reset by peer]
startupality has quit [Ping timeout: 276 seconds]
tristanp_ has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
tristanp has joined #ruby
SilverKey has quit [Read error: Connection reset by peer]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SilverKey has joined #ruby
roamingdog has quit [Remote host closed the connection]
vikid has joined #ruby
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
ibeekman has joined #ruby
jmignault has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lukec has quit [Quit: lukec]
wilbert has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
eL_bamba has joined #ruby
JoshGlzBrk has joined #ruby
Channel6 has joined #ruby
JoshGlzBrk has quit [Client Quit]
tristanp has quit [Ping timeout: 240 seconds]
CROOKED^HILLARY^ has quit [Ping timeout: 240 seconds]
recurrence has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
diegoviola has quit [Quit: WeeChat 1.5]
<recurrence>
I have a class that I want to put inside a module and submodule. Is there a way to define all that in one line? Ostensibly, is 'class ModuleA::ModuleB::ClassA' semantically the same?
tristanp has joined #ruby
<ibeekman>
Hi guys, I have basically no ruby experience other than a few Homebrew formula contributions. I'm currently trying to fix some stuff a certain formula installs using homebrew's `inreplace` with s.gsub! but ruby regular expressions are giving me a hell of a time... I've done some googling and read up in the ruby-docs on gsub and regexps but am still a bit lost. My problem is that I want to strip off the path from the compiler and linker
<jhass>
ibeekman: protip: a gist can have more than one file ;)
<smathy>
recurrence, you need to define the "containing" modules before using them as namespaces for ClassA.
zyzioziom has quit [Client Quit]
tristanp_ has quit [Ping timeout: 252 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
alxgsv has joined #ruby
symm- has joined #ruby
<jhass>
ibeekman: %r{...} literals help to get rid of the \/ headaches for starters
jenrzzz has joined #ruby
<recurrence>
Hi smathy, ah thanks!
tristanp_ has joined #ruby
<jhass>
ibeekman: [0-9.] is equivalent to . (any character)
Juanchito has quit [Quit: Connection closed for inactivity]
<jhass>
(you meant [0-9\.] most likely)
chouhou__ has joined #ruby
chouhoul_ has quit [Ping timeout: 276 seconds]
<smathy>
recurrence, you're welcome.
bronson has quit [Ping timeout: 252 seconds]
tristanp has quit [Ping timeout: 252 seconds]
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
chouhoulis has quit [Ping timeout: 244 seconds]
tristanp has joined #ruby
startupality has joined #ruby
blaxter has joined #ruby
<jhass>
ibeekman: the error says there's no nothing matching /\/usr\/local\/homebrew\/Library\/ENV\/4\.3\/clang\+\+/ in the file
elomatreb has left #ruby ["Leaving"]
<jhass>
which seems different to the code you've shown (using [0-9.]+ instead of 4\.3)
CJKinni` has joined #ruby
<ibeekman>
@jhass I moved the error to the same gist. re \. yes, so many different regexp dialects, and I'm not too familiar with ruby's... in sed, awk, grep etc. things taken inside [] usually don't need escaping... thanks also the %r{} is very usefull just reading up on that now... I'll perform some more
kobain has quit [Ping timeout: 260 seconds]
<ibeekman>
yes, sorry, 4.3 is the simplified case I got rid of the generic portion of the regexp
adac has joined #ruby
<jhass>
ibeekman: oh, looks like I was wrong about . needing escaping in [], sorry
majuscul1 is now known as majuscule
tvw has quit [Remote host closed the connection]
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CJKinni has quit [Ping timeout: 250 seconds]
<norc_>
ibeekman, your regex always matches with a trailing dot.
<norc_>
ibeekman, so it would match 1.2.3. rather than 1.2.3
<norc_>
Or. It does not.
<smathy>
:)
tristanp has quit [Read error: Connection reset by peer]
<smathy>
Ex-Perl people be like WHA!?!
tristanp has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
<norc_>
My head somehow does not stop spinning.
nando293921 has quit [Quit: Lost terminal]
<ibeekman>
jhass: yes the error is complaining about not matching, but it should be matching which is why I'm confused... norc_ yes it will match those cases... i feel like it is specific enough for my application though, the rest of the REGEXP is disambiguating that there is little to no danger of 1.2.3. being encountered... although . might be a problem... scratch that I'll use a grouping to do it correctly like you suggest
aegis3121 has quit [Ping timeout: 244 seconds]
stannard_ has joined #ruby
<jhass>
ibeekman: what's the real value you want to match?
stannard has quit [Ping timeout: 240 seconds]
tristanp_ has joined #ruby
nando293921 has joined #ruby
<jhass>
and what's the error matching your code (or the code matching your error)
chouhou__ has quit [Remote host closed the connection]
<ibeekman>
Lines like `GASNETTOOLS_CXX = /usr/local/homebrew/Library/ENV/4.3/clang++` should get replaced with `GASNETTOOLS_CXX = clang++`
saneax is now known as saneax_AFK
<ibeekman>
jhass I don't understand your most recent question
<jhass>
the error says your regex is /\/usr\/local\/homebrew\/Library\/ENV\/4\.3\/clang\+\+/
<jhass>
but your code doesn't have the \/4\.3\/ part
<jhass>
it has \/[0-9.]+\/ there instead
<jhass>
so there's a mismatch
tristanp has quit [Ping timeout: 264 seconds]
<jhass>
between the code you've run to get the error
<jhass>
and the code you've shown
skade has joined #ruby
tristanp has joined #ruby
<norc_>
jhass, Im actually wondering what the error message really means.
<ibeekman>
jhass yes the error is for replacing the `[0-9.]` with `4\.3`
codezomb has joined #ruby
<ibeekman>
I think it's from homebrew's `inreplace`... maybe I should be asking over there...
<norc_>
ibeekman, also please make it a habit to always include a stack trace for any ruby errors. It is probably not relevant in this case, but often it is very useful information.
skade has quit [Read error: Connection reset by peer]
<ibeekman>
Thanks for the help guys... I think I may have found the issue: the first gsub! is matching clang++ and clang, so it is stripping out the path. Then the second gsub gets there but ther are no longer any full paths to the clang++ shim.
barajasfab has quit [Quit: Ex-Chat]
banister has joined #ruby
gtsai has joined #ruby
<jhass>
yup sounds right
<jhass>
I suspected ENV.cc might be clang++ but that's just a variant of that issue
hutch34_ has quit [Ping timeout: 244 seconds]
<jhass>
(your code will fail if ENV.cc and ENV.cxx have the same value)
startupality has joined #ruby
<norc_>
ibeekman, note, the stack trace would then show that the offending line is the second call to gsub! there.
<norc_>
:o(
elementaru has joined #ruby
pabloh has joined #ruby
skade has joined #ruby
<ibeekman>
ENV.cc is clang and ENV.cxx is clang++ so the first substitution accidentally handles the second one...
<ibeekman>
norc_ I will make sure to remember to do it for next time, sorry I forgot it here
<norc_>
ibeekman, use a single gsub! with a backreferences like \1 maybe?
conta has quit [Ping timeout: 246 seconds]
LoneHermit has joined #ruby
lictor36 has quit [Quit: lictor36]
<ibeekman>
norc_ are there word boundaries? I know emacs regexp has \> for word boundary... that would let me handle the matches individually (because ENV.cc might be gcc and ENV.cxx might be g++ etc.)
tristanp has joined #ruby
tristanp_ has quit [Read error: Connection reset by peer]
gigetoo has quit [Ping timeout: 244 seconds]
<ibeekman>
oh \b?
skol has joined #ruby
<jhass>
ibeekman: it is in your setup, but can you guarantee for all possible setups? ;)
<jhass>
and yes, \b
skol has quit [Client Quit]
<jhass>
I mean $ should be fine here too
RobertBirnie has quit [Ping timeout: 240 seconds]
<jhass>
but is less general of course
joes has quit [Quit: leaving]
joes has joined #ruby
LoneHermit has quit [Ping timeout: 272 seconds]
rodfersou is now known as rodfersou|coffee
symm- has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
tristanp_ has joined #ruby
<umdstu>
*works on my machine*
* umdstu
closes ticket
RobertBirnie has joined #ruby
whathappens has joined #ruby
symm- has joined #ruby
<shevy>
:D
tristanp has quit [Ping timeout: 244 seconds]
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
jancel has joined #ruby
gtsai has quit [Remote host closed the connection]
kies has quit [Ping timeout: 264 seconds]
anisha has quit [Quit: Leaving]
<ibeekman>
umdstu are you a student at UMD?
roamingdog has joined #ruby
swills has quit [Ping timeout: 272 seconds]
<umdstu>
ibeekman: omg
<umdstu>
first person ever to actual make the connection
<umdstu>
actually*
<umdstu>
…but no
gtsai has joined #ruby
<umdstu>
not for a while at least
tristanp_ has joined #ruby
<ibeekman>
jhass I much prefer \b because there is no absolute garauntee it will be at the end of a line...
moeabdol has quit [Ping timeout: 250 seconds]
<ibeekman>
as for the [0-9] matching I'm doing something more robust...
chouhoul_ has joined #ruby
<ibeekman>
umdstu cool when did you graduate/quit/peace out? My advisor moved there from Princeton so I'm working for her at UMD while finishing my PhD from Princeton
chouhoul_ has quit [Remote host closed the connection]
startupality has quit [Ping timeout: 246 seconds]
chouhoul_ has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
pawnbox has quit [Ping timeout: 276 seconds]
chouhoulis has quit [Ping timeout: 272 seconds]
<umdstu>
graduated ‘09
<ibeekman>
oh cool. Ever work for UMIACS? Your ticket closing joke reminded me of a bunch of those guys
<umdstu>
yes i d
<umdstu>
did*
<ibeekman>
lol
<umdstu>
well
<umdstu>
i worked for the CS department
jackjackdripper has joined #ruby
diegoaguilar has quit [Remote host closed the connection]
<umdstu>
i’m super original with my usernames… when I was at virginia tech my username was…. vtechstu
* umdstu
drops mic
anisha has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality has joined #ruby
rodfersou|coffee is now known as rodfersou
tristanp_ has quit [Read error: Connection reset by peer]
tristanp has joined #ruby
umdstu has quit [Quit: umdstu]
ibeekman has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
whathappens has quit [Remote host closed the connection]
kirun has joined #ruby
skade has quit [Read error: Connection reset by peer]
stannard_ has quit [Remote host closed the connection]
skade has joined #ruby
lukec has joined #ruby
stannard has joined #ruby
stannard has quit [Remote host closed the connection]
skade has quit [Client Quit]
dhk has joined #ruby
Cohedrin has joined #ruby
codecop has quit [Remote host closed the connection]
skade has joined #ruby
slackbotgz has joined #ruby
seanzie has joined #ruby
gfvcastro has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tristanp_ has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
rkoller has quit [Read error: Connection reset by peer]
tristanp has quit [Read error: Connection reset by peer]
glcx_ has quit [Quit: This computer has gone to sleep]
rkoller has joined #ruby
axl_ has quit [Quit: axl_]
mdw has quit [Quit: Sleeping Zzzzz]
tristanp has joined #ruby
mauricar has quit [Quit: Leaving]
gtsai has quit [Remote host closed the connection]
gizless has joined #ruby
mwlang has quit [Quit: mwlang]
jenrzzz has joined #ruby
|2701 has joined #ruby
tristanp_ has quit [Ping timeout: 252 seconds]
glcx_ has joined #ruby
seanzie has quit [Quit: leaving]
joonty has quit [Ping timeout: 276 seconds]
SilverKey has quit [Quit: Halted.]
gizmore|2 has joined #ruby
tristanp_ has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
jancel has quit [Read error: Connection reset by peer]
gizmore|3 has joined #ruby
diegoviola has joined #ruby
gizmore has quit [Ping timeout: 244 seconds]
glcx_ has quit [Client Quit]
gizmore has joined #ruby
Channel6 has quit [Read error: Connection reset by peer]
gtsai has joined #ruby
nobitanobi has joined #ruby
gizless has quit [Ping timeout: 276 seconds]
tristanp has joined #ruby
gtsai has quit [Remote host closed the connection]
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
tristanp_ has quit [Read error: Connection reset by peer]
startupality has quit [Read error: Connection reset by peer]
_joes____ has quit [Client Quit]
import_this has quit [Client Quit]
nankyokusei has quit [Remote host closed the connection]
<jhass>
arthurl: well, passenger 2.2.2 is 7 years old
centrx has quit [Quit: centrx]
futilegames has joined #ruby
gtsai has quit [Remote host closed the connection]
<arthurl>
jhass yes- unfortunately the dev team can't upgrade this older rails 2.x app we have so i'm trying to move an existing web server that supports this app into aws, basically trying to mirror what we currently have it's running off of passenger 2.2.2
_joes____ has joined #ruby
<arthurl>
not sure if that's a requirement
<arthurl>
probably isn't
recurrence has quit [Ping timeout: 258 seconds]
<jhass>
stuck on old, likely insecure passenger, old & insecure ruby (known issues, yeah), guess you can just install a 7 years old OS while being stuck in 2009
_joes____ has quit [Client Quit]
<jhass>
if you use the time machine, do it fully
slackbotgz has quit [Remote host closed the connection]
jancel has quit [Remote host closed the connection]
<jhass>
I bet on either your gcc or boost being "too new", probably both
moeabdol has joined #ruby
<jhass>
also it looks like you're trying to compile the passenger 2.2.2 installed to your ruby-1.9.3-p551 with your ruby-1.8.7-head activated
pjaspers has quit [Remote host closed the connection]
<jhass>
please just never connect that thing to the internet
tristanp has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
gtsai has joined #ruby
adac has quit [Ping timeout: 252 seconds]
tristanp has joined #ruby
roamingdog has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
blackgoat has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
roamingdog has joined #ruby
tristanp_ has joined #ruby
devwop has joined #ruby
diegoviola has quit [Quit: WeeChat 1.5]
devwop has left #ruby [#ruby]
moeabdol has quit [Ping timeout: 250 seconds]
trista___ has joined #ruby
borodin has quit [Quit: Page closed]
tristanp has quit [Ping timeout: 252 seconds]
Snowy has joined #ruby
<smathy>
(or let us all know the IP if you do)
swills has joined #ruby
tristanp_ has quit [Ping timeout: 252 seconds]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
startupality has joined #ruby
VeryBewitching has joined #ruby
trista___ has quit [Read error: Connection reset by peer]
seanzie has quit [Quit: leaving]
Snowy has quit [Remote host closed the connection]
tristanp has joined #ruby
<tgeeky>
jhass: thanks for your help last night. I ended up making use of the ->(match) { } lambda syntax
duckpuppy has quit [Ping timeout: 260 seconds]
hutch34_ has joined #ruby
<tgeeky>
jhass: I actually didn't see your link until very much later
finisherr has joined #ruby
johnmilton has quit [Remote host closed the connection]
<jhass>
well that was the least relevant part of it
<tgeeky>
well, it was a part that was critical to me getting it to work properly
gtsai has quit [Read error: Connection reset by peer]
<jhass>
you already had Proc.new?
tomphp has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
<jhass>
that's roughly equivalent, for this usecase anyhow
<tgeeky>
procs didn't work right for some reason
<tgeeky>
well, they didn't work as I tried them
<jhass>
sure, the issue must've been elsewhere and you misinterpreted that as the cause
gtsai has joined #ruby
kobain has joined #ruby
centrx has joined #ruby
jmignault has quit [Quit: quittin' time, Ralph]
<tgeeky>
the issue was that I was desiring the proc to be executed in the context of the caller
jmignault has joined #ruby
synthro__ has quit []
<tgeeky>
and i needed to explicitly pass in something for it to work
<tgeeky>
there is the code that I finally got working properly
smathy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<tgeeky>
i am now going to make the other changes you reccomended (though I'm not moving away from nested multimap yet
<tgeeky>
)
bronson has joined #ruby
diegoaguilar has joined #ruby
<tgeeky>
jhass: but this code properly mimics the if/elsif/elsif/elsif/else behavior, and reduces the number of times the regex is used to a minimum
SilverKey has joined #ruby
<tgeeky>
jhass: I can't show you actual output, as the data is real, but it works.
<arthurl>
jhass thank you for the insight sir- and yes no plans to have this thing ever talk to the internet :)
<tgeeky>
jhass: anyway, your support and your code helped me in my time of need, and helped guide me in the right direction.
<tgeeky>
jhass++
<tgeeky>
aww, no karmabot
<arthurl>
"also it looks like you're trying to compile the passenger 2.2.2 installed to your ruby-1.9.3-p551 with your ruby-1.8.7-head activated" is that necessarily a problem ?
<jhass>
yes
elaptics`away is now known as elaptics
crystal77 has joined #ruby
pabloh has quit [Quit: This computer has gone to sleep]
curses has joined #ruby
bronson has quit [Ping timeout: 244 seconds]
platzhirsch has quit [Ping timeout: 240 seconds]
platzhirsch has joined #ruby
nobitanobi has quit [Remote host closed the connection]
<tgeeky>
jhass: one thing you mentioned, and I still want to do
<tgeeky>
jhass: how do I turn the from_table string into an actual ruby method identifying the ActiveRecord connection?
<tgeeky>
ie, 'contact'
lukec has quit [Quit: lukec]
<tgeeky>
(i mean to_table)
Gasher has quit [Quit: Leaving]
moredhel has quit [Remote host closed the connection]
<jhass>
idk your context enough and I'm not really up to crawl through that new mess you posted
<jhass>
stuff to investigate is Object#public_send, Object#instance_variable_get
<tgeeky>
jhass: it's tremendously less messy now, there is just more extra code
<jhass>
when ((not I stop reading there
<tgeeky>
jhass: ok thanks
curses has quit [Client Quit]
fmcgeough has quit [Quit: fmcgeough]
tristanp_ has joined #ruby
workmad3 has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
<tgeeky>
jhass: in which case, you already read the relevant part to my question
<jhass>
nah I scrolled around
<arthurl>
jhass switching over via 'rvm use ruby-1.9.3-p551' made no difference unfortunately
<jhass>
chances are you might even just be able to store the object where you store the string currently
curses has joined #ruby
<tgeeky>
jhass: yes, I thought of that. We'll find out, I guess. I need to make a connection pool, eventually.
<jhass>
arthurl: didn't expect it so, the issues with that would arise after successful compilation
<jhass>
arthurl: that's still more of a gcc/boost issue
<jhass>
tgeeky: AR has one internally
rodfersou has quit [Quit: leaving]
tristanp has joined #ruby
nando293921 has quit [Quit: Lost terminal]
tristanp_ has quit [Read error: Connection reset by peer]
DoubleMalt has quit [Remote host closed the connection]
<tgeeky>
jhass: do you know if AR cares about different classes inside transactions? ie: Contact.transaction do ... some_other_table = SomeOtherTable...
<jhass>
no idea
<tgeeky>
roger, thanks.
moei has quit [Quit: Leaving...]
nando293921 has joined #ruby
ajax0xd9 has joined #ruby
skade has quit [Read error: Connection reset by peer]
tomphp has quit [Ping timeout: 246 seconds]
noway_ has quit [Ping timeout: 264 seconds]
recurrence has joined #ruby
tristanp_ has joined #ruby
Devalo has quit [Remote host closed the connection]
nando293921 has quit [Client Quit]
tomphp has joined #ruby
jenrzzz_ has joined #ruby
startupality has quit [Read error: Connection reset by peer]
RegulationD has quit [Remote host closed the connection]
<tgeeky>
neha-: the concept is easy for mapreduce. map takes a set of things to some other set of things. reduce takes a set of things, and repeats some operation until you only have one thing left.
<neha->
yeah i get that, i'm not sure of the syntax of jhass' line
recurrence has joined #ruby
<neha->
is 0 just the initial val and then sum the running total?
whathapp_ has joined #ruby
whathapp_ has quit [Read error: Connection reset by peer]
<tgeeky>
neha-: 0 is not the initial value, it's the default value.
skade has joined #ruby
<tgeeky>
if you are adding a bunch of things together, 0 is the value which will have no effect
<tgeeky>
neha-: when in doubt, do a microbenchmark to prove it's better :O
johnmilton has joined #ruby
<neha->
haha how do you do that
tgeeky has quit [Quit: Lost terminal]
amnan has joined #ruby
<neha->
i see there are some microbenchmark frameworks :o
<jhass>
benchmark-ips is probably the easiest still to get it fairly right
<neha->
cool
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
kith has joined #ruby
<Guest7245>
jhass: ahh, perfect! I haven't used each_with_object... nice
lukec has quit [Quit: lukec]
rbennacer has quit [Ping timeout: 272 seconds]
arthurl has quit [Ping timeout: 252 seconds]
tgeeky has joined #ruby
<tgeeky>
heh. that's a first. I somehow hit a hotkey to logout of my computer and couldn't stop it.
Guest7245 has quit [Quit: Page closed]
johnmilton has quit [Ping timeout: 260 seconds]
eGGshke has quit [Quit: Leaving...]
elaptics is now known as elaptics`away
dstarh has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kareeoleez has quit [Remote host closed the connection]
GarethAdams has joined #ruby
tristanp has joined #ruby
Dysp has quit [Read error: Connection reset by peer]
tristanp_ has quit [Ping timeout: 258 seconds]
madgen has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
bluOxigen has quit [Ping timeout: 250 seconds]
tristanp has quit [Ping timeout: 252 seconds]
joevandy1 is now known as joevandyk
norc_ has quit [Ping timeout: 250 seconds]
bluOxigen has joined #ruby
whathappens has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 272 seconds]
whathappens has joined #ruby
tristanp_ has quit [Ping timeout: 258 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ledestin has joined #ruby
Juanchito has joined #ruby
jmignault has quit [Ping timeout: 252 seconds]
ChiefAlexander has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
tristanp has joined #ruby
bmurt has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hahuang65 has quit [Ping timeout: 260 seconds]
whathappens has quit [Ping timeout: 264 seconds]
hutch34 has quit [Ping timeout: 258 seconds]
Ebok has quit [Quit: This computer has gone to sleep]
unreal has quit [Read error: Connection reset by peer]
norc_ has joined #ruby
amnan has quit [Quit: Goodbye]
unreal has joined #ruby
jnoob22 has joined #ruby
recurrence has quit [Ping timeout: 276 seconds]
sneakersec has quit [Ping timeout: 260 seconds]
snguyen has joined #ruby
recurrence has joined #ruby
Azure has joined #ruby
gtsai_ has joined #ruby
jmignault has joined #ruby
jmignault has quit [Read error: Connection reset by peer]
jmignault has joined #ruby
centrx has joined #ruby
gtsai has quit [Ping timeout: 252 seconds]
chrisja has joined #ruby
Devalo has joined #ruby
whathappens has joined #ruby
snguyen has quit [Client Quit]
snguyen has joined #ruby
whathapp_ has joined #ruby
m_antis has joined #ruby
axl_ has quit [Quit: axl_]
curses has quit []
A124 has quit [Ping timeout: 272 seconds]
sfmk has joined #ruby
stannard_ has quit [Remote host closed the connection]
A124 has joined #ruby
jmignault has quit [Ping timeout: 244 seconds]
k3rn31 has quit [Quit: Computer has gone to sleep.]
Devalo has quit [Ping timeout: 276 seconds]
whathappens has quit [Ping timeout: 272 seconds]
whathappens has joined #ruby
startupality has quit [Read error: Connection reset by peer]
neanderslob has quit [Ping timeout: 246 seconds]
whathapp_ has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
yfeldblum has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sammichmaker has joined #ruby
sepp2k has quit [Quit: Leaving.]
moeabdol has joined #ruby
startupality has joined #ruby
bobbycvi has joined #ruby
whathappens has quit [Remote host closed the connection]
whathappens has joined #ruby
<tobiasvl>
if I run an external program with IO.popen, which first prompts the user for something, and only when the user has input that do I want to puts to it, how do I do that?
<tobiasvl>
or should I just gets from the user first and puts that to the IO maybe
tristanp has quit [Read error: Connection reset by peer]
whathapp_ has joined #ruby
crystal77 has joined #ruby
tristanp has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
tacit7 has quit [Ping timeout: 244 seconds]
snguyen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nankyokusei has joined #ruby
dhollinger has quit [Quit: WeeChat 1.4]
roamingdog has quit [Remote host closed the connection]
pabloh has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
tristanp_ has joined #ruby
moei has joined #ruby
mtkd has joined #ruby
eL_bamba has quit [Quit: Leaving]
whathappens has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
trista___ has joined #ruby
spider-mario has quit [Remote host closed the connection]
gigetoo has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
snguyen has joined #ruby
nankyokusei has quit [Ping timeout: 264 seconds]
[Butch] has quit [Quit: I'm out . . .]
recurrence has quit [Read error: Connection reset by peer]
tristanp_ has quit [Ping timeout: 252 seconds]
k3rn31 has joined #ruby
jancel has joined #ruby
tristanp has joined #ruby
solars has quit [Ping timeout: 252 seconds]
trista___ has quit [Read error: Connection reset by peer]
SilverKey has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
Contigi has joined #ruby
benlieb has quit [Quit: benlieb]
jancel has quit [Ping timeout: 252 seconds]
startupality has quit [Ping timeout: 276 seconds]
dhk has joined #ruby
snguyen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenlot has joined #ruby
kies has joined #ruby
zenlot6 has quit [Ping timeout: 252 seconds]
kies has quit [Max SendQ exceeded]
k3rn31 has quit [Quit: Computer has gone to sleep.]
marr has joined #ruby
gfvcastro has quit [Quit: My Mac has gone to sleep. ZZZzzz…]