beilabs has quit [Remote host closed the connection]
lacuna has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackjid has quit [Max SendQ exceeded]
Pupeno has joined #ruby
grassass has joined #ruby
noobsu has joined #ruby
coffeecupp has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
ryan_notabot has quit [Quit: Leaving]
yfeldblum has joined #ruby
blackjid has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
blackjid has quit [Max SendQ exceeded]
blackjid has joined #ruby
elifoster has joined #ruby
noobsu has quit [Ping timeout: 244 seconds]
lightt has quit [Remote host closed the connection]
blackjid has quit [Max SendQ exceeded]
Pupeno has quit [Ping timeout: 250 seconds]
<jphase>
it seems my "rails g controller welcome index" command just hangs after creating a new project and trying to add "gem 'foundation-rails'" to my Gemfile and running bundle. Anyone know what I could be doing wrong?
blackjid has joined #ruby
blaxter has joined #ruby
blackjid has quit [Max SendQ exceeded]
Coldblackice has quit [Ping timeout: 260 seconds]
c355e3b has quit [Quit: Connection closed for inactivity]
flopsec has quit [Remote host closed the connection]
alxgsv has quit [Remote host closed the connection]
Guest20497 has quit [Remote host closed the connection]
illusionmedic has quit [Remote host closed the connection]
mwlang has quit [Quit: mwlang]
beilabs has joined #ruby
mwlang has joined #ruby
blackjid has joined #ruby
agent_white has joined #ruby
mwlang has quit [Client Quit]
blackjid has quit [Max SendQ exceeded]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lightt has joined #ruby
mooe has quit [Quit: Connection closed for inactivity]
<agent_white>
Evenin'
blackjid has joined #ruby
blackjid has quit [Max SendQ exceeded]
blackjid has joined #ruby
blackjid has quit [Max SendQ exceeded]
certainty has joined #ruby
tmtwd has quit [Quit: Leaving]
beilabs has quit [Remote host closed the connection]
<arif__>
i'm trying to access the variable 'name' outside the loop? is there an alternative way of doing it other than initializing the variable at the very beginning?
simplon has joined #ruby
CausaMortis has joined #ruby
<apeiros>
arif__: not with this kind of loop
simplon has quit [Client Quit]
<apeiros>
and this kind of variable
jottr_ has quit [Ping timeout: 240 seconds]
<arif__>
could you please give an example what kind of loop/variable that'd work with?
ensyde has quit [Ping timeout: 264 seconds]
<apeiros>
while/until loops don't use a block argument and thus don't introduce a new scope for local variables
<dtoast>
quick, timezones.
<apeiros>
as for other variable types: please learn ruby for those. a quick explanation won't do.
<arif__>
but while/until loops check for the condition at the beginning of the loop and won't work in this case
<apeiros>
of course it will work. you just have to arrange your code accordingly.
elifoster has quit [Quit: sleep]
Spami_ has joined #ruby
Spami has quit [Read error: Connection reset by peer]
blackjid has joined #ruby
<arif__>
i'm confused. i'd be more than glad if you could kindly rearrange this particular code using while or any other loop that doesn't use a block argument
aguynamedben has joined #ruby
aguynamedben has quit [K-Lined]
blackjid has quit [K-Lined]
yfeldblu_ has joined #ruby
<apeiros>
valid = false; until valid; …
coffeecupp has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
yfeldblum has quit [Ping timeout: 250 seconds]
nankyokusei has joined #ruby
ur5us has joined #ruby
* apeiros
afk for ~10min
arooni has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arif__ has quit [Quit: Page closed]
karmatr0n has joined #ruby
coffeecupp has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 264 seconds]
karmatr0n has quit [Ping timeout: 276 seconds]
jaguarmagenta has quit [Remote host closed the connection]
ta_ has joined #ruby
dgynn has quit [Quit: dgynn]
djbkd has joined #ruby
kareeole_ has joined #ruby
kareeole_ is now known as kareeoleez_
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kareeoleez_ is now known as kareeoleez__
kareeoleez has quit [Disconnected by services]
kareeoleez__ is now known as kareeoleez
k3rn31 has quit [Quit: Computer has gone to sleep.]
edwinvdgraaf has quit [Remote host closed the connection]
edwinvdgraaf has joined #ruby
cd83x has joined #ruby
jerematic has joined #ruby
TomyWork has joined #ruby
Madplatypus has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
CloCkWeRX has joined #ruby
cd83x has quit [Ping timeout: 260 seconds]
biberu has joined #ruby
jerematic has quit [Ping timeout: 264 seconds]
terlar has joined #ruby
Couch has joined #ruby
Es0teric has joined #ruby
noobsu has quit [Ping timeout: 244 seconds]
tpendragon has joined #ruby
norc_ has joined #ruby
aguynamedben has joined #ruby
blackjid has joined #ruby
Macaveli_ has joined #ruby
noobsu has joined #ruby
darkxploit has quit [Ping timeout: 258 seconds]
kraken_ has quit [Quit: Leaving]
pepee has quit [Quit: bye $IRC]
Macaveli has quit [Ping timeout: 276 seconds]
coffeecupp has quit [Ping timeout: 272 seconds]
last_staff has quit [Remote host closed the connection]
<apeiros>
conventionally you'll only do that in your initial reply. further lines it's implied.
moeabdol has joined #ruby
<apeiros>
liri: ah, that ominous problem from yesterday with multiple occurrences of the same module in ancestry?
<liri>
yes
<apeiros>
hm
pawnbox has quit [Remote host closed the connection]
<liri>
isn't it peculiar, that the order in which you include module causes differences in ancestors list?
devbug_ has quit [Ping timeout: 258 seconds]
craigp has quit [Ping timeout: 246 seconds]
<apeiros>
it actually makes sense
arif__ has quit [Quit: Page closed]
moeabdol1 has joined #ruby
pawnbox has joined #ruby
<apeiros>
I didn't know it was possible to do it. but seems I have to update my knowledge wrt module inclusion
<liri>
why having two times included the same module makes a sense ?
<liri>
I had following problem
Devalo has joined #ruby
<liri>
my code was structured like in the sample below, so include at the top level first, then include at class level.
<apeiros>
say you have class A, and B < A, and you included M first in B, then in A
<liri>
it caused, that ancestors list was in following order: A, Object, M, PP::ObjectMixin, Kernel, BasicObject]
<apeiros>
if a method of A relies on a method of M, it would not be possible
<liri>
and then I required active_record.
<liri>
which modified Object, and caused that method try in M was shadowed by method try in Object, patched by active_record.
<apeiros>
hence it makes sense that it is possible to still inject the module into A's ancestry (which of course means it'll appear a second time in B's ancestry)
moeabdol has quit [Ping timeout: 276 seconds]
<apeiros>
well, welcome to the world of why it's bad to patch core classes
<liri>
yes, but talking about your sample.
<norc>
apeiros: oh but patching core classes is useful. Especially if you mount method_missing everywhere.
* norc
smiles
Devalo has quit [Ping timeout: 250 seconds]
<liri>
having class A, and B < A, where both A and B include M, B.ancestors shows: [B, A, M, Object, PP::ObjectMixin, Kernel, BasicObject]
<apeiros>
norc: useful isn't congruent with good ;-)
<liri>
shouldnt it be [B, M, A, M, Object, PP::ObjectMixin, Kernel, BasicObject]
<liri>
Or M can't be duplicated in ancestos list then, [B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject]
beilabs has quit [Remote host closed the connection]
<norc>
liri: The method name is a bit bad. What it really returns is the order in which Ruby looks your methods up.
<liri>
so if module M is included in B, shouldnt lookup be B, M , A ....
<apeiros>
liri: as we've learnt: not necessarily. it depends on the order you included M
<liri>
instead of B, A, M ...
<apeiros>
i.e. B, M, A, M -> included M in B first, then in A (which seems exceptional to me)
<apeiros>
and B, A, M -> included in A first, including it in B after that won't matter since ruby detects M's presence in the ancestry and won't include it again, not even in a different place.
<liri>
yeah it would be strange, to do it, first in sublcass and afterwards in base class.
<apeiros>
there's also Module#prepend
<liri>
ah, ok now I understand.
<norc>
apeiros: Have you seen what prepend does under the hood?
<norc>
It is downright disgusting.
<liri>
yeah I know about it :) but don't want to mix it :)
<apeiros>
norc: I haven't even used it yet
<norc>
apeiros: It duplicates classes, injects them into the superclass chain
<apeiros>
norc: more disgusting than refinements?
lightt has joined #ruby
<norc>
apeiros: Don't get me started on refinements.
ddffg has quit [Quit: Leaving]
<liri>
So if someone uses include at top level in some file, it is going to be messy sooner or later.
<apeiros>
patching Object by any other means than refinements is by definition messy.
<norc>
apeiros: See, *this* is why I want a builtin casting mechanism.
Dimik has quit [Ping timeout: 244 seconds]
<norc>
apeiros: So you can just derive from Object and downcast whenever you need to.
<apeiros>
what would that give you?
einarj has joined #ruby
<apeiros>
you can always copy all data from any object into a blank object…
jaguarmagenta has joined #ruby
<norc>
apeiros: except then you have to delegate all methods to object...
<apeiros>
and you can always rebind methods. well, ok: often. I still don't get why it requires ancestry to rebind :-/
<norc>
This is what inheritance solves. ;-)
yfeldblu_ has quit [Ping timeout: 250 seconds]
<apeiros>
norc: so still - what does downcasting to object give you?
<norc>
apeiros: not downcasting to object
<norc>
(that you could only do with BasicObject)
<norc>
apeiros: downcasting *from* object to your custom object class MyObject < Object
wazzat has joined #ruby
<apeiros>
wouldn't that rather be "upcasting"? :)
<apeiros>
well, you can do that
<norc>
apeiros: nope. up-casting is casting an object to its supertype.
marr has joined #ruby
<apeiros>
I wonder why we have reversed notions of the direction…
<apeiros>
down -> simpler type, =~ "up" in the ancestry
<arne>
would be great for minimal obfscusfufication i cannot write that word
<arne>
obscurfication
noobsu has joined #ruby
<norc>
Well that is the one thing its not meant for. ;-)
<norc>
Well. Okay, "minimal".
<arne>
yeah that's why i added that :)
<norc>
:)
<hanmac>
obscurfication is so obscure that no one can type it right at the first try XD
<norc>
arne: The VM bit also has a debugging advantage by the way.
<arne>
will ruby have an option to precompile who files? i think that'd be gr8
<norc>
arne: Since Ruby allows you to inspect bytecode there are some corner cases where looking at bytecode can reveal some strange behaviour you may be experiencing.
<arne>
well actually that could be done with an gem..
<ruby[bot]>
norc: # => "YARB\x02\x00\x00\x00\x03\x00\x00\x00\x91\x02\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x0 ...check link for more (https://eval.in/582471)
Gasher has joined #ruby
noobsu has joined #ruby
<norc>
Bish: the disasm is just disassembling into a human readable form. :)
kariolee_ has joined #ruby
<norc>
(Which is what my asm>> does)
<Bish>
i get it
jerematic has joined #ruby
skade has joined #ruby
<norc>
Bish: If you are really interested into the internals of Ruby there is a superb book, "Ruby Under a Microscope"
ohcibi has quit [Quit: No Ping reply in 180 seconds.]
ruby-lang764 is now known as liri
contradictioned has quit [Quit: No Ping reply in 180 seconds.]
kalleth has quit [Quit: No Ping reply in 180 seconds.]
heftig has quit [Remote host closed the connection]
Rush has quit [Remote host closed the connection]
Hobbyboy has quit [Ping timeout: 260 seconds]
bauruine has quit [Ping timeout: 260 seconds]
soahccc has quit [Ping timeout: 260 seconds]
RushPL has quit [Remote host closed the connection]
phredus has quit [Remote host closed the connection]
grvgr has joined #ruby
craigp has joined #ruby
blaxter has joined #ruby
zacsek has joined #ruby
majjoha has joined #ruby
whiteline has joined #ruby
iceden has joined #ruby
Insti has joined #ruby
shadowshell has joined #ruby
ketherah has joined #ruby
chorgi has joined #ruby
minimalism has quit [Quit: minimalism]
nankyokusei has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
theozaurus has joined #ruby
TomyWork has joined #ruby
flopsec has joined #ruby
webhat_ has joined #ruby
fenre has joined #ruby
jrafanie has joined #ruby
tw1sted has joined #ruby
eljimador has joined #ruby
Antiarc has joined #ruby
M-shine has joined #ruby
hypnosb has joined #ruby
forgot has joined #ruby
mame3 has joined #ruby
KillerFox has joined #ruby
darkxploit has quit [Ping timeout: 276 seconds]
DaniG2k has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
<theozaurus>
Hi All, I'm trying to figure out if I can get a couple of consumers of an enumerable to execute in the order that I want. Check out: https://gist.github.com/theozaurus/354c755470b1ef7e1c34234c90567f9e . I can't work out how to properly deal with the stream within class A. Any help would be really appreciated!
<norc>
theozaurus: Use .zip? :)
<theozaurus>
Oooh, let me have a play
<norc>
theozaurus: oh wait that wont really help with what you are doing.
<theozaurus>
Okay, it's a little more realistic now. Essentially I am expecting a huge stream of things and I don't want to run through it multiple times, but I also don't want my processors to be side affect free.
jerematic has quit [Ping timeout: 244 seconds]
certainty has quit [Ping timeout: 272 seconds]
bodgix has joined #ruby
<theozaurus>
* I also want my processors to be side affect free
Fernando-Basso has joined #ruby
<Bish>
ruby with jit would be so awesome
moeabdol1 has joined #ruby
<apeiros>
use jruby?
<Bish>
well my guess is im using c extensions everyhwer
hiyosi has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
<shevy>
Bish one day! all the good things will come to us. we need more C gurus
cd83x has joined #ruby
AlexJakeGreen has joined #ruby
blandflakes has quit [Client Quit]
sid_fules has joined #ruby
harai54 has quit [Ping timeout: 250 seconds]
maletor3 has joined #ruby
<norc>
theozaurus: Have you a) had performance problems and b) profiled your code to determine that particular code to be problematic?
<norc>
If not you are wasting time on a premature optimization.
<theozaurus>
It's a system designed to process millions of events so I want to make sure my architecture is sensible.
jespada has joined #ruby
Jamo_ has joined #ruby
<norc>
Fair enough.
Jamo__ has joined #ruby
cd83x has quit [Ping timeout: 276 seconds]
<norc>
theozaurus: Do you want to roll your own, or is something like eventmachine a possibility?
Jamo_ has quit [Client Quit]
Madplatypus has quit [Quit: Connection closed for inactivity]
Jamo_ has joined #ruby
maletor3 has quit [Ping timeout: 258 seconds]
<theozaurus>
I don't think I need a reactor loop to do what I want. I'm hoping that there is a primitive I can take advantage of which will save the complexity of EM.
duckpuppy has joined #ruby
Jamo has quit [Remote host closed the connection]
Jamo__ has quit [Remote host closed the connection]
Jamo_ has quit [Remote host closed the connection]
xlegoman has joined #ruby
Jamo has joined #ruby
karapetyan has joined #ruby
hanmac has quit [Ping timeout: 250 seconds]
lacce has quit []
Snowy has joined #ruby
sdothum has joined #ruby
ddffg has joined #ruby
allcentury has joined #ruby
duckpuppy has quit [Ping timeout: 260 seconds]
electrostat has quit [Remote host closed the connection]
noobsu has quit [Remote host closed the connection]
electrostat has joined #ruby
certainty has joined #ruby
<chrisseaton>
norc: I don't think anyone is actually working on a jit though are they?
ldnunes has joined #ruby
<chrisseaton>
It would be great but someone with the skills actually needs to do the work and nobody seems to want to do it
<norc>
chrisseaton: It will be some outside solution.
<jhass>
option parser probably just doesn't support what you want then
evidex has joined #ruby
rbr has quit [Ping timeout: 244 seconds]
rbr has joined #ruby
certainty has quit [Ping timeout: 260 seconds]
darkxploit has quit [Ping timeout: 244 seconds]
sdothum has joined #ruby
nullwarp has joined #ruby
nettoweb has quit [Ping timeout: 240 seconds]
<romistrub>
So I'm building a custom Ruby HTTP server and need a hosting site for it. Can DigitalOcean do that?
last_staff has quit [Quit: last_staff]
<apeiros>
yes
<romistrub>
apeiros: it did crash, haha, then I figured out why it crashed and fixed it. Just skipped that step in the explanation.
<romistrub>
apeiros: awesome, thanks
<apeiros>
romistrub: aha!
synthroi_ has joined #ruby
cd83x has joined #ruby
xlegoman has joined #ruby
certainty has joined #ruby
duoi has quit [Max SendQ exceeded]
duoi has joined #ruby
karmatr0n has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
synthroid has quit [Ping timeout: 246 seconds]
duoi has quit [Max SendQ exceeded]
duoi has joined #ruby
uncertainty has quit [Ping timeout: 276 seconds]
synthroid has joined #ruby
saneax is now known as saneax_AFK
cd83x has quit [Ping timeout: 258 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pupeno has joined #ruby
goeast has joined #ruby
darkxploit has joined #ruby
ArgartellO has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
synthroi_ has quit [Ping timeout: 244 seconds]
karmatr0n has quit [Ping timeout: 260 seconds]
deadnull_ has joined #ruby
certainty has joined #ruby
codecop has quit [Remote host closed the connection]
bruce_lee has joined #ruby
maletor3 has joined #ruby
duckpuppy has joined #ruby
<norc>
apeiros: If code magically works that should be crashing, that would be worrying more than the segmentation fault screen from Ruby I regularly get.
wazzat has joined #ruby
<norc>
Well okay, the seg fault screen does not worry me anymore... at all...
<apeiros>
you're fearless
ArgartellO has quit [Quit: Leaving]
fmcgeough has joined #ruby
Pupeno has quit [Ping timeout: 252 seconds]
maletor3 has quit [Ping timeout: 240 seconds]
<norc>
Actually I fear a great many things. Tigers, bombs exploding near me, "Hello Kitty"...
flashpoint9 has joined #ruby
davedev24 has joined #ruby
<norc>
If only I had a VT100 that I could plug into my brain, I would be able to reprogram myself to remove fear.
darkxploit has quit [Ping timeout: 258 seconds]
<adaedra>
You shouldn't, fear is sometimes useful.
bkxd_ has quit [Ping timeout: 250 seconds]
rubito has joined #ruby
r_rios has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
<shevy>
tigers are very useful!
Pupeno has joined #ruby
haxrbyte has joined #ruby
noobsu_ has joined #ruby
<norc>
adaedra: You think? I always thought standing on a street and not running away when a car approaches could be the better solution. Sadly I have no prior experience to draw from.
<norc>
So this is just a theory.
<adaedra>
Don't worry, many people experienced before you.
nankyokusei has joined #ruby
rubito has left #ruby [#ruby]
<norc>
Doesn't the scientific method require me to be skeptical of other peoples findings? Repeating other peoples experiments is important, perhaps their experiments had some fundamental flaws.
solocshaw1 has joined #ruby
kies has quit [Ping timeout: 246 seconds]
nankyokusei has quit [Ping timeout: 276 seconds]
hutch34_ has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
solocshaw1 is now known as solocshaw
infra-red has quit [Remote host closed the connection]
infra-red has quit [Remote host closed the connection]
karmatr0n has joined #ruby
Tempesta has quit [Quit: See ya!]
ramortegui has joined #ruby
moei has quit [Quit: Leaving...]
tlaxkit has quit [Quit: ¡Adiós!]
infra-red has joined #ruby
<jhass>
shouldn't you be the observer in your experiments, not the actor?
Tempesta has joined #ruby
certainty has quit [Ping timeout: 272 seconds]
darkxploit has quit [Ping timeout: 276 seconds]
sid_fules has quit [Read error: Connection reset by peer]
<tildes>
didn't some scientists in the good old days conduct experiments on themselves too, such as tasting radioactive substances, conducting electric current to their brain, etc?
jerematic has joined #ruby
<jhass>
more than necessary I imagine, given the difficulty of writing up your results after some of that
kies has joined #ruby
<tildes>
this was probably more common back in the days, when scientific publishing took place either in latin, or through hand-written letters
<tildes>
(or both of course)
ChiefAlexander has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jerematic has quit [Ping timeout: 244 seconds]
aegis3121 has joined #ruby
sdothum has joined #ruby
sdothum has quit [Client Quit]
camilasan has quit [Read error: Connection reset by peer]
infra-red has quit []
camilasan has joined #ruby
<shevy>
I pity those old folks - they had no ruby
dcluna has joined #ruby
sdothum has joined #ruby
kareeole_ has joined #ruby
solars has joined #ruby
ocbtec has quit [Quit: leaving]
kareeole_ is now known as kareeoleez_
kareeoleez has quit [Ping timeout: 276 seconds]
ta_ has quit [Remote host closed the connection]
hutch34 has joined #ruby
Devalo has joined #ruby
domgetter has quit [Ping timeout: 276 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rippa has joined #ruby
kareeoleez_ is now known as kareeoleez
hutch34_ has quit [Ping timeout: 240 seconds]
k3rn31 has joined #ruby
zacsek has quit [Ping timeout: 260 seconds]
cd83x has joined #ruby
Devalo has quit [Ping timeout: 240 seconds]
sdothum has joined #ruby
sid_fules has joined #ruby
GodFather has quit [Quit: Ex-Chat]
allcentury has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
malconis has joined #ruby
cd83x has quit [Ping timeout: 246 seconds]
theozaurus has joined #ruby
jaguarmagenta has joined #ruby
Macaveli has joined #ruby
kies has quit [Ping timeout: 276 seconds]
andikr has quit [Remote host closed the connection]
<norc>
jhass: You see, that was just darwinism at work. Over time only the good scientists survived, which brought us the technical revolution.
jaguarmagenta has quit [Ping timeout: 250 seconds]
wazzat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
d0lph1n98 has joined #ruby
wazzat has joined #ruby
millerti has joined #ruby
Macaveli has quit [Ping timeout: 272 seconds]
ips|malc has joined #ruby
roamingdog has joined #ruby
freerobby has joined #ruby
maletor3 has joined #ruby
Hyuk has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
Hyuk has quit [Client Quit]
maletor3 has quit [Ping timeout: 244 seconds]
jerematic has joined #ruby
allcentury has joined #ruby
JakFrist has joined #ruby
ZeroeSparticus has joined #ruby
JesseH has quit [Remote host closed the connection]
sid_fules has joined #ruby
crystal77 has joined #ruby
frem_ has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
futilegames has joined #ruby
SilverKey has joined #ruby
sid_fules has joined #ruby
mattwashere has joined #ruby
chouhoulis has quit [Remote host closed the connection]
solocshaw1 has joined #ruby
solocshaw has quit [Ping timeout: 250 seconds]
solocshaw1 is now known as solocshaw
brendan- has quit [Ping timeout: 252 seconds]
CJKinni has joined #ruby
chouhoulis has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
certainty has joined #ruby
hutch34_ has joined #ruby
SilverKey has quit [Quit: Halted.]
zyzioziom has quit [Ping timeout: 276 seconds]
hutch34 has quit [Ping timeout: 244 seconds]
futilegames has quit [Quit: futilegames]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cemerick>
AFAICT, rvm has set up my environment properly (GEM_HOME, etc point to ~/.rvm/...), but `bundle install` fails with "There was an error while trying to write to `/gems/ruby/2.3.0`"
vondruch has quit [Client Quit]
<cemerick>
any suggestions?
yfeldblum has joined #ruby
vondruch has joined #ruby
banister has joined #ruby
<CustosLimen>
thanks jhass
<norc>
cemerick: mmm, is it possible that its actually trying to install to /gems ? (off the root of your filesystem)
CamCam2 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
<cemerick>
norc: that certainly looks like what it's trying to do, but I can't begin to speculate as to why
kareeoleez has quit [Remote host closed the connection]
comforte has joined #ruby
<comforte>
does anyone know a script that's a python and a ruby script?
Yiota has joined #ruby
<jhass>
a = 1
<norc>
comforte: ;
Yiota has quit [Max SendQ exceeded]
<jhass>
cemerick: so you found something in bundle config?
<cemerick>
jhass: good call, thank you very much. I never would have figured that out (I touch ruby every ~5 years or so :-)
<cemerick>
the sudden radio silence is a dead giveaway I guess!
<jhass>
:P
Yiota has joined #ruby
<jhass>
comforte: and now?
xlegoman has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<cemerick>
project-specific gem paths? Is that, um, typical?
<comforte>
how about: puts "I am a ruby script"\nprint "I am a python script"
<comforte>
how could I dispatch between the two? =)
cd83x has joined #ruby
<norc>
cemerick: it can be if you have set it up that way.
floatingpoint has joined #ruby
<cemerick>
norc: deliciously tautological ;-P
<norc>
cemerick: Heh. It could be useful for deployments.
<jhass>
comforte: print("I'm a ruthon script!\n")
<norc>
jhass: I see what you did there.
<apeiros>
google "polyglot ruby python" could help
agent_white has joined #ruby
<agent_white>
Mornin'
agit0 has joined #ruby
<apeiros>
moin agent_white
<norc>
cemerick: Though other than that I prefer gem_home to manage multiple gemsets at the same time.
<cemerick>
norc: there's no .bundle/config in the source repo, so it must have been generated locally at some point?
<jhass>
yes, you typically don't check in .bundle/config
<jhass>
that'd be against its point
<jhass>
so also yes, must've run bundle --path /gems ... at some point
<cemerick>
must've been some monkey rolling his head across the keyboard .... at some point
<jhass>
I actually use bundle --path vendor/bundle over gemsets these days
prestorium has joined #ruby
<norc>
jhass: for other reasons than deployment?
<cemerick>
I was thrashing away trying to get started with the project last week, so anything's possible
<cemerick>
anyway, thanks again very much for your help, jhass & norc
<jhass>
norc: deployment does --deployment
<jhass>
so it's also frozen
cd83x has quit [Ping timeout: 258 seconds]
<norc>
mm
<jhass>
which I don't want in dev of course
<norc>
jhass: Can you elaborate what motivations you have for using a local bundle over a gemset?
<jhass>
has the advantage of a rm -rf foo and the project is gone
nettoweb has joined #ruby
symm- has joined #ruby
<norc>
Ah.
<jhass>
and I don't need a gemset manager
<jhass>
chruby and (in my case) pacman and done
flughafen_ has quit [Ping timeout: 240 seconds]
joonty has quit [Quit: This computer has gone to sleep]
<jhass>
I mean all newer programming package managers already operate that way by default
<norc>
Ah. Well so far I only use gem_home to switch between my rails5 gemset (I really want the rails5 binstub) and evertyhing else.
joonty has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
karmatr0n has quit [Ping timeout: 244 seconds]
RobertBirnie has joined #ruby
ZeroeSparticus has quit [Quit: ZeroeSparticus]
d0lph1n98 has quit [Ping timeout: 264 seconds]
qasaur has joined #ruby
mattwashere has quit [Remote host closed the connection]
Yiota has quit [Ping timeout: 246 seconds]
rbr has quit [Ping timeout: 276 seconds]
zacsek has joined #ruby
palms has quit [Read error: Connection reset by peer]
ZeroeSparticus has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yiota has joined #ruby
Yiota has quit [Max SendQ exceeded]
Yiota has joined #ruby
rbr has joined #ruby
Yiota has quit [Max SendQ exceeded]
kgrz has quit [Ping timeout: 246 seconds]
Yiota has joined #ruby
Yiota has quit [Max SendQ exceeded]
k3rn31 has quit [Quit: Computer has gone to sleep.]
kgrz has joined #ruby
Yiota has joined #ruby
Yiota has quit [Max SendQ exceeded]
jerematic has quit [Ping timeout: 260 seconds]
<shevy>
I just found https://libraries.io/rubygems/pry/sourcerank - that's quite nice, for gem authors too, to see whether their gems are up to "common standards" or whether they are not
palms has joined #ruby
Yiota has joined #ruby
certainty has joined #ruby
Yiota has quit [Max SendQ exceeded]
SilverKey has joined #ruby
goeast_ has joined #ruby
Yiota has joined #ruby
goeast has quit [Ping timeout: 264 seconds]
Yiota has quit [Client Quit]
goeast_ is now known as goeast
<shevy>
though it is biased :P
Yiota has joined #ruby
norc has quit [Ping timeout: 250 seconds]
cdg has joined #ruby
maletor3 has joined #ruby
SilverKey has quit [Client Quit]
ksmutthu_ has quit [Ping timeout: 252 seconds]
kgrz has quit [Ping timeout: 272 seconds]
smathy has joined #ruby
<Gasher>
hello, I'm trying to make multi-dimensional hashes and I don't know how to add them
<Gasher>
how to add anything to a subhash
Yiota has quit [Ping timeout: 240 seconds]
maletor3 has quit [Ping timeout: 260 seconds]
deadnull_ has quit [Quit: Bye]
flughafen_ has joined #ruby
<smathy>
Gasher, h[:foo][:bar] = 1
GodFather has quit [Ping timeout: 276 seconds]
<smathy>
...or h[:foo] = { bar: 1 } if you're adding the whole sub-hash
<tildes>
assuming h = {}; h[:foo] = {}
<tildes>
because you still need to initialize the hashes, for [] call to work
mwlang has joined #ruby
<Gasher>
yeah I know
<Gasher>
and that didn't really work
<Gasher>
but I do I need to initialise the subhash?
<tildes>
yes
sphex_ has quit [Ping timeout: 246 seconds]
<Gasher>
ah, I think that's what went wrong
sphex has joined #ruby
<Gasher>
YUS, works, thanks
<tildes>
Gasher: glad to hear that :)
Yiota has joined #ruby
<Gasher>
all that hashception can get really confusing
<apeiros>
it's often an anti-pattern to deeply nest basic collection classes (like hash or array)
<apeiros>
instead of using proper classes
<Gasher>
it's just 2 dimensional, I don't think it's that bad
pawnbox has quit [Remote host closed the connection]
<apeiros>
that said, ruby recently added Hash#dig and Array#dig, which help with that kind of structure.
<shevy>
dig up the zombies
SilverKey has joined #ruby
<apeiros>
Gasher: depends - do you have to handle whether a subhash exists or not in more than 1 place?
<Gasher>
nope
nankyokusei has joined #ruby
<apeiros>
then you might be fine
<Gasher>
I'm building a package manager, and some things (like node for example) use more than one executable (node and npm)
zyzioziom has joined #ruby
<Gasher>
that's kinda problematic and the 2-dimensional hash solved it
chouhoulis has joined #ruby
Pupeno has quit [Remote host closed the connection]
Pupeno has joined #ruby
<tildes>
Gasher: why do you want to build your own?
nankyokusei has quit [Ping timeout: 244 seconds]
Dimik has joined #ruby
zyzioziom1 has joined #ruby
zyzioziom has quit [Ping timeout: 264 seconds]
zyzioziom1 is now known as zyzioziom
pawnbox has joined #ruby
<Bish>
is there a short for .find( |x| x == 'something' )
<Gasher>
tildes; I'm tired of outdated soft in ubuntu repo
rodfersou is now known as rodfersou|lunch
ChiefAlexander has quit [Remote host closed the connection]
<Gasher>
too lazy to build/install everything myself
<Bish>
or better: find( |x| x.something == 'something' )
cemerick has quit [Ping timeout: 258 seconds]
<Bish>
sorry, bad brackets, should be curled ofc
<Gasher>
and things like arch are too unstable
jokke has quit [Quit: WeeChat 1.5]
ChiefAlexander has joined #ruby
jokke has joined #ruby
<tildes>
Bish: do you run that method on an Enumerable, such as Array object?
<Bish>
>> [{x:"yes"},{x:"can you make this shorter"}].find { |x| x.x == "yes" }
<ruby[bot]>
Bish: # => undefined method `x' for {:x=>"yes"}:Hash (NoMethodError) ...check link for more (https://eval.in/582790)
<Bish>
>> [{x:"yes"},{x:"can you make this shorter"}].find { |x| x[:x] == "yes" }
<jhass>
Bish: so I just get a botnet that yells all good
<Bish>
:D yeah that is a problem
<Bish>
but reputation systems etcpp could make that better
<Bish>
you could.. for example introduce new packagaes at 0 % reputation
<jhass>
so... gpg?
<Bish>
and people will get notified when installing
<Bish>
i never used gpg i don't know
<Bish>
atleast it's doable, i think
<Bish>
not for me, ofc
<Bish>
but a genius maybe
<suchness>
Ok I am crossposting
<jhass>
where?
l1meon has joined #ruby
<jhass>
suchness: you do understand that attr_accessor creates a method, called variable= ?
<Bish>
the fuck does block[]
<jhass>
Bish: call it
<jhass>
&ri Proc#[]
<`derpy>
No results
<Bish>
oh.
<jhass>
eh
suchness has left #ruby [#ruby]
suchness has joined #ruby
mattwashere has joined #ruby
<suchness>
Yes I realize that, which is why I would expect instance eval to set it
<jhass>
Bish: anyway, it's an alias
cd83x has joined #ruby
<suchness>
but variable is not set
<Bish>
weird alias
cemerick has joined #ruby
<jhass>
suchness: so, you also understand that variable assignment is not the same, that x.foo = bar and foo = bar are fundamentally different?
<jhass>
*variable assignment and method calls
scepticulous has quit [Quit: Konversation terminated!]
pawnbox has quit [Remote host closed the connection]
karmatr0n has joined #ruby
<suchness>
Hold on let me get my head around what you are saying
scepticulous has joined #ruby
<Bish>
make it an instance variable and it should work, amiright?
<suchness>
Oh yes
pawnbox has joined #ruby
<jhass>
suchness: x.foo = bar is just syntax sugar for x.foo=(bar)
<suchness>
right
Devalo has joined #ruby
minimalism has joined #ruby
<suchness>
So I suppose then the real question is
<jhass>
so, that also means variable assignment has to win over method calls
CJKinni` has joined #ruby
<jhass>
self.variable = "something"
<suchness>
Is there any way to make it so I do not need to call self.variable=
<suchness>
Hrm, yeah
<jhass>
a common pattern is to leave out the =
<jhass>
variable "foo"
<apeiros>
@variable =
<apeiros>
unless you want to go through the accessor
<apeiros>
then no
<jhass>
the other pattern is to yield self do |x| x.variable = "foo"
<l1meon>
hello, I have a question, how can I know the proxy anonymity level, using net/http ? I'm making a proxy checker, and I dont know how can I find the anonymity level. Can somebody help me?
<apeiros>
right, or what jhass describes, create a "DSL setter"
<suchness>
jhass: And what, define a method variable(value) that sets it?
<jhass>
yes
<suchness>
jhass: I like that, I think that's a clean solution
<suchness>
Excellent, thanks!
theozaurus has quit [Quit: Leaving.]
<jhass>
l1meon: I don't think there's any such thing as a well defined "proxy anonymity level"
<apeiros>
suchness: usually you'll define it as `def variable(*value); if value.size == 1; @value = value.first; end; @value; end`
<jhass>
not even getting into why (free) proxies are more harm than good even
<apeiros>
otherwise reading won't be possible, or setting it to nil won't be possible
<suchness>
apeiros: That's a good tip, I can see how that would be useful, thanks!
<apeiros>
suchness: up to you what you do with value.size > 1, tho :)
cd83x has quit [Ping timeout: 276 seconds]
CJKinni has quit [Ping timeout: 260 seconds]
Pupeno has joined #ruby
<suchness>
apeiros: Oh don't worry, I will make it magical
pawnbox has quit [Ping timeout: 264 seconds]
aries_liuxueyang has joined #ruby
mattwashere has quit [Remote host closed the connection]
mattwashere has joined #ruby
<l1meon>
jhass: well I know, but I've read about that proxies sends or not some headers which determines the anonymity, not literally but in sense that the server know's your real Ip and dont know, and I dont know how to get theese headers throug net/http, I've tried return all headers but the only I get to check for proxy is the "Via", others like 'X-forwarded-for' doesnt show up
crystal77 has joined #ruby
<jhass>
l1meon: they send it to the remote server, not the client
<Gasher>
<Bish> write a ruby script which handles everything with package distribution over p2p
pawnbox has joined #ruby
<Gasher>
thanks for the great idea :)
<l1meon>
jhass: so is there a way to get them? if so, how can I do it?
<jhass>
no
<jhass>
l1meon: I suggest you read up on how HTTP in general and HTTP proxies in detail work, worth your time
biberu has quit []
<jhass>
l1meon: pull out netcat and successfully write a HTTP request by hand and get a response, then one through a proxy
<domgetter>
You can't petition for an upgrade? You could point out that Ruby 1.8 is EOL, Ruby 1.9 is EOL, and that 2.0 will be EOL soon, and that you need Ruby 2.1+, but be prepared for them saying that other itnernal products depend on that version of Ruby
chouhoulis has quit [Ping timeout: 258 seconds]
Pupeno has quit [Ping timeout: 250 seconds]
<ironcamel>
i tried that domgetter. the response i got was that supposedly redhat/centos backports security fixes for all the software in their repos
<ironcamel>
that's basically what you are paying for when you pay redhat
<ironcamel>
seems like that would require hordes of developers to support all that old software
<jhass>
yes, you pay for pain ;)
skolman__ has joined #ruby
roamingdog has quit [Remote host closed the connection]
qasaur has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
glcx has quit [Quit: Quitte]
Snowy has quit [Remote host closed the connection]
<domgetter>
Of course, you'd want to specify all the characters you want to keep around
terlar has quit [Ping timeout: 252 seconds]
duoi has quit [Max SendQ exceeded]
duoi has joined #ruby
duoi has joined #ruby
duoi has quit [Changing host]
sepp2k has quit [Quit: Leaving.]
alfiemax has joined #ruby
kies has quit [Ping timeout: 252 seconds]
<alfiemax>
hi
Xentil has quit [Ping timeout: 244 seconds]
<alfiemax>
is it possible to stream a large file instead of loading the entire thing into memory?
PlasmaStar has quit [Ping timeout: 264 seconds]
<crst>
domgetter: thank you that's very nice! I just broke the function with a `/` . Is there no ruby module? It should really include any possible bad character.
mattwashere has quit [Remote host closed the connection]
Xentil has joined #ruby
mello has quit [Quit: Lost terminal]
<Bish>
norc: when will ruby get rid of GIL
<Bish>
and have native threads :3
<domgetter>
crst: "I just broke the function with a `/`" I don't know what you mean by this. "any possible bad character" Ruby doesn't know every possible bad character for every possible situation, since any character can be made to be bad
<norc>
Bish, native threads we have had since 1.9
Xentil_ has quit [Ping timeout: 260 seconds]
<norc>
Bish, and the GIL really has no meaningful impact that you will know about.
<domgetter>
Bish: Rubinius and JRuby have no GIL
<Bish>
domgetter: rubinius isn't faster, and i hate everything java.. even if its just the vm
<norc>
Bish, all the GIL really does is protect the inner workings of Ruby so it wont crash, you can do multithreading just fine with it.
<domgetter>
Bish I didn't say Rubinius was faster :)
<Bish>
like when i spawn 128 threads to do something my cores aren't equally ded
<norc>
Bish, it depends on what you are doing.
<Bish>
domgetter: yeah but where is the benefit from using rubinius, i love rubinius but it doesn't work for me
<norc>
Bish, are you I/O bound?
<Bish>
yep
<Bish>
like sockets.
<norc>
Bish, that is why.
<Bish>
I/O fucks up my threads?
<Bish>
fucks up => blocks ?
<domgetter>
Bish: No, I/O just doesn't use the computation resources of your computer to their fullest extent
<domgetter>
since the threads are waiting around for more information from the network or drive
<norc>
No, but if you have 128 I/O bound threads, what kind of conclusion about your CPU does that allow for? ...
<Bish>
*tests with calculations*
<Bish>
gimme a good example what i can calculate
<Bish>
pi?
<domgetter>
Bish: If you're on MRI, you won't peg your cores
<Bish>
yeah and why is that?
<domgetter>
Because Ruby has a GIL
<domgetter>
more specifically, because MRI has a GIL
<crst>
domgetter: I just put a / in the string and the function broke. I know there's a lot of possibilities for bad characters, that's why I was looking for a module, i.e. to change filenames for unix servers that they're not causing any problem.
<Bish>
domgetter: well norc says otheriwse
Snowy has joined #ruby
<norc>
domgetter, that is nonsense.
<norc>
domgetter, the GIL just protects some inner workings of Ruby to prevent actual crashes (not just race conditions).
<norc>
domgetter, as a result *some* methods are actually atomic, but those are corner cases.
chip__ has joined #ruby
lsmola_ has quit [Remote host closed the connection]
PlasmaStar has joined #ruby
Xentil_ has joined #ruby
certainty has joined #ruby
mtkd has quit [Ping timeout: 276 seconds]
JesseH has joined #ruby
<crst>
domgetter: I'm sorry a " was causing it to break not a /
<domgetter>
norc: I'm going to have to disagree with you. I have a 4 core machine, and just ran 4.times { threads << Thread.new { loop { 1+1 } } }; threads.first.join and it only used 25% of my processor
ishe_ua has quit [Remote host closed the connection]
k3rn31 has joined #ruby
ZeroeSparticus has quit [Quit: ZeroeSparticus]
mtkd has joined #ruby
<norc>
domgetter, great. You discovered that all the high performance multi threaded Ruby applications obviously do not bring any performance benefit at all. Go tell the developers of Thin, Typhoeus, Puma and the thousands of other projects.
<norc>
They must have missed it.
cdg has quit [Remote host closed the connection]
<domgetter>
norc: what are you talking about? They fork the process. I was talking about why threading won't peg cpus
<norc>
They dont. The three examples I mentioned are threading based.
<norc>
domgetter, why are you picking a SERVER from a SPEC as proof that Typhoeus is process based?
<norc>
okay
tjohnson has joined #ruby
<norc>
perhaps typhoeus is actually process based idk.
<norc>
but threading works.
<domgetter>
norc: I have provided proof that Threads cannot peg a multi-core cpu on multiple modern versions of Ruby. Do you have a code snippit that proves otherwise?
sid_fules has joined #ruby
kies has joined #ruby
kgrz has joined #ruby
<domgetter>
I'm also open to my methodology being shown insufficient. Perhaps I didn't use Thread correctly, or I didn't set an environment variable or configuration setting somewhere
<norc>
domgetter, sorry have had a bad day.
<norc>
domgetter, it is a valid question.
fowl has quit [Ping timeout: 272 seconds]
van has quit [Remote host closed the connection]
<Bish>
peace and happiness all over the world!
AlexJakeGreen has quit [Remote host closed the connection]
sepp2k has joined #ruby
<shevy>
welcome to #php!
<norc>
asm>> 1+1
<Bish>
is php nice and friendly?
<ruby[bot]>
norc: I have disassembled your code, the result is at https://eval.in/582854
TomyWork has quit [Quit: Leaving]
<shevy>
Bish I don't remember... I never stayed for too long on #php ... I think the online docs are good though
weckl has quit [Quit: Leaving]
<domgetter>
I always liked how the php docs had lots of examples
<norc>
domgetter, I think this is actually a corner case where you hit the GIL.
<norc>
domgetter, the reason is quite simple though, you don't do much, and the overhead of simply running that loop is protected by the GIL.
<Bish>
those are big corners :D
<domgetter>
norc: ah, okay. So is there something else I can run in those threads that won't "hit the GIL"?
<norc>
domgetter, yeah let me just come up with something sensible.
<domgetter>
fair enough
<Bish>
but if i+=1 hits the gil, nearly everything hits the gil
synthroid has quit []
<domgetter>
Bish: not necessarily. Math operations are dealt with slightly differently than other method calls for efficiency, if I remember correctly. So it's possible they interact with the GIL differntly as well
<norc>
domgetter, it is a contrived example, but it works.
djbkd has joined #ruby
<norc>
domgetter, so yeah, if you are CPU bound and use a lot of ruby core functionality then the GIL will hurt you.
<domgetter>
norc: I just ran that, and it only pegged one core again. Did I do something wrong?
nando293921 has joined #ruby
<Bish>
so GIL is a bad thing.
<norc>
Bish, yes but not as much as people make it out to be.
agit0 has joined #ruby
<norc>
domgetter, on my system that hits both CPUs at about 50%. Which ruby are you using, and which operating system are you on?
nankyokusei has quit [Ping timeout: 264 seconds]
<domgetter>
norc: so even on your system it's not pegging the cpu's?
<norc>
domgetter, as it shouldn't because it is I/O bound.
neanderslob has quit [Ping timeout: 240 seconds]
neanderslob_ has quit [Ping timeout: 250 seconds]
<norc>
domgetter, but you can use the data and do calculations with it.
neanderslob has joined #ruby
neanderslob_ has joined #ruby
neanderslob has quit [Disconnected by services]
<toretore>
ruby code is not going to "peg all cpus" no matter the code in question
<domgetter>
norc: My claim is that because of the GIL, it is impossible to use MRI/YARV and ruby Threads to use all cores as much as possible on a machine
<norc>
domgetter, here is some reality for you. When your system runs between 1,000 and 20,000 threads concurrently at any given second, any trivial code without a carefully prepared environment wont prove much.
neanderslob has joined #ruby
Pupeno has joined #ruby
chip__ has quit [Quit: Quitte]
<domgetter>
norc: I think we're talking past each other.
fowl has joined #ruby
<domgetter>
There is no test you can provide in which Ruby will peg all the cpus using only one ruby process and Threads
<norc>
domgetter, what is your operating system, which ruby and ruby version are you using?
<domgetter>
(unless you only have one core)
<bougyman>
domgetter: you mean MRI, right?
<domgetter>
bougyman: yes
<bougyman>
cause that can be done with jruby and rubinius.
Pupeno has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
<bougyman>
oic, you prefaced it with MRI/YARV
freerobby has joined #ruby
<domgetter>
I'm on Win7 with Ruby 2.2.3 and 4 cores, and a VPS with Centos7, Ruby 2.3.1 and 2 cores. On neither machine am I able to utilize 100% of all cores at once using a single Ruby process and Ruby Threads
jancel has quit [Remote host closed the connection]
fumduq- has quit [Ping timeout: 252 seconds]
firstdayonthejob has joined #ruby
<norc>
domgetter, I think MRI has no native thread support on windows.
hahuang65 has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
<domgetter>
norc: and I'm claiming that that's irrelevant to what I'm saying. YARV's GIL is the culprit here. That's why the test failed on my CentOS box.
<norc>
domgetter, well my test is succeeding,
cwenner has joined #ruby
<domgetter>
no, by your own words, the test failed
jackjackdripper has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<domgetter>
You said that you were only using 50% of your 2-core machine's cpu usage
deadnull_ has quit [Quit: Bye]
sid_fules has quit [Read error: Connection reset by peer]
sid_fules has quit [Read error: Connection reset by peer]
nando293921 has quit [Ping timeout: 240 seconds]
sid_fules has joined #ruby
<shevy>
:D
<Bish>
with rubinius it's easily making all go red
<Bish>
while being 1/100 as fast as mri :D
<shevy>
lol
c0mrad3 has joined #ruby
jaruga___ has quit [Ping timeout: 240 seconds]
Pupeno has quit [Remote host closed the connection]
<Bish>
the world of beautfil code really lacks of a good multiprocessor thing
nando293921 has joined #ruby
* Bish
hopes for crystal even though thats not interpreted
CoderPuppy has quit [Ping timeout: 272 seconds]
sid_fules has quit [Read error: Connection reset by peer]
<Bish>
or mri, which would be gr8
jespada has quit [Quit: WeeChat 1.5-dev]
<domgetter>
norc: that did cause my laptop (Linux Mint w/ 2.3.1 and 4 cores) to use 60-70% of my total cpu, so that does prove my claim wrong.
troulouliou_div2 has quit [Remote host closed the connection]
<domgetter>
is it because of the amount of resulting system calls that the kernel can make outside of ruby?
cpup has joined #ruby
sid_fules has joined #ruby
<norc>
domgetter, the GIL just protects bits and pieces from Ruby internals. So if your code spends most of its time outside (say waiting for I/O or in another C extension) it wont notice the GIL.
flashpoint9 has quit [Remote host closed the connection]
<Bish>
but adding 2 integers is as basic as it gets
goeast has quit [Ping timeout: 240 seconds]
<domgetter>
Bish: calling the "+" method on a Ruby object isn't the same as writing 1 + 1 in C
<norc>
Bish, you are repeatedly calling a block.
beilabs has joined #ruby
<norc>
Bish, and *that* is far more expensive than the 1+1
<norc>
And a lot of that is protected by the GIL.
<Bish>
domgetter: i get that, it still should do it as fast as its can
<Bish>
not as fast ruby can, but as fast as the cpu can
<norc>
asm>> 1+1
<ruby[bot]>
norc: I have disassembled your code, the result is at https://eval.in/582885
<Bish>
and that doesn't happen
nando293921 has quit [Read error: Connection reset by peer]
<norc>
there, that is what a simple + costs you in Ruby.
nando293921 has joined #ruby
<Bish>
i get all that.
<Bish>
but still, my pc should do it, with all it has
<toretore>
Bish: it doesn't work because of the gil, it's that simple
<Bish>
not being able to peg the cpu with stupid shit is stupid
Coldblackice has joined #ruby
<norc>
Bish, you can peg it with stupid shit.
<toretore>
ruby code -> lock the gil -> 1 cpu
ZeroeSparticus has joined #ruby
dhk has joined #ruby
<Bish>
norc: show me code that does
<norc>
Bish, my example from above.
Bugboy1028 has quit [Remote host closed the connection]
sid_fules has quit [Read error: Connection reset by peer]
<norc>
Bish, or do some heavy math.
<Bish>
well doesn't work dude.
<norc>
Bish, what operating system?
<norc>
What ruby version?
<Bish>
ruby 2.3.1p112
<Bish>
Linux bank 4.1.15-gentoo-r1 #3 SMP
<domgetter>
Bish: it worked in the sense that it used more than one core of your machine
sid_fules has joined #ruby
<Bish>
yeah that is right
Yiota has joined #ruby
cpup has quit [Ping timeout: 276 seconds]
<norc>
Bish, the thing is a simple loop { 1+1 } will actually spend most of its time executing the block, and most of that is GIL protected.
davedev24 has quit []
<Bish>
that all doesn't matter
<norc>
Bish, so if you do heavy math for example then you wont be GIL constraint, unless you make great use of some ruby objects like Arrays
wilsonc91 has joined #ruby
<Bish>
well, if i was about to build a interpreter
<chrisseaton>
norc: that's not right - the gil isn't released while MRI is interpreting math operations
<Bish>
i would soooo avoid having a gil
<Bish>
no matter what it costs
<norc>
chrisseaton, oh?
<domgetter>
norc: I still contend that the reason your example uses more than one core is because of the system calls which the kernel does outside of the Ruby process
Snowy has quit [Remote host closed the connection]
<domgetter>
But I coule be wrong
<Bish>
like what syscall? read?
<domgetter>
could*
<norc>
domgetter, so? If a mutual exclusion lock was held, then another thread couldn't do the same.
SilverKey has quit [Quit: Halted.]
sid_fules has quit [Read error: Connection reset by peer]
<Bish>
gil sucks eod :D
<toretore>
norc: the kernel is not restricted by mri's gil
<norc>
toretore, except while the syscall is being executed your thread that called is not.
Bugboy1028 has joined #ruby
wtiger has joined #ruby
<wtiger>
Hi!
<norc>
toretore, and if your thread held a lock before the syscall was made, it still does even if the kernel gets preempted for another thread.
<Bish>
how can ruby devs be happy with that
<Bish>
or python or whatever
<Bish>
is pypy actually good?
<wtiger>
I'm a newbie ruby/rails developer, should I use a ruby version manager?
<Bish>
wtiger: pretty much opinion based
<toretore>
wtiger: yes, use chruby/ruby-install
sid_fules has joined #ruby
<wtiger>
toretore: why?
<domgetter>
wtiger: I do. I like rvm. Others like rbenv or chruby
<Bish>
imho not.
<norc>
wtiger, most operating systems dont ship modern versions of ruby
<toretore>
wtiger: just do as i say, and you will be less frustrated
<norc>
wtiger, that is reason enough for ruby-install at least.
<Bish>
toretore: i was frustrated.
<toretore>
norc: i'm not sure what you're getting at here..
mattwashere has joined #ruby
<toretore>
norc: re: kernel and gil
<domgetter>
wtiger it relieves a lot of headache involved with installing Ruby, and it provides safe ways to hop between different versions of gems as well
<Bish>
opinions opinions.
<norc>
toretore, say thread A acquires the gil through whatever mechanism and then makes a syscall - if thread b then tries to acquire the gil it will block..
<toretore>
norc: especially that something might be preempting the linux kernel :P
jancel has joined #ruby
<norc>
toretore, nested interrupts are possible and they happen.
<toretore>
norc: ok, and?
<norc>
toretore, you have NMIs too.
<toretore>
norc: fair
<norc>
there is so many things that constantly interrupt even the kernel.
<toretore>
but that's not very relevant in this discussion about the gil afaict
<norc>
toretore, you just said the kernel is not restricted by mri's gil. But the code calling the kernel is.
<toretore>
norc: i'm still not sure what the point you're trying to get at is
<domgetter>
nroc: aren't there times where a thread just made a syscall, and then a different thread gets loaded, but the original syscall can continue on?
<norc>
domgetter, sure. The kernel can get preempted just like anything else.
<norc>
domgetter, which is whats happening.
<toretore>
norc: i think the point about your code that distributed cpu time across cores was that said cpu time was spent in the kernel and not in mri
deadnull_ has joined #ruby
<norc>
toretore, sure.
<toretore>
so, as you said, contrived
certainty has joined #ruby
<norc>
toretore, waiting on I/O is not contrived when you are looking at sockets.
<chrisseaton>
norc: but MRI releases the gil while making syscalls!
<toretore>
and the fact remains that ruby code run with one mri process will not run on multiple cpus simultaneously
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wtiger>
norc: ruby-install?
<toretore>
which was the point being made in the first place
postmodern has joined #ruby
mikeliss has joined #ruby
<toretore>
norc: that i/o concurrency works well in mri is another matter
<Bish>
wtiger: if you're using ubuntu have 2 choices, take a version manager like rvm or use a ppa(im prefering that)
<bougyman>
those aren't the only two choices.
<wtiger>
Bish: i'm on manjaro
<Bish>
or you stick to a good operating system / good distro
<toretore>
norc: and you can "trick" it into clocking some cpu time by using lots of i/o
<Bish>
bougyman: tell me the third
<wtiger>
why would I need different versions of ruby?
Yiota has joined #ruby
<Bish>
wtiger: you want the new version, ubuntu doesn't ship new
<bougyman>
Bish: /opt/ruby-<version>/
<wtiger>
Bish: hmm
<wtiger>
manjaro does though :)
<Bish>
bougyman: ? whats that supposed to mean
<Bish>
wtiger: well thats great then!
<mikeliss>
I have a feeling this is ruby-related and I'm not a Ruby programmer, so perhaps somebody can help. I just installed the Travis CI command line tool using the instructions they provided (sudo gem install travis -v 1.8.2 --no-rdoc --no-ri), but after that I can't find the travis executible on my path. I get this error: bash: /usr/bin/travis: No such file or directory. Feels like maybe my ruby or gem configuration is wrong or some
<mikeliss>
thing. Any ideas?
<Bish>
just use the one of your system
<wtiger>
cool
<wtiger>
:D
certainty has quit [Ping timeout: 250 seconds]
hutch34 has quit [Ping timeout: 250 seconds]
<domgetter>
wtiger: but the answer to your question "should I use a ruby version manager" is definitely yes, regardless of which one you choose
<wtiger>
another problem
<shevy>
wtiger how many ruby versions will you need?
chouhoulis has joined #ruby
hutch34 has joined #ruby
<wtiger>
shevy: for now, think the latest gonna be enough
zyzioziom has quit [Ping timeout: 252 seconds]
TomyLobo has joined #ruby
Pumukel has quit [Ping timeout: 240 seconds]
<norc>
chrisseaton, okay.
<jhass>
wtiger: you don't need a ruby version manager until you need another ruby version, latest until then is indeed fine. When you'll need it, since you're on a Arch derivative, I can recommend https://gist.github.com/jhass/8839655bb038e829fba1 ;)
Spami has joined #ruby
<wtiger>
jhass: duly noted :P
<wtiger>
another problem, i accedintally ran sudo gem install ____ one time, and now all my gems default install to /usr/lib/.. in place of .gem/ruby/2.3.0
bkxd has joined #ruby
<wtiger>
if I don't use sudo, it complains about file permission error
pepee has joined #ruby
dhk has quit [Ping timeout: 264 seconds]
SilverKey has joined #ruby
mattwash_ has joined #ruby
moeabdol has joined #ruby
David27 has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
mattwashere has quit [Ping timeout: 260 seconds]
moei has joined #ruby
Spami has quit [Quit: Leaving]
moeabdol has quit [Ping timeout: 240 seconds]
mikeliss has quit [Quit: mikeliss]
Dimik has quit []
aegis3121 has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
flashpoint9 has joined #ruby
AlexRussia has joined #ruby
crystal77 has joined #ruby
palms has quit [Ping timeout: 252 seconds]
Yiota has joined #ruby
crystal77 has quit [Client Quit]
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<smathy>
I still prefer using a version manager because I then have more flexibility when doing an upgrade.
Zighuatl has quit [Remote host closed the connection]
Devalo has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kirun has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
dhk has joined #ruby
jancel has quit [Remote host closed the connection]
Pupeno has joined #ruby
Devalo has quit [Ping timeout: 244 seconds]
moeabdol has joined #ruby
jancel has joined #ruby
roamingdog has quit [Remote host closed the connection]
joonty has joined #ruby
cdg has joined #ruby
yfeldblum has joined #ruby
l1meon has quit [Ping timeout: 264 seconds]
karmatr0n has quit [Ping timeout: 260 seconds]
deadnull_ has quit [Quit: Bye]
irbedded has quit [Ping timeout: 250 seconds]
CJKinni` has quit [Ping timeout: 244 seconds]
l1meon has joined #ruby
MrBusiness3 has joined #ruby
sauvin_ has quit [Remote host closed the connection]
hutch34_ has joined #ruby
hutch34 has quit [Ping timeout: 264 seconds]
Yiota has joined #ruby
Pupeno has quit [Remote host closed the connection]
Pupeno has joined #ruby
thermistor has joined #ruby
MrBusiness2 has quit [Ping timeout: 250 seconds]
SCHAAP137 has joined #ruby
certainty has joined #ruby
multi_io has quit [Ping timeout: 276 seconds]
miqlas-H has joined #ruby
jancel has quit [Remote host closed the connection]
<miqlas-H>
Hi Guys!
zyzioziom has joined #ruby
<miqlas-H>
I have some problems to get Ruby compiled on Haiku. Have somebody time to help me?
multi_io has joined #ruby
zyzioziom has quit [Client Quit]
norc has quit [Quit: Leaving]
<bruce_lee>
\(^_^)/ @all
sid_fules has joined #ruby
<bruce_lee>
how can I check if file_1 is "newer" than file_1
nanoz has quit [Read error: Connection reset by peer]
<bruce_lee>
something like comparing latest modification_time
strncat has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
strncat has left #ruby [#ruby]
nanoz has joined #ruby
vdamewood has joined #ruby
terrabl has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<terrabl>
Hey guys I am having some trouble implementing CSS and JS on my html.erb files in Rails. The gist included (https://gist.github.com/anonymous/6b4262524ad96ccd48dd) has all of the files that I believe would be necessary for you to understand the problem. In application.html I changed the original stylesheet and javascript link tags to be 'default' instead of 'application' because that is what I read to do on a SO question. If you have
durrellchamorro has joined #ruby
<terrabl>
I attempted to read up on the asset pipeline and I think I understand but I am always getting a 404 error when I try to load up default.js and default.css
<Zarthus>
?rubyonrails
<Zarthus>
!rubyonrails
<Zarthus>
?rails
<Zarthus>
¯\_(ツ)_/¯
<terrabl>
Yes rails
<Zarthus>
There's a #rubyonrails channel
<Zarthus>
you might wanna knock there
blockchan has joined #ruby
<terrabl>
Lol I just got redirected here from anotehr channel
<terrabl>
How would I get there?
<Zarthus>
your problem sounds rails related
<Zarthus>
/join #rubyonrails
durrellchamorro has left #ruby [#ruby]
<terrabl>
it for sure is
<terrabl>
thanks guys
Yiota has joined #ruby
crst has quit [Quit: Leaving...]
tvw has quit [Ping timeout: 244 seconds]
binaryplease1 has joined #ruby
thejamespinto has joined #ruby
tvw has joined #ruby
durrellchamorro has joined #ruby
<bruce_lee>
the following perl would check the modification-dates and be true if $pendingFile is "newer" than $drawingDataFile: if (-M $pendingFile < -M $drawingDataFile) {
<bruce_lee>
what is the equivalent in ruby?
<domgetter>
bruce_lee: File#stat
ur5us has joined #ruby
evidex has quit [Ping timeout: 276 seconds]
binaryplease has quit [Ping timeout: 246 seconds]
howdoi has joined #ruby
durrellchamorro has quit [Quit: durrellchamorro]
djbkd has quit [Remote host closed the connection]
<bruce_lee>
domgetter: thank you
nando293921 has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SilverKey has quit [Quit: Halted.]
kgrz has quit [Ping timeout: 276 seconds]
uberbrodt has quit [Quit: leaving]
nankyokusei has joined #ruby
dunpeal has joined #ruby
SilverKey has joined #ruby
crystal77 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
binaryplease1 is now known as binaryplease
d0nn1e has quit [Ping timeout: 260 seconds]
benzrf has left #ruby ["WeeChat 1.5"]
nando293921 has quit [Ping timeout: 258 seconds]
<dunpeal>
How do people make sure RVM always uses a particular version?
<dunpeal>
i.e. in a project managed by RVM, how do I ensure `ruby` calls the right Ruby interpreter I'd like to use?
d0nn1e has joined #ruby
<domgetter>
dunpeal: a call to `ruby` will be whichever one is set to be the one used by rvm at that time. do `rvm list` to see which one is current, and which one is default
nankyokusei has quit [Ping timeout: 258 seconds]
<dunpeal>
domgetter: right, but here's the thing: `rvm list` shows two versions, 2.2.3 and 2.3.1, and whenever I start a new bash, 2.2.3 is current, even though 2.3.1 is the default.
<dunpeal>
how can I make it so 2.3.1 is always current?
nando293921 has joined #ruby
jancel has joined #ruby
ur5us has quit [Remote host closed the connection]
k3rn31 has quit [Quit: Computer has gone to sleep.]
<domgetter>
dunpeal: This StackOverflow answer says it's possible you're loading rvm twice, so you can check for that: http://stackoverflow.com/a/5605028
<domgetter>
Try the other answers in there too, perhaps
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
Yiota has joined #ruby
<dunpeal>
domgetter: hm. I'm loading rvm in .bashrc, on a multi-window setup
<dunpeal>
(using GNU screen)
Zackio has quit [Remote host closed the connection]
<domgetter>
dunpeal did you put in that echo to see if it's being loaded twice?
braincrash has quit [Ping timeout: 272 seconds]
Yiota has quit [Client Quit]
N1njturt1e has joined #ruby
<dunpeal>
domgetter: I'm loading it in a function. The first time I run `rvm`, it loads the script.
sid_fules has quit [Read error: Connection reset by peer]
<domgetter>
dunpeal If it were me, I'd try the echo thing as a sanity check
<dunpeal>
domgetter: it's only loaded once, though in an unusual way.
braincrash has joined #ruby
<domgetter>
right, and if that's true, then the echo would only appear once. but I don't know if it only appears once, because you didn't try it yet
minimalism has quit [Quit: minimalism]
Zackio has joined #ruby
boboc has joined #ruby
<dunpeal>
domgetter: I did :) it's not.
<domgetter>
oh okay. hmm... you said you're using screen. what shell?
Gasher has quit [Ping timeout: 258 seconds]
<domgetter>
echo $SHELL will show you if you're not sure
maletor3 has quit [Ping timeout: 260 seconds]
<boboc>
guys i have a sample rails app, i have installed nginx and puma to test a droplet on digital ocean to try to deploy a sample app. i have added the 'bind tcp://0.0.0.0:9292' setting in puma.rb and 'server 127.0.0.1:9292' in the nginx upstream directive but when i access a route from the rails app it doesn't work. puma was started and it shows it is listening on tcp://0.0.0.0:9292. Any idea what the problem is? thanks
<domgetter>
boboc: for rails questions, try ##rubyonrails
<boboc>
domgetter: thanks
terlar has joined #ruby
N1njturt1e has quit []
wilsonc91 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
N1njturt1e has joined #ruby
mdw_ has quit [Quit: Sleeping Zzzzz]
terrabl has quit [Quit: Page closed]
suchness has quit [Remote host closed the connection]
ddffg has quit [Ping timeout: 240 seconds]
tildes_ has joined #ruby
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blockchan has quit [Quit: blockchan]
Zackio has quit [Read error: Connection reset by peer]
shinnya has joined #ruby
fowl has left #ruby ["Leaving"]
tildes_ has quit [Ping timeout: 272 seconds]
<dunpeal>
domgetter: /bin/bash
smathy_ has joined #ruby
<domgetter>
dunpeal: yea, I'm not sure. Is there a reason you're loading rvm in an unusual way?
tvw has quit [Remote host closed the connection]
smathy has quit [Ping timeout: 258 seconds]
biberu has joined #ruby
N1njturt1e has quit [Remote host closed the connection]
<shevy>
you people need to have less problems!
vinleod has joined #ruby
<domgetter>
shevy No risk, no reward!
abshak3 has joined #ruby
vdamewood has quit [Ping timeout: 250 seconds]
Fernando-Basso has quit [Ping timeout: 264 seconds]
abshak3 has left #ruby [#ruby]
maletor3 has joined #ruby
sid_fules has joined #ruby
certainty has joined #ruby
<Zarthus>
99 bugs in the code. take one down, patch it around. 123 bugs in the code.
dionysus69 has joined #ruby
devbug has joined #ruby
zeroDi has joined #ruby
N1njturt1e has joined #ruby
certainty has quit [Ping timeout: 276 seconds]
johnmilton has quit [Remote host closed the connection]
pawnbox_ has joined #ruby
moeabdol has quit [Ping timeout: 276 seconds]
r_rios has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
ddffg has joined #ruby
sumobob has joined #ruby
bkxd has joined #ruby
hutch34 has joined #ruby
<tubbo>
haha
ebernhardson has joined #ruby
<ebernhardson>
is it possible to share scope from outside a def into it? for example: https://repl.it/CYL7
hutch34_ has quit [Ping timeout: 244 seconds]
MrBusiness3 has quit [Ping timeout: 260 seconds]
postmodern has quit [Ping timeout: 260 seconds]
Fernando-Basso has joined #ruby
<ebernhardson>
or will i have to wrap it all into a class or something to have instance vars
arooni has joined #ruby
xlegoman has joined #ruby
xlegoman has quit [Client Quit]
Pupeno has quit [Remote host closed the connection]
ruby271 has joined #ruby
ruby271 has quit [Client Quit]
floatingpoint has joined #ruby
Fernando-Basso has quit [Client Quit]
bkxd has quit [Ping timeout: 272 seconds]
codecop has quit [Remote host closed the connection]
dhk has quit [Ping timeout: 264 seconds]
tinnvec has quit [Remote host closed the connection]
tinnvec has joined #ruby
karmatr0n has joined #ruby
dhk has joined #ruby
ouroboros_buddha has joined #ruby
Zackio has joined #ruby
jancel has quit [Remote host closed the connection]
jenrzzz has joined #ruby
tinnvec has quit [Remote host closed the connection]
tinnvec has joined #ruby
symm- has joined #ruby
postmodern has joined #ruby
mattwash_ has quit [Remote host closed the connection]
tinnvec has quit [Remote host closed the connection]
ljames has joined #ruby
tinnvec has joined #ruby
whathappens has quit [Remote host closed the connection]
kareeoleez has joined #ruby
karmatr0n has quit [Ping timeout: 240 seconds]
kareeoleez has quit [Remote host closed the connection]
whathappens has joined #ruby
whathappens has quit [Remote host closed the connection]
<ironcamel>
ebernhardson: you can make it @foo = false in the outside scope
N1njturt1e has quit [Remote host closed the connection]
mattwashere has joined #ruby
abshak3 has joined #ruby
ur5us has joined #ruby
<abshak3>
hey
abshak3 has left #ruby [#ruby]
abshak3 has joined #ruby
joonty has quit [Quit: This computer has gone to sleep]
<abshak3>
Anyone there?
wilsonc91 has joined #ruby
Madplatypus has joined #ruby
<abshak3>
hello?
<abshak3>
?
kareeoleez has joined #ruby
wilsonc91 has quit [Client Quit]
mattwashere has quit [Remote host closed the connection]
noobsu_ has quit [Remote host closed the connection]
<jhass>
abshak3: 'sup?
David27 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
kareeoleez has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
allcentury has quit [Ping timeout: 260 seconds]
<abshak3>
hey
<abshak3>
so the thing is
<abshak3>
even though i love ruby
<abshak3>
i can't seem to find ANY practical uses of it
<abshak3>
the language is the best i have seen
<abshak3>
except rails it is never used
<abshak3>
and i use nodejs for web
<abshak3>
so what should i do?
karmatr0n has joined #ruby
djbkd has joined #ruby
freerobby has quit [Quit: Leaving.]
<abshak3>
should i continue to learn?
scepticulous has joined #ruby
fishy123 has joined #ruby
<fishy123>
a
Omni_ has quit [Ping timeout: 276 seconds]
fishy123 has quit [Client Quit]
davedev24 has joined #ruby
kent\n has quit [Ping timeout: 260 seconds]
futilegames has joined #ruby
<abshak3>
...
<aegis3121>
Personally, I use it for writing scripts to automate things on my home computer. I would much rather write ruby scripts than bash
arooni has quit [Ping timeout: 260 seconds]
<hxegon>
or if you need to process data, it's actually quite nice
<abshak3>
I use ruby scripts too
arooni_ has joined #ruby
<abshak3>
I am currently learning metaprogramming in ruby
jrafanie has quit [Read error: Connection reset by peer]
<abshak3>
and I don't see myself using it anywhere
<abshak3>
it is a great concept and I am having fun
kent\n has joined #ruby
kent\n has joined #ruby
kent\n has quit [Changing host]
miqlas-H has quit [Ping timeout: 276 seconds]
<hxegon>
You should avoid metaprogramming most of the time actually
<abshak3>
why?
<hxegon>
It can help you short term, but long term it makes maintinence issues
jrafanie has joined #ruby
<hxegon>
In my experience.
<adaedra>
It can makes things harder to understand
chouhoul_ has joined #ruby
<hxegon>
what adaedra said
<adaedra>
It's a nice trick to know, but it's easy to abuse
<hxegon>
And there is usually a better way to do it
<abshak3>
but I should learn it right?
<adaedra>
Some of it is nice, but too much of it is Rails^W bad
<adaedra>
"data analysis ruby" yields some interesting results in google.
<Nilium>
shevy: The majority of the problems I have are around 1.8 era gems
<Nilium>
And at that point I just go "well this is dead to me"
<hxegon>
r_rios: gist the script?
<r_rios>
Nilium: Yeah, that's exactly what I was thinking, but I wanted to see if anyone had good arguments against my point
arooni has joined #ruby
postmodern has joined #ruby
cd83x has quit [Remote host closed the connection]
<r_rios>
hxegon: I just started writing it
<Nilium>
I guess if you wanted to be a real jerk you could try to mmap a file and then in a C extension convince Ruby that the mmap'd file was the global variable's storage or something
<Nilium>
I don't know how you'd do it but it sounds like fun
<abshak3>
is daru good?
<Nilium>
Is that a food?
<r_rios>
hxegon: But, to be more specific, the script is going to read a file, select some lines and extract some data out of them
<r_rios>
Then exit
dionysus69 has quit [Ping timeout: 272 seconds]
<abshak3>
daru is what came up when i google "data analysis ruby"
karmatr0n has quit [Ping timeout: 258 seconds]
flashpoint9 has quit [Remote host closed the connection]
<abshak3>
so I hope it's not a food
<adaedra>
:p
<adaedra>
well, try it with your use cases, that's still the best way
<hxegon>
r_rios: what do the global vars contain?
<shevy>
abshak3 you can find a lot of websites about precious stones too if you search for ruby :)
<hxegon>
r_rios: (to preface, I think it's fine if it's self contained and kept short, but there could be a better way to do it)
<shevy>
google is not yet skynet 2.1
<r_rios>
hxegon: The splitted file (something like $lines = IO.read('file').split("\n"))
<r_rios>
Although maybe I could make it a constant instead
<r_rios>
Thanks, I imagined there would be a method like that one, but I didn't know what was it
<hxegon>
is there somewhere I can make a PR to give it a random chance of saying something sexual?
<adaedra>
not really.
beilabs has quit [Remote host closed the connection]
certainty has joined #ruby
<abshak3>
`derpy moans
<hxegon>
pretty much lol
beilabs has joined #ruby
<hxegon>
r_rios: you could also put it in a Struct or something, but it depends on how much effort you want to put into it
Pupeno has quit [Changing host]
Pupeno has joined #ruby
agentmeerkat has joined #ruby
<shevy>
abshak3 lol
sid_fules has joined #ruby
<abshak3>
thanks guys, I will basically keep using ruby and hissing at the people who don't
<shevy>
`derpy quacks.
wrkrcoop has joined #ruby
<adaedra>
abshak3: well no, let people use what they wish
<r_rios>
hxegon: What's the advantage of that over a global (or a constant)?
chouhoul_ has quit [Ping timeout: 250 seconds]
<hxegon>
`derpy calculates the prime factors of a 1000000 digit number
<abshak3>
adaedra: of course, but i will still hiss at them
<wrkrcoop>
im trying to use Savon to make a soap request, but i can’t seem to figure out where the body goes?? anyon experienced with SOAP able to take a look? http://savonrb.com/version2/
<adaedra>
r_rios: I think a better thing to do would be show to show the script in question?
<hxegon>
adaedra: he is still mid writing it
<r_rios>
Not written yet. I'l just start writing and then ask for suggestions
<adaedra>
aha
rgb-one has joined #ruby
<rgb-one>
> 1 + 1
<adaedra>
Personally, for medium to large scripts, I usually wrap in a class so I use instance variables.
<hxegon>
r_rios: it's hard to say without looking at code, but generally Structs help me with keeping stuff contained and grouped logically without going through the effort of 'making a real class'
<rgb-one>
wasn't the name rubot?
<hxegon>
used to be
johnmilton has joined #ruby
<adaedra>
ruboto's been enhanced and has been renamed.
<adaedra>
considered false; won't go into 'if' branch.
<pontiki>
as it's not a real word, i use either spelling
nankyokusei has quit [Ping timeout: 258 seconds]
<pontiki>
just depends on whether you want to be fancy or not :D
* haylon
opens google
<rgb-one>
thanks haylon
* jhass
opens offtopic
<rgb-one>
and while your at it check out thruthy for me will ya
postmodern has quit [Ping timeout: 258 seconds]
<hxegon>
that might not be a real word, but that is for sure not the right spelling
<jhass>
rgb-one: /join #ruby-offtopic ;)
sartan has joined #ruby
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rgb-one>
lol.. "truthy"
<sartan>
hi guys! i'm very new to ruby. when setting a variable eg foo = "bar", and later using a function: def test(); puts(foo); end <-- it seems 'foo' doesn't exist if the variable is defined before the function. $globals are probably pretty awful to use as well. Waht's the best way to address this?
<sartan>
as opposed to passing an alphabet soup of variables in function calls
<smathy_>
sartan, OOP
<rgb-one>
use a class
JJM has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
babblebre has joined #ruby
<adaedra>
^
<aegis3121>
or a Struct, if a full-blown class is a bit much...
<adaedra>
Just be aware of pot-pourri structures
<rgb-one>
or specialized functions
<sartan>
i miss python :P
scepticulous has joined #ruby
<adaedra>
I'm pretty sure python has scopes too.
<pontiki>
python hasn't gone anywhere
<sartan>
it can access variables out of scope if namespaces aren't conflicting
<sartan>
the api i'm working with is ruby-only so here i am
<r_rios>
Not a full fledged script yet, I'm using it from irb as a require
[Butch] has quit [Quit: I'm out . . .]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pontiki>
`foo` as you've written it is a local variable. it will be treated as such inside the method `test` and that `foo` inside test will NOT have anything to do with the one you've defined in the outer scope
JakFrist has joined #ruby
cd83x has joined #ruby
cd83x has quit [Remote host closed the connection]
cd83x has joined #ruby
bruce_lee has quit [Ping timeout: 240 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
<sartan>
so in py i'd do something like class stuff: foo="bar"; def test(self); print(self.foo).
<sartan>
stuff().test()
<shevy>
what is that monster
<sartan>
trying to analogize what i'm observing ruby inheritance to work like
sarcas has joined #ruby
N1njturt1e has quit [Remote host closed the connection]
<shevy>
well you have to make the variable persistent in ruby somehow
thermistor has quit [Quit: Connection closed for inactivity]
JakFrist has quit [Client Quit]
SilverKey has quit [Quit: Halted.]
<adaedra>
translating lines by lines from a language to another is a good way to end with a bad thing
gizmore has joined #ruby
<rgb-one>
yea get the idea clear and it will flow
postmodern has joined #ruby
gtsai has quit [Remote host closed the connection]
davedev2_ has joined #ruby
gtsai has joined #ruby
blockchan has joined #ruby
freerobby has joined #ruby
scepticulous has quit [Ping timeout: 252 seconds]
antgel has joined #ruby
freerobby has quit [Client Quit]
rgb-one has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
freerobby has joined #ruby
freerobby has quit [Client Quit]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
kareeoleez has joined #ruby
davedev24 has quit [Ping timeout: 260 seconds]
k3rn31 has joined #ruby
postmodern has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
haylon has quit [Quit: Leaving]
ta_ has quit [Read error: Connection reset by peer]
abshak3 has quit [Quit: Ex-Chat]
ta_ has joined #ruby
AndyWojo has joined #ruby
floatingpoint has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<AndyWojo>
if I have a string = "1 2 3 4 5 6 7", how do I split it to grab the fields 3-7
<jokke>
in example/bar.rb i define some celluloid actors with a dsl
UserInNeed has quit [Ping timeout: 276 seconds]
haylon has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
<jokke>
and one of them runs mpc -w current
<jokke>
this is a blocking call
blockchan has quit [Ping timeout: 244 seconds]
hutch34 has quit [Ping timeout: 276 seconds]
<hxegon>
Is the problem that it's blocking jokke ?
<haylon>
I cannot for the life of me figure out how to get around this issue I'm having with JSON containing \\\\n in it or &. Either the JSON parser chokes at the & ina URL in a block of text, or I end up getting a [] noMethodError
<jokke>
if i run the executable on command line everything goes as expected (except that hitting ctrl+c seems to kill only the backtick command)
<haylon>
let me put it up on GitHub.
<jokke>
but if i pipe the output to dzen2 it won't scroll
coffeecupp has joined #ruby
<jokke>
hxegon: i think it's part of the problem
UserInNeed has joined #ruby
jancel has joined #ruby
yfeldblum has quit [Ping timeout: 260 seconds]
nadir has quit [Quit: Connection closed for inactivity]
kgrz has quit [Ping timeout: 252 seconds]
ledestin has joined #ruby
sdothum has joined #ruby
<hxegon>
what does mpc -w do? It's for controlling mpd right?
<hxegon>
jokke: ^
<haylon>
So, I've got this project, called cem_sender, which is supposed to take Custom Alert input from Zabbix, and send it to some goofy Event Management system we've brewed in house. So, when i run my gem using the cli tool, it either get it choking on a & or it tells me noMethodError
<haylon>
I've updated the Gist to include the errors.
<hxegon>
use system
<jokke>
hxegon: why?
<jokke>
i need to capture the output
<hxegon>
err, maybe not system, but backticks block
<jokke>
yes. i _want_ it to block
banister has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hxegon>
oh, I thought you said it blocking was a part of the problem
Gasher has joined #ruby
<jokke>
well it might be, yes. But i still need it to block
<jokke>
i'll try with IO.popen
freerobby has joined #ruby
prestorium has quit [Quit: Leaving]
n_blownapart has joined #ruby
banister has joined #ruby
<hxegon>
alright, see you all later
<jokke>
hxegon: bye
hxegon is now known as hxegon_afk
<jokke>
thankx
<jokke>
s
<hxegon_afk>
np, good luck jokke
yfeldblum has quit [Remote host closed the connection]
vinleod has quit [Quit: Life beckons.]
boboc has quit []
<jokke>
ok with IO.popen it's even weirder
yfeldblum has joined #ruby
allcentury has joined #ruby
gnufied has quit [Quit: Leaving]
saneax is now known as saneax_AFK
smathy_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
crystal77 has joined #ruby
jancel has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
duckpuppy has quit [Ping timeout: 260 seconds]
ddffg has quit [Quit: Leaving]
sepp2k has quit [Read error: Connection reset by peer]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
sarcas has quit [Ping timeout: 250 seconds]
ur5us has quit [Remote host closed the connection]
art-solopov has joined #ruby
jenrzzz has joined #ruby
<jokke>
no. it's the same
Diogo has quit [Quit: Connection closed for inactivity]
yfeldblum has quit [Ping timeout: 250 seconds]
jancel has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
haylon has quit [Quit: Leaving]
JJM has joined #ruby
Gasher has quit [Quit: Leaving]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
biberu has quit [Read error: Connection reset by peer]
<jokke>
so basically my problem is that `` seem to behave differently depending if output is a pipe or tty
sdothum has joined #ruby
<jokke>
(as well as IO.popen)
jackjackdripper has quit [Quit: Leaving.]
jancel has quit [Remote host closed the connection]
JJM has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shevy>
hmm
bkxd has joined #ruby
<jokke>
ahh
<jokke>
flush seems to do the trick
<jokke>
yess
<jokke>
awesome
deet_ has joined #ruby
<jokke>
celluloid is awesome
alfiemax has left #ruby ["Leaving"]
<deet_>
Hi. I'm new to Ruby programming. I would like to ask a couple of questions regarding crossplatform games. First, I don't get RubyMotion. All the examples seem to rely on SpriteKit -- what is the point of RubyMotion+SpriteKit vs Swift+SpriteKit. It will not be crossplatform if you use RubyMotion+SpriteKit, correct?
freerobby has quit [Quit: Leaving.]
Pupeno has quit [Remote host closed the connection]
dcluna has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
bmorrison has quit [Quit: bmorrison]
kies has quit [Ping timeout: 260 seconds]
Pupeno has joined #ruby
kareeoleez has quit [Remote host closed the connection]
<havenwood>
felipec: Just the reference implementation though as there are many Rubies.
bmorrison has joined #ruby
<pipework>
pontiki: I can only kinda read c. Most of the time I spent thinking about character arrays was with erlang long ago, it feels.
deet_ has quit [Ping timeout: 250 seconds]
<art-solopov>
pontiki: Haha, okay. =) Would you recommend using a theme for my first-time blog or would you recommend just writing the templates and CSS manually?
roamingd_ has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
cdg has quit [Ping timeout: 260 seconds]
roamingd_ has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
TomyLobo has quit [Ping timeout: 252 seconds]
domgetter has quit [Ping timeout: 276 seconds]
sneakerhax has quit [Ping timeout: 260 seconds]
roamingdog has joined #ruby
mleung has quit [Quit: mleung]
jaguarmagenta has quit [Ping timeout: 276 seconds]
beilabs has joined #ruby
certainty has joined #ruby
rattatmatt has joined #ruby
N1njturt1e has quit [Remote host closed the connection]
kies has joined #ruby
art-solopov has quit [Quit: Konversation terminated!]
beilabs has quit [Ping timeout: 260 seconds]
postmodern has quit [Ping timeout: 258 seconds]
pawnbox has joined #ruby
certainty has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
n1x-nz has joined #ruby
www-bukolay-com has joined #ruby
pawnbox has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
Azure has quit [Remote host closed the connection]
ur5us has joined #ruby
SilverKey has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
postmodern has joined #ruby
SilverKey has quit [Client Quit]
tjohnson has quit [Ping timeout: 264 seconds]
jmhmccr has quit [Ping timeout: 264 seconds]
c355e3b has quit [Ping timeout: 264 seconds]
jimcroft has quit [Ping timeout: 264 seconds]
aphprentice has quit [Ping timeout: 264 seconds]
mroth has quit [Ping timeout: 264 seconds]
SilverKey has joined #ruby
www-bukolay-com has quit [Ping timeout: 252 seconds]