havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.2; 2.2.6; 2.1.10: https://www.ruby-lang.org || Paste >3 lines of text on https://gist.github.com || Rails questions? Ask on #RubyOnRails || logs @ https://irclog.whitequark.org/ruby/
ptierno has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
k13nox has quit [Remote host closed the connection]
k13nox has joined #ruby
finisherr has left #ruby [#ruby]
workmad3 has quit [Ping timeout: 246 seconds]
JoshS has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
KillerFox has quit [Ping timeout: 264 seconds]
careta has quit [Ping timeout: 246 seconds]
roamingdog has joined #ruby
kristofferR has joined #ruby
ptierno has quit [Ping timeout: 250 seconds]
jeanlinux has joined #ruby
TvL2386 has quit [Ping timeout: 244 seconds]
roamingdog has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
muelleme has joined #ruby
Liothen has quit [Ping timeout: 240 seconds]
wopi has quit [Remote host closed the connection]
DarkBushido has quit [Ping timeout: 240 seconds]
jtd has quit [Remote host closed the connection]
eljimbo has quit [Ping timeout: 240 seconds]
tris has quit [Ping timeout: 240 seconds]
preyalone has quit [Quit: Connection closed for inactivity]
wopi has joined #ruby
Derperperd has joined #ruby
muelleme has quit [Ping timeout: 250 seconds]
meshsmith has quit [Remote host closed the connection]
DarkBushido has joined #ruby
DarkBushido has quit [Changing host]
DarkBushido has joined #ruby
KillerFox has joined #ruby
brendan- has joined #ruby
TvL2386 has joined #ruby
tris has joined #ruby
rashmirathi has joined #ruby
eljimbo has joined #ruby
vaporrails-sadne has joined #ruby
kristofferR has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<vaporrails-sadne> I'm running into a situation with ruby gem and open ssl
Jackneill_ has quit [Remote host closed the connection]
rashmirathi has quit [Client Quit]
<vaporrails-sadne> For some reason it keeps on giving me openssl errors even though I have already updated the certificate
wopi has quit [Remote host closed the connection]
rashmirathi has joined #ruby
wopi has joined #ruby
vaporrails-sadne has quit [Client Quit]
Liothen has joined #ruby
k13nox has quit [Remote host closed the connection]
terens has joined #ruby
shmuli has quit [Remote host closed the connection]
k13nox has joined #ruby
k13nox has quit [Remote host closed the connection]
k13nox has joined #ruby
k13nox has quit [Remote host closed the connection]
k13nox has joined #ruby
Martin___ has joined #ruby
k13nox has quit [Remote host closed the connection]
k13nox has joined #ruby
jenrzzz has joined #ruby
k13nox has quit [Remote host closed the connection]
SteenJobs has quit [Quit: SteenJobs]
<Martin___> anyone with ruby-smpp experience? I pay for connecting to a smpp server
k13nox has joined #ruby
k13nox has quit [Remote host closed the connection]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
whathappens has quit [Quit: Leaving...]
bigtawm has joined #ruby
terens has quit [Ping timeout: 258 seconds]
troys_ is now known as troys
Bounga has quit [Quit: ERC (IRC client for Emacs 25.1.1)]
Bounga has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
nettoweb has joined #ruby
muelleme has joined #ruby
shmuli has joined #ruby
muelleme has quit [Ping timeout: 256 seconds]
enterprisey has joined #ruby
JeanCarloMachado has joined #ruby
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
TvL2386 has quit [Ping timeout: 268 seconds]
brianpWins has quit [Quit: brianpWins]
TvL2386 has joined #ruby
Asher has joined #ruby
SeepingN has joined #ruby
CHoltk has quit [Ping timeout: 260 seconds]
Snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Liothen has quit [Changing host]
Liothen has joined #ruby
Devalo has joined #ruby
muelleme has joined #ruby
jaguarmagenta has joined #ruby
teclator_ has quit [Quit: No Ping reply in 180 seconds.]
Devalo has quit [Ping timeout: 265 seconds]
Devalo has joined #ruby
harai_ has quit [Ping timeout: 260 seconds]
teclator has joined #ruby
domgetter has quit [Ping timeout: 260 seconds]
muelleme has quit [Ping timeout: 248 seconds]
jaguarmagenta has quit [Ping timeout: 260 seconds]
Bounga has quit [Ping timeout: 260 seconds]
teclator has quit [Client Quit]
Devalo has quit [Ping timeout: 250 seconds]
brianpWins has joined #ruby
bluOxigen has quit [Ping timeout: 260 seconds]
bayed has quit [Quit: Connection closed for inactivity]
teclator has joined #ruby
bluOxigen has joined #ruby
a3f has joined #ruby
a3f has joined #ruby
a3f has quit [Changing host]
chouhoul_ has quit [Ping timeout: 265 seconds]
<a3f> Hello, I remember reading once that Ruby has (used to have?) a two tier threading model, two kernel threads, one for blocking IO operations and another thread on which green threads are scheduled. Is that accurate or am I mixing up something?
axisys_ has joined #ruby
axisys_ has quit [Client Quit]
<blackbombay> ruby hasn't had green threads since 1.8 - long time ago. i'm not sure if they were implemented like that or not.
<hays> what are green threads
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hays> hey is there a way with chruby and ruby-installed to upgrade minor ruby versions
<a3f> Ok, I am grading some assignments and wanted to give examples for MxN threading models
<hays> or do you basically have to reinstall
mipesom has quit [Quit: Leaving]
<a3f> I will omit Ruby from the list of examples then
axisys_ has joined #ruby
<hays> a3f: maybe it depends on the implementation as well?
<a3f> hays I thought it was the standard Ruby (MRI)
<hays> does that help
jblack has quit [Ping timeout: 250 seconds]
<a3f> hays Not really, I don't want to look through the source code. Just wanted a confirmation. I just listed go routines and erlang processes as examples
ebx has joined #ruby
JeanCarloMachado has quit [Remote host closed the connection]
muelleme has joined #ruby
axisys_ has quit [Quit: leaving]
matp has quit [Read error: Connection reset by peer]
xrlk has quit [Quit: Leaving]
<postmodern> hays, the version you installed is pretty self contained. you'd have to install the newer minor version.
eljimbo has quit [Quit: This computer has gone to sleep]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
matp has joined #ruby
gnufied has quit [Quit: Leaving]
Guest75271 has quit [Remote host closed the connection]
<bigtawm> Hey I'm new to ruby and currently reading beginning ruby by Peter Cooper. Any advise on how to contribute to open source, or resources to learn how?
ruby has joined #ruby
<bigtawm> advice
shmuli has quit [Remote host closed the connection]
ruby is now known as Guest52362
hahuang65 has joined #ruby
xall has joined #ruby
JoshS has quit [Ping timeout: 260 seconds]
ebx has quit [Quit: Leaving]
muelleme has quit [Ping timeout: 258 seconds]
marr has quit [Ping timeout: 256 seconds]
definity has quit [Ping timeout: 250 seconds]
_pop_ebx has joined #ruby
<hays> bigtawm: find something you are interested in
jenrzzz has quit [Ping timeout: 252 seconds]
<baweaver> bigtawm: Find a project you like to use
<baweaver> preferably related to something you enjoy
<baweaver> like a guitar player might look for tab sites or other tools
Silthias1 has quit [Ping timeout: 258 seconds]
Guest52362 has quit [Ping timeout: 244 seconds]
<baweaver> start out by working on documentation. Fix what you can find and document parts that are confusing to you. It helps to learn the tool and how it works, which makes it easier to contribute code later.
_pop_ebx has quit [Client Quit]
<baweaver> often times I start that way with a new OSS project I find myself on, though more often than not that's entirely because their docs annoy me and I like the tool :P
_pop_ebx has joined #ruby
hahuang65 has quit [Ping timeout: 265 seconds]
<bigtawm> Would writing tests also be a good place to start? Also, would browsing the github ruby section be a good place to look for something?
Ropeney has joined #ruby
<baweaver> That'd be a good start as well
<baweaver> essentially you need to understand more about the code to really contribute to it
<baweaver> so that builds some rapport with the maintainers while fixing things.
JeanCarloMachado has joined #ruby
<baweaver> What do you like to do outside of programming?
xall has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
Guest69 has joined #ruby
Tempesta has quit [Quit: See ya!]
railswebdev has joined #ruby
Rodya_ has joined #ruby
<bigtawm> Im just getting into object orientation with ruby, but I have done OO work in java in school. I am a huge baseball fan and Im also a student so any resources to college students would be cool to work on.
_pop_ebx has quit [Client Quit]
<bigtawm> I also play video games and enjoy fitness. Any direction you could point me in?
_pop_ebx has joined #ruby
nankyokusei has joined #ruby
<baweaver> I'll see if I can find something
<baweaver> https://github.com/slnovak/mlb_terminal - this might be fun to play with
<baweaver> You might also make some tools to help you out with College
<bigtawm> At what point would you say someone is ready to contribute to open source code? I havent worked with any large code bases but have a good grasp on object orientation
<baweaver> like see if you can make a scheduling app that pulls the schedule and finds one that works for you
<baweaver> After you help with some tests and docs, you'll get a feel for when the right time is
Rodya_ has quit [Ping timeout: 258 seconds]
<baweaver> that's more of the way that you start getting a good feel for what's in there and what issues there are.
<baweaver> but honestly you should be ready with just about any level of knowledge to at least take small bugs.
xall has joined #ruby
<bigtawm> Okay cool I figured starting with documentation the writing some tests would be a good start
Tempesta has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
<baweaver> One of the biggest areas of need though
<baweaver> the Ruby AWS SDK
<baweaver> it has really bad docs in some areas. If you join their Gitter channel and ask them if you can get some student credits to try and contribute they might work with you
<baweaver> which has the nice benefit of knowing how to work with it, which is a danged valuable skill for deployment
finisherr has joined #ruby
<blackbombay> wow really? i thought the author of yard worked on that. i'd expect the docs to be good.
<baweaver> In the sections that are covered, sure
_pop_ebx has quit [Quit: Leaving]
<baweaver> but there are dark corners which are all types of vacant
fiddlerwoaroof has quit [Quit: Gone.]
<baweaver> especially around their plugins system
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver> which doesn't exactly exist in the docs, but apparently I needed it for some obscure edgecase.
frozengeek___ has quit [Quit: frozengeek___]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver> (note: in general it's a good gem but there's a lot of it there and plenty that could use some love)
frozengeek___ has joined #ruby
frozengeek___ has quit [Remote host closed the connection]
xall has quit [Ping timeout: 250 seconds]
<bigtawm> I would actaully be pretty interested in working on that. Will they be able to help me out once I jump in the chat?
nettoweb1 has joined #ruby
frozengeek___ has joined #ruby
frozengeek___ has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 265 seconds]
muelleme has joined #ruby
nettoweb has quit [Ping timeout: 245 seconds]
frozengeek___ has joined #ruby
frozengeek___ has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 246 seconds]
<baweaver> Yeah, just ask and you'll probably get Trevor Rowe if he's still there
<baweaver> he's a good guy
chopin has quit [Remote host closed the connection]
<baweaver> though feel free to ask around here as well if you want to know anything
<baweaver> I'm not always around but if you mention my name I'll see it eventually.
chopin has joined #ruby
tdy has joined #ruby
JoshS has joined #ruby
<bigtawm> Perfect thank you so much Im sure I'll see you around Im going to try to reach out here more often
troys is now known as troys_
<baweaver> there's normally someone online that can answer questions, so feel free just to ask
muelleme has quit [Ping timeout: 265 seconds]
chopin has quit [Ping timeout: 244 seconds]
xcesariox has joined #ruby
matheusmoreira has joined #ruby
fiddlerwoaroof has joined #ruby
jaguarmagenta has joined #ruby
JeanCarloMachado has quit [Ping timeout: 256 seconds]
a3f has quit [Quit: Zzzzz..]
Asher has quit [Quit: Leaving.]
<bigtawm> Cool thanks for being so beginner friendly.
<King_DuckZ> I'm using the Rasem gem in a class, and I think when I do Rasem::SVGImage.new(...) do end, inside the block my class' variables are shadowed
<King_DuckZ> doing self.timestamp for example says that Rasem has no "timestamp" method
<King_DuckZ> how can I qualify my variables to tell ruby they are part of my class, not Rasem's block?
mrconfused has quit [Remote host closed the connection]
<baweaver> Rasem is probably doing some type of class_eval
byte512 has joined #ruby
a3f has joined #ruby
<baweaver> so pull the variables to the top and define them there by another name
<baweaver> or just call them by name
<baweaver> because self. is redundant inside a class
gingray has joined #ruby
<eam> are you ever not inside a class?
<baweaver> anyways, gotta jet
<eam> :D
<baweaver> eam: stop that
<blackbombay> ivar lookup will look in Rasems scope too, you can create local copies with local variables and use those. sometimes, if a block arg is received, *_eval wont be used. could try that too.
enterprisey has quit [Ping timeout: 250 seconds]
<baweaver> I object
<baweaver> unless I block
<King_DuckZ> I started doing self.timestamp because @timestamp is nil as soon as I get into Rasem's block
<blackbombay> timestamp = @timestamp and then try.
splud has quit [Quit: splud]
<baweaver> *shakes fist* evaaaaaaaal
<baweaver> anyways, now I'm off
<baweaver> cheers
<King_DuckZ> omg do I really need to reassign all of the class variables? :(
<blackbombay> you could just copy self, _self = self and then use that.
<blackbombay> it's bad API design on rasems part.
<King_DuckZ> ok undefined method timestamp... I have no accessor for @timestamp, maybe that's why
muelleme has joined #ruby
<blackbombay> yeah, id just copy the ivars into the blocks scope with local variables.
reverberations has quit [Ping timeout: 265 seconds]
amclain has quit [Quit: Leaving]
nettoweb1 has quit [Ping timeout: 265 seconds]
<blackbombay> if there is really that many, you could just create a hash: instance_variables.each_with_object({}) { |iv, h| h[iv] = instance_variable_get(iv) }
<blackbombay> then use that.
Martin___ has quit [Remote host closed the connection]
<King_DuckZ> it's just 4, if I copy them it works
<King_DuckZ> I was hoping to make that code shorter... I just added 4 more lines instead :p
<King_DuckZ> well, thanks, it fixed my problem :)
<blackbombay> cool
* King_DuckZ slaps Rasem
finisherr has quit [Quit: finisherr]
a3f has quit [Quit: Zzzzz..]
SteenJobs has joined #ruby
suck has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
phwelo has joined #ruby
a3f has joined #ruby
User458764 has joined #ruby
a3f has quit [Client Quit]
a3f has joined #ruby
a3f has quit [Client Quit]
nettoweb has joined #ruby
rfoust has joined #ruby
redpants has quit [Quit: leaving]
eljimbo has joined #ruby
eljimbo has quit [Remote host closed the connection]
Martin___ has joined #ruby
dnicole has joined #ruby
eljimbo has joined #ruby
roamingdog has quit [Remote host closed the connection]
eljimbo has quit [Remote host closed the connection]
fullofcaffeine has quit [Remote host closed the connection]
roamingdog has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
fullofcaffeine has joined #ruby
xrlk has joined #ruby
mBailey_j has joined #ruby
d^sh has joined #ruby
enterprisey has joined #ruby
fullofcaffeine has quit [Ping timeout: 250 seconds]
GodFather has quit [Ping timeout: 250 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
davidt has quit []
shmuli has joined #ruby
mBailey_j has left #ruby ["Leaving"]
muelleme has joined #ruby
sdwrage_ has joined #ruby
sdwrage has quit [Ping timeout: 265 seconds]
agent_white has quit [Quit: leaving]
elephants has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
User458764 has joined #ruby
Rodya_ has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
jshjsh has joined #ruby
JoshS has quit [Ping timeout: 260 seconds]
UserJosh has joined #ruby
cdg has quit [Remote host closed the connection]
shmuli has quit [Remote host closed the connection]
King_DuckZ has left #ruby [#ruby]
webguynow has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 258 seconds]
jshjsh has quit [Ping timeout: 260 seconds]
webguynow has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
enterprisey has quit [Ping timeout: 258 seconds]
kbdkode has joined #ruby
matheusmoreira has quit [Quit: matheusmoreira]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
benlieb has joined #ruby
bigtawm has quit [Ping timeout: 244 seconds]
gingray has quit [Ping timeout: 250 seconds]
ullu has left #ruby ["Closing Window"]
dviola has quit [Quit: WeeChat 1.6]
benlieb has quit [Quit: benlieb]
muelleme has joined #ruby
LoneHermit has joined #ruby
muelleme has quit [Ping timeout: 248 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dar123 has joined #ruby
yfeldblum has quit [Remote host closed the connection]
JoshS has joined #ruby
UserJosh has quit [Ping timeout: 260 seconds]
agent_white has joined #ruby
kbdkode is now known as koffeekbd
harfangk has joined #ruby
yfeldblum has joined #ruby
hanmac has quit [Ping timeout: 258 seconds]
fmcgeough has joined #ruby
eljimbo has joined #ruby
Silthias has joined #ruby
muelleme has joined #ruby
Felipe__ has joined #ruby
nankyokusei has joined #ruby
Martin___ has quit []
charliesome has joined #ruby
muelleme has quit [Ping timeout: 250 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
charliesome has quit [Client Quit]
djbkd has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hanmac has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
astrobunny has joined #ruby
railssmith has quit [Ping timeout: 258 seconds]
Vile` has quit [Ping timeout: 256 seconds]
nofxx_ has joined #ruby
alibby has joined #ruby
alibby1 has quit [Read error: No route to host]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
nofxx has quit [Ping timeout: 240 seconds]
harai_ has joined #ruby
araujo has quit [Read error: Connection timed out]
muelleme has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
eljimbo has quit [Quit: This computer has gone to sleep]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xrlk has quit [Remote host closed the connection]
xrlk has joined #ruby
xrlk has quit [Remote host closed the connection]
araujo has joined #ruby
xrlk has joined #ruby
eljimbo has joined #ruby
xrlk has quit [Client Quit]
iMadper has joined #ruby
xrlk has joined #ruby
raul782 has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 250 seconds]
phwelo has quit [Ping timeout: 248 seconds]
dnicole has quit [Remote host closed the connection]
_sfiguser has quit [Ping timeout: 244 seconds]
elephants has quit [Quit: Leaving...]
eljimbo has quit [Quit: This computer has gone to sleep]
roamingdog has quit [Remote host closed the connection]
igniting has quit [Ping timeout: 265 seconds]
Rodya_ has joined #ruby
eljimbo has joined #ruby
LoneHermit has quit [Ping timeout: 246 seconds]
mtkd has quit [Ping timeout: 252 seconds]
babblebre has quit [Quit: Connection closed for inactivity]
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iMadper is now known as Madper|Busy
mtkd has joined #ruby
roamingdog has joined #ruby
_sfiguser has joined #ruby
jsgrant has quit [Quit: Konversation terminated!]
muelleme has joined #ruby
jaguarmagenta has quit [Read error: Connection reset by peer]
eljimbo has quit [Quit: This computer has gone to sleep]
railssmith has joined #ruby
koooge has joined #ruby
jaguarmagenta has joined #ruby
jsgrant has joined #ruby
jsgrant has quit [Client Quit]
muelleme has quit [Ping timeout: 250 seconds]
jsgrant has joined #ruby
jshjsh has joined #ruby
bikram_ has joined #ruby
JoshS has quit [Ping timeout: 260 seconds]
shmuli has joined #ruby
konsolebox has joined #ruby
XV8 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Bounga has joined #ruby
eljimbo has joined #ruby
pilne has quit [Quit: Quitting!]
ramfjord has quit [Ping timeout: 260 seconds]
UserJosh has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
raul782 has joined #ruby
rashmirathi has quit [Remote host closed the connection]
jshjsh has quit [Ping timeout: 260 seconds]
jsgrant has quit [Quit: Konversation terminated!]
ptierno has joined #ruby
jshjsh has joined #ruby
eljimbo has quit [Quit: This computer has gone to sleep]
enterprisey has quit [Quit: Leaving]
JoshS has joined #ruby
jsgrant has joined #ruby
Felipe__ has quit [Quit: Leaving]
UserJosh has quit [Ping timeout: 260 seconds]
Ropeney has quit [Ping timeout: 246 seconds]
UserJosh has joined #ruby
muelleme has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jshjsh has quit [Ping timeout: 260 seconds]
ptierno has quit [Ping timeout: 265 seconds]
JoshS has quit [Ping timeout: 244 seconds]
UserJosh is now known as JoshS
eljimbo has joined #ruby
muelleme has quit [Ping timeout: 248 seconds]
suck has quit [Quit: Connection closed for inactivity]
XV8 has joined #ruby
nonnatus has joined #ruby
jokester has quit [Quit: WeeChat 1.5]
jsgrant has quit [Quit: Konversation terminated!]
Guest69 has joined #ruby
Yacker has joined #ruby
jsgrant has joined #ruby
railswebdev has joined #ruby
harai_ has quit [Ping timeout: 258 seconds]
allstar has joined #ruby
dextertzu has quit [Read error: Connection reset by peer]
Guest69 has quit [Read error: Connection reset by peer]
railswebdev has quit [Read error: Connection reset by peer]
railswebdev has joined #ruby
dextertzu has joined #ruby
Immune has quit [Ping timeout: 240 seconds]
eljimbo has quit [Quit: This computer has gone to sleep]
roamingdog has quit [Remote host closed the connection]
muelleme has joined #ruby
gix has quit [Ping timeout: 260 seconds]
brendan- has joined #ruby
novice has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
muelleme has quit [Ping timeout: 252 seconds]
gix has joined #ruby
tau has quit [Remote host closed the connection]
LoneHerm_ has joined #ruby
JoshS has quit [Ping timeout: 244 seconds]
dkam has quit [Ping timeout: 265 seconds]
novice has quit [Quit: Page closed]
nankyokusei has joined #ruby
dkam has joined #ruby
novice has joined #ruby
LoneHerm_ has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
eljimbo has joined #ruby
astrobunny has quit [Remote host closed the connection]
eljimbo has quit [Client Quit]
nankyokusei has quit [Ping timeout: 244 seconds]
Madper|Busy is now known as madper
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Yacker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
igniting has joined #ruby
shmuli has quit [Remote host closed the connection]
muelleme has joined #ruby
bikram_ has quit [Ping timeout: 252 seconds]
peteykun has quit [Ping timeout: 260 seconds]
jcao219 has quit [Ping timeout: 250 seconds]
Ropeney has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
ddffg has quit [Ping timeout: 250 seconds]
Mrgoose has joined #ruby
<Mrgoose> Question, how can i iterate over an array and place it in a new array
jshjsh has joined #ruby
<Mrgoose> figured it out, thanks
raul782 has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 250 seconds]
xall has joined #ruby
<Mrgoose> maybe not
Devalo has joined #ruby
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Ropeney> Mrgoose, like this? `[1,2,3,4,5].select{ |f| f % 2 == 0 }`
<baweaver> what do you want to do with said array?
<baweaver> &ri Enumerable
<baweaver> suggested reading ^
Devalo has quit [Ping timeout: 240 seconds]
xall has quit [Ping timeout: 240 seconds]
<Mrgoose> baweaver: got a sec to look at a code paste?
<baweaver> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<baweaver> shoot it up there and post the link back on here.
douglascorrea has quit []
ur5us has quit []
<Mrgoose> https://gist.github.com/anonymous/bbcb13707b2e4df65c5a776dd97f63d3 , bit of a bad paste. But basically x["source"] contains the info and there are two results in [hits][hits] but my resulting hash only gives me one result
<Mrgoose> let me know if i need to format that better, or explain better
bhrgunatha has joined #ruby
ruby has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Ropeney> Mrgoose, can you add an expected result?
ruby is now known as Guest55550
<baweaver> Let's take a lookie here.
<baweaver> (also yeah, expected is awesome)
infernix has quit [Ping timeout: 245 seconds]
shmuli has joined #ruby
muelleme has joined #ruby
<novice> Long ass question: I'm trying to create a script that gets information about tv shows from thetvdb.com and saves them to a database. Initially it should copy all the data they have and store them, later on it should just look for updates once a week and apply them. I want to display the information on a website built with RoR later on. Do I have to use Ruby for that script or is there a way I can use RoR and use the
<novice> same database stuff for the site and the script?
<novice> hope that makes sense it's late
SteenJobs has quit [Quit: SteenJobs]
<baweaver> Ah
<baweaver> I see it.
<baweaver> by the way, #to_h works for that too.
<baweaver> >> [[?a, 1]].to_h
<ruby[bot]> baweaver: # => {"a"=>1} (https://eval.in/679923)
astrobunny has joined #ruby
<baweaver> >> [['a', 1], ['a', 2]].to_h
<ruby[bot]> baweaver: # => {"a"=>2} (https://eval.in/679924)
<baweaver> Notice what happened there
<baweaver> your key is the same on each one of them.
<baweaver> so you get an overwrite
<Mrgoose> ah
igniting has quit [Ping timeout: 258 seconds]
<Mrgoose> what if i wanted to do an array with no named key
<baweaver> just use map
<baweaver> no to_h or Hash[]
<baweaver> rs["hits"]["hits"].map { |x| x["_source"] }
<Mrgoose> that makes sense
muelleme has quit [Ping timeout: 258 seconds]
<Mrgoose> after seeing those examples, thanks!
<baweaver> Definitely take a look through Enumerable above
<baweaver> There's a ton of good stuff in there
<baweaver> and it's what I recommend to anyone trying to get good with Ruby.
<Mrgoose> looking now
<baweaver> Enumerable being a module Array mixes in
<baweaver> and most other collections
egg_ has joined #ruby
yashima has joined #ruby
yashima has left #ruby [#ruby]
Guest55550 has quit [Ping timeout: 248 seconds]
raul782 has joined #ruby
skweek has quit [Ping timeout: 258 seconds]
infernix has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
igniting has joined #ruby
dar123 has quit [Ping timeout: 258 seconds]
arescorpio has joined #ruby
troys_ is now known as troys
yfeldblum has quit [Remote host closed the connection]
josealobato has joined #ruby
muelleme has joined #ruby
bhrgunatha has quit [Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161021084537]]
metaf5_ has joined #ruby
johnzorn has joined #ruby
marxarelli|afk has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<johnzorn> is it possible to run 'bundle exec exe/myprog' with some kind of backtrace with line number?
bhrgunatha has joined #ruby
jaequery has joined #ruby
LoneHermit has joined #ruby
muelleme has quit [Ping timeout: 246 seconds]
jaequery has quit [Client Quit]
mBailey_j has joined #ruby
LoneHermit has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
arescorpio has quit [Quit: Leaving.]
eljimbo has joined #ruby
mBailey_j has left #ruby ["Leaving"]
benlieb has joined #ruby
muelleme has joined #ruby
Bounga has joined #ruby
byte512 has quit [Ping timeout: 260 seconds]
jblack has joined #ruby
muelleme has quit [Ping timeout: 244 seconds]
Bounga has quit [Ping timeout: 260 seconds]
troys has quit [Quit: Bye]
jblack has quit [Ping timeout: 260 seconds]
AgoraSecurity has joined #ruby
<AgoraSecurity> Hello
<AgoraSecurity> I'm having some problems/doubts with ruby
<AgoraSecurity> irb(main):090:0> hex.to_s[0,2]
<AgoraSecurity> irb(main):089:0> hex
<AgoraSecurity> => "38393A3B"
<AgoraSecurity> => "38"
<AgoraSecurity> irb(main):091:0> hex.to_s[2,4]
<AgoraSecurity> => "393A"
<AgoraSecurity> irb(main):092:0> hex.to_s[4,6]
<AgoraSecurity> => "3A3B"
<AgoraSecurity> irb(main):093:0> hex.to_s[6,8]
<AgoraSecurity> => "3B"
<AgoraSecurity> irb(main):094:0>
<AgoraSecurity> Any ideas why that happens?? I just want to get "39" and I'm getting "393A", why??
dnicole has joined #ruby
charliesome has joined #ruby
pawnbox has joined #ruby
Yacker has joined #ruby
Norm has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
Norm has joined #ruby
brianpWins has quit [Quit: brianpWins]
yfeldblum has quit [Remote host closed the connection]
ruby has joined #ruby
adgtl has quit [Quit: bye]
ruby is now known as Guest33296
yfeldblum has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
adgtl has joined #ruby
<egg_> AgoraSecurity first argument start, second length
lightstalker has quit [Ping timeout: 250 seconds]
yardenbar has joined #ruby
nankyokusei has joined #ruby
edektor has joined #ruby
<edektor> How can I parse a iso8601 date string with the utc offset from the string?
rakm has joined #ruby
<edektor> 2016-11-17T15:47:18-08:00
jokester has joined #ruby
bhrgunatha has quit [Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161021084537]]
muelleme has joined #ruby
Immune has joined #ruby
Immune has quit [Max SendQ exceeded]
Immune has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
the_drow has joined #ruby
<apeiros> >> require 'time'; Time.iso8601('2016-11-17T15:47:18-08:00') # @ edektor
<ruby[bot]> apeiros: # => 2016-11-17 15:47:18 -0800 (https://eval.in/679940)
novice has quit [Quit: Leaving]
Guest33296 has quit [Remote host closed the connection]
Yacker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<edektor> and what if I want to create another date with the same timezone as t?
terens has joined #ruby
<blackbombay> apeiros is awake. sign i should go to bed.
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros> lol?
the_drow has quit [Client Quit]
<apeiros> I've been awake for almost 2h now :(
rakm has joined #ruby
eljimbo has quit [Quit: This computer has gone to sleep]
muelleme has quit [Ping timeout: 258 seconds]
<edektor> a new date with the timezone from the string
<blackbombay> i haven't slept since yday. it's 6am now :((
<blackbombay> been watching rob pike videos on youtube
KnownSyntax has quit [Ping timeout: 245 seconds]
arooni has quit [Ping timeout: 256 seconds]
<Mrgoose> I just took some nyquil, i'll be out shortly
<apeiros> in that case: good nicht blackbombay, sleep tight :)
<apeiros> same @ Mrgoose
<apeiros> edektor: sadly I don't know how. bare ruby is rather bad wrt timezones :-/
<blackbombay> nite :)
KnownSyntax has joined #ruby
<edektor> maybe get the offset and set it on the new time
arooni has joined #ruby
inoperable has quit [Quit: ZNC 1.6.3 - http://znc.in]
Dimik has quit [Ping timeout: 245 seconds]
fullofcaffeine has joined #ruby
harai_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
jhass has quit [Ping timeout: 246 seconds]
<AgoraSecurity> @egg_ :Thanks a lot
Dimik has joined #ruby
jhass has joined #ruby
allstar has quit [Quit: Leaving]
sdwrage_ is now known as sdwrage
ofkors has joined #ruby
Jameser has joined #ruby
yardenbar has quit [Ping timeout: 244 seconds]
Dimik has quit [Ping timeout: 245 seconds]
shmuli has quit [Remote host closed the connection]
Dimik has joined #ruby
johnmccabe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ofkors has quit [Ping timeout: 258 seconds]
jeyraof has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
shmuli_ has joined #ruby
fullofcaffeine has joined #ruby
muelleme has joined #ruby
LoneHerm_ has joined #ruby
aidalgol has joined #ruby
gingray has joined #ruby
pawnbox has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
fullofcaffeine has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
rakm has joined #ruby
muelleme has quit [Ping timeout: 244 seconds]
LoneHerm_ has quit [Ping timeout: 268 seconds]
brianpWins has joined #ruby
CloCkWeRX has quit [Ping timeout: 244 seconds]
agent_white has quit [Ping timeout: 258 seconds]
Rodya_ has quit [Remote host closed the connection]
josealobato has quit [Quit: Textual IRC Client: www.textualapp.com]
charliesome has quit [Ping timeout: 268 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
adgtl has quit [Changing host]
adgtl has joined #ruby
adgtl has joined #ruby
zukin has joined #ruby
lightstalker has joined #ruby
Dimik has quit []
dionysus69 has joined #ruby
raul782 has quit [Remote host closed the connection]
fullofcaffeine has joined #ruby
agent_white has joined #ruby
last_staff has joined #ruby
teclator has quit [Ping timeout: 245 seconds]
teclator has joined #ruby
rmf_ has joined #ruby
muelleme has joined #ruby
rmf_ is now known as robfrawley
Devalo has joined #ruby
LiquidInsect has quit [Ping timeout: 245 seconds]
brianpWins has quit [Quit: brianpWins]
edektor has quit []
Rodya_ has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
muelleme has quit [Ping timeout: 246 seconds]
Devalo has quit [Ping timeout: 258 seconds]
LiquidInsect has joined #ruby
jsgrant has quit [Ping timeout: 265 seconds]
zukin has quit [Quit: leaving]
jsgrant has joined #ruby
Rodya_ has quit [Ping timeout: 258 seconds]
bovis has quit [Quit: leaving]
LiquidInsect has quit [Ping timeout: 246 seconds]
bikram_ has joined #ruby
User458764 has joined #ruby
xall has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
AgoraSecurity has quit []
muelleme has joined #ruby
Puffball has quit [Remote host closed the connection]
blaxter has joined #ruby
blaxter has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stewartmckee has joined #ruby
ARCADIVS has joined #ruby
blaxter has joined #ruby
blaxter has quit [Remote host closed the connection]
bikram_ has quit [Ping timeout: 268 seconds]
kassav has joined #ruby
blaxter has joined #ruby
zacts has quit [Ping timeout: 245 seconds]
stewartmckee has quit []
fullofcaffeine has quit [Remote host closed the connection]
Derperperd has quit [Quit: Derperperd]
tedstriker has joined #ruby
Puffball has joined #ruby
elifoster has joined #ruby
igniting has quit [Ping timeout: 252 seconds]
fullofcaffeine has joined #ruby
lacour has quit [Quit: Leaving]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Cohedrin has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ta_ has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
pawnbox has quit [Ping timeout: 265 seconds]
firstdayonthejob has joined #ruby
Puffball_ has joined #ruby
pawnbox has joined #ruby
blaxter has quit [Quit: foo]
Puffball has quit [Ping timeout: 240 seconds]
alexherbo2 has joined #ruby
jshjsh has quit [Ping timeout: 258 seconds]
Asher has joined #ruby
igniting has joined #ruby
LiquidInsect has joined #ruby
domgetter has joined #ruby
blaxter has joined #ruby
jaguarmagenta has quit []
firstdayonthejob has quit [Ping timeout: 250 seconds]
blaxter has quit [Client Quit]
jaguarmagenta has joined #ruby
egg_ has quit [Remote host closed the connection]
agit0 has joined #ruby
nankyokusei has joined #ruby
jaguarmagenta has quit [Client Quit]
aganov has joined #ruby
xall has quit [Ping timeout: 256 seconds]
Jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
raul782 has joined #ruby
muelleme has quit [Ping timeout: 250 seconds]
jblack has joined #ruby
nankyokusei has quit [Ping timeout: 248 seconds]
fullofcaffeine has quit [Ping timeout: 260 seconds]
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
raul782 has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
muelleme has joined #ruby
jblack has quit [Ping timeout: 260 seconds]
xall has joined #ruby
Bounga has joined #ruby
jenrzzz has joined #ruby
modin has quit [Ping timeout: 246 seconds]
kassav has quit [Read error: Connection reset by peer]
Bounga has quit [Ping timeout: 260 seconds]
lenwood has joined #ruby
kassav has joined #ruby
byte512 has joined #ruby
muelleme has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 256 seconds]
Rodya_ has joined #ruby
Burgestrand has joined #ruby
modin has joined #ruby
Bounga has joined #ruby
dasher00 has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
djbkd has quit [Quit: Leaving...]
elifoster has quit [Quit: sleep]
benlieb has quit [Quit: benlieb]
mark_66 has joined #ruby
vondruch has joined #ruby
LoneHermit has joined #ruby
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
xcesariox has quit [Quit: Textual IRC Client: www.textualapp.com]
byte512 has quit [Ping timeout: 265 seconds]
claudiuinberlin has joined #ruby
tedstriker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bocaneri has joined #ruby
xall has quit [Read error: Connection reset by peer]
nadir has quit [Quit: Connection closed for inactivity]
aryaching has quit [Ping timeout: 258 seconds]
lenwood has quit [Ping timeout: 246 seconds]
hahuang65 has joined #ruby
ta_ has joined #ruby
gigetoo has quit [Read error: Connection reset by peer]
Immune has quit [Ping timeout: 240 seconds]
edwinvdgraaf has joined #ruby
xall has joined #ruby
hahuang65 has quit [Ping timeout: 244 seconds]
Snickers has joined #ruby
frozengeek__ has joined #ruby
frozengeek__ is now known as frozengeek___
dionysus69 has quit [Ping timeout: 240 seconds]
mgorbach has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
sdwrage has quit [Quit: Leaving]
ur5us has joined #ruby
mgorbach has joined #ruby
yupvr has joined #ruby
xall has quit [Read error: Connection reset by peer]
dextertzu has quit [Read error: Connection reset by peer]
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
xall has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
tvw has joined #ruby
astrobun_ has joined #ruby
Koshian____ has quit [Ping timeout: 258 seconds]
yfeldblum has joined #ruby
dextertzu has joined #ruby
yfeldblum has quit [Remote host closed the connection]
Macaveli has joined #ruby
astrobunny has quit [Ping timeout: 258 seconds]
JeanCarloMachado has joined #ruby
nofxx_ has quit [Ping timeout: 248 seconds]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yfeldblum has quit [Remote host closed the connection]
joonty has joined #ruby
k13nox has joined #ruby
Devalo has joined #ruby
egg_ has joined #ruby
Macaveli has quit [Ping timeout: 252 seconds]
shmuli_ has quit [Remote host closed the connection]
pandaant has joined #ruby
Devalo has quit [Ping timeout: 256 seconds]
roamingdog has joined #ruby
lenwood has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
Koshian____ has joined #ruby
shmuli has joined #ruby
harai_ has quit [Ping timeout: 260 seconds]
Fernando-Basso has joined #ruby
shmuli has quit [Remote host closed the connection]
roamingdog has quit [Ping timeout: 245 seconds]
Macaveli has joined #ruby
Rodya_ has quit [Quit: Leaving...]
flying has joined #ruby
mikecmpbll has joined #ruby
Humdai has joined #ruby
Humdai has quit [Client Quit]
Humdai has joined #ruby
Salih has joined #ruby
xall has quit [Ping timeout: 260 seconds]
k13nox has quit [Remote host closed the connection]
nankyokusei has joined #ruby
Immune has joined #ruby
k13nox has joined #ruby
bigkevmcd has joined #ruby
matthewd has quit [Ping timeout: 258 seconds]
nankyokusei has quit [Ping timeout: 258 seconds]
jeanlinu_ has joined #ruby
jeanlinux has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
bikram_ has joined #ruby
matthewd has joined #ruby
shmuli has joined #ruby
atmosx has joined #ruby
shmuli has quit [Remote host closed the connection]
ddffg has joined #ruby
mim1k|wo1k is now known as mim1k|work
shmuli has joined #ruby
shmuli has quit [Remote host closed the connection]
shmuli has joined #ruby
manjaro-kde5 has joined #ruby
jeanlinu_ has quit [Remote host closed the connection]
jeanlinux has joined #ruby
lenwood has quit [Ping timeout: 250 seconds]
senayar has joined #ruby
senayar has joined #ruby
senayar has quit [Changing host]
shmuli has quit [Remote host closed the connection]
jeanlinux has quit [Ping timeout: 260 seconds]
k13nox has quit [Quit: Leaving...]
jeyraof has quit [Quit: Leaving]
tomphp has joined #ruby
jblack has joined #ruby
<alexandernst> Why after evaluatin "_, dos, _ = [1, 2, 3]" "_"'s value is 2?
<alexandernst> I'd expect it to be either 1 or 3
<manveru> alexandernst: what ruby version is that?
<alexandernst> 0.9.6
<alexandernst> ah, ruby, sorry
<manveru> uhm
<manveru> lol
<manveru> >> _, dos, _ = [1,2,3]; _
<ruby[bot]> manveru: # => 3 (https://eval.in/680051)
<alexandernst> 2.0.0p648 (2015-12-16 revision 53162)
jaruga___ has joined #ruby
<manveru> if, however, you do something like this in irb, _ will always be the value of the last thing you evaluated
Silthias has quit [Ping timeout: 248 seconds]
ogotai has quit [Remote host closed the connection]
ddv has joined #ruby
ur5us has quit [Remote host closed the connection]
<ddv> anyone know to get the public key with openSSL::PKey::RSA withouth the ------ BEGIN fields etc?
<ddv> +how
jblack has quit [Ping timeout: 265 seconds]
heftig has quit [Remote host closed the connection]
ocbtec has joined #ruby
<manveru> ddv: well, apart from the obvious String#split or String#gsub ... why do you want that? :)
<ddv> need to mock a request which has this public in the response
Cymew has quit [Remote host closed the connection]
<ddv> public key*
<ddv> but with the BEGIN PUBLIC KEY stuff
<ddv> without*
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<manveru> >> require 'openssl'; OpenSSL::PKey::RSA.new(1024).to_pem.gsub(/\n?-----(BEGIN|END) RSA (PUBLIC|PRIVATE) KEY-----\n/, '')
<ruby[bot]> manveru: # => "MIICXwIBAAKBgQCmeggsbWjHICppsP/Xg+qOD82SZZ+KEQLlpyfYH0A+/MU+c3mD\nbLYg+9Hr4aSxSUiQNADqNeMjUe4lOn7nm ...check link for more (https://eval.in/680059)
Cymew has joined #ruby
<manveru> like this?
SesMan has joined #ruby
<ddv> manveru: yes, thanks
postmodern has quit [Quit: Leaving]
bayed has joined #ruby
heftig has joined #ruby
workmad3 has joined #ruby
pawnbox has quit [Remote host closed the connection]
koooge has quit [Quit: Leaving...]
infobot` has joined #ruby
infobot` has quit [Remote host closed the connection]
Beams has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gigetoo has joined #ruby
Burgestrand has joined #ruby
hightower2 has joined #ruby
koffeekbd has quit [Ping timeout: 240 seconds]
lenwood has joined #ruby
sid_fules has joined #ruby
bikram_ has quit [Quit: Lost terminal]
manjaro-kde5 has quit [Ping timeout: 250 seconds]
astrobun_ has quit [Remote host closed the connection]
dhollinger has quit [Ping timeout: 260 seconds]
Immune has quit [Ping timeout: 240 seconds]
shmuli has joined #ruby
dhollinger has joined #ruby
Fichtenstein has joined #ruby
guest has joined #ruby
shmuli has quit [Ping timeout: 245 seconds]
<guest> I am unable to install Vagrant vbguest plugin with the following error, can anyone help? https://gist.github.com/RoryHolland/f758dfdc4898446fb0d21ea13afac25f
xall has joined #ruby
<guest> I have also asked in #vagrant but I suspect this error will make sense to someone here too.
suck has joined #ruby
pandaant has quit [Remote host closed the connection]
bkxd has quit [Quit: Lost terminal]
pandaant has joined #ruby
suck is now known as savage
nikivi has joined #ruby
xall has quit [Ping timeout: 256 seconds]
gizmore has quit [Ping timeout: 250 seconds]
gizmore has joined #ruby
savage is now known as [`_`]
<Cymew> If I create a class called Foo, and in that class create a variable (class variable?) called @bar can I then when I instantiate the class as quux access that same variable as quux.bar?
<Cymew> I though the . notation was for method onvocation, but the code I'm reading makes no sense in that case.
<Cymew> rather "invocation".
<domgetter> Cymew it depends on exactly "where" in the class you defined @bar
xall has joined #ruby
p1ngarn has joined #ruby
<domgetter> Did you define it inside a method inside Foo?
<Cymew> Looks like it.
<domgetter> Then @bar will be available in other methods inside Foo, but if you want to access it via quux.bar, you'll need to make a method called bar that returns @bar
ldnunes has joined #ruby
<domgetter> you can't access instance variables from outside the class. You can only call methods
JeanCarloMachado has quit [Ping timeout: 260 seconds]
<Cymew> That was my impression.
<Cymew> I wonder why on earth this code works then, as it goes counter to all my understanding of ruby rules for variable and method scope.
<domgetter> Can you show the code? Use http://gist.github.com if it's more than 3 lines of code
<Cymew> I probably need to sanitize it a bit first. I will do another read-through first and see if I'm missing something.
<xrlk> XD
xall has quit [Ping timeout: 252 seconds]
<canton7> Cymew, make sure you not missing an 'attr_reader' or 'attr_accessor'
Macaveli has quit [Read error: No route to host]
<domgetter> canton7 "I wonder why on earth this code works then"
<canton7> yep, that's what I'm responding to
Macaveli has joined #ruby
<domgetter> But if it works, then they aren't missing anything. I don't follow the reasoning
<canton7> domgetter, presumably he didn't see them when he was reading the code
<Cymew> Oh, if I have an :attr_reader then that variable data method is auto generated by the reader statement?
<domgetter> ahhhh
<canton7> 'missing' as in 'haven't seen', rather than 'missing from code'
<domgetter> canton7 yes, sorry, I read it differently
gener1c has quit [Ping timeout: 248 seconds]
gener1c_ has joined #ruby
<canton7> Cymew, yeah, 'attr_reader :foo' causes a method called 'foo' to be generated, which just returns '@foo'
<canton7> domgetter, yeah, sorry, took me a while to see that it could be read in that way
<Cymew> ...and then the quux.bar is a method invocation that returns the value of the instance variable @bar in that case.
<canton7> yep
<domgetter> yep!
joonty1 has joined #ruby
jahmalz has joined #ruby
<Cymew> Then the code makes sense. I missed, as in did not read the header of the file closely enough, that :attr_reader.
<Cymew> My understanding of ruby scope holds, and I learned how to access instance variables.
nankyokusei has joined #ruby
<Cymew> Thanks a lot domgetter and canton7!
flying has quit []
ferr has joined #ruby
<domgetter> Now you get to learn that even if there's no method that returns it, you can still access instance variables with the instance_variable_get method.
<domgetter> Don't ever use it though
joonty has quit [Ping timeout: 256 seconds]
<domgetter> quux.instance_variable_get(:@bar) would have worked, but it's bad form
<Cymew> Good to know.
tvw has quit [Ping timeout: 245 seconds]
nankyokusei has quit [Ping timeout: 268 seconds]
konsolebox has quit [Quit: Leaving]
jeanlinux has joined #ruby
toretore has joined #ruby
gr33n7007h has joined #ruby
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
blackbombay has quit [Ping timeout: 256 seconds]
CloCkWeRX has joined #ruby
aidalgol has quit [Remote host closed the connection]
bhrgunatha has joined #ruby
bhrgunatha has quit [Client Quit]
gr33n7007h1 has joined #ruby
gr33n7007h1 is now known as al2o3-cr
Posix has joined #ruby
<Posix> Where is Ruby developed? On GitHub?
gr33n7007h has quit [Ping timeout: 250 seconds]
<dminuoso> Posix: The main development happens on subversion, but the repository is mirrored on github and also accepts pull-requests from there.
definity has joined #ruby
<dminuoso> It's best if any contributions go through their bug tracker first though, except for trivial or small fixes.
<dminuoso> (There's maintainers that manage pull requests on github and then merge the changes into subversion)
<dminuoso> Actually its not manually maintained, but pushing from git to upstream happens with "git svn"
JeanCarloMachado has joined #ruby
arussel has joined #ruby
<arussel> does ruby has a maximum size for string ? I'm using logstash that is written in ruby, and for some reason a field that should be over 4000chars is trunctated.
<dminuoso> arussel: Yes. 2**63 - 2 on 64 bit platforms
<dminuoso> (And likewise 2**31 - 1 on 32 bit platforms)
<dminuoso> Err, minus 1 on the first. Typo. :)
p1ngarn has quit [Quit: p1ngarn]
ldnunes has quit [Ping timeout: 245 seconds]
<dminuoso> Mind that this length is in distinct codepoints and not characters.
<arussel> so it should be able to handle way more than 4000 chars ...
<dminuoso> Absolutely.
joonty2 has joined #ruby
<dminuoso> arussel: Do you have some underlying database for this? 4,000 chars sounds suspiciously like some database "varchar" restriction.
ldnunes has joined #ruby
<dminuoso> Oracle for example has an upper limit of 4000 on varchar2
<arussel> no, I'm testing patterns on grok logstash, so this is cut/paste into stdin, out to stdout
ldnunes has quit [Read error: Connection reset by peer]
<arussel> and it gets the message and output it correctly
<arussel> so this is not a cut/paste issue
<arussel> but when setting a field to the value, it is trunctated
ldnunes has joined #ruby
<domgetter> Looks like the maximum size of an event message is 4095?
<domgetter> What version of Logstash are you using?
joonty1 has quit [Ping timeout: 256 seconds]
<arussel> I've seen that one, but my event is has already been ingested by logstash without problem
NET||abuse has joined #ruby
<arussel> logstash 2.4.1
<arussel> my message is correctly set and not truncated
<domgetter> With the pry gem, you should be able to poke around and find when your string is getting truncated
<domgetter> But it's certainly not Ruby itself doing it
nettoweb has joined #ruby
<arussel> ok, thanks
gigetoo has quit [Ping timeout: 245 seconds]
gigetoo has joined #ruby
marktwo has joined #ruby
Posix has quit [Quit: Page closed]
Rickmasta has joined #ruby
jblack has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
nikivi has quit [Quit: irc]
ldnunes has joined #ruby
joonty1 has joined #ruby
xall has joined #ruby
joonty2 has quit [Ping timeout: 244 seconds]
Rickmasta has quit [Ping timeout: 250 seconds]
pawnbox has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jblack has quit [Ping timeout: 260 seconds]
<jokke> hi
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jokke> i'm looking for something like statsd-instrument for logging, which would allow me to add logging to my application without having to change the code
xall has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
XV8 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
terens has quit [Ping timeout: 244 seconds]
_sfiguser has quit [Ping timeout: 260 seconds]
al2o3-cr has quit [Ping timeout: 260 seconds]
vlingesh has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
<vlingesh> I'm getting this error when i try and install ruby 2.2.0 using rvm https://gist.github.com/vjlingesh/28e3ef47ffd42ea7d6a2a530cbd86b83
<vlingesh> can anyone help me out?
rakm has joined #ruby
_sfiguser has joined #ruby
Silthias has joined #ruby
ngw has joined #ruby
<ngw> hello *
<ngw> I'm finding a lot of difficulties testing the behavior of a Rack middleware
<ngw> I'm using get, post and all the other methods of rack/test
<ngw> but I'm not able to just use a method that takes a request and writes headers just before executing, like auth!(Rack::Request.new(this: :whatever))
<ngw> can someone help me?
<ngw> the Rack::Request I have is fine, I just can't find a way to execute it against my Rack app
gr33n7007h has joined #ruby
xall has joined #ruby
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
JoshS has joined #ruby
joonty2 has joined #ruby
nankyokusei has joined #ruby
jschoolcraft has joined #ruby
joonty1 has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
ldnunes has quit [Ping timeout: 246 seconds]
c355e3b has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
ta_ has quit [Remote host closed the connection]
ldnunes has joined #ruby
sparch has joined #ruby
sparch has joined #ruby
sparch has quit [Changing host]
officialsandeep9 has joined #ruby
officialsandeep9 has left #ruby ["Bye."]
Phage has quit [Quit: Nos vemos.]
biberu has joined #ruby
asidorenko_ has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
sepp2k has joined #ruby
<asidorenko_> Hey, question: if I have a module DSL, I do DSL.module_eval { load 'test.rb' } and my test.rb contains 'p self', I get main. However my expection is to get DSL. I guess I miss something, maybe can somebody explain? (ruby 2.3.1)
guest is now known as rory
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jinie has joined #ruby
ldnunes has quit [Ping timeout: 260 seconds]
<apeiros> asidorenko_: no, load/require always load the code in toplevel.
_sfiguser has quit [Remote host closed the connection]
<asidorenko_> apeiros: Thank you, now it clear. Is it somewhere documented? I was looking without any success for a such hint
sid_fules has quit [Remote host closed the connection]
gener1c_ has quit [Read error: Connection reset by peer]
<dminuoso> Is there an elegant and compact way to transform a string in such a way, that its characters are replaced with any but it's previous character? Randomness does not need to be guaranteed.
<dminuoso> Without changing the length of the string. ;-)
xall has quit [Ping timeout: 244 seconds]
<apeiros> dminuoso: gsub(/(.)./) { (alphabet - [$1]).sample }
<apeiros> f.ex.
<apeiros> first char needs special case, though :)
<apeiros> oh, forgot to keep $1
<apeiros> .gsub(/(.)./) { $1+(alphabet - [$1]).sample }
ldnunes has joined #ruby
<apeiros> it might be more performant to do repeated samples on alphabet until it's a different char than $1. but I dislike that kind of solution (since it can theoretically loop indefinitely). also more code :)
<dminuoso> apeiros: Mmm, there's some bug in there. :p
<dminuoso> But I get the idea.
<apeiros> quite possible. untested :D
terens has joined #ruby
raul782 has joined #ruby
mjuszczak has joined #ruby
atmosx has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> apeiros: Think Ill just tackle the problem differently. Right now I was thinking of this using as a generic helper for my tests - but I think stubbing methods to simply return fixed "wrong" and "right" is better.
<apeiros> :)
<apeiros> hf
joonty1 has joined #ruby
Macaveli has joined #ruby
joonty2 has quit [Ping timeout: 250 seconds]
careta has joined #ruby
pawnbox has quit [Ping timeout: 258 seconds]
ldnunes has quit [Ping timeout: 248 seconds]
raul782 has quit [Ping timeout: 244 seconds]
joonty2 has joined #ruby
joonty1 has quit [Ping timeout: 265 seconds]
dextertzu has quit [Read error: Connection reset by peer]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
joonty1 has joined #ruby
Humdai has quit [Read error: Connection reset by peer]
douglascorrea has joined #ruby
dextertzu has joined #ruby
joonty2 has quit [Ping timeout: 265 seconds]
dionysus69 has joined #ruby
Ropeney has joined #ruby
Humdai has joined #ruby
nadir has joined #ruby
joonty1 has quit [Ping timeout: 260 seconds]
joonty has joined #ruby
egg_ has quit []
sdothum has joined #ruby
ldnunes has joined #ruby
<terens> hello
<terens> rubocop style guide says that
<terens> # bad
<terens> end
<terens> do_something
<terens> if some_condition
<terens> but #good
<terens> do_something if some_condition
<terens> however this could be long
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
agit0 has quit [Quit: zzzZZZ….]
<dminuoso> terens: Dont make it long.
<dminuoso> terens: If your line does more than one thing, split it into multiple lines.
<terens> this forexample?
<terens> iface_str.write "description \"#{interface.comment.gsub(/[^0-9A-Za-z]/, '')}\" " unless interface.comment.empty?
<domgetter> terens Rubocop's rules are subjective. If you don't like a rule, you can ignore it
joonty1 has joined #ruby
<dminuoso> for example: do_something(with: {call_method(:foo, proc{foo}) }) if data[10..(CONSTANT-1)].send(:things) { |o| o.tap.............................
gigetoo has quit [Ping timeout: 260 seconds]
gigetoo has joined #ruby
<dminuoso> terens: If someone without knowing your code takes more than a second to understand what a line of code does on an abstract level ("call method if a and b are equal") then its generally a code smell.
<dminuoso> Requiring so much space that you cant jam it into one line implies that you are doing a lot.
joonty has quit [Ping timeout: 246 seconds]
gnufied has joined #ruby
sid_fules has joined #ruby
tau has joined #ruby
<terens> ok
pawnbox has joined #ruby
phwelo has joined #ruby
raul782 has joined #ruby
synthroid has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
<domgetter> terens personally, for the particular example you gave, I would make the "description ..." string stored in a local variable just before that line, and then use that local variable in the `iface_str.write sanitized_description unless interface.comment.empty?` or something like that
claudiuinberlin has joined #ruby
<dminuoso> terens: Personally I have mixed feelings about modifier_if and modifier_unless though - it visually contradicts the execution flow.
<domgetter> But of course, there's always a way to make code "better", and everyone has their own opinion on how code should look :)
joonty1 has quit [Quit: This computer has gone to sleep]
<dminuoso> And in some edge cases can lead to surprising behavior.
<dminuoso> For example:
<domgetter> (I agree with dminuoso that you shouldn't use `unless`)
<dminuoso> >> puts a if a = 10
<ruby[bot]> dminuoso: # => /tmp/execpad-adecebed1b8c/source-adecebed1b8c:2: warning: found = in conditional, should be == ...check link for more (https://eval.in/680270)
<dminuoso> ^- click the link to see the result
<dminuoso> The "Did you mean?" error message is particularly hilarious.
<dminuoso> Probably worth a bug report even. ;-)
Beams has quit [Quit: .]
cydrobolt has quit [Ping timeout: 245 seconds]
joonty has joined #ruby
<domgetter> The aesthetic problem with using "unless" is that even for the rare times when it feels natural to use it, if you have to sit and think about it, it becomes twice as hard to reason about.
sczizzo has joined #ruby
ngw has quit [Quit: Page closed]
igniting has quit [Ping timeout: 260 seconds]
<dminuoso> domgetter: I think modifier_unless is actually more usuable than keyword_unless - because modifiers force you to think about it anyway.
claudiuinberlin has quit [Ping timeout: 256 seconds]
bluOxigen has quit [Ping timeout: 260 seconds]
<dminuoso> raise FooError unless foo.valid?
* dminuoso shrugs
cydrobolt has joined #ruby
cydrobolt has joined #ruby
cydrobolt has quit [Changing host]
bluOxigen has joined #ruby
<domgetter> I guess I should say, it's harder if you have to think about the opposite case. "unless vs unless not" is weirder than "if vs if not"
GodFather has joined #ruby
<domgetter> But of course, there are simple enough cases where that never really happens, so you get the best of both worlds (like your raise example)
<domgetter> It would be bike-shedding to say "No, you should have 'if foo.invalid?'!"
<dminuoso> action unless not(!record.not_invalid?)
<dminuoso> That's what I usually go for.
<dminuoso> And once I have written the code, I usually use this: https://gist.github.com/sragu/503243
<domgetter> Just make sure #not_invalid? doesn't always return a boolean and you're golden
jblack has joined #ruby
Yacker has joined #ruby
GodFather has quit [Remote host closed the connection]
zacts has joined #ruby
maokomioko has joined #ruby
maokomioko has quit [Client Quit]
<dminuoso> domgetter: Indeed. I usually have the method use "caller" to check whether the method was invoked from an rspec suite and then return class objects instead.
<dminuoso> That's how you stub methods for tests.
jblack has quit [Ping timeout: 244 seconds]
DoubleMalt has joined #ruby
Burgestrand has joined #ruby
<dminuoso> return Class.new if caller.any? { |c| c =~ /rspec/ } # standard method prologue.
<domgetter> You should submit your resume to Volkswagen!
<dminuoso> Haha.
definity has quit [Ping timeout: 260 seconds]
<jokke> anyone?
<dminuoso> jokke: anyone what?
<jokke> i'm looking for something like statsd-instrument for logging, which would allow me to add logging to my application without having to change the code
<jokke> ^
GodFather has joined #ruby
<terens> domgetter: but still inline condition seems unreadable to me
<dminuoso> jokke: Just use the generic Logger interface.
rippa has joined #ruby
tyang has joined #ruby
<jokke> dminuoso: yes but then i'd have logger calls all over my code
<domgetter> terens then like I said originally, ignore the Rubocop rule :)
<terens> lol
<dminuoso> jokke: Why?
<terens> ok thanks
<domgetter> I'm pretty sure you can configure Rubocop to not raise that warning
<dminuoso> terens: Look at rubocop and tell it what to tell you.
<dminuoso> Do not use it on default settings.
<dminuoso> It's likely not what you need.
<jokke> dminuoso: maybe i'm missing something...
<domgetter> Remember, Rubocop was just written by some people. You can have opinions, too
Yacker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yacker has joined #ruby
<jokke> basically i want to do something like this:
Yacker has quit [Client Quit]
<jokke> Logger.info('MyModule::MyClass#my_method') { |result| "do something with #{result}" }
<dminuoso> What?
<terens> I read the doc i havent instlalled it
<dminuoso> jokke: What is result?
<jokke> so that each time that method is called it would produce a log message from that block
<jokke> result would be the return value of the method
<dminuoso> jokke: set_trace_func
Rickmasta has joined #ruby
<jokke> what's that?
<dminuoso> jokke: What you want.
<jokke> :)
agit0 has joined #ruby
<dminuoso> jokke: Note you can't selectively pick single methods, so you have to filter through it. Also note that the impact is quite heavy.
<jokke> performance wise you mean?
<jokke> hmm
<dminuoso> Yeah.
<jokke> not good
<dminuoso> jokke: Otherwise you can look into various implementations of Stubs/Mocks
<jokke> maybe i could monkeypatch my methods
freebsduser has joined #ruby
<jokke> that would be something like ActiveSupports alias_method_chain thing
agit0 has quit [Read error: Connection reset by peer]
<dminuoso> jokke: Just use Module#prepend - alias_method_chain is a silly thing from an old and ancient past.
Yacker has joined #ruby
<jokke> ohh
<jokke> never seen that before
ldnunes has quit [Quit: Leaving]
<dminuoso> jokke: You can use some generic template metaprogramming to quickly encapsulate a variety of methods if you like.
tk__ has joined #ruby
<dminuoso> That way you can quickly encapsulate a set of methods without modifying any code.
Rickmasta has quit [Ping timeout: 260 seconds]
<jokke> that is _exactly_ what i need
nankyokusei has joined #ruby
<jokke> but i'm not quite getting how it's used from the docs
<dminuoso> jokke: It's best if you understand what Module#include does actually behind the scenes.
<jokke> hm
<dminuoso> Effectively it just inserts the target module into the inheritence chain.
<domgetter> jokke do you understand the #ancestors method on classes?
<dminuoso> Making it an ancestor.
Yacker has quit [Client Quit]
<jokke> well i can just guess what it means
<domgetter> >> Fixnum.ancestors
<ruby[bot]> domgetter: # => [Fixnum, Integer, Numeric, Comparable, Object, Kernel, BasicObject] (https://eval.in/680316)
<jokke> yeah
djbkd has joined #ruby
<dminuoso> jokke: ancestors is the chain of classes and modules used for method lookup.
<jokke> and A < B would probably just be A.ancestors.include?(B)
<domgetter> Fixnum is a child class of Integer, which in turn is a child of Numeric, which includes Comparable, which is why numbers can be compared
<jokke> yeah
pragmaticus has joined #ruby
<jokke> so far on track
<dminuoso> jokke: So what prepend does, is it inserts a target module *before* the class itself.
<domgetter> Module#prepend allows you to "inject" a module into that inheritance chain
<dminuoso> >> class A; end; puts A.ancestors
<ruby[bot]> dminuoso: # => A ...check link for more (https://eval.in/680317)
<dminuoso> >> module M; end; class A; prepend M; end; puts A.ancestors
<ruby[bot]> dminuoso: # => M ...check link for more (https://eval.in/680318)
<dminuoso> >> module M; end; class A; prepend M; end; p A.ancestors
<ruby[bot]> dminuoso: # => [M, A, Object, Kernel, BasicObject] ...check link for more (https://eval.in/680319)
<jokke> i see
<dminuoso> This means that methods in M are considered first for method lookup. But since its all ancestors chain, you can call the original or a hidden method by using super.
<dminuoso> because super will delegate the call into the ancestors chain (where the original class is next)
<domgetter> The order of ancestors affects where a method will be found when Ruby is digging through the ancestors to find a method
<jokke> yes
<jokke> that's awesome
<jokke> why have i never used that before
<jokke> makes many things so much easier
nankyokusei has quit [Ping timeout: 265 seconds]
<dminuoso> jokke: Indeed.
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> jokke: It's the more elegant way to monkey patch things. :)
<jokke> truly
<domgetter> If you have time, I recommend the text "Metaprogramming Ruby" which is WAY more approachable than it sounds
<jokke> can i have a link?
<domgetter> This is the official link: https://pragprog.com/book/ppmetr2/metaprogramming-ruby-2
ldnunes has joined #ruby
Beams has joined #ruby
<jokke> thank you very much dminuoso and domgetter, you've been super helpful!
<domgetter> That books contains the stuff that makes Ruby Ruby
<domgetter> in my opinion
sid_fules has quit [Ping timeout: 246 seconds]
<jokke> well normally i'm trying to avoid too much metaprogramming
sid_fules has joined #ruby
<dminuoso> jokke: If you learn how Ruby method lookup works, and how singleton classes fit into the whole scheme - you have the basic skillset required to do (now seemingly complicated) metaprogramming easily.
<domgetter> The think is, I wouldn't recommend metaprogramming very much if at all. But I WOULD recommend understanding what's going on
<dminuoso> jokke: Mostly folks avoid it because they don't understand how Ruby works, so it looks all magical.
Snowy has joined #ruby
<jokke> heh
Burgestrand has joined #ruby
<elomatreb> Metaprogramming is what makes Ruby so fun in my opinion. No other language I know makes it so comfortable
Burgestrand has quit [Client Quit]
<dminuoso> elomatreb: Depends on what you do though. Template metaprogramming in C++ tackles some specific problems quite elegantly (though templates are cumbersome to use)
d0nn1e has quit [Ping timeout: 240 seconds]
<domgetter> You'll learn how to arbitrarily rip open execution contexts with instance_eval and add methods directly to objects dynamically with singleton classes, and you'll actually be able to use class instance variables
Burgestrand has joined #ruby
<domgetter> I know half of those words don't mean much now, but I assure you it's awesome to learn
<dminuoso> domgetter: Honesty I think the biggest confusion about instance_eval and class_eval is that they are named after abstract concepts in Ruby, but not after what they do.
<domgetter> dminuoso I agree with you on that
d0nn1e has joined #ruby
<elomatreb> dminuoso: I've been too scared of C++ to every learn it :(
brendan- has joined #ruby
<domgetter> Yeah, calling instance_eval on a class affects the class *as an instance of the Class class*, not the class's instances
<apeiros> hu? C++ isn't that hard. the language that is.
<dminuoso> C++ is easy to learn, but it takes a long time to learn all the details and get really good at it.
* apeiros hasn't yet had a reason to learn the ecosystem - that part is indeed scary, mainly due to its sheer size
mrwn has joined #ruby
<apeiros> I find C scary. for all its weird edge cases of undefined behavior.
<dminuoso> apeiros: C++ is not any different in that regard. ;-)
<elomatreb> Close-to-metal programming is probably more what scares me, my first programming language was a weird robotics dialect of ANSI C, I still have flashbacks
<apeiros> I thought they cut down a lot of UB?
<dminuoso> No.
<apeiros> ok. in that case: C++ is scary.
<dminuoso> Most UB in C makes a lot of sense and its obvious.
<apeiros> I'd disagree.
<dminuoso> There's very little UB that may not be obvious at first glance - especially because things "seem to work"
<domgetter> >> Module.is_a?(Class) && Class.is_a?(Module)
<ruby[bot]> domgetter: # => true (https://eval.in/680342)
<apeiros> the "obvious" part mostly.
<dminuoso> apeiros: Maybe I just have a different perspective having written a compiler and a kernel (where you need to understand exactly what the compiler does to code).
* dminuoso shrugs
last_staff has quit [Quit: last_staff]
<dminuoso> apeiros: There's some things where C++ adds UB even. For example C since C99 allows type punning through unions. Doing so in C++ is UB.
<dminuoso> (There is no legal way to type pun in C++ sadly)
<apeiros> dminuoso: the point is, there's plenty of code where when you read it, it seems obvious what it does. and then somebody points out all the things which are actually UB.
<apeiros> and of course, all of them make sense.
foxxx0 has joined #ruby
<apeiros> but you need to keep track of a lot of things.
<apeiros> anyway, I think we're OT :D
<dminuoso> apeiros: Type punning is my absolute favourite of UB because compilers rarely detect it - they always generate code that works... *mostly*. You end up getting programs that simply don't execute like the code.
<dminuoso> And people do it so often it's hilarious. :-)
griffindy has joined #ruby
gingray has quit [Ping timeout: 240 seconds]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jshjsh has joined #ruby
domgetter has quit [Ping timeout: 250 seconds]
mjuszczak has quit []
alexherbo2 has quit [Quit: WeeChat 1.6]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rakm has joined #ruby
rakm has quit [Client Quit]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rakm has joined #ruby
ramortegui has joined #ruby
JoshS has quit [Ping timeout: 268 seconds]
griffindy has joined #ruby
rakm has quit [Client Quit]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has joined #ruby
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
rfoust has joined #ruby
rfoust has quit [Client Quit]
rakm has quit [Client Quit]
rakm has joined #ruby
rakm has quit [Client Quit]
rakm has joined #ruby
rakm has quit [Client Quit]
allcentury has joined #ruby
hahuang65 has quit [Ping timeout: 250 seconds]
jmignault has joined #ruby
pawnbox has quit [Remote host closed the connection]
aupadhye has quit [Quit: Leaving]
asidorenko_ has left #ruby [#ruby]
sczizzo has quit []
ptierno has joined #ruby
ptierno has joined #ruby
ptierno has quit [Changing host]
claudiuinberlin has joined #ruby
<jokke> is there also a extend equivalent for prepend?
<dminuoso> What?
<dminuoso> jokke: Now this is an issue of not understanding how things work again in Ruby. ;-)
<dminuoso> jokke: Tell me, under the hood - what do you think is the difference between class methods and instance methods?
<dminuoso> Hint: There is none.
jhack has joined #ruby
<jokke> well. class methods are called on the class object and instance methods on the instances of a class
<apeiros> jokke: the short answer is "no" btw. - in case that wasn't evident from dminuoso's answer ;-)
<dminuoso> Right, and where are they defined on?
agent_white has quit [Remote host closed the connection]
<dminuoso> apeiros: The equivalent is still: prepend.
<dminuoso> So no to your no.
<jokke> on the class
<apeiros> oh, I misread jokke's question
<apeiros> I read it as "is extend equivalent to prepend"
<jokke> so, i just do def self.foo in my prepended module?
<jokke> and it works
* apeiros should pay more attention
<dminuoso> jokke: Let me give you rule 17 in Ruby: All methods are defined on classes.
<dminuoso> jokke: So if instance methods are defined on the class, where are class methods defined on?
<apeiros> dminuoso: should I nitpick?
<tobiasvl> all methods are defined on objects, aren't they
<dminuoso> tobiasvl: No.
<jokke> on the class instance?
<dminuoso> jokke: Nope.
<dminuoso> jokke: Rule 17.
<dminuoso> *All*
<jokke> on the singleton class :)
<apeiros> all methods are defined on modules or subclasses thereof
<jokke> :D
<tobiasvl> hm. what methods don't belong to objects?
<dminuoso> (ANd note Im using modules and classes synonymously)
<apeiros> (class being the most prominent subclass of module)
<dminuoso> jokke: Precisely.
cinderhaze has joined #ruby
pawnbox has joined #ruby
<dminuoso> jokke: The class objects singleton class.
claudiuinberlin has quit [Ping timeout: 260 seconds]
<dminuoso> jokke: Essentially "extend" is just syntactic sugar for "include on the class objects singleton class"
lenwood has quit [Ping timeout: 260 seconds]
<dminuoso> which should give you a hint how to do the same thing with prepend.
<jokke> mhm
<cinderhaze> Good morning everyone.... Quick question. I have an airgapped server that won't have a rubygem mirror available, and I have a set of gems that need installed. I want to know if there is a way to have a directory full of the .gem files, and do something like 'gem install --local *.gem' but have it able to figure out the dependency order of all the passed in arguments
SteenJobs has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
<jokke> yeah it works from class << self
arussel has left #ruby ["ERC (IRC client for Emacs 24.5.1)"]
<cinderhaze> if not, does anyone have an example of good documentation for either using bundle package to prebuild a gem with it's dependencies vendored inside of it, or an fpm based approach for setting this up to be a single installer?
eljimbo has joined #ruby
<dminuoso> jokke: :)
<Papierkorb> cinderhaze: I'd probably just copy over the gem file cache
<dminuoso> apeiros: You're right though. I should have said all methods in Ruby are defined on RClass'es ;-)
<Papierkorb> cinderhaze: Or, if you're actually using bundler (I guess), just copy the vendor/ directory too
mrwn has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
UserJosh has joined #ruby
djbkd has joined #ruby
<dminuoso> jokke: You could also do singleton_class.prepend(Mod) -- which is probably a little better than to open the entire singleton class.
<jokke> dminuoso: i'm opening up anyway
<jokke> *it
<dminuoso> Fair enough then.
<cinderhaze> Papierkorb: In our current situation, we have a bootstrapping process where we just have an array of download locations for all the gems we want installed as system gems. I was hoping to be able to not also need a Gemfile. we currently don't have bundler on the system where these gems are being installed, but it shouldn't be a problem to have it on the dev/CI side
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> cinderhaze: should be doable with just rubygems, and definitively is doable with bundler. Don't remember how. With bundler iirc it was --package on a dev machine before copying the project.
<Papierkorb> cinderhaze: You are not using bundler to manage gems for your project(s)?
<apeiros> cinderhaze: note that rubygems inherited a lot of bundler's functionality (and bundler is currently being merged into rubygems)
<cinderhaze> this is not a 'ruby project'. this is a few gems neede for a Puppet server installation (the hiera-eyaml gem and it's dependencies to handle encrypted yaml values on disk)
jshjsh has quit [Ping timeout: 268 seconds]
<dminuoso> apeiros: They are taking way too long. It's fairly easy to merge these two together. "git checkout bundler; git merge -s ours rubygems;"
<dminuoso> Clearly.
malconis has joined #ruby
definity has joined #ruby
djbkd has quit [Ping timeout: 260 seconds]
<dminuoso> Build and ship - done.
ptierno has quit [Ping timeout: 250 seconds]
johnmilton has joined #ruby
aegis3121 has joined #ruby
ptierno has joined #ruby
malconis has quit [Ping timeout: 260 seconds]
fmcgeough has joined #ruby
malconis has joined #ruby
aegis3121 has quit [Ping timeout: 258 seconds]
roamingdog has joined #ruby
minimalism has quit [Quit: minimalism]
Yacker has joined #ruby
Burgestrand has joined #ruby
cartothemax has joined #ruby
cartothemax has quit [Client Quit]
cartothemax has joined #ruby
cartothemax has quit [Client Quit]
jhack has quit [Quit: jhack]
SteenJobs has quit [Ping timeout: 260 seconds]
johnmilton has quit [Remote host closed the connection]
joonty1 has joined #ruby
SteenJobs has joined #ruby
xall has joined #ruby
joonty has quit [Ping timeout: 260 seconds]
joonty2 has joined #ruby
suchness has joined #ruby
<suchness> Hello, does anyone know a way to specify "as" on a joins with activerecord? I have two models, Carrot and Lettuce that inherit from Vegetable. I have another model, Meal, that has_many :carrots and has_many :lettuces. I want to do, Meal.joins(:carrots).joins(:lettuces).select("*").to_sql The problem is, the select part of my statement doesn't differentiate between lettuce and carrot, they are both vegetables, so "name" ends up being overriden,
<suchness> I only get carrot name or vegatable name, not both. If I was able to pass an "as" somehow it would make this much more simple... Also, I am crossposting this in rails.
<elomatreb> suchness: Don't crosspost without mentioning please, it's seen as rude
<suchness> I did mention it
<suchness> In both posts
<suchness> Get off your high horse
freebsduser has quit [Ping timeout: 245 seconds]
<elomatreb> Lol, rip. Didn't read to the end, sorry :|
joonty1 has quit [Ping timeout: 240 seconds]
khupwd has joined #ruby
Beams_ has joined #ruby
joonty1 has joined #ruby
Beams has quit [Ping timeout: 252 seconds]
roamingdog has quit [Remote host closed the connection]
joonty2 has quit [Ping timeout: 244 seconds]
cinderhaze has left #ruby ["WeeChat 0.3.8"]
<jokke> just for a proof of concept: can i define new constants from strings?
<dminuoso> Yes.
<dminuoso> Well, from symbols.
<dminuoso> But well. ;-)
<dminuoso> &ri const_set
<jokke> ok well to_sym to the rescue
<jokke> ah
<jokke> cool
nettoweb has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
<jokke> thanks
<dminuoso> jokke: Actually it seems that it accepts strings too, so yes - absolutely!
<dminuoso> :P
SteenJobs has quit [Quit: SteenJobs]
lenwood has joined #ruby
Snowy has quit [Remote host closed the connection]
Snowy has joined #ruby
<jokke> :)
joonty2 has joined #ruby
roamingdog has joined #ruby
<jokke> dminuoso: we were joking around with a collegue how often everyone on the team misspells the module Aggregator. So i came up with this awesome solution: 'aggregator'.chars.permutation { |chars| const_set(chars.join.capitalize, Aggregator) }
joonty1 has quit [Ping timeout: 250 seconds]
<jokke> :P
<kyle__> jokke: I think that's taking the principle of least surprise a bit too far :P
<jokke> :)
<jokke> i also always forget that the correct term in english is co-worker
joonty1 has joined #ruby
<dminuoso> jokke: Haha. Now that is downright hilarious.
<apeiros> jokke: but what if they type Agregator? :-O
<dminuoso> jokke: Wrap the pattern into a method "Module#const_set_for_idiots"
<dminuoso> And make a feature request.
<jokke> dminuoso: will do!
<jokke> :)
roamingdog has quit [Remote host closed the connection]
<dminuoso> jokke: You can also say colleague.
rikai has quit [Ping timeout: 244 seconds]
<apeiros> const_missing -> did you mean
<dminuoso> apeiros: OHhh.
<jokke> apeiros: !! of course!
<dminuoso> Holy!
<jokke> THE POSSIBILITIES!
<jokke> :D
<dminuoso> Never again get an uninitialized constant error!
<jokke> something with levensthein! *gets to coding*
<apeiros> think of all the confusion you can caus^H^H^H^H clear!
joonty2 has quit [Ping timeout: 260 seconds]
axisys has quit [Read error: Connection reset by peer]
<apeiros> jokke: jaro-winkler > levenshtein
nankyokusei has joined #ruby
axisys has joined #ruby
fullofcaffeine has joined #ruby
<dminuoso> Wait. "AcviteRcoerd" does not work for you? Please upgrade to Ruby 2.3.2.
claudiuinberlin has joined #ruby
<apeiros> with all english terms, soundex might also be nice
<dminuoso> I love this.
DLSteve has joined #ruby
<apeiros> is pigruby a thing?
Salih has quit [Quit: Leaving]
maucar has joined #ruby
jmignault has quit [Ping timeout: 248 seconds]
<dminuoso> jokke: Though I learned to be careful with jokes in the army.
saslam has joined #ruby
maucar has quit [Remote host closed the connection]
joonty2 has joined #ruby
maucar has joined #ruby
<jokke> i just learned how to doge work assignments in the army
<dminuoso> jokke: We used to tease new recruits sending them to the requisition officer to pick up "gearbox sand" - which they'd usually do without wondering what they were fetching. Our CO told us that in his platoon a recruit not only fetched it, but poured it into several lubrication ports in an armored vehicle - causing a 5 digit damage to the gearbox.
<jokke> *dodge
<jokke> :D:D:D
zilberstein has joined #ruby
<zilberstein> hi #ruby
<apeiros> hi zilberstein
<dminuoso> jokke: He was not amused because some idiots take even the silliest jokes seriously. :p
<zilberstein> I'm installing sensu-influxdb-extension using Gemfile
<zilberstein> I run bundle in directory with Gemfile
lele has quit [Ping timeout: 260 seconds]
bastelfreak has joined #ruby
Macaveli has joined #ruby
<zilberstein> Why that crap tries to download every single dependency and build it again if I have it installed already ?
<zilberstein> It fails miserably trying to build eventmachine 1.0.3
<zilberstein> But it is installed already
nankyokusei has quit [Ping timeout: 260 seconds]
polishdub has joined #ruby
<dminuoso> zilberstein: Are you using --deployment for bundler?
<dminuoso> Or providing a local gem path?
saslam has quit [Read error: Connection reset by peer]
joonty1 has quit [Ping timeout: 256 seconds]
cats has quit [Remote host closed the connection]
<zilberstein> dminuoso, I just run bundle without any options
rikai has joined #ruby
Ropeney has quit [Quit: Textual IRC Client: www.textualapp.com]
cdg has joined #ruby
cats has joined #ruby
<dminuoso> zilberstein: Please gist your "bundle config"
agent_white has joined #ruby
maucar has quit [Remote host closed the connection]
<apeiros> zilberstein: additionally to what dminuoso will go for - it might well be that your installed gems do not exactly match your Gemfile.lock
<zilberstein> dminuoso, http://pastie.org/10965064
joonty1 has joined #ruby
<dminuoso> zilberstein: Set for your local app (/home/xentime/src/frameworks/sensu-influxdb-extension-master/.bundle/config): "vendor/bundle"
<apeiros> f.ex. eventmachine 1.0.3 is rather old. it's unlikely that your locally installed EM matches that version.
<dminuoso> There you go.
Snickers has quit [Ping timeout: 250 seconds]
hahuang65 has joined #ruby
<dminuoso> zilberstein: Your bundler is configured to use a local directory, so it fetches everything and places it there.
lele has joined #ruby
User458764 has joined #ruby
<zilberstein> dminuoso, UNDLE_PATH: "vendor/bundle"
joonty2 has quit [Ping timeout: 244 seconds]
<dminuoso> zilberstein: Precisely. Once you set a bundle path you tell it to "not default to rubygem settings" but to use whatever is specified. And inside that directory you do not have anything from your global installation.
<zilberstein> apeiros, dpkg -l ruby-eventmachine
<zilberstein> shows 1.0.3-6
<zilberstein> dminuoso, I see.
<apeiros> zilberstein: so your package manager features an ancient gem. great?
<zilberstein> dminuoso, do you know how to tell it to use existing libraries ?
<zilberstein> as I can't build eventmachine
<zilberstein> gcc raises errors
kareelee has joined #ruby
<dminuoso> zilberstein: bundle config --delete path
<dminuoso> zilberstein: and then rerun bundle
<zilberstein> apeiros, I'm satisfied with ancied one.
Burgestrand has quit [Read error: Connection reset by peer]
<apeiros> $ gem search '^eventmachine$' -> eventmachine (1.2.1 ruby
<dminuoso> zilberstein: dont forget to delete the vendor/bundle directory afterwards.
diego2 has joined #ruby
<apeiros> zilberstein: I hope you have the matching ancient ruby version then ;-)
diego2 is now known as dviola
joonty2 has joined #ruby
Burgestrand has joined #ruby
<zilberstein> apeiros, I'm from Python/Java/Erlang sphere and this looks so screwed up
ruby has joined #ruby
hahuang65 has quit [Ping timeout: 258 seconds]
<apeiros> zilberstein: because in python, stuff for python 2 will work with python 3?
ruby is now known as Guest61119
<zilberstein> apeiros, noone uses python 3
<tobiasvl> lol
<apeiros> yeah. and you think this is messed up? :D
<tobiasvl> so you're from the python 2 sphere then zilberstein
joonty1 has quit [Ping timeout: 250 seconds]
<apeiros> in ruby, people actually do use newer versions. because they don't suck ;-p
<dminuoso> apeiros: Right..
<apeiros> dminuoso: well, if you want it phrased defensively: because the newer versions are an improvement.
<dminuoso> apeiros: Just hang around in #rubyonrails sometimes, and see how many folks are still using 1.9.x ;-)
marr has joined #ruby
<dminuoso> There's quite a few people unwilling to upgrade, but then despearately asking for help to fix issues with unsupported ruby versions using unsupported libraries..
Beams has joined #ruby
<dminuoso> Which is great, because it's an invitation for me to become really creative, finding new ways to tell them to "fuck off"
<zilberstein> I've just installed eventmachine 1.0.7
<apeiros> ah. that. well. yeah. but I'd claim that's different from the python schism
anjen has joined #ruby
<zilberstein> But it still tries to use 1.0.3
mjuszczak has joined #ruby
<zilberstein> in Gemfile.lock it says eventmachine>=1.0.3
mjuszczak has quit [Max SendQ exceeded]
<apeiros> zilberstein: a Gemfile.lock is there to isolate your app. to ensure it uses precisely the version of dependencies it was built with.
<apeiros> so that is "works as designed".
joonty1 has joined #ruby
mjuszczak has joined #ruby
<zilberstein> apeiros, >= means greather than or equal
<apeiros> Gemfile = "these are my dependencies", Gemfile.lock = "with those versions it has been built and works"
<zilberstein> apeiros, not just equal
<apeiros> yeah, you're not reading it right. sorry.
<zilberstein> at least in any programming language
<tobiasvl> but also equal
<apeiros> you're looking at the part where it is listed as a dependency of something else.
<apeiros> and there it retains how the dependency is specified.
csk has quit [Read error: Connection reset by peer]
ledestin has joined #ruby
Beams_ has quit [Ping timeout: 248 seconds]
<apeiros> running `bundle update` will replace your Gemfile.lock, using the newest version of each gem still satisfying the dependency spec.
<Papierkorb> zilberstein: If you're from the Java sphere, you'd appreciate that bundler helps you doing "reproducable builds" with this locking mechanism
joonty2 has quit [Ping timeout: 268 seconds]
jhack has joined #ruby
<zilberstein> Papierkorb, pom.xml describes all the versions that one of build systems then assemble together
alexherbo2 has joined #ruby
<zilberstein> So I executed bundle successfully ( finally )
<zilberstein> and now, when I use gem list, I do not see package that was built in list
<Papierkorb> zilberstein: Same concept, slightly different implementation.
<zilberstein> How do I install a new package ?
joonty2 has joined #ruby
<Papierkorb> zilberstein: See what apeiros wrote
dionysus69 has quit [Ping timeout: 248 seconds]
<zilberstein> Papierkorb, yeah, implementation that raises exception when it finds older libraries, even if a newer one is installed
<zilberstein> apeiros, Papierkorb this is what I've done
<zilberstein> bundle install created a new .lock file
<Papierkorb> zilberstein: It wants the right one, not any newer one. That's what locking is for.
csk has joined #ruby
<zilberstein> and it says 21 packages installed whatever
<zilberstein> but gem list do not show that package
<zilberstein> Papierkorb, I was complaining on different error that I had today
<zilberstein> Papierkorb, and I had to remove all other versions of package to satisfy bundle
joonty1 has quit [Ping timeout: 268 seconds]
shinnya has joined #ruby
<zilberstein> So how do I install gem ?
raul782 has quit [Remote host closed the connection]
<zilberstein> from local directory
<zilberstein> where Gemfile.lock exists
iamse7en has joined #ruby
joonty2 has quit [Ping timeout: 252 seconds]
<dminuoso> zilberstein: you need to have rubygem point at the appropriate directory.
<dminuoso> zilberstein: Honestly it's best to stay clear from your operating systems attempt to provide ruby gems for you - it just provides headaches and problems.
<iamse7en> If anyone has a sec, I would really appreciate some help with this... (comparing arrays and manipulating them based on criteria) https://gist.github.com/anonymous/0b16502812cafa71ae79ac82f80d0afa TIA!
kareelee has quit []
<dminuoso> iamse7en: b.each.with_index { |e, i| if e.nil? && b[i].nil?; delete columns; end }
<dminuoso> iamse7en: dont try to be smart with transposing and so on.
rakm has joined #ruby
<dminuoso> Code needs to be readable, not fancy.
igniting has joined #ruby
Derperperd has joined #ruby
rakm has quit [Client Quit]
joonty2 has joined #ruby
raul782 has joined #ruby
<zilberstein> So bundle package created vendor/cache/*gems
<zilberstein> but only dependencies !
<zilberstein> How to install that package after all: https://github.com/seegno/sensu-influxdb-extension ??
<dminuoso> zilberstein: gem install sensu-etc-blah
<zilberstein> I've spent 2.5 hours trying to understand that
<dminuoso> zilberstein: or have bundler install it.
<dminuoso> zilberstein: you probably should use bundler anyway)
<zilberstein> dminuoso, Could not find a valid gem
<zilberstein> ..
<zilberstein> dminuoso, what bundler command I should use ?
<dminuoso> zilberstein: then use bundler with git:
pandaant has quit [Remote host closed the connection]
jahmalz has quit [Quit: Leaving]
<dminuoso> i.e. gem 'sensu-inf..blablaba', git: https://github.com/you/know/what
aryaching has joined #ruby
<dminuoso> well, the last one as a string
Rickmasta has joined #ruby
dionysus69 has joined #ruby
aries_liuxueyang has quit [Ping timeout: 265 seconds]
<zilberstein> dminuoso, gem 'sensu-influxdb-extension', :git => 'https://github.com/seegno/sensu-influxdb-extension'
<zilberstein> No such file or directory
<apeiros> seems that project no longer exists?
joonty1 has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
<dminuoso> zilberstein: Oh there is no gemspec file.
cdg_ has joined #ruby
<zilberstein> dminuoso, yeah. So I tried to specify version, according to documentation
<zilberstein> and it failed
<dminuoso> zilberstein: Honestly its just a file with 150 lines of code. You can just copy paste.
<dminuoso> zilberstein: How?
<zilberstein> dminuoso, http://bundler.io/git.html
joonty2 has quit [Ping timeout: 244 seconds]
<zilberstein> dminuoso, you mean to put it to gems directory ?
<dminuoso> zilberstein: nah. just have some vendor/lib/whatever.rb
cdg has quit [Ping timeout: 240 seconds]
anjen has quit [Quit: anjen]
Rickmasta has quit [Ping timeout: 256 seconds]
<zilberstein> dminuoso, and then ?
joonty2 has joined #ruby
Derperperd has quit [Quit: Derperperd]
rfoust has joined #ruby
gigetoo has quit [Read error: Connection reset by peer]
gigetoo has joined #ruby
joonty1 has quit [Ping timeout: 256 seconds]
tk__ has quit [Quit: ばいばい]
joonty1 has joined #ruby
joonty2 has quit [Ping timeout: 240 seconds]
kareelee has joined #ruby
jgnagy has joined #ruby
blackbombay has joined #ruby
benlieb has joined #ruby
joonty2 has joined #ruby
JeanCarloMachado has joined #ruby
a1fa has quit [Ping timeout: 246 seconds]
infernix has quit [Quit: ZNC - http://znc.sourceforge.net]
a1fa has joined #ruby
DoubleMalt has quit [Ping timeout: 248 seconds]
joonty1 has quit [Ping timeout: 265 seconds]
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rutix has quit []
Burgestrand has joined #ruby
<iamse7en> thanks dminuoso . for delete columns, should I use delete_at or just delete
Burgestrand has quit [Client Quit]
terens has quit [Remote host closed the connection]
joonty1 has joined #ruby
kareelee has quit [Remote host closed the connection]
kobain has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
joonty2 has quit [Ping timeout: 240 seconds]
jokke has quit [Remote host closed the connection]
mhib has joined #ruby
chouhoulis has joined #ruby
jokke has joined #ruby
[`_`] is now known as ^[`-`]^
<dminuoso> iamse7en: look at the documentation of each and then you tell me.
madper has quit [Remote host closed the connection]
ARCADIVS has quit [Quit: ARCADIVS]
<iamse7en> delete :)
<dminuoso> :)
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agit0 has joined #ruby
agit0 has quit [Client Quit]
gr33n7007h has quit [Quit: WeeChat 1.6]
maddmaxx has joined #ruby
yupvr has quit [Ping timeout: 256 seconds]
TPug has joined #ruby
gr33n7007h has joined #ruby
lenwood has joined #ruby
^mtkd has quit [Ping timeout: 250 seconds]
mtkd has joined #ruby
TPug has quit [Ping timeout: 256 seconds]
araujo has quit [Quit: Leaving]
benlieb has quit [Quit: benlieb]
Norm has left #ruby [#ruby]
xrlk has quit [Ping timeout: 260 seconds]
sneakerhax has quit [Ping timeout: 260 seconds]
bluOxigen has quit [Ping timeout: 256 seconds]
TvL2386 has quit [Quit: Ex-Chat]
bluOxigen has joined #ruby
konsolebox has joined #ruby
xrlk has joined #ruby
railswebdev has joined #ruby
jhack has quit [Quit: jhack]
yupvr has joined #ruby
jhack has joined #ruby
shinnya has quit [Ping timeout: 246 seconds]
yupvr has quit [Remote host closed the connection]
infernix has joined #ruby
skweek has joined #ruby
nankyokusei has joined #ruby
jblack has joined #ruby
<iamse7en> dminuoso what am i doing wrong here. another hint? b.each.with_index { |e, i| if e.nil? && x[i].nil?; b.delete(e); p.delete(i) ;a.delete(i); end }
TarVanim_ has joined #ruby
TarVanim_ is now known as TarVanimelde
drixon has joined #ruby
<definity> Does self.method_name mean that a method is static?
drixon has quit [Client Quit]
kassav has quit [Quit: kassav]
TarVanimelde has left #ruby [#ruby]
zenguy_pc has quit [Ping timeout: 245 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<iamse7en> oh i need delete_at for p, a, and x.
nankyokusei has quit [Ping timeout: 248 seconds]
Fichtenstein has quit [Quit: Fichtenstein]
jbeeze has joined #ruby
Fichtenstein has joined #ruby
chopin has joined #ruby
ta_ has joined #ruby
mjuszczak has quit [Ping timeout: 260 seconds]
<iamse7en> nevermind. i got it. i needed to use delete_at otherwise it would delete every nil in b
<iamse7en> b.each.with_index { |e, i| if e.nil? && x[i].nil?; b.delete_at(i); p.delete_at(i) ;a.delete_at(i); x.delete_at(i); end }
faces has quit []
zenguy_pc has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
<iamse7en> i wonder if there's a way to not repeat those delete_ats
joonty2 has joined #ruby
jhack has quit [Quit: jhack]
jeanlinu_ has joined #ruby
jhack has joined #ruby
jeanlinux has quit [Ping timeout: 240 seconds]
joonty1 has quit [Ping timeout: 268 seconds]
jshjsh has joined #ruby
kareelee has joined #ruby
gener1c has joined #ruby
<djellemah> iamse7en: [b,p,a,x].each{|ary| ary.delete_at i}, but that reads only marginally better, and incurs an identical array construction for each element of b
jhack has quit [Client Quit]
User458764 has joined #ruby
<iamse7en> ah okay. not sure what that second part means. but for performance, which one should I use
jhack has joined #ruby
UserJosh has quit [Ping timeout: 268 seconds]
mark_66 has quit [Remote host closed the connection]
kareelee has quit [Ping timeout: 250 seconds]
khupwd has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
cpruitt has joined #ruby
<djellemah> iamse7en: the [b,p,a,x] array would be constructed each time your {|e,i| ...} block is executed. And it's the same set of values every time.
<iamse7en> oh i see
p0wn3d has quit [Ping timeout: 260 seconds]
GodFather has quit [Ping timeout: 260 seconds]
brendan- has joined #ruby
benlieb has joined #ruby
aganov has quit [Remote host closed the connection]
TomyWork has quit [Remote host closed the connection]
csk has quit [Quit: ZZZzzz…]
jhack has quit [Quit: jhack]
SteenJobs has joined #ruby
rrichardsr3 has joined #ruby
senayar has quit []
jhack has joined #ruby
ledestin has quit [Ping timeout: 268 seconds]
rrichardsr3 has quit [Client Quit]
Snickers has joined #ruby
rrichardsr3_ has joined #ruby
rrichardsr3_ has quit [Client Quit]
rrichardsr3_ has joined #ruby
rrichardsr3_ has quit [Client Quit]
rrichardsr3 has joined #ruby
gregf_ has quit [Ping timeout: 260 seconds]
<gener1c> hey
agit0 has joined #ruby
<gener1c> i am trying to write a test but i cant help but see that the tests in ruby core test the installed ruby and not the source
<gener1c> am i wrong?
<gener1c> for example in ftp_test.rb
<gener1c> i mean
<gener1c> test_ftp.rb
<gener1c> it does require 'net/ftp'
<gener1c> and not load 'lib/net/ftp.rb'
jhack has quit [Client Quit]
<gener1c> how do i test what i have changed then?
kareelee has joined #ruby
<apeiros> gener1c: I'd assume that the test suite properly sets up $LOAD_PATH
edwinvdgraaf has quit [Remote host closed the connection]
<gener1c> ah then i dont know how to use the test suit :\
edwinvdgraaf has joined #ruby
<gener1c> ill dig more
<gener1c> runner.rb
agit0 has quit [Client Quit]
edwinvdgraaf has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 260 seconds]
edwinvdgraaf has joined #ruby
teoric has joined #ruby
kareelee has quit [Ping timeout: 252 seconds]
Asher has quit [Quit: Leaving.]
agit0 has joined #ruby
kith has quit [Quit: kith]
p0wn3d has joined #ruby
cats has quit [Quit: BURN HIS HOUSE DOWN]
<iamse7en> djellemah || dminuoso : my code isn't working completely right. example: https://gist.github.com/anonymous/5b7cf227977febb741c75767e9743e90
cats has joined #ruby
<iamse7en> would love some help if you could!
bigtawm has joined #ruby
edwinvdgraaf has quit [Ping timeout: 248 seconds]
<apeiros> iamse7en: p, a, b and x are columns in a table?
zukin has joined #ruby
<iamse7en> apeiros. no i just call them columns
<iamse7en> these are just regular arrays
<toretore> why don't you put them together if they belong together
<apeiros> iamse7en: yes, but from the idea, it's like those arrays are columns in a table?
<toretore> ["Joel Embiid", 1.37, 1.99, 2.5]
kareelee has joined #ruby
<toretore> even better: a hash with descriptive keys
<apeiros> (otherwise I'd question why you use the term "column"…)
<iamse7en> apeiros they will be eventually. but i receive them as separate arrays from json
<apeiros> iamse7en: you might have an easier life then if you'd use transpose:
<apeiros> table = [p, a, b, x].transpose
jhack has joined #ruby
<apeiros> table is now row-based
<iamse7en> so transpose it first. then delete col
<iamse7en> oh i see
cma2 has joined #ruby
<apeiros> and you can just table.reject! { |cp,ca,cb,cx| cx.nil? }
teoric has quit [Quit: WeeChat 1.5]
<iamse7en> oh i really like that
<cma2> Hello guys, I am chatting with you from Mars!
<iamse7en> did i just trigger that
<iamse7en> oh i really like that
<cma2> We wrote small communication in Ruby
<apeiros> if you need columns again, just p,a,b,x = table.transpose
<apeiros> cma2: cool
<iamse7en> apeiros that's awesome. thank you
<apeiros> cma2: so you're the martian?
egg_ has joined #ruby
<cma2> apeiros, yes!
jhack has quit [Client Quit]
<apeiros> how are the potatoes growing?
<iamse7en> effing matt damon
splud has joined #ruby
<Papierkorb> cma2: Stand before one of the robots driving on the mars with a shoe on your head and make it take a photo of you
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
<apeiros> Papierkorb: what? not with a newspaper from today?
<cma2> apeiros, sorry, but our mission is secret, now I can't tell u much, but our small tool for communication is written in Ruby!
<havenwood> cma2: Earth greets you!
<cma2> havenwood, thanks!
<cma2> havenwood, one of our problems with ruby is difficulty of debugging
araujo has quit [Client Quit]
<cma2> havenwood, we used some Lisp for using metaprogramming facilities for debugging info
User458764 has quit [Ping timeout: 245 seconds]
sarkis has joined #ruby
kareelee has quit [Read error: Connection reset by peer]
chazu has quit [Quit: ZNC 1.6.1+deb1~ubuntu14.04.0 - http://znc.in]
ledestin has joined #ruby
<cma2> It has been 4 weeks that we landed on Mars, I am the first person who landed their.
kareelee has joined #ruby
<sarkis> hey all - anyone able to get resque working with upstart? it seems upstart by default sends signals for example SIGQUIT to all procs in the a proc group - this includes the forks that the parent resque process creates ... from what i understand to stop resque gracefully - we must only send a QUIT to the parent and wait...
benlieb has quit [Quit: benlieb]
araujo has joined #ruby
User458764 has joined #ruby
User458764 has quit [Max SendQ exceeded]
User458764 has joined #ruby
amclain has joined #ruby
izaac has quit [Ping timeout: 252 seconds]
bigkevmcd has quit [Quit: Outta here...]
joonty1 has joined #ruby
ferr has quit [Quit: WeeChat 1.5]
bigkevmcd has joined #ruby
tragique has joined #ruby
mBailey_j has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
joonty1 has quit [Client Quit]
joonty2 has quit [Ping timeout: 265 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
chazu has joined #ruby
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
lenwood has quit [Ping timeout: 250 seconds]
fumk has quit [Quit: It wasn't me, it was the papers :(]
Daneel has quit [Quit: tchitchaaa]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
allcentury has quit [Ping timeout: 252 seconds]
frozengeek___ has quit [Quit: frozengeek___]
harai_ has joined #ruby
benlieb has joined #ruby
cma2 has left #ruby [#ruby]
fullofcaffeine has quit [Remote host closed the connection]
railswebdev has joined #ruby
definity has quit [Ping timeout: 260 seconds]
zilberstein has quit [Ping timeout: 248 seconds]
dasher00 has joined #ruby
gregf_ has joined #ruby
zilberstein has joined #ruby
nankyokusei has joined #ruby
egg_ has quit []
mBailey_j has left #ruby ["Leaving"]
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jhack has joined #ruby
Guest61119 has quit [Remote host closed the connection]
Rickmasta has joined #ruby
nonnatus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby has joined #ruby
ruby is now known as Guest66338
tyang_ has joined #ruby
ur5us has quit [Remote host closed the connection]
jhack has quit [Client Quit]
^[`-`]^ is now known as suck
SeepingN has joined #ruby
jhack has joined #ruby
Guest66338 has quit [Ping timeout: 244 seconds]
tyang has quit [Ping timeout: 250 seconds]
Rickmasta has quit [Ping timeout: 256 seconds]
jblack has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
jaruga___ has quit [Quit: jaruga___]
jhack has quit [Client Quit]
whiteline has quit [Remote host closed the connection]
agit0 has quit [Quit: zzzZZZ….]
Beams has quit [Quit: .]
definity has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
nonnatus has joined #ruby
whiteline has joined #ruby
gusrub has joined #ruby
zilberstein has quit [Ping timeout: 245 seconds]
zukin has quit [Ping timeout: 258 seconds]
whathappens has joined #ruby
zukin has joined #ruby
Rutix has joined #ruby
Rutix has quit [Changing host]
Rutix has joined #ruby
whiteline has quit [Remote host closed the connection]
whiteline has joined #ruby
Snowy has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
Snowy has joined #ruby
Derperperd has joined #ruby
ponga has joined #ruby
UserJosh has joined #ruby
Snowy has quit [Ping timeout: 250 seconds]
justinf has joined #ruby
claudiuinberlin has quit []
jshjsh has quit [Ping timeout: 268 seconds]
<justinf> is there a way to build a self-conteind binary for linux that contains ruby and a script and all dependencies?
tdy has quit [Ping timeout: 260 seconds]
<justinf> checking this, thanks
eljimbo has quit [Quit: This computer has gone to sleep]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benlieb has joined #ruby
mhib has quit [Quit: Leaving]
ldnunes has quit [Read error: Connection reset by peer]
jeanlinu_ has quit [Remote host closed the connection]
agit0 has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
last_staff has joined #ruby
ldnunes has joined #ruby
Humdai has quit [Quit: Leaving]
dhollinger has quit [Ping timeout: 252 seconds]
xall has quit [Read error: Connection reset by peer]
sid_fules has quit [Remote host closed the connection]
jhack has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
<blackbombay> havenwood: is that anymore than compiled binaries + instructions on how to bundle them?
ldnunes has joined #ruby
xall has joined #ruby
gnufied has quit [Ping timeout: 258 seconds]
railswebdev has joined #ruby
hahuang65 has joined #ruby
gusrub has quit [Remote host closed the connection]
last_staff has quit [Ping timeout: 268 seconds]
gusrub has joined #ruby
saslam has joined #ruby
<havenwood> blackbombay: yeah, they use mock chroots in a docker container to build a single binary for all linux distros (well, two, depending on arch0
<havenwood> blackbombay: the passenger folk did a good job
<havenwood> blackbombay: it's really more attention to detail than the RVM or Travis binaries
pilne has joined #ruby
<blackbombay> yeah sounds cool, i just thought it'd be automated.
frozengeek___ has joined #ruby
aryaching has quit [Ping timeout: 265 seconds]
aryaching has joined #ruby
mikecmpbll has joined #ruby
gusrub has quit [Ping timeout: 246 seconds]
last_staff has joined #ruby
tomphp has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
Ishido has joined #ruby
raul782 has quit [Remote host closed the connection]
sarkis has quit [Quit: WeeChat 1.5]
SCHAAP137 has joined #ruby
s2013 has joined #ruby
raul782 has joined #ruby
StoneCypher has joined #ruby
<StoneCypher> What book would you recommend to an experienced programmer who would prefer to get straight to the nuts and bolts, and needs to cover both Ruby and Rails? Multiple books are fine if appropriate. Free or paid are both fine.
<StoneCypher> I kind of want to stay away from the "you're a wizard" type stuff
zukin has quit [Ping timeout: 258 seconds]
eljimbo has joined #ruby
eljimbo has quit [Read error: Connection reset by peer]
Synthead has joined #ruby
SCHAAP137 has quit [Ping timeout: 260 seconds]
p0wn3d has quit [Ping timeout: 246 seconds]
tref has joined #ruby
gusrub has joined #ruby
stevie has joined #ruby
<stevie> i also want to use ruby but using it on windows a is a f***** nightmare
<miah> install the ubuntu thing for windows, that will make it better probably
help_m has joined #ruby
<help_m> can someone help me with post requests to json?
<stevie> good point
firstdayonthejob has joined #ruby
<ruby[bot]> help_m: as I told you already, please use https://gist.github.com
<help_m> here's my code
last_staff has quit [Read error: Connection reset by peer]
gusrub has quit [Remote host closed the connection]
agit0 has quit [Quit: zzzZZZ….]
dhollinger has joined #ruby
<blackbombay> shouldn't you have a Net::HTTP instance you use to the Post object to? eg http.request(post_obj)
sid_fules has joined #ruby
hightower3 has joined #ruby
User458764 has joined #ruby
<Mrgoose> Any idea why this doesn't work? when using extend on an instance? http://pastie.org/10965195
hightower2 has quit [Ping timeout: 268 seconds]
suchness has quit [Ping timeout: 260 seconds]
<blackbombay> Mrgoose: use include instead of extend, or klass.extend(StatusHelper) before calling klass.test
benlieb has quit [Quit: benlieb]
dviola has quit [Quit: WeeChat 1.6]
benlieb has joined #ruby
<Mrgoose> ah
<Mrgoose> that was easy enough
sid_fules has quit [Ping timeout: 252 seconds]
jhack has quit [Quit: jhack]
s1kx has joined #ruby
gusrub has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
SCHAAP137 has joined #ruby
[Butch] has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
railssmith has quit [Ping timeout: 256 seconds]
shmuli has joined #ruby
agit0 has joined #ruby
roamingdog has joined #ruby
agit0 has quit [Client Quit]
jhack has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
help_m has quit [Ping timeout: 260 seconds]
agit0 has joined #ruby
kirun has joined #ruby
shmuli has quit [Ping timeout: 244 seconds]
Lord_of_Life has quit [Excess Flood]
StoneCyp1er has joined #ruby
p0wn3d has joined #ruby
Cohedrin has joined #ruby
Lord_of_Life has joined #ruby
<apeiros> cma2 is gone?
<apeiros> too sad. would have loved to learn what kind of FTL com tech they've invented
<definity> Why did action cable have to be invented when we have AJAX?
<definity> dosent it do the sme thing?
johnny56 has quit [Ping timeout: 246 seconds]
<elomatreb> Definity: Action cable is for web sockets, AJAX is, well, AJAX
StoneCypher has quit [Ping timeout: 265 seconds]
<definity> okay.
<definity> It seems like it is a lot better than AJAX, JS only uses 1 thread i belive.
tref has quit [Quit: tref]
<baweaver> You might want to do some reading on what websockets are.
nicoulaj has joined #ruby
<elomatreb> There is a fundamental difference. AJAX is just a regular HTTP request by the client, websockets are a persistent connection which can be used to send messages in any direction
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackwind_123 has joined #ruby
DoubleMalt has joined #ruby
<baweaver> both of which have their uses
<baweaver> which are very distinct of one another
<stevie> rbenv is taking forever to install on windows bash'
<Eiam> StoneCyp1er: I like "Confident Ruby"
<stevie> is that normal?
kareelee has quit [Remote host closed the connection]
<baweaver> define forever
<Eiam> StoneCyp1er: I'd suggest asking in #rubyonrails, its a pretty big stack and knowing ruby does not mean you know rails, lots of magic in rails under the hood
<stevie> 7+ minutes
<baweaver> Might be compiling from source for some reason.
johnny56 has joined #ruby
<stevie> thats what its grabbing
<baweaver> source, yep
<baweaver> so that'll take a few
<StoneCyp1er> Eiam: in re: first recommendation: thanks
<StoneCyp1er> Eiam: in re: second recommendation: will do
<Eiam> StoneCyp1er: Confident Ruby is more about patterns and practices to write... confident.. ruby
<stevie> can i do rbenv global 2.3.1 while rbenv install 2.3.1 is going on?
<Eiam> but I'd say its a good foundation for thinking about your ruby code
<baweaver> I'd assume that would break
<baweaver> but you can try
<StoneCyp1er> Eiam: okay :)
<stevie> i spend more time installing ruby than using it on windows lol
<stevie> its a shame I need it
<Eiam> baweaver: any opinion on confident ruby or avdi's work?
Log1x has quit [Excess Flood]
<baweaver> It's good in general.
<baweaver> also avdi is on channel sometimes.
phwelo_ has joined #ruby
<Eiam> I mean it feels like in part its advocating basically introducing some typing into ruby
<Eiam> which I don't personally mind but I know some people can have violent reactions
* baweaver shrugs
* Eiam shrugs with baweaver
<baweaver> everyone gets prissy over something in programming
<StoneCyp1er> baweaver: tabs
<StoneCyp1er> the single most important thing in software, in fact
<baweaver> For the most part I just ignore them or bake it into the style guide and say argument over.
* StoneCyp1er lets linters be jerks for him
<blackbombay> i wish ruby had rubyfmt, so style arguments would die forever.
<Eiam> baweaver: yeah, I think we can all agree curly brackets clearly go on the following line instead of inline with the statement.
<Eiam> ;)
jshjsh has joined #ruby
<StoneCyp1er> Eiam: ... not even in jest, sir
<baweaver> My general opinion is if you waste my time arguing about style I'm going to grill you for it.
nankyokusei has quit [Remote host closed the connection]
<Eiam> baweaver: I had my team just write a linter that encompassed our agreed upon style
<Eiam> no more arguing, the linter just enforces it. done
<baweaver> pretty much
suck is now known as JSchmoe
kareelee has joined #ruby
crdpink has quit [Ping timeout: 245 seconds]
phwelo has quit [Ping timeout: 240 seconds]
<ytti> 3/win 13
<Eiam> StoneCyp1er: =) I don't like some common rubyism's, like calling methods with a space then the parameters, or how the last call in a method if its a hash can have the {} removed from it, and so on
* Eiam shrugs
<Eiam> do as you wish
<Eiam> ruby still cool language =)
UserJosh has quit [Ping timeout: 268 seconds]
symm- has joined #ruby
DoubleMalt has quit [Ping timeout: 268 seconds]
hahuang65 has joined #ruby
kareelee has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 252 seconds]
<StoneCyp1er> Eiam: i'm old and i use terrible languages so i'm sure i'll be fine (and hate everything :D)
bob434 has joined #ruby
mjuszczak has joined #ruby
railssmith has joined #ruby
<Eiam> StoneCyp1er: give it some time, ruby will grow on you. its a great, fun language
roamingdog has quit [Remote host closed the connection]
<Eiam> I love writing ruby its my goto get something done language
<ljarvis> all languages suck
<ljarvis> thread
<Eiam> ljarvis: meh.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis> yes I am bitter
<ljarvis> but it's true
<ljarvis> Ruby is still fun after 10 years though
<ljarvis> if not infuriating at times
<iamse7en> if anyone has a second, I'm struggling to adjust this code to handle nil error. Would really appreciate the help! https://gist.github.com/anonymous/e722b4d4da56de463b6bd439a7a6f803
<Eiam> you are using nil to indicate state
<iamse7en> only so I can remove indexes if it has nil in arrays b && x.
<iamse7en> Not using it to indicate state in ln 13-15, where i'm having the error
jenrzzz has quit [Ping timeout: 260 seconds]
claudiuinberlin has joined #ruby
definity has quit [Ping timeout: 244 seconds]
scripore has joined #ruby
mjuszczak has quit [Ping timeout: 240 seconds]
bob434 has quit [Ping timeout: 260 seconds]
cpruitt has quit [Quit: cpruitt]
ramfjord has joined #ruby
Log1x has joined #ruby
Log1x has quit [Changing host]
Log1x has joined #ruby
jhack has quit [Quit: jhack]
jmignault has joined #ruby
<ljarvis> iamse7en: protip: dont put them there in the first place
<Eiam> yeah
<Eiam> a.map!{|x| x.nil? ? 0 : x}
<iamse7en> ljarvis && elam: i did not put them there. it's from an outside source. And some nils are more important than others.
<Eiam> you are using nil to mean multiple things
jblack has joined #ruby
definity has joined #ruby
<Eiam> right, but thats not how nil works
Fernando-Basso has quit [Quit: WeeChat 1.5]
kareelee has joined #ruby
jackjackdripper has joined #ruby
bumao has quit [Ping timeout: 260 seconds]
Fernando-Basso has joined #ruby
jhack has joined #ruby
<Eiam> like, this is such an annoying thing. nil does not mean empty, it doesn't mean 0, it means NOTHING. you are assigning it meaning and thats the issue at its core
xall has quit [Read error: Connection reset by peer]
<Eiam> so replace your nils with things that have valid meaning in your process
tref has joined #ruby
<iamse7en> Eiam. ok i see what you're saying.
<Eiam> initially, nil means "delete values that are both equal to nil"
<Eiam> then later it means "do math, but shit, nil means something new here, its now a number"
<Eiam> I'm not saying that nil should equal 0, I don't know what your inputs represent
<Eiam> but they should be wrapped into meanings that *do* mean what you expect.
<toretore> iamse7en: you should provide more information about the data to get better help
xall has joined #ruby
<Eiam> ljarvis: anyway, if you remove the nils from a,b,x and replace them with 0, you get the expected output of [6.0, 4.1, 7.0] but I don't know enough about your data set to know if replacing nils later on with 0 is valid
pawnbox has joined #ruby
bumao has joined #ruby
aarwine has joined #ruby
<toretore> random strings, numbers and nils with questions like "how do i do this very specific thing which i think maybe could do what i want" is not very useful
<ljarvis> wrong person
<aarwine> How can I convert a string ( "true" ) to a boolean ( true ) - Is eval("true") the only way?
<iamse7en> got it thank you
<Eiam> ljarvis: sorry =)
<toretore> aarongodin: no
workmad3 has quit [Ping timeout: 240 seconds]
<ljarvis> aarwine: if str == "true"; true; end
jmignault has quit [Ping timeout: 260 seconds]
<toretore> sorry aarongodin
chris2 has quit [Ping timeout: 246 seconds]
<ljarvis> but omre importantly: why? :)
<ljarvis> more*
<Eiam> ljarvis: maybe its an input he desnt control and now he is transforming it into something he does control =)
<Eiam> he/she/they w/e
kareelee has quit [Ping timeout: 244 seconds]
<aarwine> ljarvis: but what if str is sometimes a str and sometimes a boolean? Is my best bet to do var.to_s.eql? "true" ?
<aarwine> :(
<ljarvis> aarwine: that you're an awful person
<ljarvis> then*
<Eiam> aarwine: for sure sanitize your inputs
<Eiam> so code further down the pipe doesn't need to worry
<ljarvis> aarwine: can we see some code for context?
<aarwine> Isn't this a classic be broad in what you accept and strict in what you send?
<ljarvis> meh
<Eiam> uh
<ljarvis> be strict everywhere
<Eiam> I'd rather be strict in what I accept
<aarwine> haha
<ljarvis> unless you want to be broad
<aarwine> that's fair i guess
<Eiam> otherwise I'm responsible for your mess
cdg_ has quit [Ping timeout: 260 seconds]
<aarwine> tbh, there's very controlled inputs here it'll always be a string but I'm mad because it should have been a boolean to begin with
<aarwine> thanks
<ljarvis> aarwine: do you only care about "true"?
* Eiam high fives ljarvis
<ljarvis> or false too?
libastral has joined #ruby
<toretore> aarwine: +1 for strict
<aarwine> hrm, because if str will return true?
<aarwine> It's a toggle on cleaning up after the script is done
tref has quit [Ping timeout: 250 seconds]
iamse7en has quit [Quit: I'm out like a black kid in a spelling bee.]
<ljarvis> ok, but do you *only* want t ocheck for "true", or "false", other?
<aarwine> ah, anything other than true/false I'd default to nothing (false)
tomphp has joined #ruby
<ljarvis> right ok, then yeah, input.to_s == "true" is the way to go
kareelee has joined #ruby
<aarwine> much cleaner than my original eval :)
alexherbo2 has quit [Quit: WeeChat 1.6]
<aarwine> I am surprised that there isn't a to_boolean method on strings; I guess that's because of all the strings that are not true or false
<toretore> which strings should be true?
kareelee has quit [Read error: Connection reset by peer]
<blackbombay> all of them.
<Eiam> yeah, whats it mean for a string to be true
tref has joined #ruby
<Eiam> existence, I would presume
<havenwood> "is this string true?"
<Eiam> so x = "" is false or... ? =p
<havenwood> that's a truthy string
kareelee has joined #ruby
<aarwine> if str would eval to true but so would "true"_to_boolean
<ljarvis> here we go..
<aarwine> okok
<aarwine> sorry!
* aarwine ducks
<toretore> you will also be reprimanded for considering using eval
<aarwine> I do like seeing the edge cases Eiam, I think it was helpful to me :)
<havenwood> i thought it was interesting that matz said something about how he'd make eval a keyword if he could go back at the rubyconf qa
pawnbox has quit [Ping timeout: 260 seconds]
<blackbombay> why a keyword?
<havenwood> if he said i didn't catch it, i was curious to hear more
maloik has quit [Remote host closed the connection]
kareelee has quit [Ping timeout: 250 seconds]
maloik has joined #ruby
Rickmasta has joined #ruby
_sfiguser has joined #ruby
agit0 has quit [Quit: zzzZZZ….]
bocaneri has quit [Remote host closed the connection]
chris2 has joined #ruby
<blackbombay> is ruby getting types?
Rickmasta has quit [Ping timeout: 245 seconds]
Snowy has joined #ruby
jshjsh is now known as JoshS
Snowy has quit [Remote host closed the connection]
Snowy has joined #ruby
nankyokusei has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
justinf has left #ruby ["done"]
symm- has quit [Ping timeout: 250 seconds]
lenwood has joined #ruby
symm-_ has joined #ruby
<ljarvis> ruby has types
<stevie> hey ruby
<apeiros> ljarvis: you might get into an argument that classes aren't types ;-)
<Eiam> blackbombay: .is_a?(Array) =)
<stevie> when I ran rails server, it gave an error about mysql sockets. The tutorial I am watching said this, where would I be able to find it on ubuntu for windows?
<ljarvis> apeiros: :D
<Eiam> apeiros: if it walks like a duck and talks like a fuck...
kareelee has joined #ruby
<ljarvis> !rails stevie
<ljarvis> ?rails stevie
<ruby[bot]> stevie: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<blackbombay> is ruby getting optional strict typing then
<stevie> oh right
<stevie> different irc
<stevie> my bad
<Eiam> damn, my auto correct got me the ONE time I want to type the word "duck"
<ljarvis> blackbombay: probably not in the next 10 years
Snowy_ has joined #ruby
Snowy has quit [Ping timeout: 260 seconds]
nankyokusei has quit [Ping timeout: 250 seconds]
zeroDi has joined #ruby
<blackbombay> cool
sagax has joined #ruby
csk has joined #ruby
fullofcaffeine has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tref has quit [Quit: tref]
harai_ has quit [Ping timeout: 245 seconds]
kareelee has quit [Ping timeout: 258 seconds]
Derperperd has quit [Quit: Derperperd]
definity has quit [Ping timeout: 265 seconds]
jhack has quit [Ping timeout: 245 seconds]
JSchmoe is now known as suck
c0mrad3 has joined #ruby
brendan- has joined #ruby
sid_fules has joined #ruby
Derperperd has joined #ruby
jmignault has joined #ruby
kareelee has joined #ruby
skweek has joined #ruby
pawnbox has joined #ruby
<apeiros> blackbombay: by strict, do you mean static?
jhack has joined #ruby
<apeiros> strong/weak typed, static/dynamic typed those are the two categories (ruby is strongly and dynamically typed)
jgt has joined #ruby
c355e3b has joined #ruby
tdy has joined #ruby
<blackbombay> sorry yeah i meant optional static typing
jmignault has quit [Ping timeout: 260 seconds]
tragique has left #ruby [#ruby]
<apeiros> I think something like that is being evaluated, yes
hightower2 has joined #ruby
<apeiros> one thing I'd welcome a lot is non-nil-able arguments
kith has joined #ruby
TheCubeLord has joined #ruby
TheCubeLord has joined #ruby
TheCubeLord has quit [Changing host]
brendan- has quit [Ping timeout: 258 seconds]
scripore has quit [Ping timeout: 260 seconds]
sparch has quit [Ping timeout: 260 seconds]
hightower3 has quit [Ping timeout: 248 seconds]
<apeiros> I'd love to experiment with a language which has a well built null-pattern
<Papierkorb> apeiros: Crystal?
<apeiros> I think ruby could easily implement one
<Papierkorb> or what do you mean by that?
kraljev11 has joined #ruby
<ljarvis> apeiros: enter fp
<apeiros> Papierkorb: classes whose instances are considered falsy and implement the null pattern
vuoto has joined #ruby
scripore has joined #ruby
xall has quit [Ping timeout: 240 seconds]
kraljev11 has quit [Quit: kraljev11]
manjaro-kde5_ has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
Snowy_ has quit [Remote host closed the connection]
Snowy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Snowy has quit [Ping timeout: 248 seconds]
<Eiam> it would remove a lot of checking
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Eiam> https://github.com/avdi/naught if you want to play with the idea...
muelleme has joined #ruby
AlexRussia has quit [Ping timeout: 258 seconds]
<Eiam> I have some older code in shipping code that used naught when I was playing around with it
<apeiros> NB: I'm not sure whether the null pattern is a good idea/thing. but I could imagine that - at least if used correctly - can be very useful and keep code a lot cleaner.
<apeiros> Eiam: but naught sadly can't alleviate that ruby only treats nil & false as falsy
tomphp has joined #ruby
ocbtec has quit [Quit: leaving]
rapha has quit [Quit: brb, reboot]
last_staff has joined #ruby
<blackbombay> ya unless it's an established pattern in the language stuff like that are just cool toys that hardly anybody would use.
_sfiguser has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 256 seconds]
* Eiam accepts being hardly anbody
<blackbombay> rails would have the power to introduce something like that and see it used.
<toretore> tbh i think not having null is better and "null objects" are stupid
hightower2 has quit [Ping timeout: 252 seconds]
<Eiam> I'd be OK with eliminating Null
<Eiam> but if one must have null, Null as an object is a step up =)
<toretore> with null objects you get something that looks like it should be something, but it's actually nothing and you can't detect it
<Eiam> toretore: of course you can detect it..
<toretore> if you can ask it, sure
<Eiam> but as soon as you need to detect that nothing means something, you've already eliminated nothing
<Eiam> and instead of nthing it now really means :Empty or :NoValue or something else
<toretore> but that's the point of the pattern, that it behaves like it's something and not nothing
<Eiam> which is what you *should* instead use to represent it
mtkd has joined #ruby
<Eiam> toretore: you can teach a man to fish but...
last_staff has quit [Client Quit]
sneakerhax has joined #ruby
<toretore> my point is that you should be forced to treat "not the value you wanted" differently
<Eiam> ruby has a lot of ways to handle this
fmcgeough has quit [Quit: fmcgeough]
<toretore> if you're disciplined and make the effort, but rogue nils are still everywhere
fumk has joined #ruby
redpants has joined #ruby
<Eiam> its possible to write bad code in any language
<Eiam> even strongly typed ones that don't allow nil
<toretore> some make it easier ;)
<Eiam> toretore: C has gotten us pretty far ;)
<toretore> (those that have null)
<toretore> how many people love c? how many billions of bugs could have been prevented?
ebbflowgo has joined #ruby
kareelee has quit [Ping timeout: 248 seconds]
* Eiam shrugs
<Eiam> Software Engineering is hardly an engineering profession, we've got a ways to go still.
crdpink has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
csk has quit [Ping timeout: 260 seconds]
<apeiros> toretore: I see it more as: it propagates the absence of something
AlexRussia has joined #ruby
<apeiros> (it = the null object, since I'm a bit late)
<toretore> apeiros: i guess it depends on the specific implementation; but i've seen many people implement it as "a Person whose .name is 'Mr Nonexistent''"
<toretore> of course you can make a NonExistingPerson or a MaybePerson
<apeiros> toretore: yeah, the one thing I fear about the null pattern is that I think it might be a lot harder to do well than other patterns.
_sfiguser has joined #ruby
<apeiros> that's one of the main parts of "I'm not sure it's good"
<toretore> yeah, people see "null object pattern" and think "oh great, i don't have to check for nulls anymore!"
fullofcaffeine has quit [Ping timeout: 250 seconds]
dasher00 has quit [Ping timeout: 250 seconds]
^phwelo_ has joined #ruby
kareelee has joined #ruby
<apeiros> sadly people work like that in many situations. "Oh great. this means I'm no longer responsible"
<apeiros> "no silly. it helps you being responsible. it's still on you."
<apeiros> +but
<apeiros> see encodings -> "oh hey, I can just use force_encoding. that'll make it do what I want, right?"
Pazzaz has joined #ruby
<apeiros> see threads -> "oh hey, when I have a GIL, it's all thread safe, right?" or "when I put a mutex around it, everything will be fine, right?"
<toretore> yeah, which is why in general i'm in favor of forcing people to do things right
<apeiros> see databases -> "oh hey, just put it into a transaction, and all is dandy, right?"
<toretore> because i often have to deal with the consequences of poor choices
phwelo_ has quit [Ping timeout: 245 seconds]
hightower2 has joined #ruby
ur5us has quit [Remote host closed the connection]
sid_fules has quit [Remote host closed the connection]
kareelee has quit [Ping timeout: 265 seconds]
sid_fules has joined #ruby
cudoviste has joined #ruby
tref has joined #ruby
ldnunes has quit [Quit: Leaving]
s1kx has quit [Quit: bai]
sid_fules has quit [Read error: Connection reset by peer]
Pazzaz has quit [Quit: Leaving]
<muelleme> i have this piece of json, that jq happily parses, but ruby tells me JSON::ParserError - 822: unexpected token at '<the whole thing>
bluOxigen has quit [Ping timeout: 250 seconds]
rwb has quit [Ping timeout: 244 seconds]
<apeiros> muelleme: I suggest you gist the paste
<apeiros> err, the json
kareelee has joined #ruby
bluOxigen has joined #ruby
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> jq parses '"css": ".card {\n'?
AnoHito_ has quit [Ping timeout: 260 seconds]
<muelleme> i tried wrapping it with both ' and %q before giving it to JSON.parse, with and without :quirks_mode => true
<apeiros> I don't think a literal \n (not a newline) is valid there
<apeiros> oh
<apeiros> silly me
<blackbombay> parses fine for me.
<apeiros> that stuff is quoted
<muelleme> it's just a string
<apeiros> yeah
Dimik has joined #ruby
<muelleme> blackbombay: in ruby?
<blackbombay> yep
manjaro-kde5_ has quit [Ping timeout: 246 seconds]
* baweaver mutters something about Monads and Maybes
mistergibson has joined #ruby
gigetoo has quit [Ping timeout: 256 seconds]
kareelee has quit [Ping timeout: 245 seconds]
<apeiros> hm, I got a parse error too (used %q{} to wrap the string)
gigetoo has joined #ruby
<apeiros> I'll try reading it from stdin
<blackbombay> require 'json'
<blackbombay> JSON.parse File.read('./foo.json')
<blackbombay> works for me ^
<apeiros> oh, reading from stdin worked
<apeiros> so something with the escaping interferes. rare.
JeanCarloMachado has quit [Ping timeout: 256 seconds]
<apeiros> >> %q{\\special}
<ruby[bot]> apeiros: # => "\\special" (https://eval.in/680617)
<apeiros> hm, no
rwb has joined #ruby
kareelee has joined #ruby
<apeiros> not quite sure. I guess tv is too distracting.
Snowy has joined #ruby
<muelleme> i'll put it in a file, at least that works. thanks! it's weird though
GodFather has joined #ruby
Jackneill has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 258 seconds]
sepp2k has quit [Quit: Leaving.]
kareelee has quit [Ping timeout: 268 seconds]
shmuli has joined #ruby
XV8 has joined #ruby
JoshS has quit [Quit: Leaving]
nonnatus has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tref has quit [Quit: tref]
SeepingN has joined #ruby
manjaro-kde5_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
kareelee has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
dionysus69 has quit [Quit: dionysus69]
benlieb has quit [Quit: benlieb]
scripore has quit [Ping timeout: 240 seconds]
agit0 has joined #ruby
scripore has joined #ruby
vuoto has quit [Remote host closed the connection]
kareelee has quit [Ping timeout: 256 seconds]
[Butch] has quit [Quit: I'm out . . .]
djbkd has joined #ruby
fullofcaffeine has joined #ruby
nonnatus has joined #ruby
sepp2k has joined #ruby
scripore has quit [Ping timeout: 244 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agit0 has quit [Quit: zzzZZZ….]
nonnatus has quit [Ping timeout: 260 seconds]
agit0 has joined #ruby
postmodern has joined #ruby
tvw has joined #ruby
shmuli has quit []
tomphp has joined #ruby
cdg has joined #ruby
phwelo_ has joined #ruby
shmuli has joined #ruby
Bounga has joined #ruby
agit0 has quit [Ping timeout: 265 seconds]
workmad3 has joined #ruby
firstdayonthejob has quit [Quit: WeeChat 1.6]
manjaro-kde5_ has quit [Ping timeout: 260 seconds]
mweshi has joined #ruby
tref has joined #ruby
^phwelo_ has quit [Ping timeout: 250 seconds]
kareelee has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
blackbombay has quit [Quit: WeeChat 1.5]
noname has quit [Quit: WeeChat 1.6]
blackbombay has joined #ruby
firstdayonthejob has joined #ruby
byte512 has joined #ruby
AndrewIsHere has joined #ruby
tdy has quit [Quit: tdy]
Bounga has quit [Ping timeout: 260 seconds]
Rickmasta has joined #ruby
fmcgeough has joined #ruby
TPug has joined #ruby
phwelo_ has quit [Ping timeout: 260 seconds]
Rickmasta has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
synthroid has quit []
Snowy has quit [Remote host closed the connection]
eljimbo has joined #ruby
malcolmva has quit [Ping timeout: 252 seconds]
Snowy has joined #ruby
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cudoviste has quit []
nankyokusei has joined #ruby
malcolmva has joined #ruby
mistergibson has quit [Quit: Leaving]
Snowy has quit [Ping timeout: 248 seconds]
benlieb has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
Bounga has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sid_fules has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
shmuli has quit [Remote host closed the connection]
mrwn has joined #ruby
ptierno has quit [Ping timeout: 240 seconds]
rwb1 has joined #ruby
rwb has quit [Ping timeout: 268 seconds]
rwb1 is now known as rwb
banisterfiend has joined #ruby
Bounga has quit [Ping timeout: 260 seconds]
jhack has quit [Quit: jhack]
cevett has quit [Read error: Connection reset by peer]
codefromhell has joined #ruby
dasher00 has joined #ruby
s2013 has joined #ruby
codefromhell has quit [Client Quit]
tyang_ has quit [Read error: Connection reset by peer]
dasher00 has quit [Max SendQ exceeded]
dasher00 has joined #ruby
cevett has joined #ruby
enterprisey has joined #ruby
l33n has joined #ruby
mweshi has quit [Ping timeout: 246 seconds]
<l33n> wondering if someone can explain or show me documentation of how to write and implement an httpclient that requests a json file i create from a ruby http server
stevie has quit [Quit: Leaving]
xrlk has quit [Read error: Connection reset by peer]
AnoHito has joined #ruby
kareelee has quit [Ping timeout: 245 seconds]
codefromhell has joined #ruby
codefromhell has quit [Client Quit]
xrlk has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<l33n> tight
<l33n> you all are tight
libastral has quit [Quit: leaving]
libastral has joined #ruby
<apeiros> l33n: na, you just sometimes need a bit more patience than 5min
<apeiros> and just a hint for the future: collectively insulting a channel is not a good way to get help
<l33n> lol
<l33n> love
<apeiros> for a simple get request, open-uri is usually sufficient
lxsameer has quit [Quit: WeeChat 1.6]
<apeiros> I believe googling for "ruby open-uri", you'll get plenty of examples on how to retrieve data.
kareelee has joined #ruby
<l33n> apeiros, what is meant by creating a http client though
<apeiros> (it's 2 lines of code, if you include the `require`)
<apeiros> your browser is an http client
<l33n> ok
<apeiros> an application which uses the http protocol to communicate with a server
roamingdog has joined #ruby
djbkd has quit [Remote host closed the connection]
tdy has joined #ruby
<l33n> so i can point to a controller(?) in my rails project that requests a json file that another controller made?
<l33n> point to it in the browser
djbkd has joined #ruby
suck has quit [Quit: Connection closed for inactivity]
djbkd has quit [Read error: Connection reset by peer]
nofxx has joined #ruby
yfeldblum has joined #ruby
djbkd has joined #ruby
<apeiros> o0
<l33n> eh
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mweshi has joined #ruby
malconis has quit [Read error: Connection reset by peer]
<apeiros> I don't follow
kareelee has quit [Ping timeout: 244 seconds]
<l33n> so i just wrote an action in the pages_controller.rb that takes some hash and generates a json
Snowy has joined #ruby
TPug has joined #ruby
<l33n> how do i implement open-uri in the browser, do i create a ruby file
ramfjord_ has joined #ruby
mweshi has quit [Client Quit]
<apeiros> o0
<l33n> whatever, thanks
<apeiros> your browser is an http client. that does not mean "writing an http client" means "put it in the browser"
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benlieb has quit [Quit: benlieb]
<blackbombay> l33n: javascript.
<apeiros> l33n: maybe you should stop with providing tiny little nuggets and instead fill us in on what you want to do
jgt has quit [Ping timeout: 240 seconds]
<apeiros> because right now I'm rather puzzled. and you obviously lack the understanding to reduce the problem to just the parts you actually need. so IMO go for the full explanation.
tomphp has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
<l33n> wrote an action in the pages_controller.rb that takes some hash and generates a json, now i want to create a ruby http client that gets the JSON from the server and parses it and returns the data
muelleme has quit [Ping timeout: 258 seconds]
<apeiros> yes. so you don't put the ruby code in the browser.
<apeiros> you literally write a ~2 line ruby script.
<apeiros> and the google suggestion I made above should get you there.
benlieb has joined #ruby
<l33n> ok thanks
Yacker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> though, the 2 lines is only to fetch the data.
hahuang65 has quit [Ping timeout: 245 seconds]
<apeiros> (and to parse it)
c0mrad3 has quit [Quit: Connection closed for inactivity]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<apeiros> how much code you need to process the data depends - of course - on what exactly you want to do with the data.
rwb has quit [Ping timeout: 252 seconds]
benlieb has quit [Client Quit]
<apeiros> ?crosspost l33n
<ruby[bot]> l33n: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
Derperperd has quit [Quit: Derperperd]
Yacker has joined #ruby
JeanCarloMachado has joined #ruby
AndrewIsHere has quit []
kareelee has joined #ruby
vuoto has joined #ruby
Derperperd has joined #ruby
Derperperd has quit [Client Quit]
kareelee has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Ping timeout: 244 seconds]
enterprisey has quit [Remote host closed the connection]
faces has joined #ruby
douglascorrea has quit [Remote host closed the connection]
douglascorrea has joined #ruby
Yacker has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kristofferR has joined #ruby
anuxivm has joined #ruby
kareelee has joined #ruby
douglascorrea has quit [Ping timeout: 256 seconds]
SteenJobs has quit [Quit: SteenJobs]
brendan- has joined #ruby
libastral has quit [Quit: ZNC 1.6.3 - http://znc.in]
roamingdog has quit [Remote host closed the connection]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
phwelo has joined #ruby
<chrisseaton> Does anyone know how one joins #ruby-lang? When I try I'm told I have to be invited. What's the criteria for an invitation?
allcentury has joined #ruby
<apeiros> chrisseaton: #ruby-lang redirects to #ruby
<apeiros> and since you're already here, you get that confusing message
<chrisseaton> apeiros: oh right, I thought it was a language development room, where as this was more user-oriented
<apeiros> no, we fused :)
libastral has joined #ruby
<apeiros> I think #ruby-core exists
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros> not entirely sure
skweek has quit [Ping timeout: 240 seconds]
<blackbombay> i never thought that'd happen.
<apeiros> blackbombay: yeah, I was surprised too that it happened after over 10y :D
<blackbombay> yeah :/
<blackbombay> better late than never.
<apeiros> indeed
kareelee has quit [Ping timeout: 268 seconds]
polishdub has quit [Quit: Leaving]
raul782 has quit []
rwb has joined #ruby
kareelee has joined #ruby
claudiuinberlin has quit []
dionysus69 has joined #ruby
mwlang has joined #ruby
<dionysus69> as I know ruby doesn't support multi-process multi threading
<dionysus69> as I understand, it means it can't use multiple cores of cpu?
TPug has joined #ruby
<havenwood> dionysus69: well, you can have multiple Ruby processes and each process can have multiple threads - albeit there's a global VM lock (GVL)
<dionysus69> so the fact that it has Thread class just mean that it can run multiple non-concurrent processes right?
<blackbombay> #ruby needs a FAQ for these Qs.
<apeiros> ?faq
<ruby[bot]> apeiros: I don't know anything about faq
<havenwood> dionysus69: Give these series of articles a read: http://www.jstorimer.com/blogs/workingwithcode/8085491-nobody-understands-the-gil
<apeiros> bad bot! no snack!
<apeiros> !faq
<dionysus69> ok one more question :D
sid_fules has quit [Read error: Connection reset by peer]
<apeiros> hm, ok. so we haven't linked the faq. probably because it still needs a lot of love
<dionysus69> I just found out how cool tcpsocket class is
kareelee has quit [Ping timeout: 260 seconds]
nettoweb has quit [Ping timeout: 250 seconds]
<gener1c> i cant find in the doc , how do i run the ruby core tests
<apeiros> !fact add faq You can find an FAQ here: https://ruby-community.com/faq
<ruby[bot]> apeiros: I will remember that faq is You can find an FAQ here: https://ruby-community.com/faq
brendan- has quit [Ping timeout: 258 seconds]
<apeiros> blackbombay: ^ contributions are very welcome!
<havenwood> dionysus69: You might like Jesse Storimer's books (a short book each on the subject of processes, tcp sockets and threads): http://www.jstorimer.com/pages/books
<dionysus69> how easily it is possible to contact anything on internet... what else should i look up? i know socket can run on many diffeerent protocols so which other ones are common or good practice in most cases?
<blackbombay> apeiros: cool. is it on github too?
nettoweb has joined #ruby
mattp_ has quit [Ping timeout: 265 seconds]
<havenwood> dionysus69: They're very accessible and are quick reads but cover the basics.
<blackbombay> nvm i see ;)
<apeiros> dionysus69: important to note, ruby (the language) doesn't imply any restrictions on threading. jruby (a ruby runtime) can do parallel threads.
<dionysus69> wow sounds like i have a new thing to put on kindle for travel or something :D
<dionysus69> jruby just uses jvm doesnt it?
<apeiros> blackbombay: sure. it's got a ribbon showing that ;-)
<apeiros> you know, that top right thing "fork me on github" ;-p
<blackbombay> indeed
<dionysus69> tbh i am just theorizing over here because I actually havent created threads in any language yet, just cause i never needed them xD
<blackbombay> and i think it needs a lil love. how can install ruby not mention chruby/ruby-install? :<
<apeiros> as said - contributions are welcome ;-)
<blackbombay> yep
<dionysus69> but i was just reading https://www.tutorialspoint.com/ruby/ruby_socket_programming.htm and this just strikes me as something I need to know xD asap lol
hahuang65 has joined #ruby
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<railssmith> is this the usual way to get text from a match object?
<railssmith> my_text.match(/\d+/).to_s
<railssmith> Is to_s the best practice here?
<apeiros> railssmith: no
<apeiros> my_text[/\d+/] for this case
<railssmith> thanks!
<railssmith> I will find something to read about match objects so I will learn what their use case is.
tref has quit [Quit: tref]
p0wn3d has quit [Ping timeout: 256 seconds]
<apeiros> if you do have a MatchData object for other reasons though, then either #to_s or #[0] is fine.
rfoust has joined #ruby
tau has quit [Remote host closed the connection]
<apeiros> railssmith: you use MatchData objects if you have capturing groups or if you want to get the pre-match or post-match
<railssmith> my other reasons were, that's the first way i got it to work after reading stackoverflow. ;-)
<apeiros> there might be other reasons I forget. but for simple matches, String#[] is your friend.
<railssmith> I appreciate your help alot
<apeiros> yw
<blackbombay> dionysus69: my advice is: don't worry about if threads are concurrent or parallel until it becomes a problem.
benlieb has joined #ruby
libastral has quit [Quit: ZNC 1.6.3 - http://znc.in]
libastral has joined #ruby
ptierno has joined #ruby
ptierno has joined #ruby
kareelee has joined #ruby
symm-_ has quit [Ping timeout: 268 seconds]
tau has joined #ruby
<dionysus69> blackbombay: ye I know you are right, i am just still curious about everything at the same time in fact, thats my biggest problem x(
zeroDi has quit [Quit: WeeChat 1.6]
<blackbombay> it's just an implementation detail, it varies between implementations of the language.
charliesome has joined #ruby
Fernando-Basso has quit [Quit: WeeChat 1.6]
ptierno has quit [Ping timeout: 246 seconds]
<dionysus69> hmm ok i guess i ll just forget about it atm, but anyways, what is the most common ruby class used for data transmission? is it tcpsocket or something else?
<dionysus69> i just dont know other alternative classes
<blackbombay> what are you trying to do?
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
bigkevmcd has joined #ruby
vuoto has quit [Remote host closed the connection]
<blackbombay> "data transmission" is quite broad.
vuoto has joined #ruby
vuoto has quit [Remote host closed the connection]
<dionysus69> not trying to do anything specific, just want to theoretically know what tools exist :D
vuoto has joined #ruby
<dionysus69> and what are differences etc, speed, connection overhead, good for mass pushing, good for one large push etc etc
<blackbombay> there's classes or methods for TCP sockets, UDP sockets, pipes, unix sockets, ...
<apeiros> dionysus69: you should usually optimize for comfort, not for performance
<dionysus69> ok i guess thats where i will start from
shmuli has joined #ruby
<blackbombay> or present a real world scenario, then optimize for that.
vuoto has quit [Remote host closed the connection]
<dionysus69> yes but i am anxious to know before i start doing something
<blackbombay> learning by trial and error works fine.
gizmore|2 has joined #ruby
<dionysus69> i am into web development and i took month of research before i finally decided to go with rails
<blackbombay> yeah it's good to be informed before you make a decision.
p0wn3d has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
<l33n> hi, pastebin.com/ZgtACsqs, I am tyring to generate a json file, this is what I have, then I have a script like this, pastebin.com/aRtb18gw, im not getting anything printed in ouput, can anyone give me some pointers
<ruby[bot]> l33n: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/a1f1b7cc2631039377ad8dd4d9d48abb
<ruby[bot]> l33n: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<dionysus69> yes its like if u start learning with a bad tool evolution takes a different path ^.^
<apeiros> l33n: rails?
jgt has joined #ruby
<l33n> yes
claw has quit [Ping timeout: 258 seconds]
<apeiros> then that other channel where you posted earlier is the right place
<blackbombay> lol
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
l33n has left #ruby ["Leaving"]
metaf5_ has quit [Quit: WeeChat 1.4]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has quit [Ping timeout: 260 seconds]
sid_fules has joined #ruby
<mwlang> dionysus69: I tend to favor Faraday talking to other servers, at least for HTTP(S) protocols.
muelleme has joined #ruby
domgetter has joined #ruby
sid_fules has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
shmuli has quit [Remote host closed the connection]
<dionysus69> mwlang: i ll take a look at that too for sure
sepp2k has quit [Quit: Leaving.]
claw has joined #ruby
<libastral> i'd better learn net/http, because it is ruby's builtin library
dasher00 has quit [Ping timeout: 258 seconds]
jgt has quit [Ping timeout: 240 seconds]
kareelee has quit [Remote host closed the connection]
<libastral> and ssl is done as simple, as http.use_ssl = true
kareelee has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
<blackbombay> agree
CloCkWeRX has joined #ruby
shmuli has joined #ruby
<dionysus69> what do you mean by net? in net/http?
oncall-pokemon has quit [Quit: Connection closed for inactivity]
tfitts has joined #ruby
<dionysus69> thumbs up xD
dasher00 has joined #ruby
shmuli has quit [Remote host closed the connection]
<domgetter> When you load the library, you put require "net/http"
kareelee has quit [Ping timeout: 256 seconds]
Madplatypus has joined #ruby
<dionysus69> :)
<dionysus69> is rack built on http/net?
<domgetter> There is also net/ftp, net/imap, net/telnet and a couple others
<dionysus69> net/http *
<blackbombay> nope.
kareelee has joined #ruby
jcao219 has joined #ruby
robfrawley has quit [Remote host closed the connection]
<dionysus69> but its using something like that right? it perhaps implements same type of functionality itself
<dionysus69> what my real question is, are they in same category of software xD?
<apeiros> not really
<libastral> dionysus69: rack is just a framework to decouple webapp from server
<apeiros> the only thing they have in common is having to parse http headers
<apeiros> the rest is rather different
<dionysus69> ok thx
hahuang65 has quit [Ping timeout: 248 seconds]
pragmaticus has quit [Ping timeout: 260 seconds]
<dionysus69> ok good night all
<apeiros> n8 dionysus69
<blackbombay> nite
<dionysus69> and thanks allot for answering noob questions xD
tercenya has quit [Remote host closed the connection]
scripore has joined #ruby
mrwn has quit [Remote host closed the connection]
tercenya has joined #ruby
firstdayonthejob has quit [Ping timeout: 256 seconds]
brendan- has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
Rickmasta has joined #ruby
Sammichmaker has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
brendan- has quit [Ping timeout: 258 seconds]
harai_ has joined #ruby
JeanCarl1Machado has joined #ruby
Rickmasta has quit [Ping timeout: 260 seconds]
saslam has quit [Ping timeout: 268 seconds]
JeanCarloMachado has quit [Ping timeout: 250 seconds]
Cohedrin has quit [Max SendQ exceeded]
kareelee has quit [Read error: Connection reset by peer]
Snowy has quit [Remote host closed the connection]
nankyokusei has joined #ruby
kbdkode has joined #ruby
kareelee has joined #ruby
Snowy has joined #ruby
Cohedrin has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
mtkd has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
blackbom1 has joined #ruby
Cohedrin has quit [Max SendQ exceeded]
jbeeze has quit [Remote host closed the connection]
allcentury has quit [Ping timeout: 256 seconds]
Snowy has quit [Ping timeout: 268 seconds]
_pop_ebx has joined #ruby
Cohedrin has joined #ruby
blackbombay has quit [Ping timeout: 256 seconds]
Cohedrin has quit [Max SendQ exceeded]
Cohedrin has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anuxivm has quit [Ping timeout: 260 seconds]
buglessdr has joined #ruby
gingray has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
Cohedrin has quit [Ping timeout: 240 seconds]
Yacker has joined #ruby
hahuang65 has joined #ruby
cdg has quit [Remote host closed the connection]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xiti has quit [Quit: Xiti]
railssmith has quit [Ping timeout: 245 seconds]
kareelee has quit [Remote host closed the connection]
tuxaddicted has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
agent_white has quit [Quit: later]
skweek has joined #ruby
kbdkode has quit [Quit:   see ya  ]
harai_ has quit [Read error: Connection reset by peer]
kbdkode has joined #ruby