Spami has quit [Quit: This computer has gone to sleep]
keen__________11 has joined #ruby
keen__________10 has quit [Ping timeout: 255 seconds]
phutchins has joined #ruby
weemsledeux has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
bkulbida has quit [Ping timeout: 255 seconds]
l_tonz_ has quit [Quit: Leaving...]
Guest82630 has quit [Ping timeout: 246 seconds]
phutchins has quit [Ping timeout: 260 seconds]
mistermocha has joined #ruby
mburns has joined #ruby
jaredrhine has joined #ruby
rbowlby has joined #ruby
framling has joined #ruby
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
marr has quit [Ping timeout: 264 seconds]
devbug_ has joined #ruby
ramfjord has joined #ruby
wildlander has quit [Quit: Saliendo]
kayloos has joined #ruby
Mia has joined #ruby
devbug has quit [Ping timeout: 240 seconds]
Oog has joined #ruby
devbug has joined #ruby
KensoDev has quit []
minimalism has joined #ruby
bkulbida has joined #ruby
kalusn has quit [Ping timeout: 268 seconds]
devbug_ has quit [Ping timeout: 240 seconds]
trodai has left #ruby [#ruby]
iamjarvo_ has joined #ruby
yfeldblum has joined #ruby
mistermocha has quit [Ping timeout: 244 seconds]
blackmes1 has quit [Ping timeout: 268 seconds]
prestorium has joined #ruby
pocketprotector- has joined #ruby
michael_mbp has quit [Excess Flood]
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
bkulbida has quit [Ping timeout: 252 seconds]
yfeldblum has quit [Ping timeout: 272 seconds]
michael_mbp has joined #ruby
tubbo has quit [Ping timeout: 265 seconds]
tubbo has joined #ruby
sepp2k1 has quit [Read error: Connection reset by peer]
nwhirschfeld has joined #ruby
jdawgaz has joined #ruby
tkuchiki has joined #ruby
Yzguy has joined #ruby
towski_ has quit [Remote host closed the connection]
RobertBirnie has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
rushed has quit [Quit: rushed]
rushed has joined #ruby
tkuchiki has quit [Remote host closed the connection]
Azure has joined #ruby
balazs has joined #ruby
mistermocha has joined #ruby
tubuliferous has quit [Ping timeout: 252 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pdoherty has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
Yzguy has quit [Quit: Zzz...]
zenguy_pc has quit [Ping timeout: 240 seconds]
pdoherty has quit [Client Quit]
Bellthoven has quit []
bkulbida has joined #ruby
jessemcgilallen has joined #ruby
tier has quit [Remote host closed the connection]
andykingking has quit [Quit: Leaving.]
saddad has joined #ruby
htmldrum has quit [Ping timeout: 250 seconds]
iamjarvo_ has quit [Quit: Computer has gone to sleep.]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cyther_ has joined #ruby
ledestin has joined #ruby
bkulbida has quit [Ping timeout: 265 seconds]
Cyther has quit [Ping timeout: 240 seconds]
towski_ has joined #ruby
towski_ has quit [Remote host closed the connection]
towski_ has joined #ruby
Limix has joined #ruby
benlieb has joined #ruby
Motoservo has joined #ruby
tubbo has quit [Ping timeout: 252 seconds]
Oog has quit []
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
user1138 has quit [Ping timeout: 246 seconds]
yfeldblum has joined #ruby
bkulbida has joined #ruby
towski_ has quit [Ping timeout: 250 seconds]
jun has joined #ruby
nwhirschfeld has joined #ruby
tubbo has joined #ruby
bigmac has quit [Quit: Leaving]
allcentury has quit [Ping timeout: 268 seconds]
Rollabunna has joined #ruby
yfeldblum has quit [Ping timeout: 240 seconds]
pocketprotector- has quit [Read error: Connection reset by peer]
pocketprotector- has joined #ruby
framlinqp has joined #ruby
framling has quit [Read error: Connection reset by peer]
casadei has joined #ruby
casadei has quit [Client Quit]
verdoc has quit [Quit: No Ping reply in 180 seconds.]
Rollabunna has quit [Ping timeout: 268 seconds]
benlieb has quit [Quit: benlieb]
oetjenj has quit [Ping timeout: 240 seconds]
benlieb has joined #ruby
Limix has quit [Quit: Limix]
htmldrum has joined #ruby
verdoc has joined #ruby
oetjenj has joined #ruby
andywojo has joined #ruby
swgillespie has joined #ruby
oetjenj has quit [Ping timeout: 264 seconds]
oetjenj has joined #ruby
ruurd has joined #ruby
dopamean_ has quit [Ping timeout: 240 seconds]
jun has quit [Remote host closed the connection]
tkuchiki has joined #ruby
baroquebobcat_ has quit [Quit: baroquebobcat_]
bonhoeffer has joined #ruby
glenn_ has joined #ruby
oetjenj has quit [Ping timeout: 250 seconds]
kayloos has quit [Remote host closed the connection]
_blizzy_ has quit [Ping timeout: 255 seconds]
dcunit3d has quit [Remote host closed the connection]
A124 has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 255 seconds]
ruurd has quit [Ping timeout: 260 seconds]
glenn_ has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amystephen has quit [Quit: amystephen]
glenn_ has joined #ruby
charliesome has joined #ruby
simplyianm has joined #ruby
tkuchiki has quit [Ping timeout: 256 seconds]
A124 has joined #ruby
oetjenj has joined #ruby
ruurd has joined #ruby
kalusn has joined #ruby
Kerber0s_ has joined #ruby
ruurd has quit [Ping timeout: 260 seconds]
Kerber0s has quit [Ping timeout: 252 seconds]
dopamean_ has joined #ruby
nettoweb has joined #ruby
dcunit3d has joined #ruby
I has joined #ruby
I is now known as Guest44491
robbyoconnor has joined #ruby
imperator has joined #ruby
ruurd has joined #ruby
andywojo has quit [Ping timeout: 265 seconds]
yfeldblum has joined #ruby
|ifei5g00d has joined #ruby
RobertBirnie has joined #ruby
|ifei5g00d has quit [Remote host closed the connection]
yfeldblum has quit [Read error: Connection reset by peer]
ruurd has quit [Ping timeout: 252 seconds]
yfeldblum has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has quit [Remote host closed the connection]
|ifei5g00d has joined #ruby
yfeldblum has joined #ruby
oetjenj has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Ping timeout: 246 seconds]
nXqd has joined #ruby
<nXqd>
hi guys, I'm looking forward to create a ruby repl that I can use in gitter. Anybody has done it before ? I'm familiar with ruby, but I'm thinking about security and how to interact with api and such
<orangerobot>
hi. what (if any) is the difference between jekyll and octopress? I see them mentioned in the same context and it's not very clear to me where they differ
bruno- has joined #ruby
PhantomS_ has quit [Read error: Connection reset by peer]
PhantomSpank has joined #ruby
f1dget has quit [Quit: Leaving]
XxionxX has joined #ruby
oetjenj has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
gener1c has joined #ruby
<nXqd>
orangerobot: iirc, octopress is a framework built on top of jekyll
grzegorz has quit [Remote host closed the connection]
<orangerobot>
nXqd: hmmm I see. thanks
<nXqd>
welcome
ramfjord has quit [Ping timeout: 240 seconds]
gener1c_ has quit [Ping timeout: 264 seconds]
kalusn has quit [Remote host closed the connection]
nomadic has quit [Ping timeout: 244 seconds]
nomadic has joined #ruby
braincra- has quit [Quit: bye bye]
solocshaw has quit [Ping timeout: 255 seconds]
oetjenj has joined #ruby
dorei has quit []
nerium has quit [Quit: nerium]
Channel6 has joined #ruby
rbowlby_ has joined #ruby
gix has quit [Ping timeout: 240 seconds]
glenn_ has quit [Read error: Connection reset by peer]
glenn_ has joined #ruby
glenn_ has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
glenn_ has joined #ruby
rbowlby has quit [Ping timeout: 240 seconds]
jamto11 has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jun___ has joined #ruby
gix has joined #ruby
saddad has joined #ruby
_blizzy_ has joined #ruby
sdwrage has joined #ruby
Oog has joined #ruby
Oog has quit [Client Quit]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
towski_ has joined #ruby
<imperator>
evenin folks
kalusn has joined #ruby
mistermocha has joined #ruby
kalusn has quit [Remote host closed the connection]
tubuliferous has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
jamto11 has quit [Remote host closed the connection]
orangerobot has quit [Quit: Page closed]
favadi has joined #ruby
Kerber0s_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jamto11 has joined #ruby
oetjenj has quit [Ping timeout: 244 seconds]
jun___ has quit [Read error: Connection reset by peer]
jun___ has joined #ruby
Rollabunna has joined #ruby
mistermocha has quit [Ping timeout: 264 seconds]
dcunit3d has quit [Remote host closed the connection]
oetjenj has joined #ruby
putz54 has joined #ruby
davedev24 has quit [Ping timeout: 246 seconds]
davedev24 has joined #ruby
putz54 has left #ruby [#ruby]
_blizzy_ has joined #ruby
moeabdol has quit [Ping timeout: 265 seconds]
dagda1_ has quit [Ping timeout: 255 seconds]
dcunit3d has joined #ruby
rushed has quit [Quit: rushed]
dagda1 has joined #ruby
CanTonic has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zenguy_pc has joined #ruby
jamto11 has quit [Remote host closed the connection]
richard7 has joined #ruby
<richard7>
Hello
YourKicks has joined #ruby
riotjones has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Channel6 has quit [Ping timeout: 255 seconds]
patdohere has joined #ruby
rushed has joined #ruby
prateekp has joined #ruby
<prateekp>
i am trying to run rspec test in a thread
<prateekp>
but when i do expect, it says no such method
<prateekp>
while `should` runs
<prateekp>
but with a warning that it is deprecated
<bnagy>
you gem build blah.gemspec then gem install blah.gem
<dtscode>
ah ok
<dtscode>
thanks
ndrei has joined #ruby
<bnagy>
modulo fancy new stuff
<dtscode>
sorry, am ruby noob
<bnagy>
no worries
G has quit [K-Lined]
SegFaultAX has quit [K-Lined]
sagittarian has quit [Ping timeout: 264 seconds]
phutchins has quit [Ping timeout: 246 seconds]
norc has joined #ruby
<dtscode>
thanks :D worked like a charm
<shevy>
the well known blah.gem
pontiki has quit [Ping timeout: 240 seconds]
pawnbox has joined #ruby
<norc>
I would expect this to crash or fail if I read the ruby doc on Class#new http://pastie.org/10476126
G has joined #ruby
SegFaultAX has joined #ruby
<dtscode>
oh dear I broke the program
chthon has joined #ruby
tkuchiki has joined #ruby
shmoon_ has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
joonty has joined #ruby
joufflu has joined #ruby
platzhirsch has joined #ruby
<shevy>
norc hey webchat friend
speakingcode has quit [Ping timeout: 264 seconds]
<norc>
Hiya
robbyoconnor has quit [Ping timeout: 255 seconds]
karapetyan has joined #ruby
timonv has joined #ruby
framlinqp has quit [Remote host closed the connection]
khebbie has joined #ruby
speakingcode has joined #ruby
SylarRuby has joined #ruby
whowantstolivefo has joined #ruby
speakingcode has quit [Ping timeout: 240 seconds]
whowantstolivefo has left #ruby [#ruby]
timonv has quit [Ping timeout: 252 seconds]
ndrei has joined #ruby
htmldrum has quit [Ping timeout: 260 seconds]
ruby-lang388 has joined #ruby
SylarRuby has quit [Remote host closed the connection]
ruby-lang388 has quit [Client Quit]
_aeris_ has quit [Remote host closed the connection]
poom has joined #ruby
Gnomethrower is now known as BlacksoxCrypto
zotherstupidguy has quit [Ping timeout: 250 seconds]
<adaedra>
Hello rubyists
zotherstupidguy has joined #ruby
<Ropeney>
hello adeponte
pawnbox has quit [Ping timeout: 246 seconds]
<Ropeney>
hello adaedra
<adaedra>
:o)
pawnbox has joined #ruby
ramfjord has joined #ruby
mighub has joined #ruby
beast has quit [Quit: Leaving]
<mighub>
Just wanted to know if there is a channel dedicated to minitest. I can't seem to find one.
leafybasil has quit [Remote host closed the connection]
Kendos-Kenlen has joined #ruby
_blizzy_ has joined #ruby
BlacksoxCrypto is now known as PandaCrypto
<poom>
Hello. Is there any possibility to detect key duplication in a hash?
<adaedra>
what do you mean?
senayar has joined #ruby
<yorickpeterse>
morning
joufflu has quit [Quit: Leaving]
odt_ has joined #ruby
<shevy>
poom it's like highlander - there can only be one
zotherstupidguy has quit [Ping timeout: 250 seconds]
ndrei has quit [Ping timeout: 240 seconds]
pawnbox has quit [Read error: Connection reset by peer]
linduxed has quit [Ping timeout: 250 seconds]
<norc>
shevy: So what do you think about what I said earlier?
<poom>
eg. I have hash ha = {'a' => 'aa', 'b' => 'bb', 'a' => 'cc'} and I want to detect that I have duplicated 'a' i hash and show any info to user
zotherstupidguy has joined #ruby
odt has quit [Ping timeout: 240 seconds]
<norc>
poom: Hash will overwrite the key/value pair if you use the same key again.
Outlastsheep has quit [Ping timeout: 246 seconds]
<norc>
>> {'a' => 'aa', 'b' => 'bb', 'a' => 'cc'}
<ruboto>
norc # => /tmp/execpad-e8946405b4b1/source-e8946405b4b1:2: warning: duplicated key at line 2 ignored: "a" ...check link for more (https://eval.in/448819)
<norc>
You get a warning at least.
odt_ is now known as odt
ndrei has joined #ruby
<poom>
I'm using puppet and have central hash with env configuration. If someone make duplication I could have huge problem
<norc>
poom: Use a custom class or document it then.
Hounddog has joined #ruby
peteykun has joined #ruby
_blizzy_ has quit [Read error: Connection reset by peer]
<norc>
poom: But in the end, you probably do not want to expose data structures that if modified will screw up your program.
<shevy>
norc as I told you before, you are not a ruby user man
<norc>
o_o
<norc>
That almost hurt.
<shevy>
no it did not
<norc>
You are right.
<poom>
That's what I want - if puppet detect key duplication, it should fail with some information
beauby has joined #ruby
roshanavand has joined #ruby
<adaedra>
poom: I think there's a puppet channel somewhere, they can give better advice on puppet.
<adaedra>
?puppet
<ruboto>
Please join #puppet for help with it.
<adaedra>
Ah, here it is.
Kerber0s has joined #ruby
<shevy>
poom you will have to detect if the key is already included
<norc>
shevy: What am I then? Aside from a webchat friend.
<shevy>
so much code to see
_blizzy_ has joined #ruby
<norc>
(And Im still looking for an icon in webchat to show that you are truly a friend)
<shevy>
norc for some reason you attempt to identify random non-problems
<poom>
yes I know, but it is mostly a ruby issue, puppet doesn't have any function or mechanism to do what I want, and I have to write my own ruby function
<norc>
shevy: This was merely a question about the ruby docs actually.
arup_r has joined #ruby
<norc>
shevy: They state Class#new calls #allocate (the source code shows differently).
<shevy>
that's a heroic cause to improve the ruby docs
<shevy>
isn't allocate defined on the C level only?
<norc>
Just something I noticed thats all.
<norc>
Yeah.
shredding has joined #ruby
roshanavand has quit [Remote host closed the connection]
<maloik>
arup_r: you mentioned me this weekend?
senayar_ has joined #ruby
<norc>
shevy: Im using Ruby extensively. Im just spending some time getting to know the internals bit by bit.
<arup_r>
hum. May be. but I forgot what I did
mighub has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
senayar has quit [Read error: Connection reset by peer]
stan has joined #ruby
_aeris_ has joined #ruby
<[k->
Ruby under a microscope
herbst has joined #ruby
linduxed has joined #ruby
niko has quit [Ping timeout: 600 seconds]
charliesome has quit [Read error: Connection reset by peer]
blackmes1 has quit [Ping timeout: 268 seconds]
charliesome has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
c0m0 has joined #ruby
Or1on has quit [Quit: gone]
ZucchiniZe is now known as ZucchiniZe-
arup_r has quit [Read error: Connection reset by peer]
PandaCrypto is now known as Gnomethrower
leafybasil has joined #ruby
codecop has joined #ruby
Musashi007 has joined #ruby
blackmes1 has joined #ruby
poom has quit [Quit: Konversation terminated!]
nfk|laptop has quit [Ping timeout: 240 seconds]
Zamyatin has quit [Ping timeout: 244 seconds]
bweston92 has joined #ruby
dcunit3d has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<Ropeney>
[k- is that book dated now? looks good
n008f4g_ has quit [Ping timeout: 240 seconds]
shevy has quit [Ping timeout: 252 seconds]
robbyoconnor has joined #ruby
<[k->
i think there is a second edition
[k-_ has joined #ruby
[k- has quit [Read error: Connection reset by peer]
nfk|laptop has joined #ruby
shevy has joined #ruby
khebbie has quit [Ping timeout: 264 seconds]
BTRE has quit [Read error: Connection reset by peer]
async_prince has quit [Quit: WeeChat 1.3]
async_prince has joined #ruby
BTRE has joined #ruby
[k-_ is now known as [k-
leafybasil has quit [Remote host closed the connection]
<shevy>
you could perhaps use Struct if you want to arbitrarily store ivar-like content
<[k->
hmm, it worked last tine
<adaedra>
instance_variable_set is not the solution here I feel
freezevee has joined #ruby
pontiki has quit [Ping timeout: 240 seconds]
<shevy>
he wants to use instance_variable_set!
sanjayu has joined #ruby
skade has joined #ruby
<adaedra>
So that makes it the right solution magically?
<[k->
shevy, our mission is embodied in ?fake
<[k->
?fake
<ruboto>
Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
<odt>
well the point is to be able to use the key names in the future without changing anything but the print lines
<[k->
**bring up the best possible solution**
<shevy>
adaedra are you to define what is right and what is wrong?
skade has quit [Client Quit]
TheWhip_ has joined #ruby
ramfjord has joined #ruby
<adaedra>
no, that's why there is a "I feel" in my message.
<shevy>
there are lots of ways in ruby!
Zamyatin has quit [Ping timeout: 256 seconds]
norc has quit [Ping timeout: 246 seconds]
<[k->
**bring up the best possible solution**
<shevy>
**we are all waiting for it**
mark2 has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
<adaedra>
odt: I'd turn them into objects and call a method on them, so I have access to variables directly. That would require to change your code a lot. For dynamism, if you really want it, you can indeed instance_variable_set in your initializer or save the hash and use method_missing.
mark2 has joined #ruby
stardiviner has quit [Ping timeout: 246 seconds]
TheWhip has quit [Ping timeout: 256 seconds]
marr has joined #ruby
<adaedra>
Otherwise, in the current shape of code, not much to do.
<adaedra>
Minimal changes would be to use OpenStruct and instance_exec, but it's not the prettiest of solutions.
<shevy>
that was a nice way of saying that this code is not perfect
khebbie has quit [Ping timeout: 256 seconds]
<adaedra>
shevy: No code is perfect.
stamina has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
stardiviner has joined #ruby
scripore has joined #ruby
leafybas_ has joined #ruby
<odt>
ok, thanks anyway! dont think ill change anything there right now with my current skill set
Rickmasta has joined #ruby
leafybasil has quit [Ping timeout: 255 seconds]
Couch has joined #ruby
sanjayu has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 252 seconds]
<shevy>
\o/
odt_ has joined #ruby
norc has joined #ruby
leafybas_ has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
Cork has quit [Ping timeout: 264 seconds]
_blizzy_ has joined #ruby
shevy has joined #ruby
roshanavand has joined #ruby
grzegorz has quit [Remote host closed the connection]
PaulCape_ has joined #ruby
SCHAAP137 has quit [Ping timeout: 265 seconds]
TheWhip has quit []
tkuchiki has joined #ruby
PaulCapestany has quit [Ping timeout: 244 seconds]
amystephen has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
wpp has quit [Quit: ZZZzzz…]
FernandoBasso has quit [Read error: Connection reset by peer]
tkuchiki has quit [Remote host closed the connection]
skade has joined #ruby
dionysus69 has joined #ruby
wpp has joined #ruby
ircplususer22993 has joined #ruby
ircplususer22993 has quit [Client Quit]
[k- has quit [Read error: Connection reset by peer]
[k- has joined #ruby
Cork has joined #ruby
devoldmx has quit [Remote host closed the connection]
naftilos76 has joined #ruby
pontiki has joined #ruby
tkuchiki has joined #ruby
pontiki has quit [Remote host closed the connection]
stardiviner has quit [Ping timeout: 268 seconds]
stardiviner has joined #ruby
grzegorz has joined #ruby
syath has joined #ruby
SCHAAP137 has joined #ruby
SylarRuby has joined #ruby
Steve_Jobs has quit [Ping timeout: 268 seconds]
pawnbox has quit [Remote host closed the connection]
<platzhirsch>
Having an array of tuples [t, s], how can I group them by t so that t is only present as a key in a Hash?
<platzhirsch>
array.group_by { |e| e[0] } creates a Hash mapping to [[t1, s1],...] when I really want t => [s1, s2,..] if that makes sense
pawnbox has joined #ruby
<shevy>
nodehirsch!
<shevy>
are you back in the promised ruby land again?
DanKnox has joined #ruby
<platzhirsch>
yeah for scripting
<platzhirsch>
need to analyze some database logs :D
FernandoBasso has joined #ruby
<platzhirsch>
trying to find some correlations
Rollabunna has quit [Ping timeout: 264 seconds]
nanoz has joined #ruby
p0wn3d__ has joined #ruby
<jhass>
each_value {|v| v.map!(&:last) } ?
<platzhirsch>
jhass: nice one, yeah
pawnbox has quit [Remote host closed the connection]
sdothum has joined #ruby
<platzhirsch>
incredible how I lost my Ruby data structure joggling skills
scripore has joined #ruby
pawnbox has joined #ruby
last_staff has joined #ruby
zenguy_pc has quit [Ping timeout: 252 seconds]
sanjayu has joined #ruby
sanjayu has quit [Client Quit]
atmosx has joined #ruby
<atmosx>
hello
scripore has quit [Client Quit]
sanjayu has joined #ruby
<atmosx>
How can I read HAML and convert to HTML from a ruby script? I want to create an email HTML template using HAML and the 'mail' gem.
beauby has quit [Ping timeout: 246 seconds]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Soda has quit [Remote host closed the connection]
howdoi has joined #ruby
opal has joined #ruby
herbst has joined #ruby
<adaedra>
atmosx: use the haml gem
<atmosx>
yeah I am looking into the documentation
root has joined #ruby
grzegorz has quit [Read error: Connection reset by peer]
zotherstupidguy has quit [Ping timeout: 240 seconds]
grzegorz has joined #ruby
root is now known as Guest3421
zenguy_pc has joined #ruby
<atmosx>
I was looking for this Haml::Engine.new(file).render
<atmosx>
nice
some_body has joined #ruby
speakingcode has joined #ruby
Cork has quit [Ping timeout: 246 seconds]
<some_body>
hey, i asked yesterday, but I have a .txt file that ruby refuses to read as UTF-8, and gives me invalid byte sequence US ASCII errors anytime I touch it. I have the correct locale on my machine, the correct magic comment in my code, and I even reinstalled ruby 2.1, all to no effect
<yorickpeterse>
some_body: File.open(file, :encoding => Encoding::UTF_8), or use force_encoding('UTF-8') when reading data
<atmosx>
not the entire file, just a couple of liens
zotherstupidguy has joined #ruby
<yorickpeterse>
alternatively you can open the file using Encoding::BINARY, then use force_encoding to convert it to UTF8
cantaberry has joined #ruby
<yorickpeterse>
most likely the input file contains bogus data
<some_body>
yorickpeterse: looks like that did the trick. what could be causing my ruby to not use UTF-8 by default. I thought that was a 2.0 thing
beauby has joined #ruby
<yorickpeterse>
It does use UTF8 by default
opal_ has joined #ruby
<yorickpeterse>
But the file contains invalid character sequences apparently
<some_body>
how could I easily strip all valid ascii chars form it and dump that to a new file?
<some_body>
could regex do that?
<yorickpeterse>
You can't reliably remove invalid sequences without losing input
opal has quit [Ping timeout: 256 seconds]
<yorickpeterse>
The only solid way is to convert it to whatever encoding the data is actually saved in, then convert that to UTF8
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
you can use String#scrub to remove invalid sequences, but you might lose data
gagrio has quit [Ping timeout: 264 seconds]
<some_body>
so if I forced this file to .open with UTF 8 encoding, and then .scrub, then write to a new file?
<yorickpeterse>
Would't make a difference if the data in the file itself is already broken
speakingcode has quit [Ping timeout: 240 seconds]
<yorickpeterse>
e.g. I had a case where Amazon S3 would serve data in ASCII, but the documents contained UTF8 sequences
norc has quit [Ping timeout: 246 seconds]
<yorickpeterse>
That particular case, if I remember correctly, was fairly easy to solve using force_encoding
speakingcode has joined #ruby
_blizzy_ has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
beauby has quit [Ping timeout: 264 seconds]
Kerber0s has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
beauby has joined #ruby
Pumukel has joined #ruby
spcmastertim has joined #ruby
xstaz has joined #ruby
mikecmpbll has joined #ruby
BTRE has quit [Quit: Leaving]
crankharder has joined #ruby
cantaberry has quit [Ping timeout: 260 seconds]
speakingcode has quit [Ping timeout: 265 seconds]
cantaberry has joined #ruby
speakingcode has joined #ruby
<ljarvis>
I have an array of records that have "timestamp" attributes. I want to group them into arrays where the time difference is more than 12 hours and record the difference between the final time of each group and the first time of the following group. For example: https://gist.github.com/leejarvis/60cdd2b183f8d6022d13 I have a bit of a wild while() and I think I'm probably missing something
blackmes1 has quit [Ping timeout: 252 seconds]
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
<ljarvis>
(group_by day doesn't work because it's not day, it's every > 12 hours)
<some_body>
yorickpeterse: I just wrote the old file to the new file by .scrub! each line and appending it to the new file, and when U do cmp newfile oldfile -b, it tells me that the EOF on the first file is different'
<yorickpeterse>
ljarvis: hm
<yorickpeterse>
probably the approach is to get the date + hour, floor/ceil it, group per that
momo-reina has joined #ruby
<yorickpeterse>
some_body: scrub only works if the input string is in UTF8
<yorickpeterse>
if it's ASCII it doesn't do anything
phutchins has joined #ruby
speakingcode has quit [Ping timeout: 244 seconds]
<some_body>
so force_encoding is really the only possible solution then
Pupp3tm4st3r has quit [Remote host closed the connection]
chthon has quit [Quit: Ex-Chat]
atmosx has quit [Quit: parting / quiting]
<yorickpeterse>
well, normally you'd read/write with encoding explicitly set to UTF8
<yorickpeterse>
but to clean it up you'd have to do: read as binary, force encoding to UTF8, write as UTF8
<yorickpeterse>
from the top of my head
speakingcode has joined #ruby
Porfa has joined #ruby
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lxsameer has quit [Quit: Leaving]
Pupp3tm4st3r has joined #ruby
<yorickpeterse>
ljarvis: how many groups do you want per day, only 2?
<yorickpeterse>
if so you can do something like (hour.to_f / 12).floor * 12
krisquigley has quit [Remote host closed the connection]
<ljarvis>
yorickpeterse: the "day" metric is essentially superfluous as it's always relative to the previous timestamp, but yeah if it's per 12 hours then it'll only ever be <=2
prestorium has joined #ruby
<yorickpeterse>
alternatively you loop over the timestamps and store them per hour, then reduce them to a set of per 12 hours each
<yorickpeterse>
map/reduce yo, gotta use MongoDB for that :D
* yorickpeterse
runs
naftilos76 has quit [Quit: Αποχώρησε]
pawnbox has quit [Remote host closed the connection]
Cork has joined #ruby
tomaz_b has joined #ruby
hectortrope has quit [Remote host closed the connection]
sgambino has joined #ruby
opal_ has left #ruby [#ruby]
karapetyan has quit [Remote host closed the connection]
<maloik>
and something along the lines of memo_array.last.last < (next_time_object - 12.hours) if that makes sense but your solution might be a bit quicker
beauby has joined #ruby
chrisseaton has quit []
chrisseaton has joined #ruby
<maloik>
somewhat related: apparently Array(time_obj) resultsi n an array [date, time, timezone] or something along those lines
ndrei has quit [Ping timeout: 240 seconds]
grzegorz has quit [Ping timeout: 240 seconds]
Rollabunna has joined #ruby
<yorickpeterse>
ughhh, GitLab uses LOWER(X) without indexes in so many places
karapetyan has quit [Ping timeout: 250 seconds]
lokson has joined #ruby
devoldmx has joined #ruby
phutchins has quit [Quit: WeeChat 1.1.1]
armyriad has quit [Ping timeout: 246 seconds]
<tomaz_b>
anybody?
Pupp3tm4st3r has quit [Remote host closed the connection]
<yorickpeterse>
tomaz_b: probably not
devoldmx has quit [Ping timeout: 264 seconds]
ndrei has joined #ruby
yes`r has joined #ruby
<darix>
tomaz_b: i dont think cassandra is that much used^^
<asui>
dunno maybe as environment variable or something similar?
<Aria>
And how structured a value in that single variable?
michael_mbp has joined #ruby
<Aria>
Environment variables are only inherited downward, so it would only last as long as the process and its children
<adaedra>
asui: what for?
aryaching has joined #ruby
<adaedra>
what will you do, with this saved variable? When will it be read again?
tkuchiki has quit [Remote host closed the connection]
<asui>
It's only a number that's why I won't use a file
nanoz has quit [Ping timeout: 244 seconds]
<adaedra>
It's not a problem to use a file for such a small amount of data
dhjondoh has quit [Quit: dhjondoh]
<asui>
The script is calles every 30 seconds. And I want to pass the variable from the first run to the second run
LMity has joined #ruby
<yorickpeterse>
Either you save it as a file and it persists, or save it in memory and its lost when the script stops
aryaching has quit [Client Quit]
<Aria>
Or in a database, which is eventually a file but you get to ignore that fact.
<Aria>
Or stuff it into a blockchain and have other people store it in files for you. :)
<adaedra>
You could use something like a memcache (careful if invalidation though)
Igorshp has quit [Remote host closed the connection]
roshanavand has joined #ruby
emilkarl has joined #ruby
mxrguspxrt has joined #ruby
<asui>
Ok. so the nicest way is to store it in an additional file. Then I'll do this =) Thanks a lot
dopamean_ has quit [Ping timeout: 252 seconds]
<havenwood>
asui: Maybe just use a file. See PStore and YAML::Store in the stdlib.
codecop has quit [Quit: Išeinu]
mxrguspxrt has quit [Client Quit]
devoldmx has joined #ruby
jessemcgilallen has quit [Read error: Connection reset by peer]
tkuchiki has joined #ruby
simplyianm has quit [Ping timeout: 240 seconds]
<havenwood>
If you even need transactions.
pawnbox has quit [Ping timeout: 240 seconds]
<asui>
havenwood: Thank you for that clue. But instead loading the PStore library which it will also store everything in a file, I can do this by myself.
beauby has joined #ruby
newdan has joined #ruby
Igorshp has joined #ruby
<havenwood>
asui: You could also consider a UNIXSocket if both are running at the same time.
devoldmx has quit [Ping timeout: 252 seconds]
<asui>
havenwood: it's for my statusbar. So theres only one process per time
sankaber has quit [Remote host closed the connection]
<havenwood>
asui: Aha
kimegede has joined #ruby
Guest44491 has quit [Ping timeout: 264 seconds]
tkuchiki has quit [Remote host closed the connection]
skweek has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
inteq has quit [Remote host closed the connection]
umgrosscol has joined #ruby
zenguy_pc has quit [Ping timeout: 240 seconds]
<[k->
or just let the script handle itself
<[k->
sleep(30)
<[k->
(but this will be less easy to debug)
sankaber has joined #ruby
karapetyan has joined #ruby
karapetyan has quit [Remote host closed the connection]
<asui>
That's a great idea.
<adaedra>
note that if one occurence of a script take longer, you'll delay all next runs
Guest1234 has joined #ruby
<adaedra>
if you count on your script to run exactly every 30s, not counting on run time, this is not the best idea
ksteck has joined #ruby
LiquidInsect has quit [Ping timeout: 265 seconds]
sankaber has quit [Remote host closed the connection]
`tim` has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dvarrui has joined #ruby
sankaber has joined #ruby
<asui>
hmmm good point.
<[k->
exaxtly every 30s is impossible in any case
<[k->
we all know time is the most difficult thing to handle
mistermocha has quit [Remote host closed the connection]
chouhoulis has quit [Remote host closed the connection]
`tim` has joined #ruby
<[k->
you could spawn a new thread every 30s though, let the main thread have a main loop, which creates a new thread and sleeps 30s
_blizzy_ has quit [Ping timeout: 265 seconds]
allcentury has quit [Quit: WeeChat 1.2]
<asui>
then I cant use this :( the script should show stocks points so there shouldn't be to much delay
charliesome has quit [Ping timeout: 250 seconds]
<adaedra>
Just add persistance by a file
jdawgaz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
If what stops you is disk writes, mount a tmpfs and write in it
<adaedra>
(it's not persistant across reboots tho)
<[k->
there would be a delay spawning a Ruby process each time, and IO takes time too :)
<adaedra>
?
<asui>
sounds good. I can use /tmp for that.
ruurd has joined #ruby
<asui>
[k-: sure there's always a little delay in everthing. But if I use the non threaded variant I could get some trouble with the http request.
jgt has joined #ruby
Pupp3tm4_ has joined #ruby
charliesome has joined #ruby
charliesome has quit [Client Quit]
ruurd has quit [Quit: Bye]
bkxd has joined #ruby
ruurd has joined #ruby
<[k->
you could spawn a new thread every 30s though, let the main thread have a main loop, which creates a new thread and sleeps 30s
jessemcgilallen has joined #ruby
zenguy_pc has joined #ruby
<[k->
when the thread finishes, ruby will return the result
<[k->
and you can pass it on to the new thread
stardiviner has quit [Quit: Code, Sex, Just fucking world.]
<[k->
(fun fact: the passing of objects from one thing to another is called threading)
basiles has joined #ruby
<asui>
I guess I'll code both - the threaded variant and the one using a file. Then I can test both and can learn even more ruby :D
CloCkWeRX has joined #ruby
Pupp3tm4st3r has quit [Ping timeout: 268 seconds]
<asui>
Thanks everyone,
<adaedra>
also, what should happen if a script takes more than 30s to execute?
leafybas_ has joined #ruby
tagrudev has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
freezevee has quit [Remote host closed the connection]
<heftig>
[k-: you can get very close to a 30s-interval, though, without any drift
<newdan>
Say I want all the definitions in an .rb to be part of one module. Is there a way to do that without having the whole thing indented under a "module Foo" line? Maybe something similar to how Java's package keyword works?
<[k->
adaedra: then the runtime passes on the previous successful run
leafybasil has quit [Ping timeout: 244 seconds]
<[k->
(which is what your solution does as well)
bruno- has quit [Ping timeout: 240 seconds]
<adaedra>
[k-: "should"
<[k->
what
<[k->
newdan, you don't have to indent in ruby, but you should
Zamyatin has joined #ruby
<[k->
module is only the universally recognised way to do this in ruby
<to_json>
do people really use ruby version managers in production?
<adaedra>
[k-: I'm not asking about what the current proposed solutions do, I'm asking about what asui expect it to do
<to_json>
like, I'm sure some do, but is that like, a best practice sort of thing?
<adaedra>
One like another
<adaedra>
Depends on your needs I guess
Rickmasta has joined #ruby
shredding has joined #ruby
<heftig>
to_json: i've seen deployment systems that package up ruby, gems and all, together with the project
roshanavand has quit [Remote host closed the connection]
Alayde has joined #ruby
<to_json>
heftig: that's roughly what I was leaning towards, but I have devs arguing for rbenv in prod
Pupp3tm4_ has quit [Remote host closed the connection]
Pupp3tm4st3r has joined #ruby
<to_json>
I'm mostly trying to decide if it's a fight worth having or if I should just cede this one :-/
<adaedra>
What are you? Sysadmin?
<heftig>
just seems like another state to manage that can go wrong
kyle__ has quit [Ping timeout: 268 seconds]
shredding has quit [Client Quit]
<to_json>
platform/'devops'
Pupp3tm4_ has joined #ruby
dravine has quit [Ping timeout: 244 seconds]
<hal_9000>
to_json: “best practice” is a matter of opinion. i do think there should be *some* way to ensure/know what version is being used
peteykun has quit [Ping timeout: 240 seconds]
shredding has joined #ruby
banister has joined #ruby
dravine has joined #ruby
Emmanuel_Chanel has joined #ruby
<to_json>
trufax hal_9000
<newdan>
to_json: I think if you're going to package up the Ruby version anyway then rbenv would be redundant. That said, if you're *not* packaging up Ruby in some kind of .deb or the like, then yes I'd use rbenv
<newdan>
In general you want everything to be as locked down/predictable as possible when you deploy
<to_json>
they already use project specific .ruby-version files, but that could jsut as easily be used to calculate build-time rpm links
<adaedra>
to_json: first of all, do the system-provided ruby is in the right version to deploy the app?
tesuji has joined #ruby
<to_json>
adaedra: system ruby is not the right version
<to_json>
newdan: we are fulfilling a mandate for all RPMs all the time
<adaedra>
so it means you'll have to juggle between versions at some point
Pupp3tm4st3r has quit [Ping timeout: 240 seconds]
banister has quit [Read error: Connection reset by peer]
<to_json>
adaedra: We're leaning towards 'immutable(ish) servers, so ideally we'd rebuild instead of juggle. that said, immutable is not a buisiness priority so yeah, we'll have to...
<adaedra>
what I mean, is that at minimum you'll have system ruby and project ruby on the machine
<to_json>
thanks for talking this through with me btw, folks. This is super helpful
<to_json>
adaedra: troof
zotherstupidguy has quit [Ping timeout: 246 seconds]
zotherstupidguy has joined #ruby
Musashi007 has joined #ruby
<hal_9000>
to_json: i’m personally not opposed to (e.g.) hardcoding a ruby path in a shell script
<newdan>
Eh. If you're writing the deploy script you can just provide an absolute path to the right Ruby
<newdan>
I mean I guess an extra rbenv wouldn't hurt but I don't see it as so critical if you're packaging up ruby in your RPM
chrissonar has quit [Remote host closed the connection]
jcoe has joined #ruby
<to_json>
newdan: yeah, it's just more code on the server
<hal_9000>
and btw you *could* write code to check versions of ruby and/or gems to ensure minimum requirements
<to_json>
hal_9000: thats p much exactly what I proposed
n008f4g_ has joined #ruby
<to_json>
the shell script pluss reading a .ruby-version file
shinnya has quit [Ping timeout: 268 seconds]
roshanavand has joined #ruby
<to_json>
yeah I think I'ma fight the conservative fight
troulouliou_div2 has joined #ruby
<to_json>
thanks again adaedra hal_9000 newdan
beauby has joined #ruby
DrCode has joined #ruby
dravine_ has joined #ruby
<headius>
good morning!
dravine has quit [Ping timeout: 264 seconds]
dravine_ is now known as dravine
some_one has quit [Ping timeout: 246 seconds]
skade has quit [Quit: Computer has gone to sleep.]
prestorium has quit [Quit: Konversation terminated!]
bkxd has quit [Ping timeout: 268 seconds]
riotjone_ has quit [Remote host closed the connection]
jgt has quit [Ping timeout: 268 seconds]
skade has joined #ruby
The_Phoenix has joined #ruby
skade has quit [Client Quit]
nertzy2 has quit [Quit: Leaving]
michael_mbp has quit [Excess Flood]
howdoi has quit [Quit: Connection closed for inactivity]
nertzy has joined #ruby
blackmes1 has joined #ruby
kyle__ has joined #ruby
BTRE has joined #ruby
jayforsythe has joined #ruby
Channel6 has joined #ruby
<jayforsythe>
Hi
shmilan has joined #ruby
<jayforsythe>
I shmilan
<jayforsythe>
Hi*
SenpaiSilver has quit [Quit: Leaving]
<shmilan>
Hello, jayforsythe
devoldmx has joined #ruby
emilkarl has quit [Quit: emilkarl]
jayforsythe has quit [Client Quit]
michael_mbp has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
LiquidInsect has joined #ruby
emilkarl has joined #ruby
peteykun has joined #ruby
Kerber0s has joined #ruby
Porfa has quit [Quit: Porfa]
pawnbox has joined #ruby
Kerber0s has quit [Read error: Connection reset by peer]
devoldmx has quit [Ping timeout: 265 seconds]
grzegorz has joined #ruby
Xiti has quit [Quit: Xiti]
Kerber0s has joined #ruby
jenrzzz has joined #ruby
eminencehc has joined #ruby
emilkarl has quit [Client Quit]
Porfa has joined #ruby
Musashi007 has quit [Quit: Musashi007]
anisha has joined #ruby
I has joined #ruby
Xiti has joined #ruby
Xiti has quit [Client Quit]
I is now known as Guest99531
ndrei has quit [Ping timeout: 256 seconds]
benlovell has joined #ruby
jobewan has joined #ruby
axl_ has joined #ruby
sankaber has quit [Remote host closed the connection]
grzegorz has quit [Ping timeout: 268 seconds]
sankaber has joined #ruby
umgrosscol has quit [Ping timeout: 240 seconds]
ruurd has joined #ruby
polishdub has joined #ruby
gizmore has joined #ruby
gizmore has quit [Changing host]
gizmore has joined #ruby
mary5030 has joined #ruby
jessemcgilallen has quit [Quit: jessemcgilallen]
Rollabunna has quit [Remote host closed the connection]
popnfloss has left #ruby [#ruby]
DanKnox is now known as DanKnox[away]
ruurd has quit [Client Quit]
chouhoulis has joined #ruby
DanKnox[away] is now known as DanKnox
vdamewood has joined #ruby
SylarRuby has quit [Remote host closed the connection]
dravine has quit [Ping timeout: 264 seconds]
sivsushruth has joined #ruby
baroquebobcat_ has joined #ruby
dravine has joined #ruby
paulcsmith has joined #ruby
bruno- has joined #ruby
Alayde has left #ruby ["WeeChat 1.1.1"]
cball has quit [Ping timeout: 246 seconds]
jgt has joined #ruby
nanoz has joined #ruby
anisha has quit [Quit: Leaving]
paulcsmith has quit [Client Quit]
gregoriokusowski has joined #ruby
umgrosscol has joined #ruby
paulcsmith has joined #ruby
inteq has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tk__ has quit [Quit: ばいばい]
Pupp3tm4_ has quit [Remote host closed the connection]
ruurd has joined #ruby
UtkarshRay has joined #ruby
cschneid_ has joined #ruby
Zamyatin has quit [Ping timeout: 264 seconds]
<cajone>
does anyone have any experience of using rbuic4 ie qt4 xml files -> ruby code, I seem to have an issue that rbuic4 is defaulting to KDE UI bindings?
leafybas_ has quit [Remote host closed the connection]
kwd has quit [Quit: kwd]
mistermocha has joined #ruby
leafybasil has joined #ruby
prateekp has quit [Quit: Page closed]
cball has joined #ruby
mistermocha has quit [Ping timeout: 265 seconds]
Zamyatin has joined #ruby
krisquigley has quit [Remote host closed the connection]
karapetyan has joined #ruby
rippa has joined #ruby
nfk|laptop has quit [Remote host closed the connection]
Cyther has joined #ruby
eminencehc has quit [Remote host closed the connection]
ishikawa91 has joined #ruby
jgt has quit [Ping timeout: 240 seconds]
tkuchiki has joined #ruby
eminencehc has joined #ruby
Xiti has joined #ruby
noethics has joined #ruby
Channel6 has quit [Ping timeout: 265 seconds]
Guest99531 has quit [Quit: Leaving]
Jardayn has joined #ruby
dopie has joined #ruby
yeshacker has quit [Ping timeout: 255 seconds]
blackmes1 has quit [Quit: WeeChat 1.3]
Asher has joined #ruby
mistermocha has joined #ruby
skade has joined #ruby
renier has joined #ruby
mistermo_ has joined #ruby
Xiti has quit [Client Quit]
krisquigley has joined #ruby
Xiti has joined #ruby
mistermocha has quit [Ping timeout: 272 seconds]
dfinninger has joined #ruby
kimegede has quit [Quit: Leaving...]
Xiti has quit [Client Quit]
Motoservo has joined #ruby
riotjones has joined #ruby
FernandoBasso has quit [Quit: WeeChat 1.3]
cantaberry has quit [Ping timeout: 260 seconds]
cantaberry has joined #ruby
SCHAAP137 has quit [Remote host closed the connection]
blackmesa has joined #ruby
bollullera has joined #ruby
jas02 has quit [Quit: jas02]
cschneid_ has quit [Read error: Connection reset by peer]
riotjones has quit [Ping timeout: 240 seconds]
jas02 has joined #ruby
bollullera has left #ruby [#ruby]
DexterLB has quit [Read error: Connection reset by peer]
mistermocha has quit [Read error: Connection reset by peer]
eminencehc has joined #ruby
Lucky__ has joined #ruby
tkuchiki has quit [Remote host closed the connection]
skweek has quit [Remote host closed the connection]
ramfjord has joined #ruby
hobodave has joined #ruby
basiles has joined #ruby
lucianosousa has joined #ruby
funkenstrahlen has left #ruby ["WeeChat 1.1.1"]
tkuchiki has joined #ruby
shmilan has quit [Ping timeout: 246 seconds]
skweek has joined #ruby
senayar has quit []
sanjayu has quit [Ping timeout: 255 seconds]
yardenbar has joined #ruby
devoldmx has joined #ruby
trautwein has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
danman has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
danman has quit [Client Quit]
diegoaguilar has quit [Ping timeout: 255 seconds]
shmilan has joined #ruby
dopamean_ has quit [Ping timeout: 264 seconds]
towski_ has joined #ruby
c0m0 has quit [Ping timeout: 264 seconds]
Entropy2 has joined #ruby
<Entropy2>
why does everyone say ruby is slow
<Entropy2>
also would jRuby be faster thanks to the JVM's JIT
baroquebobcat_ is now known as baroquebobcat
devoldmx has quit [Ping timeout: 240 seconds]
<chrisseaton>
Entropy2: Ruby does seem pretty slow compared to implementations of other dynamic languages on common benchmarks
<chrisseaton>
but whether that matters to you or not is a different question
woodruffw has quit [Read error: Connection reset by peer]
<Entropy2>
chrisseaton, can I compile ruby to a single executable that is statically linked?
symm- has joined #ruby
<chrisseaton>
Entropy2: not with any existing implementation I don't think think - except maybe Ruby Motion - but even if you did I don't think that would make it any faster
dvarrui has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
crdpink has joined #ruby
crdpink2 has quit [Ping timeout: 240 seconds]
woodruffw has joined #ruby
<Entropy2>
chrisseaton, oh no this is for portability
<reaVer>
ruby is mostly there for glueing
<reaVer>
if you want performance, you create C modules
shoutsid has quit [Ping timeout: 268 seconds]
<reaVer>
and then use those within ruby
<chrisseaton>
reaVer: you have to admit it's a shame we have to do that though
Rollabunna has joined #ruby
jgt has joined #ruby
<reaVer>
chrisseaton: no it isn't
lubarch has joined #ruby
<reaVer>
ruby is a scripting language, making a scripting language perform is basically trying to produce an oxymoron
<reaVer>
ruby has the flexibility it needs for high level coding
<Entropy2>
reaVer, Javascript
<reaVer>
and C has the robustness for low level coding
<Entropy2>
V8
Steve_Jobs has joined #ruby
<Entropy2>
so it's not a oxymoron
<chrisseaton>
but we can't we have both that flexibility and performance?
<eam>
Entropy2: v8 is not fast
<Entropy2>
google wrote an entire JIT just to rip through javascript like it was ricepaper
shinnya has joined #ruby
<reaVer>
chrisseaton: not to the extend the seperation of the two functions gives you
<Entropy2>
eam, V8 is stupidly fast
<canton7>
and how much did V8 cost to develop, I wonder? :P
diegoviola has joined #ruby
michaeldeol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eam>
Entropy2: it's fast "for a scripting language"
<eam>
which is still very, very slow
<eam>
there's really no comparison
eminencehc has quit [Remote host closed the connection]
<Entropy2>
ASM is faster than C
<Entropy2>
;)
last_staff has joined #ruby
<reaVer>
Entropy2: no it isn't
riotjone_ has joined #ruby
<Entropy2>
reaVer, it is.
<eam>
C essentially is an assembly language
<canton7>
that's a non-statement. It depends on who wrote it, since there's no optimization with ASM
<reaVer>
C translates to assembly, so it's basically the same thing
<Entropy2>
no.
<Entropy2>
Assembly is a high level language aswell
<reaVer>
and while people used to be able to write more optimized code in asm than the c compiler would do, times have changed
<Entropy2>
It boils down to OPTCODES
jpfuente_ has joined #ruby
symm- has quit [Client Quit]
<eam>
Entropy2: the elements that impact speed are the ability to avoid work - languages with intrinsic abstractions cannot avoid certain types of overhead
<reaVer>
oh boy, someone snapped and went full on troll
<canton7>
Entropy2, you mean opcodes ;) and assembly is just shorthand for opcodes. It isn't a level above them
<canton7>
yeah... troll alarm is wailing with now
<canton7>
*right now
PaulCape_ has quit [Quit: .]
<eam>
it's true that there are some abstractions tied to C -- for example function call overhead
<adaedra>
I smell trolling
<Entropy2>
Yea I'm a troll because I pointed out C doesn't boil to ASM
<Entropy2>
>.>
<Entropy2>
C boils to opcodes (Accidentally added a T last time, shoot me)
PaulCapestany has joined #ruby
<canton7>
asm is basically just opcodes though - there's no abstraction
<eam>
but the thing is, you can avoid those behaviors in C if you wish
<Entropy2>
canton7, there is though
<reaVer>
Entropy2: do you know what the difference in low level and high level coding is?
<Entropy2>
yes
benlovell has quit [Ping timeout: 246 seconds]
<reaVer>
prove it
<Entropy2>
When speaking from the CPU's point of view eveyrthing is high level.
<eam>
Entropy2: are you under the impression that x86 opcodes are the actual instructions executed by the CPU?
mark2 has quit [Remote host closed the connection]
<canton7>
Entropy2, what is the abstraction which assembly gives you? :)
<eam>
you know that x86 machine code itself is a high level interpreted language, right?
<Entropy2>
Yes I know
<shevy>
real programmers speak in machine code
<Entropy2>
ASM -> OPCODES -> CPU Microcode
<Entropy2>
C -> OPCODES -> CPU microcode
<adaedra>
I smell off-topic
<reaVer>
no
<shevy>
I smell baguette!
Agent001 has joined #ruby
pietr0 has joined #ruby
<Entropy2>
adaedra, my original question was about Ruby's performance.
<eam>
adaedra: it's kinda on topic, we're talking about the intrinsic limitations of a language
<Entropy2>
eam, we're not on topic
<shevy>
yes, ruby is slower than C
<reaVer>
C -> ASM -> w/e comes after it
<reaVer>
and there's several executable formats around
eminencehc has joined #ruby
<Entropy2>
shevy, but is the performance hit that bad that anything that needs high speed proccessing can't be done in Ruby?
mikecmpbll has quit [Ping timeout: 240 seconds]
Bellthoven has joined #ruby
<reaVer>
C and C++ still compile to assembly and then compile that assembly to object code
<Entropy2>
I'm not talking 40k connections a second
<shevy>
I have no idea, it was never my complaint about ruby. I find it more annoying that the documentation is awful
riotjone_ has quit [Ping timeout: 250 seconds]
<Entropy2>
shevy, I hear gems are amazing
<shevy>
big companies who went the ruby-prototyping route, went on to re-write in java or C anyway
<adaedra>
eam: it's on the line, I'd say.
<eam>
adaedra: granted ;)
krisquigley has quit [Remote host closed the connection]
<reaVer>
Entropy2: it's ill advised to build a quake4 engine in ruby for example
paulcsmith has joined #ruby
<Entropy2>
shevy, say that in any other channel and see how many people argue java isn't used in enterprise ;)
<Entropy2>
reaVer, ok
beauby has quit [Ping timeout: 240 seconds]
<reaVer>
yet you could do something as simple as create a main loop that calls C modules that take care of the rendering and what not
<Entropy2>
reaVer, that helps a lot
<shevy>
well, they'd have to accept numbers and facts; twitter switched to java/scala once they had too high a traffic/response cost
<Entropy2>
reaVer, so Ruby should be used more like a Glue code
<reaVer>
the difference between low level languages and high level languages is really simple to explain
diegoaguilar has joined #ruby
<eam>
twitter is also not in the business of strongly optimizing for efficiency
<Entropy2>
shevy, don't worry, I worked a company that used Java for their payrolls and other applications they sold
<Entropy2>
eam, Java can be quite efficient
<reaVer>
with a high level language you say "Build me a car"
<canton7>
or for stuff where speed of writing is more important for speed of importance
<eam>
Entropy2: sure it can
<adaedra>
shevy: that's exactly the thing: they changed when they hit the line
<canton7>
*more important than
<reaVer>
and with a low level language you tell it every step of the way how it should build a car
<canton7>
ack I can't write
<shevy>
they dumped ruby like that ex-girlfriend!
<canton7>
or for stuff where speed of writing is more important than speed of performance
<adaedra>
reaVer: and in germany, you can say: "Build a car that pass polution tests even if it's over the levels"
<reaVer>
so the low level language allows you to optimize better
<Entropy2>
ok I started a language war by accident
<reaVer>
the high level language allows you to code faster
<shevy>
adaedra hey... others cheated too :)
<Entropy2>
guys
<reaVer>
adaedra: indeed XD
<Entropy2>
I just wanted to know how well ruby performs ; - ;
<eam>
for anything but the largest scale deployments (and twitter isn't large) you'll generally have a bias toward safety and developer speed vs runtime speed
<adaedra>
Such questions are often here to... well, this.
<Entropy2>
adaedra, It wasn't my intention to start a language war.
<adaedra>
Let's say it was.
<Entropy2>
can someone answer me this. Ruby is good as a sort a glue code between multiple languages?
<adaedra>
wasn't.
<shevy>
Entropy2 well, it depends on who makes such a statement. if it is an old blog, it may refer to ruby 1.8.x; ruby past 1.8.x is a bit faster, and once matz is finished with mruby, then now we'll be talking!
<adaedra>
How do I english.
<shevy>
with french accent please adaedra
<Entropy2>
shevy, So ruby is getting a performance boost?
ndrei has joined #ruby
<adaedra>
shevy: Énglish.
<reaVer>
I'm not trying to make this sound like a language war, Ruby has characteristics that allow you to be really productive at a superficial level
<Entropy2>
Can I compile ruby into a single executeable for Linux?
<adaedra>
Entropy2: there's more than performance that is important.
<reaVer>
and C allows you to create stuff that is fast
tkuchiki has quit [Remote host closed the connection]
<chrisseaton>
I really don't think it's true that a low level language always allows you to optimise better. In C you generally get what you ask for. If you call malloc, then heap will always be allocated. In Ruby you can ask it to allocate an Array on the heap, but the implementation can do something else instead - like allocate it on the stack.
<reaVer>
the combination of the two essentially makes ruby fast
<shevy>
Entropy2 sorta... there will be frozen strings in ruby 3.x era for instance, which will improve speed... also I still don't like that change :P
<Entropy2>
reaVer, what about go :p
<Entropy2>
frozen strings?
jpfuente_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
yeah
benlieb has joined #ruby
<adaedra>
String literals will be immutable by default.
<reaVer>
chrisseaton: just think about the fact that the fastest ruby interpreter is written in C, and understand the problem of what you said :p
<Entropy2>
guys
<Entropy2>
don't fight over java.
<Entropy2>
I'm asking about JRuby
<newdan>
Yes, I like Ruby more than Java, which is why I'm hanging out in #ruby. But JRuby is still slower than Java. I don't really understand the question I guess
baroquebobcat has quit [Quit: baroquebobcat]
<reaVer>
I'm not fighting over java
<adaedra>
Entropy2: running on JVM allows to benefit from optimizations in the JVM.
<reaVer>
java is best left ignored
<Entropy2>
adaedra, :)
<reaVer>
in the middle of nowhere
basiles_ has quit [Ping timeout: 240 seconds]
<Entropy2>
reaVer, I, i like java ; - ;
<adaedra>
(You were asking for JRuby performance)
<newdan>
Ruby performance is not great
<adaedra>
It's ok
<reaVer>
Entropy2: once you learn some real languages you will learn to hate it with a passion :p
<Entropy2>
So if I write something with JRuby I can distribute it as a Jar
<headius>
reaVer: the fastest ruby interpreter is not written in C
<Entropy2>
reaVer, I've learned PHP and Java and beginning to learn C
<newdan>
Entropy2: I believe so, check out the Warbler project
<Entropy2>
reaVer, I hate all the boiler plates but love the JVM
<eam>
reaVer: jruby is faster than mri in many areas
<reaVer>
headius: what changed? :p
<eam>
(and slower in some others)
<shevy>
TIOBE says java is the best
<chrisseaton>
reaVer: I think the fastest Ruby interpreter is my one - JRuby+Truffle which is written in Java, but I guess that's not something we can settle on IRC
oetjenj has joined #ruby
baroquebobcat has joined #ruby
<adaedra>
Entropy2: also, if you want to compare ruby implementations, you can also look at rubinius.
<chrisseaton>
reaVer: the next fastest is Topaz, which is written in Python
<newdan>
newdan: In any case you can use JRuby API to write a Java class that starts JRuby, then package your Ruby scripts as JAR assets. But I think Warbler does some of that for you or something
<Entropy2>
adaedra, how many implimentations are there
<headius>
JRuby proper is usually faster than MRI and like chrisseaton says the truffle stuff is another level beyond that
<adaedra>
Entropy2: many
<adaedra>
some of them abandonned
beauby has joined #ruby
<adaedra>
i.e. IronRuby
<headius>
chrisseaton: well, rpython
<reaVer>
eam: oh I'm sorry, I did kinda mean without infinite memory bloat :p
<headius>
it's not like it's running on top of a python impl at runtime
<shevy>
:>
<Entropy2>
If you guys want to argue about a language argue about Turin
<Entropy2>
Turing*
<Entropy2>
and OpenTuring
<adaedra>
?guys
<ruboto>
Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
<headius>
?gals
<ruboto>
I don't know anything about gals
<headius>
of course not
<shevy>
we shall simply accept the fact that ruby won't be the fastest language on earth
<eam>
reaVer: well, the distinction highlights a key perspective: Do you want overall higher throughput while churning through huge piles of unoptimized code? Or do you need to minimize work in a smaller critical section?
<adaedra>
it's not meant to
<adaedra>
If you want performance, stick to C/C++
jessemcgilallen has joined #ruby
arescorpio has joined #ruby
SylarRuby has joined #ruby
<eam>
java and other advanced abstract runtimes excel at the former, but can't really do the latter (where you'd use something like C)
sivsushruth has quit [Ping timeout: 240 seconds]
<adaedra>
Ruby has advantages, but it's not speed
<eam>
and C isn't good at the former unless you're willing to expend an unreasonable amount of developer time
<Entropy2>
there's a GoLang to ruby transpilre.
<Entropy2>
why?
<adaedra>
Also, performance Ruby provides is often good enough.
sivsushruth has joined #ruby
roshanavand has quit [Remote host closed the connection]
<adaedra>
Go ask the author
<Entropy2>
I'm currently installing Coffeescript
ruurd has joined #ruby
<Entropy2>
It makes Javascript less painful.
<adaedra>
I wonder how it does that.
<headius>
I'm currently making coffee
<headius>
it makes life less painful
<adaedra>
uhuh
dopamean_ has joined #ruby
<eam>
irish it
shoutsid has joined #ruby
<adaedra>
Want a virtual hug, headius?
<headius>
I should swedish it and put in a shot of akavit
allcentury has joined #ruby
basiles has joined #ruby
<adaedra>
Jaha
<eam>
we were out at a mexican place and they had "mexican coffee" which had a shot of tequila -- at which point I reaized that <any ethnicity> coffee generally meant adding booze of some kind
zcreative has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
zcreative has quit [Client Quit]
paulcsmith has quit [Ping timeout: 260 seconds]
<headius>
that sounds as bad as putting in akavit
<adaedra>
Here coffee is just coffee
Porfa has quit [Quit: Porfa]
paulcsmith has joined #ruby
<eam>
it was fantastic actually, they also added cinnamon
<headius>
ruby and coffee are good together so I'm not offtopic
roshanavand has joined #ruby
<headius>
?coffee
<ruboto>
here's a coffee, you seem to need it: ☕
<headius>
ding
ruurd has quit [Client Quit]
<eam>
I just drink drip coffee like a philistine
* Entropy2
hugs headius
symm- has joined #ruby
<Entropy2>
it gets better
<Entropy2>
We can get you a caffine IV
<headius>
right next to my beer IV
djbkd has joined #ruby
<Entropy2>
I'm drug free except caffine
niko has joined #ruby
<adaedra>
Congrats
ruurd has joined #ruby
<adaedra>
Personally, my drug is cat pictures
<Entropy2>
when someone touches my coffee I will break their fingers.
<adaedra>
?cat
<ruboto>
I don't know anything about cat
<Entropy2>
^
<Entropy2>
cats
phutchins has joined #ruby
<Entropy2>
?cat
<ruboto>
I don't know anything about cat
<Entropy2>
?ror
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<adaedra>
Bad ruboto
axl_ has quit [Quit: axl_]
freezevee has joined #ruby
<shevy>
havenwood also likes coffee
<pocketprotector>
I've watched pretty much all of the videos on lynda regarding ruby. I am looking for projects and was thinking about immersing myself into ruby by rewriting my bash scripts and stopping the use of shell scripting all together.
bkxd has joined #ruby
yeshacker has joined #ruby
<pocketprotector>
I'm looking for some more ideas on how to exercise my ruby skillz.
michaeldeol has joined #ruby
<ruurd>
?mew
<ruboto>
I don't know anything about mew
<ruurd>
?grumpy
<ruboto>
I don't know anything about grumpy
<ruurd>
?stupid ruboto
<ruboto>
ruboto, I don't know anything about stupid
Porfa has joined #ruby
benlieb has quit [Quit: benlieb]
<adaedra>
See you all, be nice
<shevy>
pocketprotector yay \o/ down with shellscripts
rattatmatt has joined #ruby
jpfuente_ has joined #ruby
<shevy>
pocketprotector start a logical route; start with methods; transition into classes lateron; then use modules too; then package stuff into gems even if you only want to use them locally
<shevy>
the more you write the better you'll become
psy_ has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
psy_ has quit [Max SendQ exceeded]
<pocketprotector>
methods are my favorite part of ruby so far
petricore has joined #ruby
psy_ has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
mikecmpbll has joined #ruby
firstdayonthejob has joined #ruby
EllisTAA has joined #ruby
dfinning_ has quit [Remote host closed the connection]
lubarch has quit [Quit: leaving]
benlieb has joined #ruby
lubarch has joined #ruby
moeabdol has quit [Ping timeout: 260 seconds]
Kendos-Kenlen has joined #ruby
[Butch] has quit [Remote host closed the connection]
stan has quit [Ping timeout: 264 seconds]
freezevee has quit [Ping timeout: 265 seconds]
nateberkopec has quit [Read error: Connection reset by peer]
tomphp has joined #ruby
<headius>
eam: I drink keurig coffee, so you're a better person than I
<ishikawa91>
hey @pocketprotector, check out project euler as well
rewzn has quit [Quit: WeeChat 1.1]
rewzn has joined #ruby
<eam>
headius: I'm surprised you'd admit to such a heinous social faux pas
DanKnox is now known as DanKnox[away]
<Sam_Gerber>
It will make you wish you had never seen the words "pandigital" and "prime"
shmilan has quit [Ping timeout: 246 seconds]
<headius>
eam: I'm permanently on step one of my 12-step keurig addiction program
<eam>
acceptance?
DEA7TH has joined #ruby
asui has quit [Quit: Leaving]
<headius>
acceptance and admittance that keurig owns me rather than the other way around
kalusn has quit [Remote host closed the connection]
saddad has joined #ruby
<pocketprotector>
ha. i am browsing the problems now
<headius>
honestly though, I just don't like coffee that much
<headius>
not enough to put more than keurig effort into it before fixing bugs in my ruby implementation so I'm not offtopic
<eam>
me either, I just want some black bean soaked water to glug down before I need to turn my brain on
roshanavand has quit [Remote host closed the connection]
<headius>
yeah, exactly
<eam>
I used to swallow whole beans in the morning
hanmac has joined #ruby
<headius>
I'd switch to tea if keurig water blasted out at boiling temps
<pocketprotector>
you guys dont shoot it up?
<eam>
pocketprotector: pack it in my gums like chaw
triangles2 has quit [Quit: Leaving]
<headius>
chaw's awesome
<pocketprotector>
is that like chaw chank redemption?
<headius>
- a hockey-playing nimrod in my 9th grade calc class
Igorshp has quit [Remote host closed the connection]
shadoi has joined #ruby
<eam>
I kinda want to buy a turkish coffee set, but I know it'll just take up space in my kitchen after the interest dies off
<pocketprotector>
i am very happy with my hario drip set.
<shevy>
eam yeah! british influence here in europe
<to_json>
with a focus on being exceedingly pedantic and idomatic
apt-get has joined #ruby
<to_json>
which sounds annoying AF but it's a decent wy to get more comfortable with the $LANG way of doing things
<Sam_Gerber>
cool!
<pocketprotector>
to_json: wow that is freakin cool!
bruno- has quit [Read error: Connection reset by peer]
krisquigley has joined #ruby
<headius>
Sam_Gerber: yeah :-(
<to_json>
here's a talk by the project creator where she talks in depth about why it exists and steps through an example problem (in ruby) to an almost unreasonable depth: https://www.youtube.com/watch?v=qLpvc5r6Bb0
craysiii has joined #ruby
<pocketprotector>
i wish my computer had sound
<to_json>
oh no!
<pocketprotector>
ill have to email it to myself and watch it on my laptop
eminencehc has quit [Remote host closed the connection]
baweaver has joined #ruby
JDiPierro has quit [Remote host closed the connection]
bruno- has joined #ruby
baweaver has quit [Remote host closed the connection]
baweaver has joined #ruby
vdamewood has quit [Quit: Life beckons.]
joufflu has joined #ruby
riotjone_ has joined #ruby
`tim` has quit [Read error: Connection reset by peer]
<pocketprotector>
yay sound
<ishikawa91>
how did people like exercism.io? I have been meaning to try it out
dstarh has quit [Read error: Connection reset by peer]
phutchins has quit [Ping timeout: 240 seconds]
eminencehc has joined #ruby
bruno- has quit [Ping timeout: 264 seconds]
shoutsid has quit [Remote host closed the connection]
caliostro has joined #ruby
caliostro_ has joined #ruby
caliostro_ has quit [Read error: Connection reset by peer]
petricore has quit [Read error: Connection reset by peer]
riotjone_ has quit [Ping timeout: 256 seconds]
apt-get has quit [Read error: Connection reset by peer]
shadoi has quit [Quit: Leaving.]
kobain has joined #ruby
kobain has quit [Max SendQ exceeded]
ngscheur1 has joined #ruby
kobain has joined #ruby
jenrzzz has joined #ruby
tenderlove has joined #ruby
_aeris_ has quit [Ping timeout: 256 seconds]
pharaoh2 has joined #ruby
_aeris_ has joined #ruby
shoutsid has joined #ruby
[Butch] has joined #ruby
mozzarella has quit [Quit: WeeChat 1.2]
jenrzzz has quit [Ping timeout: 240 seconds]
petricore has joined #ruby
mozzarella has joined #ruby
zenguy_pc has quit [Ping timeout: 255 seconds]
pocketprotector- has joined #ruby
ramfjord has joined #ruby
momo-reina has quit [Ping timeout: 244 seconds]
pawnbox has quit []
pawnbox has joined #ruby
saddad has quit [Ping timeout: 255 seconds]
yardenbar has quit [Ping timeout: 264 seconds]
gusTester has joined #ruby
krisquigley has quit [Remote host closed the connection]
gusTester has left #ruby [#ruby]
<pocketprotector>
?!!
<pocketprotector>
ill have to figure out what the double !! is all about
zenguy_pc has joined #ruby
andersoldahl has joined #ruby
pandaant has quit [Remote host closed the connection]
baweaver has quit [Remote host closed the connection]
axl_ has joined #ruby
andersoldahl has quit [Client Quit]
<hal_9000>
pocketprotector: convert to Boolean
djbkd has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
tvw has quit []
basiles has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
basiles has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
jackjackdripper has quit [Client Quit]
zfez has left #ruby [#ruby]
djbkd has joined #ruby
jackjackdripper has joined #ruby
phutchins has joined #ruby
kalusn has joined #ruby
shoutsid has quit [Remote host closed the connection]
niemcu has joined #ruby
Musashi007 has joined #ruby
dfinninger has joined #ruby
Skelz0r has joined #ruby
solars has joined #ruby
yardenbar has joined #ruby
The_Phoenix has quit [Read error: Connection reset by peer]
<pocketprotector>
ahh!
tynamite has left #ruby [#ruby]
dfinninger has quit [Ping timeout: 256 seconds]
D-unit has joined #ruby
tynamite has joined #ruby
<tynamite>
Hi I have a problem
eminencehc has quit [Remote host closed the connection]
<caliostro>
what kind?
yardenbar has quit [Ping timeout: 272 seconds]
<tynamite>
I'm trying to save the % symbol to the database and I'm getting an error saying it's the bad encoding. My html page is utf-8 and google chrome developer tools cannot interpret the %
<caliostro>
maybe because % is a special character in sql
lucianosousa has quit [Quit: lucianosousa]
<caliostro>
try to escape it, \%
lucianosousa has joined #ruby
shoutsid has joined #ruby
<tobiasvl>
or %%
yeshacker has quit [Read error: Connection reset by peer]
eminencehc has joined #ruby
<tobiasvl>
that's the way to escape it in actual sql
<tynamite>
I'm using Sequel ORM so I expected that to escape it automatically.
<eam>
or more importantly, use placeholders instead of string interpolation in your db query
yeshacker has joined #ruby
<tobiasvl>
tynamite: not if it needs to be escaped in the sql itself, but it will probably escape the ruby string for you
timonv has joined #ruby
<caliostro>
check the documentation of Sequel ORM
baweaver has joined #ruby
D-unit has quit [Quit: leaving]
Motoservo has quit [Ping timeout: 256 seconds]
<tobiasvl>
sequel can't know if you actually want a special sql character or if you want a literal %, just like a ruby string can't escape for you
kalusn has quit [Remote host closed the connection]
gusTester has joined #ruby
kalusn has joined #ruby
<tynamite>
But I'm saving content to a database, not writing queries.
skweek has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 240 seconds]
shoutsid has quit [Remote host closed the connection]
<adaedra>
re
jgt has joined #ruby
shoutsid has joined #ruby
<shevy>
adaedra is back!
devoldmx has joined #ruby
<adaedra>
Prepare for trouble!
mary5030_ has joined #ruby
beast has joined #ruby
mary5030 has quit [Ping timeout: 244 seconds]
yardenbar has joined #ruby
Alina-malina has quit [Read error: Connection reset by peer]
Motoservo has joined #ruby
<djbender>
pocketprotector: exercism is great.
benlieb has quit [Quit: benlieb]
yairgo has joined #ruby
yairgo has quit [Client Quit]
ericjphillips has joined #ruby
yairgo has joined #ruby
Cyther_ has joined #ruby
devoldmx has quit [Ping timeout: 256 seconds]
Alina-malina has joined #ruby
baweaver has quit [Remote host closed the connection]
karapetyan has quit [Remote host closed the connection]
mary5030_ has quit [Remote host closed the connection]
mary5030 has joined #ruby
karapetyan has joined #ruby
Cyther has quit [Ping timeout: 264 seconds]
Jackneill has joined #ruby
cdg has quit [Remote host closed the connection]
chouhoulis has quit [Read error: Connection reset by peer]
chouhoulis has joined #ruby
mary5030_ has joined #ruby
<pocketprotector>
djbender: yeah it is!
bklane has joined #ruby
cdg has joined #ruby
riotjone_ has joined #ruby
riotjone_ has quit [Read error: Connection reset by peer]
skweek has joined #ruby
basiles has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
riotjone_ has joined #ruby
riotjone_ has quit [Remote host closed the connection]
riotjone_ has joined #ruby
benlieb has joined #ruby
mary5030 has quit [Ping timeout: 264 seconds]
llua has left #ruby [#ruby]
mary5030_ has quit [Ping timeout: 256 seconds]
karapetyan has quit [Ping timeout: 250 seconds]
shoutsid has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 264 seconds]
shoutsid has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
mary5030 has quit [Remote host closed the connection]
<atmosx>
and I'll remove the '?' since I don't want this to return 'true'.
<caliostro>
i don't like raise exception, just return true/false
<jhass>
or ensure_runnable though that's vague, perhaps two, ensure_platform and ensure_setup
ericjphillips has joined #ruby
_blizzy_ has joined #ruby
<atmosx>
jhass: ensure_setup is the best probably
<atmosx>
caliostro: why? wha tis the difference?
podman has joined #ruby
mary5030 has joined #ruby
<caliostro>
raising exception is a side effect, i prefer functional programming
<jhass>
this is a CLI tool?
grzegorz has quit [Ping timeout: 255 seconds]
<atmosx>
jhass: yes
mary5030 has quit [Read error: Connection reset by peer]
<jhass>
I'd go with Kernel#abort then
<atmosx>
jhass: I'm rewriting it and I'd like to follow best practices
<atmosx>
jhass: Kernel#abort ? hm
<atmosx>
jhass: will that work with all unices?
pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pocketprotector>
meh best practices
sankaber has quit [Read error: Connection reset by peer]
mary5030 has joined #ruby
Kendos-Kenlen has quit [Quit: Konversation terminated!]
<jhass>
sure it's just a wrapper around Kernel#exit and Kernel#warn
<atmosx>
jhass: cool
sankaber has joined #ruby
pwnd_nsfw has joined #ruby
shoutsid has quit [Remote host closed the connection]
Soda has quit [Remote host closed the connection]
shoutsid has joined #ruby
Agent001 has left #ruby [#ruby]
Kendos-Kenlen has joined #ruby
djbkd has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
djbkd has joined #ruby
diegoaguilar has joined #ruby
basiles has joined #ruby
bkxd has joined #ruby
tmtwd has joined #ruby
some_body has joined #ruby
<some_body>
.tap is really slow
Kendos-Kenlen has quit [Quit: Konversation terminated!]
Kendos-Kenlen has joined #ruby
Kendos-Kenlen has quit [Client Quit]
bkxd has quit [Ping timeout: 250 seconds]
bungoman has joined #ruby
chouhoulis has joined #ruby
stamina has quit [Ping timeout: 250 seconds]
brunto has quit [Ping timeout: 256 seconds]
brunto has joined #ruby
some_body has left #ruby [#ruby]
tmtwd has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 250 seconds]
fxck has joined #ruby
krisquigley has joined #ruby
maletor has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<pipework>
caliostro: You're going to have a fun time with ruby then. Also, your code will be rather confusing for rubyists and anyone who doesn't share your understanding of the meanings of true and false.
ramfjord has quit [Ping timeout: 246 seconds]
roshanavand has joined #ruby
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
caliostro right but then you have only "true" and "false", false to indicate error; even in C you have exit with different exit status odes
<jhass>
the bucket is chosen by using the keys hash % number_of_buckets
Osc has joined #ruby
basiles has quit [Ping timeout: 250 seconds]
twistedpixels has quit [Ping timeout: 240 seconds]
<jhass>
then on lookup the linked list of that bucket is iterated and eql? is used to find the actual entry
kadoppe has joined #ruby
gusTester has joined #ruby
<Osc>
How do I chain a select and each for an array?
<pipework>
Osc what have you tried?
<jhass>
rlv: so if you do something that changes keys hash, you would be lucky to hit the same bucket again
<pipework>
Have you considered #each, and using next in the block?
<Osc>
Is that the ruby way? Very new to ruby
<pipework>
Osc: If I'm understanding you correctly.
<jhass>
rlv: rehash recomputes all key hashes and puts the entries into the right buckets
<Osc>
I've tried data[api].paths.select{ |path| path.take(1).take(1).tags.include?(tag.name)}.each do |path|
WizJin has quit [Remote host closed the connection]
<pipework>
You have something enumerable, and you want to do something to a subset of the enumerable, right?
<zotherstupidguy>
what does this line do? bundle install --path vendor/cache
<Osc>
pipework:Yeah
<pipework>
zotherstupidguy: did you read the docs or try it?
<zotherstupidguy>
pipework nope,
<pipework>
Osc: data[api].paths.each { next unless path.take(1).take(1).tags.include?(tag.name); other_part }
<rlv>
jhass: What do you mean by hash % number_of_buckets/
<rlv>
?*
<pipework>
zotherstupidguy: sounds like something worth investigating
devoldmx has joined #ruby
<jhass>
rlv: that's modulo, do you know modulo?
<rlv>
jhass: Oh right. Okay.
<Osc>
pipework: So no chaining?
<pipework>
Osc: None necessary.
pharaoh2 has joined #ruby
<Osc>
pipework: Don't I need to name path?
<Osc>
in next unless path.
jamesaxl has joined #ruby
<pipework>
Osc: data[api].paths.each {|path| next unless path.take(1).take(1).tags.include?(tag.name); other_part }
lucianosousa has joined #ruby
<pipework>
sorry, forgot the block variable.
<jhass>
I prefer the select variant myself actually
<pipework>
You're just #each'ing over all paths and nexting over the ones that don't fit the condition.
<pipework>
jhass: Why? Seems like a waste.
<Osc>
and other_part would be "do"?
bender_unit has joined #ruby
<jhass>
pipework: more expressive, harder to miss
shinnya has quit [Ping timeout: 255 seconds]
twistedpixels has joined #ruby
<pipework>
Osc: It'd be what you want to happen to a path that you want to do something with.
<pipework>
jhass: I can see how someone would want that, but I'm a fan of matz's style here with preferring loops and next and the such.
<jhass>
greater chance of a block being responsible for a single thing
mloy_ has quit [Quit: Leaving]
<Osc>
And if I want a block there?
<pipework>
It might be that the enumerable object is rather expensive.
Igorshp has joined #ruby
<pipework>
Osc: Don't want a block there, just put the contents of what the previous block used to be in there.
mloy has joined #ruby
mloy_ has joined #ruby
rlv has quit [Quit: Page closed]
gregoriokusowski has quit [Quit: gregoriokusowski]
<Osc>
pipework: It's in a erb template
stamina has joined #ruby
<pipework>
Osc: Can you show me all the relephant code?
mloy_ has quit [Client Quit]
<jhass>
Osc: so keep in mind it's just pipework's opinion, choose the style you prefer ;)
rlv has joined #ruby
<pipework>
Osc: Keep in mind that the select then the each is unnecessarily expensive just for eye candy.
<rlv>
jhass: Are symbols looked up in the hash the same way?
<jhass>
Osc: if it's in a template you probably should pass the already filtered list to the template
devoldmx has quit [Ping timeout: 272 seconds]
sebstrax has quit [Quit: Connection closed for inactivity]
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
rlv: yes, the trick for symbols is that their .hash is a very cheap operation based on their .object_id which is based on their pointer address internally
codeurge has joined #ruby
<pipework>
"my style" is also more in line with the preferences of the language creator, so there's that.
<noethics>
jhass, not sure what this is meant to show
<noethics>
if there is an all-encompassing json serializer in java i'm pretty sure ruby can make it work
bruno- has joined #ruby
DEA7TH has joined #ruby
<adaedra>
there's the "can we" and the "should we"
<noethics>
his point was the "can we"
<noethics>
i think
<noethics>
anyway no biggie i started working on a port of YAML::dump to json, was just looking where i could submit it
<noethics>
thanks!
ndrei has joined #ruby
<adaedra>
and how will you represent the class names, what jhass showed you?
riotjones has joined #ruby
<noethics>
serializing to a lower order format has loss of data, inevitably
diegoviola has quit [Changing host]
diegoviola has joined #ruby
BSaboia has joined #ruby
<adaedra>
maybe that's why json encoder tried to avoid
<adaedra>
what*
<noethics>
maybe, but it's pretty much useless as is
<adaedra>
it is?
<noethics>
hyperbole obviously :P in terms of marshalling an arbitrary object, yes
<noethics>
it is utterly useless
<ramfjord>
Hey @here - we have a bizarre practice at my company where we package everything into rpm's. Occasionally I run into issues with dynamically linked .so files being in different places in the production vs. build environment. Does anyone know of a way to perhaps statically link all .so files when installing gems through bundler?
<adaedra>
Because JSON is not for marshalling an object
baweaver has quit [Remote host closed the connection]
<noethics>
i marshal and unmarshal objects all the time in other languages
<noethics>
(via json)
axl_ has quit [Quit: axl_]
<noethics>
even if it dumped the object as a hash wold be sufficient
<adaedra>
What a great argument, "other languages do it"
<noethics>
yeah, that's pretty much the only way to bring context to language features
mary5030 has quit [Remote host closed the connection]
<noethics>
ruby isn't special in this regard anyway
<adaedra>
BraddPitt: you mean `def self.`? No, totally normal.
* adaedra
pets `derpy
adambeynon has quit [Ping timeout: 256 seconds]
* havenwood
tries to remember to use derpy in the mysterious future
Kendos-Kenlen has quit [Quit: Konversation terminated!]
<jhass>
you mean when the new ruboto replaces it? :P
<BraddPitt>
but still calling it like Module.method
<BraddPitt>
or should I just create a class inside of it? I'm not sure if what I'm doing in considered proper
chipotle has joined #ruby
<adaedra>
jhass: should be some time before that.
<jhass>
if you never make an instance a module is preferred even
<BraddPitt>
perfect
<adaedra>
havenwood: it's okay, it's only here for testing technically.
<jhass>
adaedra: I found "mysterious future" quite fitting
<adaedra>
it is.
<BraddPitt>
also, jhass is #module_function, self.method and extend self essentially doing the same thing? Granted, extend self applies to all methods in the module
ishikawa91 has quit [Ping timeout: 240 seconds]
newdan has quit [Ping timeout: 246 seconds]
<jhass>
no
<shevy>
BraddPitt there is private versus public difference
<EasyCo>
Is there any difference between explicitly defining symbol as method params vs not? i.e: def my_method(:param1, :param2) VS def my_method(param1, param2)
Pumukel has joined #ruby
djbender has quit [Ping timeout: 264 seconds]
schaary has quit [Ping timeout: 264 seconds]
<jhass>
module_function copies the method to the singleton class and makes the original private, extend self adds the module to the ancestor chain and def self defines it directly in the singleton class
<BraddPitt>
I like the idea of copying the method to an eigen class and keeping the original private
<rlv>
jhass: But I thought the for..in syntax was just syntactic sugar for the each iterator?
<jhass>
rlv: well, not just
<havenwood>
jhass: oops!
skweek has joined #ruby
<adaedra>
?coffee havenwood
<ruboto>
havenwood, here's a coffee, you seem to need it: ☕
<jhass>
rlv: it uses that internally but there's this semantic difference
lea has quit [Ping timeout: 246 seconds]
northfurr has joined #ruby
<havenwood>
adaedra: Not sure there's any amount of coffee that can wake me today.
sepp2k has quit [Ping timeout: 260 seconds]
<havenwood>
rlv: Don't use for.
uber has quit [Ping timeout: 250 seconds]
<EasyCo>
Actually what I saw was a class definition like: class MyClass < SomeClass.new(:param1, :param2)
<havenwood>
Look, right nick! Can I have a cookie to go with my coffee?
<EasyCo>
I've never seen that before, what's the intent there?
<havenwood>
EasyCo: Struct
<adaedra>
?cake havenwood
<ruboto>
havenwood, here's your cake:
<jhass>
EasyCo: that's just passing the symbols to the method .new of SomeClass
paulcsmith has quit [Quit: Be back later ...]
t3rm has joined #ruby
beauby has joined #ruby
<jhass>
EasyCo: and in the case of Struct.new an antipattern, use MyClass = Struct.new(:param1, :param2)
basiles has quit [Ping timeout: 244 seconds]
roshanavand has joined #ruby
sepp2k has joined #ruby
roshanavand has quit [Remote host closed the connection]
<jhass>
but it's just a call, not a definition
<rlv>
variables defined insided while, until and for are visible outside. why?
marsjaninzmarsa has joined #ruby
<jhass>
because. they're defined to not create a new scope and so they don't
<rlv>
jhass: So only blocks, classes, and modules create new scopes?
<jhass>
and the stabby lambda literal, yes
LMity has joined #ruby
Voker57 has quit [Read error: Connection reset by peer]
<jhass>
if I had to speculate on the motivation of defining them so, it's because it's quite useful for if and case to not do so and the loops got it for consistency with them
<ruboto>
shevy # => undefined method `hi' for Foo:Module (NoMethodError) ...check link for more (https://eval.in/449235)
lokson has quit [Ping timeout: 265 seconds]
pizzaops has joined #ruby
beauby has joined #ruby
SCHAAP137 has quit [Quit: Leaving]
<shevy>
so many bot-downloads on rubygems... I have a gem with a disclaimer "WARNING - DO NOT DOWNLOAD!" and in like 5 minutes, 10 downloads appear
<BraddPitt>
yeah
<BraddPitt>
ill put a gem on there without telling anyone about it and i get a bunch of DLs
n1ftyn8_ has joined #ruby
<BraddPitt>
but my main gem has *almost* 4.5k downloads
<BraddPitt>
pretty happy about that
<shevy>
4500 real people?
blackjid has quit [Max SendQ exceeded]
kirun has quit [Remote host closed the connection]
<eam>
I'm sure most of mine are CI systems
shredding has quit [Ping timeout: 268 seconds]
justin_pdx has quit [Quit: justin_pdx]
<shevy>
what is CI system?
blackjid has joined #ruby
<shevy>
I didn't even know you had any gems eam :)
<eam>
continuous integration - builds and stuff
_blizzy_ has quit [Read error: Connection reset by peer]
koz_ has joined #ruby
<eam>
can you view gems by author on rubygems?
<shevy>
hmm
<eam>
huh, yeah
<eam>
mine aren't too popular
<eam>
all niche junk
zenguy_pc has quit [Ping timeout: 264 seconds]
gyre007 has joined #ruby
renderfu_ has joined #ruby
<shevy>
it's really hard to assess how popular a gem really is with bot downloads distorting the numbers :(
<koz_>
I'm trying to use the ruby version provided by my package manager. When I call 'gem install bundler', I get the following error dump: http://dpaste.com/3R9Q32C
lipoqil has joined #ruby
bb010g has joined #ruby
<koz_>
Should I be concerned, and if so, how do I resolve this?
<eam>
shevy: my top one is https://rubygems.org/gems/rangeclient, and it's totally just got high numbers because a large number of other projects pull it into their bundles every time they build
<eam>
very few actual users
brunto has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 268 seconds]
<eam>
(and it's the dumbest, most simple rest_client wrapper)
pharaoh2 has joined #ruby
ELCALOR has joined #ruby
<eam>
the gem I'd say is the most useful and broadly applicable has the least downloads
_blizzy_ has joined #ruby
dfinninger has quit []
barhum2013 has joined #ruby
bkxd has joined #ruby
<shevy>
hmmm
aaeron has joined #ruby
richb___ has left #ruby [#ruby]
<pipework>
koz_: You either need to use gem with a local gem home setup, or use sudo with gem, though I suggest using chruby and ruby-install
<aaeron>
Hi.
<aaeron>
What is the best way of waiting for threads
<aaeron>
I use: threads.each(&:join)
simplyianm has joined #ruby
<aaeron>
Dint seem to work
<aaeron>
Is this better: ThreadsWait.all_waits(*threads)
<aaeron>
??
p0wn3d__ has joined #ruby
bryancp has joined #ruby
<jhass>
elaborate?
beauby has quit [Ping timeout: 244 seconds]
<aaeron>
I found a case, where one thread failed and it aborted the others too
cek has joined #ruby
jenrzzz_ has joined #ruby
<BraddPitt>
hah, I am triumphany re; testing private instance module methods
<eam>
shevy: why don't you code review some of my gems
<eam>
we can trade
<koz_>
pipework: chruby and ruby-install are what, sorry?
<pipework>
BraddPitt: The idea is that you shouldn't test private implementation.
<pipework>
koz_: google it
<koz_>
pipework: Alright, thanks.
<BraddPitt>
I know pipework but this method definitely should be tested imo
<pipework>
Cheers.
<havenwood>
koz_: A tool to install Ruby and a tool to switch between Rubies.
<pipework>
BraddPitt: Then it should not be private.
<BraddPitt>
but its only used for the public methods in the module :'(
<shevy>
eam one thing at a time! right now I have to finish porting my oldest and biggest 1.8.x codebase
<pipework>
If you need, make the private method delegate to an object, test that object's public methods.
jenrzzz has quit [Ping timeout: 256 seconds]
yairgo has quit [Quit: yairgo]
<eam>
I thought 1.8 was deprecated, surely no one's still using it
beauby has joined #ruby
charles81 has joined #ruby
<shevy>
hey I have been there for years when everyone else was on 1.9!
halfdan has joined #ruby
justin_pdx has joined #ruby
bcavileer has joined #ruby
manveru has joined #ruby
ngscheur1 has quit [Ping timeout: 240 seconds]
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
bkxd has quit [Ping timeout: 240 seconds]
<shevy>
I am almost finished in total though; after this, it's just 3 small but boring projects... and then my old ruby-gnome collection... which is also no fun to change (from gtk2 to gtk3, and the other things that changed in gnome... )
<koz_>
pipework: I just tried doing gem out of sudo - still get the same error dump.
<koz_>
Guess I have to try the other approach too.
n008f4g_ has quit [Ping timeout: 268 seconds]
kellabyte has joined #ruby
<eam>
shevy: if you were using perl it'd just work on newer versions
<Limix>
When I use their documented method for generating the signed post, the object that is returned just send through the master secret creds.
lokson has quit [Quit: WeeChat 1.0.1]
skweek has quit [Remote host closed the connection]
tomphp has joined #ruby
<Limix>
BraddPitt, screw it, I give up for today
<Limix>
thanks for trying
<BraddPitt>
ok
<Limix>
total amazon hate right now
tomphp has quit [Client Quit]
<pocketprotector>
amazon is whack
<Limix>
thank you
riotjone_ has joined #ruby
paulcsmith has quit [Ping timeout: 250 seconds]
<Limix>
what are the alternatives for s3?
<Limix>
I’m so ready
riotjone_ has quit [Read error: Connection reset by peer]
<pocketprotector>
get off of amazon
pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
riotjone_ has joined #ruby
shmilan has joined #ruby
pharaoh2 has joined #ruby
mikecmpbll has quit [Quit: i've nodded off.]
tubuliferous has joined #ruby
mistermocha has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
riotjone_ has quit [Ping timeout: 264 seconds]
Icey has joined #ruby
p0wn3d__ has quit [Ping timeout: 268 seconds]
Eiam_ has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
benlieb has quit [Quit: benlieb]
mattprelude has quit [Ping timeout: 272 seconds]
Bellthoven has quit []
Eiam_ has quit [Client Quit]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skade has quit [Quit: Computer has gone to sleep.]
Bellthoven has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
justinmburrous has joined #ruby
baweaver has joined #ruby
Bellthoven has quit [Client Quit]
vdamewood has joined #ruby
caliostro has quit [Remote host closed the connection]
eminencehc has joined #ruby
cdg has quit [Ping timeout: 264 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rcvalle has quit [Quit: rcvalle]
Lucky__ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
eminencehc has quit [Remote host closed the connection]
BSaboia has quit [Quit: Leaving]
jackjackdripper has quit [Quit: Leaving.]
y2k has joined #ruby
Mojo_Nixon has joined #ruby
niemcu has quit [Ping timeout: 268 seconds]
<y2k>
When a file is run directly the value of __FILE__ is just the name of the file like "foo.rb" but when it is required by another file, it is an absolute path to foo.rb (path/to/foo.rb). Is this how it works?