baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.1; 2.2.5; 2.1.10: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || Rails questions? Ask on #RubyOnRails || logs @ https://irclog.whitequark.org/ruby/
CloCkWeRX has joined #ruby
CloCkWeRX has left #ruby [#ruby]
sdwrage has joined #ruby
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
newbie1 has quit [Ping timeout: 265 seconds]
nando293921 has joined #ruby
Pumukel has joined #ruby
BackEndCoder has quit [Excess Flood]
BackEndCoder has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
eljimmy has quit [Quit: This computer has gone to sleep]
Pumukel has joined #ruby
loechel has joined #ruby
RedNifre_ has quit [Read error: Connection reset by peer]
<hays> what is the : doing here? def initialize(size:)
Pumukel_ has joined #ruby
RedNifre_ has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
<hays> does that force you to say new size:5 ? intead of new 5
loechel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
<hays> followup; what does &:foo do?
<hays> how is it different from &foo
Pumukel_ has quit [Ping timeout: 265 seconds]
loechel has joined #ruby
charliesome has joined #ruby
Pumukel_ has joined #ruby
shinnya has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
Pumukel has joined #ruby
loechel has quit [Ping timeout: 248 seconds]
pawnbox has joined #ruby
elifoster has joined #ruby
Pumukel_ has quit [Ping timeout: 248 seconds]
eljimmy has joined #ruby
loechel has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Dudee has joined #ruby
<Dudee> hy
pawnbox has quit [Ping timeout: 248 seconds]
ezio has left #ruby ["Leaving"]
loechel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
<hays> is p just short for puts?
<adam12> hays: puts something.inspect
loechel has joined #ruby
<hays> why does is seem like its nil
maletor1 has joined #ruby
Pumukel_ has joined #ruby
pavshn has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
blackmes1 has quit [Ping timeout: 244 seconds]
Pumukel has quit [Ping timeout: 248 seconds]
Pumukel has joined #ruby
loechel has quit [Ping timeout: 248 seconds]
Sashimi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maletor1 has quit [Ping timeout: 248 seconds]
arnonhongklay has joined #ruby
loechel has joined #ruby
jgpawletko has joined #ruby
Pumukel_ has quit [Ping timeout: 248 seconds]
_djbkd has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 248 seconds]
_djbkd has joined #ruby
jgpawletko has quit [Client Quit]
Pumukel has joined #ruby
marr has quit [Ping timeout: 240 seconds]
loechel has quit [Ping timeout: 248 seconds]
_djbkd has quit [Ping timeout: 260 seconds]
Pumukel has quit [Ping timeout: 248 seconds]
Pumukel has joined #ruby
loechel has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has joined #ruby
bmurt has joined #ruby
Pumukel_ has joined #ruby
Dudee has left #ruby [#ruby]
Pumukel has quit [Ping timeout: 265 seconds]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
Pumukel has joined #ruby
astrobunny has joined #ruby
loechel has quit [Ping timeout: 265 seconds]
Pumukel_ has quit [Ping timeout: 265 seconds]
Pumukel has quit [Ping timeout: 248 seconds]
nankyokusei has joined #ruby
zacstewart has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
UserOO7 has joined #ruby
Rodya_ has quit [Remote host closed the connection]
pwnd_nsfw` has joined #ruby
Rodya_ has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
pwnd_nsfw has quit [Ping timeout: 272 seconds]
Rodya_ has quit [Ping timeout: 272 seconds]
mistermocha has joined #ruby
hightower2 has joined #ruby
eljimbo has joined #ruby
_sfiguser has joined #ruby
<_sfiguser> is it true that is always better to use rvm and not instally ruby system wide ?
zeroDi has quit [Quit: WeeChat 1.5]
eljimmy has quit [Ping timeout: 240 seconds]
BlkDynmt has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 248 seconds]
<jazzonmym11nd> _sfiguser: i'd say no.
coolboy has joined #ruby
<_sfiguser> jazzonmym11nd, ok so when it is suggested to use rvm ?
johnDoe111 has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
<NetSage> version managers are probably a good habit to get into
NetSage has quit [Remote host closed the connection]
<jazzonmym11nd> when you are on an OS that doesn't ship ruby or ships an outdated version of ruby, when you want to manage more than one version of ruby.
pokalyis has joined #ruby
coolboy has quit [Remote host closed the connection]
ropeney has joined #ruby
johnDoe111 has quit [Ping timeout: 265 seconds]
<_sfiguser> jazzonmym11nd, ok so if one is a developer installing different versions of gems etc... it is a good habit right ?
meinside has quit [Quit: Connection closed for inactivity]
<jazzonmym11nd> bundler solves the problem of managing gem dependencies
duncannz has quit [Remote host closed the connection]
mrBen2k2k2k____ has quit [Ping timeout: 260 seconds]
<_sfiguser> yeah ok but.. i mean i had problems with system ruby some time ago
fly5566 has joined #ruby
<_sfiguser> conflicting different versions of the same gem required for two different programs
blackmes1 has joined #ruby
<jazzonmym11nd> bundler is designed to solve that problem but if you are just an end user who wants to use two gems who have conflicting dependencies then yes i guess gemsets are one way to work around that.
<jazzonmym11nd> i'm not saying don't use rvm or gemsets, just that it is not always better to use rvm.
j0bk has quit [Quit: ZNC 1.6.1 - http://znc.in]
tdy has joined #ruby
mrBen2k2k2k_ has quit [Ping timeout: 244 seconds]
blackmes1 has quit [Ping timeout: 250 seconds]
skweek has quit [Ping timeout: 255 seconds]
dreamyspell has quit [Quit: Leaving]
sarkis has quit [Ping timeout: 276 seconds]
habitullence has quit [Ping timeout: 276 seconds]
<hays> if i want threading to actually work is jruby or rubinius a better bet
jshjsh has joined #ruby
elifoster has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<jazzonmym11nd> i would try both but yes rubinius and jruby don't have the same lock that MRI has.
mrBen2k2k2k has quit [Ping timeout: 255 seconds]
<hays> getting rubinius installed on my mac is quite the adventure so far
programmerq has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 240 seconds]
<jazzonmym11nd> rubinius is still slower than MRI on most benchmarks that are single threaded.
<hays> right now im building it wirth ruby-install and that seems to be working
programmerq has joined #ruby
JoshS has joined #ruby
harfangk has joined #ruby
<_sfiguser> which is the faster ruby implementation ?
a7d7p has joined #ruby
JoshS has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 240 seconds]
<jazzonmym11nd> id say mri or jruby, it depends what you're doing.
dviola has quit [Quit: WeeChat 1.5]
jshjsh has quit [Ping timeout: 244 seconds]
aryaching has joined #ruby
<_sfiguser> jazzonmym11nd, i'm doing ruby scripts generally
<jazzonmym11nd> probably mri then, jruby takes a while to boot
bonhoeffer has joined #ruby
<_sfiguser> sorry jazzonmym11nd i don't see any mri on "rvm list known"
<jazzonmym11nd> mri is another word for official ruby
<_sfiguser> maybe you refer to "mruby" or to "rbx" ?
<bonhoeffer> i want to make a hash to record number frequencies 1..9 -- what is the best way to initialize this hash?
optiz0r has quit [Ping timeout: 244 seconds]
<bonhoeffer> thinking something like k = {}; 1..9.map{|r| k[r]=0}
<bonhoeffer> but that is no good
<jazzonmym11nd> what's wrong with it?
<_sfiguser> jazzonmym11nd, why they call it mri ? what does mri stand for ?
<jazzonmym11nd> official ruby has had a few names historically: matz ruby interpreter(mri), yarv(yet another ruby vm).
<jazzonmym11nd> mri is 1.8, yarv is 1.9 & beyond.
axsuul has joined #ruby
<_sfiguser> ok
<_sfiguser> thanks
<bonhoeffer> jazzonmym11nd: nothing wrong i guess -- works well
<bonhoeffer> just looking to see if there is a more efficient way to go about it-- a big array might be O(n)
toretore has quit [Ping timeout: 244 seconds]
ramfjord has joined #ruby
<jazzonmym11nd> bonhoeffer: you could say Hash.new(0), so that on first key access the default value is always 0, but that makes every key work that way, even "a", or "b" (as possible mistakes in your code)
<bonhoeffer> nice
<bonhoeffer> then i can do
<bonhoeffer> (1..9).map{|k| freq_hash[k]}
<jazzonmym11nd> why bother?
<jazzonmym11nd> point of default value like that is lazy initialization.
<bonhoeffer> oh, because i want to do this: num1.each do |n| freq_hash1[n] += 1 end
<jazzonmym11nd> just do that then
<bonhoeffer> to build a hash of frequencies from "12312" => {1 => 2, 2 => 2, 3 = 1}
<jazzonmym11nd> no need to initialize first.
solocshaw has joined #ruby
<bonhoeffer> then freq_hash1[n] += 1 won't work for nil
<jazzonmym11nd> it won't be nil
<jazzonmym11nd> it'll be 0
symm- has joined #ruby
<bonhoeffer> because of the Hash.new(0)
<bonhoeffer> #testing
<jazzonmym11nd> yea
<jazzonmym11nd> >> h = Hash.new(0); h[:a] += 1; h[:b] += 1; h
<ruby[bot]> jazzonmym11nd: # => {:a=>1, :b=>1} (https://eval.in/644351)
<bonhoeffer> cool
<bonhoeffer> oh wow --- i'm getting "["=>1, "\""=>10, in the frequency
<bonhoeffer> off of num1 = num1.to_s.split('')
<bonhoeffer> and then num1.each do |n| freq_hash1[n] += 1 end
<jazzonmym11nd> check what num1 is, 'p num1'.
<bonhoeffer> oh, i know why -- oops
pawnbox has joined #ruby
<bonhoeffer> console misuse --
Azure|dc has joined #ruby
a7d7p has quit [Quit: a7d7p]
JakFrist has joined #ruby
pawnbox has quit [Ping timeout: 240 seconds]
Azure has quit [Ping timeout: 264 seconds]
Guest63892 has quit [Ping timeout: 248 seconds]
optiz0r has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp has quit [Remote host closed the connection]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
skweek has joined #ruby
matp has joined #ruby
zipace has quit [Ping timeout: 265 seconds]
blackmes1 has joined #ruby
maletor1 has joined #ruby
JakFrist has joined #ruby
cyphase has quit [Ping timeout: 248 seconds]
blackmes1 has quit [Ping timeout: 260 seconds]
maletor1 has quit [Ping timeout: 248 seconds]
bonhoeffer has quit [Ping timeout: 240 seconds]
solocshaw has quit [Remote host closed the connection]
LoneHermit has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
gilfoyle has joined #ruby
gilfoyle is now known as Guest35369
cyphase has joined #ruby
bonhoeffer_ has joined #ruby
<bonhoeffer_> has anyone ever called ruby a domain specific language?
skweek has quit [Ping timeout: 244 seconds]
wingwalker has quit [Ping timeout: 250 seconds]
LoneHermit has quit [Ping timeout: 264 seconds]
Guest35369 has quit [Ping timeout: 250 seconds]
solocshaw has joined #ruby
wingwalker has joined #ruby
rmf_ has joined #ruby
rmf_ is now known as robfrawley
nebben has quit [Remote host closed the connection]
skweek has joined #ruby
nebben has joined #ruby
Pumukel has joined #ruby
bonhoeffer_ has quit [Quit: Page closed]
robfrawley has quit [Ping timeout: 248 seconds]
JoshS has joined #ruby
tectonic has quit []
Pumukel has quit [Ping timeout: 265 seconds]
braincrash has quit [Quit: bye bye]
tmtwd has joined #ruby
tdy has quit [Ping timeout: 248 seconds]
eizua has joined #ruby
rmf_ has joined #ruby
rmf_ is now known as robfrawley
oncall-pokemon has quit [Quit: Connection closed for inactivity]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
SteenJobs has joined #ruby
A_Drone has joined #ruby
nankyokusei has joined #ruby
historypeats has quit [Quit: Connection closed for inactivity]
solocshaw has quit [Remote host closed the connection]
anisha has joined #ruby
nankyokusei has quit [Ping timeout: 244 seconds]
chkm8 has joined #ruby
arescorpio has joined #ruby
braincrash has joined #ruby
braincrash is now known as braincras
solocshaw has joined #ruby
mistermocha has joined #ruby
tristanp has joined #ruby
A_Drone_ has joined #ruby
A_Drone has quit [Ping timeout: 244 seconds]
Joufflu has quit [Quit: Leaving]
nuck has joined #ruby
nuck is now known as Guest46692
A_Drone_ has quit [Remote host closed the connection]
A_Drone has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
Vile` has quit [Ping timeout: 250 seconds]
skweek has quit [Ping timeout: 264 seconds]
A_Drone has quit [Remote host closed the connection]
mozzarella has quit [Read error: Connection reset by peer]
mozzarella has joined #ruby
A_Drone has joined #ruby
wuyin has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
a7d7p has joined #ruby
rrichardsr3 has joined #ruby
CamonZ has quit [Quit: Textual IRC Client: www.textualapp.com]
blackmes1 has joined #ruby
maletor1 has joined #ruby
jphase has joined #ruby
duderonomy has quit [Read error: Connection reset by peer]
duderono_ has joined #ruby
gilfoyle has joined #ruby
gilfoyle is now known as Guest98071
blackgoat has joined #ruby
hotpanca_ has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
maletor1 has quit [Ping timeout: 240 seconds]
A_Drone has quit [Ping timeout: 265 seconds]
duderono_ has quit [Ping timeout: 265 seconds]
Guest98071 has quit [Ping timeout: 260 seconds]
A_Drone has joined #ruby
duderonomy has joined #ruby
hotpancakes has quit [Ping timeout: 272 seconds]
duderonomy has quit [Client Quit]
Vile` has joined #ruby
gix has quit [Ping timeout: 244 seconds]
ARCADIVS has joined #ruby
craigp_ has quit [Ping timeout: 240 seconds]
UserOO7_ has joined #ruby
BTRE has quit [Quit: Leaving]
gix has joined #ruby
UserOO7 has quit [Ping timeout: 244 seconds]
arnonhongklay has quit [Read error: Connection reset by peer]
SteenJobs has quit [Quit: peaceee]
arnonhongklay has joined #ruby
Sammichmaker has joined #ruby
BTRE has joined #ruby
paradisaeidae has joined #ruby
A_Drone has quit [Remote host closed the connection]
a7d7p has quit [Quit: a7d7p]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LoneHerm_ has joined #ruby
BackEndCoder has quit [Excess Flood]
jphase has quit [Remote host closed the connection]
UserOO7_ has quit [Remote host closed the connection]
tristanp has quit []
BackEndCoder has joined #ruby
tristanp has joined #ruby
charliesome has joined #ruby
Pumukel has joined #ruby
a7d7p has joined #ruby
a7d7p has quit [Client Quit]
loechel has joined #ruby
eljimbo has quit [Quit: This computer has gone to sleep]
zacstewart has quit [Read error: Connection reset by peer]
zacstewart has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
vqrs has quit [Ping timeout: 272 seconds]
loechel has quit [Ping timeout: 248 seconds]
vqrs has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
Cohedrin has joined #ruby
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest46692 has quit [Changing host]
Guest46692 has joined #ruby
Guest46692 is now known as nuck
pawnbox has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
SteenJobs has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 1.5]
arnonhongklay has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 244 seconds]
jtzero1 has quit [Ping timeout: 265 seconds]
blackmes1 has joined #ruby
maletor1 has joined #ruby
robfrawley has quit [Ping timeout: 265 seconds]
Guest4184_______ is now known as Iacobus
Iacobus has quit [Changing host]
Iacobus has joined #ruby
Iacobus has joined #ruby
p0p0pr37_ has joined #ruby
phredus has quit [Read error: Connection reset by peer]
phredus has joined #ruby
maletor1 has quit [Ping timeout: 265 seconds]
blackmes1 has quit [Ping timeout: 264 seconds]
p0p0pr37 has quit [Ping timeout: 260 seconds]
p0p0pr37_ is now known as p0p0pr37
sarkis has joined #ruby
SteenJobs has quit [Quit: peaceee]
alexherbo2 has quit [Quit: WeeChat 1.5]
agit0 has joined #ruby
sarkis has quit [Ping timeout: 265 seconds]
robfrawley has joined #ruby
robfrawley is now known as Guest2473
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
aries_liuxueyang has joined #ruby
joekarma has joined #ruby
joekarma has quit [Client Quit]
wingwalker has quit [Quit: Leaving]
wingwalker has joined #ruby
blackgoat has quit [Ping timeout: 248 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
tmtwd has quit [Ping timeout: 260 seconds]
Pupeno has joined #ruby
wingwalker has quit [Client Quit]
wingwalker has joined #ruby
wombawomba has joined #ruby
rrichardsr3 has quit [Quit: He who dares .... wins.]
nankyokusei has joined #ruby
icey has quit [Ping timeout: 255 seconds]
Guest2473 has quit [Ping timeout: 260 seconds]
robfrawl1y has joined #ruby
pawnbox has joined #ruby
x0f has quit [Ping timeout: 250 seconds]
nankyokusei has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
arescorpio has quit [Quit: Leaving.]
pwnd_nsfw has joined #ruby
nando293921 has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
alfiemax has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 248 seconds]
mistermocha has joined #ruby
sdwrage has quit [Quit: Leaving]
x0f has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
LoneHermit has joined #ruby
conta has quit [Ping timeout: 260 seconds]
arnonhongklay has joined #ruby
grh has joined #ruby
gilfoyle has joined #ruby
gilfoyle is now known as Guest82059
ramfjord has quit [Ping timeout: 272 seconds]
solocshaw has quit [Remote host closed the connection]
ljames has joined #ruby
sarkis has joined #ruby
wingwalker has quit [Ping timeout: 248 seconds]
Guest82059 has quit [Ping timeout: 260 seconds]
tdy has joined #ruby
LoneHermit has quit [Ping timeout: 272 seconds]
dminuoso has joined #ruby
Pumukel has joined #ruby
solocshaw has joined #ruby
dminuoso has quit [Read error: Connection reset by peer]
wingwalker has joined #ruby
wingwalker has quit [Max SendQ exceeded]
wingwalker has joined #ruby
lxsameer has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
Pumukel has quit [Ping timeout: 265 seconds]
duncannz has joined #ruby
Pumukel has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maletor1 has joined #ruby
sarkis has quit [Ping timeout: 248 seconds]
blackmes1 has joined #ruby
pawnbox has quit [Remote host closed the connection]
raeoks has joined #ruby
pawnbox has joined #ruby
nofxx has joined #ruby
nofxx has joined #ruby
nofxx has quit [Changing host]
cyphase has joined #ruby
maletor1 has quit [Ping timeout: 255 seconds]
Pumukel has quit [Ping timeout: 248 seconds]
Pumukel has joined #ruby
grh has quit [Ping timeout: 264 seconds]
_sfiguser has quit [Ping timeout: 255 seconds]
joekarma has joined #ruby
blackmes1 has quit [Ping timeout: 248 seconds]
A_Drone has joined #ruby
alexherbo2 has joined #ruby
dminuoso has joined #ruby
wugy has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
shmulik has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
shmulik has joined #ruby
jshjsh has joined #ruby
loechel has joined #ruby
LoneHermit has joined #ruby
Guest64580 has quit [Excess Flood]
JoshS has quit [Disconnected by services]
Pumukel_ has joined #ruby
jshjsh is now known as JoshS
robopunk has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
Guest83809 has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
A_Drone has quit [Ping timeout: 272 seconds]
Pumukel has joined #ruby
loechel has quit [Ping timeout: 248 seconds]
LoneHermit has quit [Ping timeout: 244 seconds]
loechel has joined #ruby
robopunk has left #ruby [#ruby]
Pumukel_ has quit [Ping timeout: 248 seconds]
_sfiguser has joined #ruby
cyphase has joined #ruby
A_Drone has joined #ruby
bigkevmcd has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
johnmccabe has joined #ruby
A_Drone has quit [Remote host closed the connection]
loechel has quit [Ping timeout: 248 seconds]
A_Drone has joined #ruby
darek has quit [Remote host closed the connection]
ramfjord has joined #ruby
pavshn has joined #ruby
djbkd_ has joined #ruby
Pumukel has joined #ruby
wisn has joined #ruby
pawnbox has quit [Remote host closed the connection]
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
Sashimi has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
anisha has joined #ruby
jshjsh has joined #ruby
Pumukel has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
arnonhongklay has quit [Remote host closed the connection]
JoshS has quit [Ping timeout: 244 seconds]
ishe_ua has joined #ruby
pontiki has joined #ruby
charliesome has joined #ruby
cyphase has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
dminuoso has quit [Ping timeout: 260 seconds]
firstdayonthejob has joined #ruby
segmond has joined #ruby
paradisaeidae has quit [Quit: ChatZilla 0.9.92 [Firefox 48.0.1/20160817112116]]
Pumukel has joined #ruby
solocshaw has quit [Remote host closed the connection]
Burgestrand has joined #ruby
Burgestrand has quit [Client Quit]
aufi has joined #ruby
aries_liuxueyang has quit [Ping timeout: 244 seconds]
jshjsh is now known as JoshS
dminuoso has joined #ruby
loechel has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
ur5us has quit [Remote host closed the connection]
craigp_ has joined #ruby
solocshaw has joined #ruby
duncannz has quit [Remote host closed the connection]
aufi has quit [Quit: Leaving]
pawnbox has joined #ruby
Ishido has joined #ruby
cyphase has quit [Ping timeout: 248 seconds]
teclator has joined #ruby
olistik has joined #ruby
solocshaw has quit [Remote host closed the connection]
ur5us has joined #ruby
loechel has quit [Ping timeout: 265 seconds]
firstdayonthejob has quit [Ping timeout: 265 seconds]
Immune has quit [Ping timeout: 272 seconds]
solocshaw has joined #ruby
wisn has quit [Ping timeout: 265 seconds]
cyphase has joined #ruby
ur5us has quit [Ping timeout: 248 seconds]
vqrs has quit [Ping timeout: 276 seconds]
vqrs has joined #ruby
k3rn31 has quit [Ping timeout: 265 seconds]
aries_liuxueyang has joined #ruby
arnonhongklay has joined #ruby
Pumukel has joined #ruby
dminuoso has quit [Remote host closed the connection]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maletor1 has joined #ruby
joekarma has quit [Quit: joekarma]
aries_liuxueyang has quit [Ping timeout: 244 seconds]
grh has joined #ruby
conta has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
A_Drone has quit [Ping timeout: 276 seconds]
Pumukel has joined #ruby
blackmes1 has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
A_Drone has joined #ruby
maletor1 has quit [Ping timeout: 244 seconds]
bsrd has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
blackmes1 has quit [Ping timeout: 264 seconds]
Pumukel has joined #ruby
raeoks has quit [Read error: Connection reset by peer]
cyphase has quit [Ping timeout: 265 seconds]
dminuoso has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
solocshaw has quit [Ping timeout: 265 seconds]
agit0 has quit [Ping timeout: 276 seconds]
cyphase has joined #ruby
vondruch has quit [Ping timeout: 244 seconds]
submitnine has joined #ruby
_joes_ has joined #ruby
dionysus69 has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
rk has joined #ruby
blackgoat has joined #ruby
rk has quit [Client Quit]
aganov has joined #ruby
last_staff has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
minimalism has quit [Quit: minimalism]
blackgoat has quit [Ping timeout: 240 seconds]
Pumukel has joined #ruby
gagrio has joined #ruby
TomyWork has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
aries_liuxueyang has joined #ruby
pokalyis has quit [Quit: Textual IRC Client: www.textualapp.com]
Silthias has joined #ruby
nankyokusei has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
ixti has quit [Ping timeout: 260 seconds]
claudiuinberlin has joined #ruby
pawnbox has quit [Remote host closed the connection]
Pumukel has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
conta1 has joined #ruby
gilfoyle has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta1 is now known as conta
gilfoyle is now known as Guest30961
biberu has joined #ruby
cyphase has quit [Ping timeout: 265 seconds]
A_Drone has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 265 seconds]
A_Drone has joined #ruby
Pumukel has joined #ruby
Guest30961 has quit [Ping timeout: 248 seconds]
wombawomba has quit [Ping timeout: 264 seconds]
mistermocha has joined #ruby
cyphase has joined #ruby
chwbacca has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
edwinvdgraaf has joined #ruby
ixti has joined #ruby
Pumukel has joined #ruby
ljames has quit []
mistermocha has quit [Ping timeout: 244 seconds]
vondruch has joined #ruby
Pumukel has quit [Ping timeout: 248 seconds]
rsampaio_ has quit [Ping timeout: 248 seconds]
conta1 has joined #ruby
andikr has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta1 is now known as conta
wethu has quit [Read error: Connection reset by peer]
gilfoyle_ has joined #ruby
wethu has joined #ruby
tomphp has joined #ruby
cyphase has quit [Ping timeout: 248 seconds]
pontiki has quit [Quit: "Poets have been mysteriously silent on the subject of cheese." -- G.K.Chesterson]
conta has quit [Read error: Connection reset by peer]
AndyBotwin has joined #ruby
jphase has joined #ruby
jphase has quit [Changing host]
jphase has joined #ruby
mark_66 has joined #ruby
Pumukel has joined #ruby
gingray has joined #ruby
conta has joined #ruby
cyphase has joined #ruby
bocaneri has quit [Ping timeout: 248 seconds]
sarkis has joined #ruby
djbkd_ has quit [Remote host closed the connection]
aryaching has quit [Quit: Bye]
akira616 has joined #ruby
antgel has joined #ruby
aidalgol has joined #ruby
olistik has quit [Ping timeout: 248 seconds]
aidalgol is now known as Guest80323
conta has quit [Read error: Connection reset by peer]
arnonhongklay has quit [Remote host closed the connection]
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
Guest80323 is now known as aidalgol
Immune has joined #ruby
maletor1 has joined #ruby
sarkis has quit [Ping timeout: 240 seconds]
sevenfourk has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shmulik> is anyone familiar with ciphers ? ssl ede3
pawnbox has quit [Remote host closed the connection]
arnonhongklay has joined #ruby
blackmes1 has joined #ruby
bocaneri has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
maletor1 has quit [Ping timeout: 265 seconds]
<shmulik> in last time i really assisted in this group fore any ruby algorithm
Pumukel has joined #ruby
conta has joined #ruby
ropeney has quit [Quit: Textual IRC Client: www.textualapp.com]
A_Drone has quit [Remote host closed the connection]
A_Drone has joined #ruby
cyphase has quit [Ping timeout: 272 seconds]
TreyG has quit [Ping timeout: 248 seconds]
blackmes1 has quit [Ping timeout: 244 seconds]
biberu has quit [Read error: Connection reset by peer]
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
TheBrayn has quit [Quit: WeeChat 1.5]
cyphase has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
last_staff has quit [Quit: last_staff]
pwnd_nsfw` has joined #ruby
axsuul has joined #ruby
last_staff has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
biberu has joined #ruby
jphase has quit [Remote host closed the connection]
pawnbox has joined #ruby
p0p0pr37_ has joined #ruby
mim1k_ has joined #ruby
blaxter has joined #ruby
ianconnolly has quit [Ping timeout: 244 seconds]
Guest83809 has quit [Excess Flood]
p0p0pr37 has quit [Ping timeout: 244 seconds]
p0p0pr37_ is now known as p0p0pr37
Pumukel has quit [Ping timeout: 265 seconds]
ianconnolly has joined #ruby
mim1k has quit [Ping timeout: 244 seconds]
giraffe has joined #ruby
giraffe has quit [Max SendQ exceeded]
jaiks has quit [Remote host closed the connection]
jaruga___ has joined #ruby
jaruga___ is now known as jaruga_____
weckl has joined #ruby
rafadc has joined #ruby
conta has quit [Ping timeout: 244 seconds]
A_Drone has quit [Read error: Connection reset by peer]
johnmccabe has joined #ruby
Evan- has quit [Ping timeout: 244 seconds]
yaewa has joined #ruby
Guest98158 has joined #ruby
moei has quit [Ping timeout: 244 seconds]
aries_liuxueyang has quit [Ping timeout: 248 seconds]
ArielMT has quit [Ping timeout: 244 seconds]
marens has quit [Ping timeout: 244 seconds]
marens_ has joined #ruby
cyphase has quit [Ping timeout: 248 seconds]
init7 has quit [Ping timeout: 240 seconds]
marr has joined #ruby
blackmes1 has joined #ruby
wingwalker has quit [Ping timeout: 272 seconds]
harfangk has quit [Ping timeout: 244 seconds]
`derpy has quit [Ping timeout: 244 seconds]
oddmunds has quit [Ping timeout: 244 seconds]
`derpy has joined #ruby
justinmcp_ has quit [Read error: Connection reset by peer]
Evan- has joined #ruby
Prira has quit [Ping timeout: 244 seconds]
Prira has joined #ruby
harfangk has joined #ruby
yeltzooo9 has quit [Ping timeout: 244 seconds]
wspider has quit [Ping timeout: 244 seconds]
ArielMT has joined #ruby
oddmunds has joined #ruby
yeltzooo has joined #ruby
justinmcp has joined #ruby
elenatanasoiu has joined #ruby
wspider has joined #ruby
aries_liuxueyang has joined #ruby
init7 has joined #ruby
Burgestrand has joined #ruby
habitullence has joined #ruby
habitullence has quit [Client Quit]
TreyG has joined #ruby
A_Drone has joined #ruby
cyphase has joined #ruby
conta has joined #ruby
eizua has quit [Quit: Leaving]
ghostlight has quit [Ping timeout: 250 seconds]
djbkd_ has joined #ruby
ctp has joined #ruby
habitullence has joined #ruby
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
olistik has joined #ruby
mim1k_ is now known as mim1k
pawnbox has quit [Remote host closed the connection]
ghostlight has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
chwbacca has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
ctp has quit [Client Quit]
Coldblackice has quit [Ping timeout: 260 seconds]
flying has joined #ruby
ctp has joined #ruby
jazzonmym11nd has quit [Ping timeout: 255 seconds]
Coldblackice has joined #ruby
jkeeney has quit [Ping timeout: 265 seconds]
wethu has quit [Quit: This computer has gone to sleep]
Coldblackice has quit [Max SendQ exceeded]
tomphp has joined #ruby
Coldblackice has joined #ruby
ctp has quit [Ping timeout: 240 seconds]
yaewa has quit [Quit: Leaving...]
strigonLeader has quit [Ping timeout: 272 seconds]
wethu has joined #ruby
moei has joined #ruby
spectrum has joined #ruby
Coldblackice has quit []
the_drow has joined #ruby
sarkis has joined #ruby
saneax-_-|AFK is now known as saneax
wisn has joined #ruby
djbkd_ has quit [Remote host closed the connection]
maletor1 has joined #ruby
wethu has quit [Quit: This computer has gone to sleep]
wethu has joined #ruby
sarkis has quit [Ping timeout: 265 seconds]
Wolland has joined #ruby
ponga has joined #ruby
maletor1 has quit [Ping timeout: 248 seconds]
evidex has joined #ruby
nofxx has quit [Ping timeout: 264 seconds]
conta has quit [Read error: Connection reset by peer]
ctp has joined #ruby
ur5us has joined #ruby
pawnbox has joined #ruby
A_Drone has quit [Remote host closed the connection]
TheHodge has joined #ruby
pawnbox has quit [Ping timeout: 244 seconds]
harfangk_ has joined #ruby
gokulnath_ has joined #ruby
blackgoat has joined #ruby
harfangk has quit [Ping timeout: 248 seconds]
olistik has quit [Remote host closed the connection]
gokulnath_ is now known as gokulnat
gokulnat is now known as gokulnath
lifeai has joined #ruby
harfangk_ has quit [Quit: Textual IRC Client: www.textualapp.com]
bsrd has quit [Ping timeout: 240 seconds]
blackgoat has quit [Ping timeout: 240 seconds]
wethu has quit [Quit: This computer has gone to sleep]
ferr has joined #ruby
vasilakisfil has joined #ruby
elenatanasoiu has quit [Ping timeout: 240 seconds]
<vasilakisfil> is there any point doing this? ['a', 'b', 'c'].map(&:freeze).freeze instead of just ['a', 'b', 'c'].freeze ?
biberu has quit []
nankyokusei has joined #ruby
AlexRussia_ has quit [Ping timeout: 265 seconds]
<apeiros> >> x = ['a', 'b', 'c'].freeze; x.first.upcase!; x # vasilakisfil
<ruby[bot]> apeiros: # => ["A", "b", "c"] (https://eval.in/644514)
mim1k has quit [Read error: Connection reset by peer]
johnmccabe has joined #ruby
mim1k has joined #ruby
<vasilakisfil> ok so you are suggesting that there is a performance gain given tht the second one does not freeze the internals
nankyokusei has quit [Ping timeout: 244 seconds]
<apeiros> I have not the faintest idea from what you read this suggestion.
<vasilakisfil> hmm then what the code snippet you pasted suggests ?
<vasilakisfil> that the items inside the array are not frozen, right ?
<apeiros> correct
<vasilakisfil> less strings frozen more memory allocation, right (let's say that we deal with longer strings because I think strings like 'a' and 'abc' are highly optimized already)
<vasilakisfil> right ?
<apeiros> not necessarily
<vasilakisfil> ok
<vasilakisfil> so the only point of freezing strings is for the sake of less error-prone code?
jazzonmym11nd has joined #ruby
<apeiros> I can't infer intention from that snippet. reducing potential for errors would be one possible reason to freeze strings.
<apeiros> performance can be another.
mistermocha has joined #ruby
<vasilakisfil> there was no particular intention from that snipper, it was an example basically asking if there is any point (regarding performance) of doing that
chkm8 has quit [Ping timeout: 265 seconds]
Bounga has joined #ruby
tonini has joined #ruby
nargin has joined #ruby
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kedare has joined #ruby
elenatanasoiu has joined #ruby
<dminuoso> vasilakisfil: What is your question?
<dminuoso> vasilakisfil: Are you asking what the advantage of freezing is?
<dminuoso> Or is this about Symbol#to_proc?
jazzonmym11nd has quit [Ping timeout: 240 seconds]
bsrd has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
<apeiros> vasilakisfil: I'll answer differently. your question "is there any point in doing A instead of B" - "yes, there are points."
<nargin> Hi! As far as I understand, in ruby I can do variable substitution in strings using the #{} syntax, such as: "the value of var is #{var}". What I observe is this: if 'var' is not defined, it is replaced by an empty string "". Is there a way to enforce a failure in such a case?
<vasilakisfil> is there any point doing this? ['a', 'b', 'c'].map(&:freeze).freeze instead of just ['a', 'b', 'c'].freeze ? (talking about performance) <--- that's my question:
pawnbox has joined #ruby
<apeiros> nargin: if it is not defined, you'll get an exception
toretore has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
<dminuoso> nargin: if var is not defined, you get an error.
<dminuoso> >> "#{foo}"
<vasilakisfil> if there is any point freezing every array element instead of just the array
<ruby[bot]> dminuoso: # => undefined local variable or method `foo' for main:Object ...check link for more (https://eval.in/644528)
<apeiros> nargin: which means that your variable is defined
<apeiros> vasilakisfil: see above.
<apeiros> vasilakisfil: I'll answer differently. your question "is there any point in doing A instead of B" - "yes, there are points."
<nargin> oh, I it's a special case: it's a variable with an '@' in front
axsuul has joined #ruby
<dminuoso> vasilakisfil: Whatever you freeze becomes immutable. In case of array the elements are still mutable.
<dminuoso> vasilakisfil: So if you freeze the array, you can still modify the elements. But if your intention is that the elements must be immutable - then you would freeze the elements.
<apeiros> nargin: aha. you can do #{@var || raise("danger zone!")}
<dminuoso> And don't do that.
<apeiros> note that this will also raise if @var is set to nil or false, not just when it wasn't previously defined.
<dminuoso> String interpolation with conditions and raising exceptions is not pretty.
AlexRussia_ has joined #ruby
<apeiros> and on yet another note: not knowing whether a variable is defined at a certain point in your code is a very serious code smell. initialize your variables properly.
<apeiros> I'd concur with dminuoso. do your assertions before the interpolation.
ta__ has quit [Ping timeout: 244 seconds]
stamina has joined #ruby
jsrn_ has joined #ruby
<nargin> I need to maintain some other code, not my choice :-) Let me give you some more context, maybe that helps: a have a ruby commandline tool that sets some variable and then replaces them in a template to generate new files. It's a thor class that calls the 'template' function. Now I want to refactor this and find all the errors between the script and the templates.
ixti has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
<nargin> so I was hoping I can run the (rather big) script and somehow get a flag so it fails on all the problems that exist in the current version with referencing undefined / replaced variables.
workmad3 has joined #ruby
ta_ has joined #ruby
<dminuoso> nargin: local variables cant be referenced when undefined, as this will trigger a NameErroe exception.
p0p0pr37_ has joined #ruby
<dminuoso> nargin: As for instance variables, you can use -w/-W to add some additional debugging, which will catch references to uninitialized instance variables.
p0p0pr37 has quit [Ping timeout: 276 seconds]
p0p0pr37_ is now known as p0p0pr37
unshadow has joined #ruby
maletor1 has joined #ruby
blackmes1 has quit [Ping timeout: 244 seconds]
Bounga has quit [Remote host closed the connection]
Tempesta_ has joined #ruby
Bounga has joined #ruby
p0p0pr37_ has joined #ruby
pawnbox has quit [Remote host closed the connection]
_sfiguser has quit [Ping timeout: 265 seconds]
symm- has quit [Ping timeout: 276 seconds]
giz|work has joined #ruby
pawnbox has joined #ruby
Tempesta has quit [Ping timeout: 248 seconds]
p0p0pr37 has quit [Ping timeout: 250 seconds]
p0p0pr37_ is now known as p0p0pr37
<nargin> dminuoso, thanks. -w is exaclty what I was looking for
maletor1 has quit [Ping timeout: 244 seconds]
<dminuoso> apeiros: Though technically I told a lie.. :D
wethu has joined #ruby
marens_ is now known as marens
<dminuoso> >> puts binding.local_variable_get(:foo); foo = 1;
<ruby[bot]> dminuoso: # => ...check link for more (https://eval.in/644545)
<dminuoso> But someone writing such code should be shot.
A_Drone has joined #ruby
apeiros has quit [Ping timeout: 244 seconds]
init7 has quit [Ping timeout: 250 seconds]
ferr has quit [Ping timeout: 244 seconds]
priodev has quit [Ping timeout: 244 seconds]
seggy has quit [Ping timeout: 244 seconds]
hirvi has quit [Ping timeout: 244 seconds]
vifino has quit [Ping timeout: 240 seconds]
hirvi has joined #ruby
tristanp has quit [Read error: Connection reset by peer]
unshadow has quit [Ping timeout: 244 seconds]
gingray has quit [Ping timeout: 244 seconds]
gingray has joined #ruby
tristanp has joined #ruby
wisn has quit [Ping timeout: 244 seconds]
apeiros has joined #ruby
ferr has joined #ruby
seggy has joined #ruby
aries_liuxueyang has quit [Ping timeout: 244 seconds]
unshadow has joined #ruby
vifino has joined #ruby
<nargin> I agree :-)
init7 has joined #ruby
aries_liuxueyang has joined #ruby
priodev has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
griff has joined #ruby
LambdaSix has quit [Ping timeout: 244 seconds]
biberu has joined #ruby
Pumukel has joined #ruby
ocbtec has joined #ruby
loechel has joined #ruby
astrobunny has quit [Remote host closed the connection]
blackmes1 has joined #ruby
blaxter has quit [Quit: foo]
Pumukel has quit [Ping timeout: 265 seconds]
wisn has joined #ruby
loechel has quit [Ping timeout: 265 seconds]
nargin has quit [Quit: Leaving]
Pumukel has joined #ruby
wethu has quit [Quit: This computer has gone to sleep]
ixti has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
ur5us has quit [Remote host closed the connection]
Pumukel has joined #ruby
LambdaSix has joined #ruby
alcipir has joined #ruby
sai_ has joined #ruby
Bounga has quit [Ping timeout: 250 seconds]
Immune has quit [Ping timeout: 260 seconds]
DoubleMalt has quit [Ping timeout: 265 seconds]
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
akira616 has quit [Quit: Leaving]
ctp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pumukel has quit [Ping timeout: 265 seconds]
jazzonmym11nd has joined #ruby
ctp has joined #ruby
Pumukel has joined #ruby
jazzonmym11nd has quit [Ping timeout: 276 seconds]
ixti has quit [Ping timeout: 260 seconds]
Pumukel has quit [Ping timeout: 265 seconds]
salut has joined #ruby
alcipir is now known as cabs
shortCircuit__ has joined #ruby
<shortCircuit__> halo
A_Drone has quit [Remote host closed the connection]
Pumukel has joined #ruby
blackmes1 has quit [Ping timeout: 260 seconds]
<salut> hi
<shortCircuit__> I have a question. in nodejs to parse a csv .. I usually read the file using stream's and then a csv parser middleware . in ruby is there some way to do this ?
<shortCircuit__> and is it necessary
yardenbar has joined #ruby
<dminuoso> So when you say nodejs, why are you asking in #ruby ?
<dminuoso> Just curiousity..
<shortCircuit__> no . I am asking if we can do that in ruby :P
<dminuoso> Ah.
<shortCircuit__> files maybe 10 12 mb or 2-5 mb .. so I thought it would be useful to use streams ..
<dminuoso> shortCircuit__: Our CSV library in our library handles files for you already.
spectrum has quit [Quit: Oh Shidd]
<dminuoso> shortCircuit__: But sure, you can also pass it strings.
wethu has joined #ruby
<shortCircuit__> I know ruby has csv parser . so does it handle streaming by itself .. also is it necessary to use streaming for large csv files
dreamyspell has joined #ruby
sarkis has joined #ruby
<dminuoso> shortCircuit__: You can look how it's implemented yourself.
Pumukel has quit [Ping timeout: 265 seconds]
<xpt> s/necessary/advisable/
dreamyspell has quit [Client Quit]
tobiasvl has quit [Ping timeout: 250 seconds]
BubonicPestilenc has joined #ruby
<BubonicPestilenc> hey all
Pumukel has joined #ruby
<BubonicPestilenc> are there any way to tell active record, that default value for field is ""
<BubonicPestilenc> don't want ot make fields "null'ed"
<BubonicPestilenc> (varchar fields)
<dminuoso> ?rails BubonicPestilenc
<ruby[bot]> BubonicPestilenc: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
A_Drone has joined #ruby
<BubonicPestilenc> wrong, i'm using activerecord :D
<BubonicPestilenc> w/o rails :D
<BubonicPestilenc> btw, ty
<shortCircuit__> using a setter getter method ?
astrobunny has joined #ruby
<BubonicPestilenc> ooh, i've got tons of text- fields :(
gokulnath_ has joined #ruby
maletor1 has joined #ruby
sarkis has quit [Ping timeout: 240 seconds]
conta has joined #ruby
tlaxkit has joined #ruby
Tempesta has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Changing host]
<shortCircuit__> use meta programming maybe, get the list of rows and then define method .. I mean normally in migration at database level you should put a default value
<dminuoso> shortCircuit__: But it seems like the ruby CSV library uses IO streams, basically using IO#gets all over the place.
<salut> normalize_attribute Gem ?
<dminuoso> shortCircuit__: So just pass it an IO object, and it will work efficiently.
Pumukel has quit [Ping timeout: 265 seconds]
A_Drone has quit [Remote host closed the connection]
Moosashi has joined #ruby
gokulnath has quit [Ping timeout: 240 seconds]
<BubonicPestilenc> funny thing
<BubonicPestilenc> that it feels like sql-mode + strict, but i have disabled it
<shortCircuit__> dminuoso .. oh nice.. how did you find that ? . I have done some rails and now I hate myself for not doing ruby first
submitnine has quit [Ping timeout: 248 seconds]
Pumukel has joined #ruby
<BubonicPestilenc> ./opt/local/lib/ruby2.3/gems/2.3.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:in `_query': Mysql2::Error: Field 'inscription' doesn't have a default value: INSERT INTO `hmdb` (`title`, `created_at`) VALUES ('test', '2016-09-19 10:40:56') (ActiveRecord::StatementInvalid)
Tempesta_ has quit [Ping timeout: 265 seconds]
johnDoe111 has joined #ruby
<dminuoso> shortCircuit__: I just looked up the implementation of csv.rb, browsed a bit - and then look at what IO#gets does. I noticed it was just calling rb_io_getsline, and I traced that to the implementation in io.c
craigp_ has quit [Ping timeout: 248 seconds]
<dminuoso> and there I just checked what that function doe.
<dminuoso> does.
<shortCircuit__> ao I see
maletor1 has quit [Ping timeout: 264 seconds]
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<shortCircuit__> so basically do an File.read that opens an io . then pass the |file_io| to CSV.new(file_io, ...)
<shortCircuit__> but yeah foreach sounds easier
<dminuoso> shortCircuit__: No. Not File.read
<dminuoso> shortCircuit__: Just File.open
<shortCircuit__> oh ok
<dminuoso> shortCircuit__: File.read will actually read the entire content of the File immediately.
submitnine has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Bounga has joined #ruby
jshjsh has joined #ruby
JoshS has quit [Disconnected by services]
jshjsh is now known as JoshS
johnDoe111 has quit [Remote host closed the connection]
a7d7p has joined #ruby
eizua has joined #ruby
blackgoat has joined #ruby
Burgestrand has joined #ruby
axsuul has quit [Read error: Connection reset by peer]
BubonicPestilenc has quit [Quit: BubonicPestilenc]
A_Drone has joined #ruby
johnDoe111 has joined #ruby
rodfersou has joined #ruby
hanmac has quit [Ping timeout: 250 seconds]
johnDoe111 has quit [Remote host closed the connection]
TheHodge has quit [Quit: Connection closed for inactivity]
johnDoe111 has joined #ruby
tlaxkit has quit [Read error: Connection reset by peer]
rodfersou has quit [Ping timeout: 255 seconds]
tlaxkit has joined #ruby
tlaxkit has quit [Remote host closed the connection]
conta has quit [Ping timeout: 248 seconds]
garymeade has joined #ruby
conta has joined #ruby
garymeade has quit [Client Quit]
twe4ked has quit [Ping timeout: 250 seconds]
DoubleMalt has joined #ruby
garymeade has joined #ruby
nankyokusei has joined #ruby
garymeade has quit [Client Quit]
<shortCircuit__> hi
eregon has quit [Ping timeout: 244 seconds]
twe4ked has joined #ruby
Pumukel has joined #ruby
<wisn> hello
astrobunny has quit [Remote host closed the connection]
<shortCircuit__> https://gist.github.com/argentum47/ba89b2a06c35069b9003df0d94e06725 I made this gist .. the thing is, I want to skip the first 13 lines because you can see the csv is sortof fucked by that over part .. The first approach kindof takes 20mb . for a 2mb file where as the foreach takes only 2 mb
<shortCircuit__> is there a way to use the foreach and yet drop the first 13
eregon has joined #ruby
hanmac has joined #ruby
nankyokusei has quit [Ping timeout: 265 seconds]
GodFather has joined #ruby
aidalgol has quit [Quit: zZzZZzzzz]
LambdaSix has quit [Ping timeout: 240 seconds]
<dminuoso> shortCircuit__: What do you mean by "the first approach kindof takes 20mb" ?
<matthewd> shortCircuit__: CSV.foreach('./data/test_data.csv').lazy.drop(13).each do |row|
<matthewd> The better move would probably be to pass CSV an IO that's already been advanced past the first block though, IMO
gfvcastro has joined #ruby
gingray has quit [Ping timeout: 244 seconds]
jazzonmym11nd has joined #ruby
mistermocha has joined #ruby
arnonhongklay has quit [Remote host closed the connection]
A_Drone has quit [Remote host closed the connection]
johnDoe111^ has joined #ruby
jazzonmym11nd has quit [Ping timeout: 255 seconds]
mistermocha has quit [Ping timeout: 248 seconds]
elenatanasoiu has quit [Quit: WeeChat 1.5]
nuck has quit [Ping timeout: 240 seconds]
elenatanasoiu has joined #ruby
craigp_ has joined #ruby
conta has quit [Read error: Connection reset by peer]
AlexRussia_ has quit [Ping timeout: 260 seconds]
johnDoe111 has quit [Ping timeout: 272 seconds]
shortCircuit__ has quit [Ping timeout: 240 seconds]
blackmes1 has joined #ruby
nuck has joined #ruby
nuck is now known as Guest92264
eizua has quit [Quit: Leaving]
LambdaSix has joined #ruby
conta has joined #ruby
JeanCarloMachado has joined #ruby
Sashimi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
griff has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
blackmes1 has quit [Ping timeout: 248 seconds]
griff has joined #ruby
johnDoe111^ has quit [Remote host closed the connection]
johnDoe111 has joined #ruby
johnDoe111 has quit [Remote host closed the connection]
nankyokusei has joined #ruby
johnDoe111 has joined #ruby
johnDoe111 has quit [Remote host closed the connection]
unshadow has quit [Quit: leaving]
johnDoe111 has joined #ruby
gigetoo has quit [Ping timeout: 260 seconds]
spectrum has joined #ruby
gigetoo has joined #ruby
spectrum has quit [Client Quit]
nankyokusei has quit [Client Quit]
maletor1 has joined #ruby
rodfersou has joined #ruby
Pumukel has quit [Remote host closed the connection]
giz|work has quit [Ping timeout: 264 seconds]
maletor1 has quit [Ping timeout: 248 seconds]
Sashimi has joined #ruby
AlexRussia has joined #ruby
jshjsh has joined #ruby
JoshS has quit [Disconnected by services]
jshjsh is now known as JoshS
conta has quit [Read error: Connection reset by peer]
A124 has quit [Ping timeout: 265 seconds]
zipace has joined #ruby
giz|work has joined #ruby
conta has joined #ruby
A_Drone has joined #ruby
A_Drone has quit [Remote host closed the connection]
icey has joined #ruby
Pumukel has joined #ruby
tectonic has joined #ruby
tvl has joined #ruby
JakFrist has joined #ruby
tvl is now known as tobiasvl
Robtop__ has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
johnDoe111 has quit [Remote host closed the connection]
Pumukel has joined #ruby
Moosashi has quit [Quit: Moosashi]
nadir has joined #ruby
Moosashi has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
giz|work has quit [Ping timeout: 255 seconds]
Pumukel has quit [Ping timeout: 265 seconds]
trifling-jest has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
pawnbox has quit [Remote host closed the connection]
trifling-jest has quit [Client Quit]
shortCircuit__ has joined #ruby
trifling-jest has joined #ruby
<shortCircuit__> sorry guys got tied up in a standup meetiing
ledestin has joined #ruby
Silthias has joined #ruby
dviola has joined #ruby
<shortCircuit__> matthewd .. how would one go past the first block?
dviola has quit [Changing host]
dviola has joined #ruby
<matthewd> shortCircuit__: See the comment I added
<shortCircuit__> ok
rafadc has quit [Ping timeout: 240 seconds]
<shortCircuit__> I see
snood1205 has quit [Read error: Connection reset by peer]
Silthias1 has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Silthias has quit [Ping timeout: 255 seconds]
snood1205 has joined #ruby
vuoto has joined #ruby
ARCADIVS has quit [Quit: ARCADIVS]
conta has quit [Ping timeout: 260 seconds]
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
JeanCarloMachado has quit [Quit: leaving]
JeanCarloMachado has joined #ruby
pwnd_nsfw` has joined #ruby
trifling-jest has quit []
vuoto has quit [Remote host closed the connection]
vuoto has joined #ruby
Robtop__ has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Client Quit]
johnmilton has joined #ruby
<shortCircuit__> the code is stuck when I ran matthewd
JeanCarloMachado has joined #ruby
giz|work has joined #ruby
johnmilton has quit [Client Quit]
conta has joined #ruby
LoneHerm_ has joined #ruby
cabs has quit [Ping timeout: 272 seconds]
johnmilton has joined #ruby
aryaching has joined #ruby
<matthewd> shortCircuit__: Sounds like there isn't a "\n" line, then
LoneHerm_ has quit [Ping timeout: 240 seconds]
tectonic has quit []
<matthewd> shortCircuit__: Add `io.eof? || ` to the until condition, so it stops instead of getting stuck... but then you'll need to work out the right condition to match the real separator line
<shortCircuit__> ah I see
<shortCircuit__> ok
blackmes1 has joined #ruby
johnmilton has quit [Ping timeout: 248 seconds]
the_drow has joined #ruby
johnmilton has joined #ruby
<shortCircuit__> why is it not printing the row .. if I do CSV.foreach().lazy.drop or adding an eof?
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
alfiemax has quit [Ping timeout: 272 seconds]
sai_ has quit [Remote host closed the connection]
d0nn1e has quit [Ping timeout: 260 seconds]
<matthewd> With lazy you'd need a .force on the end
arnonhongklay has joined #ruby
<matthewd> With my version, it's reaching EOF in the first loop, because it never finds a "\n"
<shortCircuit__> oh had to do .each
d0nn1e has joined #ruby
Pumukel has joined #ruby
<matthewd> shortCircuit__: Are you using the test file from the gist, or something else?
<matthewd> shortCircuit__: My version worked for me, on that file
<shortCircuit__> it is the test file .. just that there is a lot of https://gist.github.com/argentum47/ba89b2a06c35069b9003df0d94e06725#file-test_data-csv-L18 .. its 2.1mb
arnonhongklay has quit [Remote host closed the connection]
arnonhongklay has joined #ruby
blackmes1 has quit [Ping timeout: 265 seconds]
<shortCircuit__> this is strange CSV.foreach('./data/test_data.csv').lazy.drop(13).each this doesn't drop the first 13
<shortCircuit__> matthewd hm, checking
snockerton has joined #ruby
sarkis has joined #ruby
jazzonmym11nd has joined #ruby
Sashimi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<shortCircuit__> huh, if I copy paste the data from the gist, then your code works for me as well
chouhoulis has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
<shortCircuit__> but with the original file I have, it doesn't . I should log io.gets and see what is the value
sai_ has joined #ruby
<matthewd> The real file might have a "\r\n" instead, maybe?
akashdeep_ has joined #ruby
Pumukel has joined #ruby
<akashdeep_> hi
harfangk has joined #ruby
<shortCircuit__> yeah , the first line says ""Report,Reviews\r\n" and then it stops there
sarkis has quit [Ping timeout: 244 seconds]
maletor1 has joined #ruby
chouhoul_ has joined #ruby
jazzonmym11nd has quit [Ping timeout: 240 seconds]
<shortCircuit__> I changed to \r\n and it works
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shortCircuit__> matthewd but how ?
<shortCircuit__> oh ok I see.
p0p0pr37_ has joined #ruby
chouhoulis has quit [Ping timeout: 265 seconds]
<shortCircuit__> matthewd, so until it encounters the first "\r\n" only, it returns nil and then after that parse the csv as usual
<shortCircuit__> nice
Pumukel has quit [Ping timeout: 248 seconds]
giz|work has quit [Ping timeout: 272 seconds]
Pumukel has joined #ruby
p0p0pr37 has quit [Ping timeout: 244 seconds]
p0p0pr37_ is now known as p0p0pr37
maletor1 has quit [Ping timeout: 244 seconds]
abhinav has joined #ruby
<abhinav> hi
<abhinav> how can i get var j = json_returned_by_this_url.com ??
<abhinav> in irb.
axsuul has joined #ruby
blackwind_123 has quit [Ping timeout: 255 seconds]
Pumukel has quit [Ping timeout: 248 seconds]
blackgoat has quit [Quit: WeeChat 1.5]
last_staff has quit [Quit: run last_staff, run!]
bsrd has quit [Ping timeout: 248 seconds]
ChiefAlexander has joined #ruby
f4cl3y has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
<shortCircuit__> twilio .. sounds very pitbull
Moosashi has quit [Quit: Moosashi]
gnufied has joined #ruby
arnonhongklay has quit [Remote host closed the connection]
<harfangk> pitbull?
arnonhongklay has joined #ruby
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
conta1 has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta1 is now known as conta
aegis3121 has joined #ruby
cdg has joined #ruby
bmurt has joined #ruby
vqrs has quit [Ping timeout: 265 seconds]
chouhoul_ has quit [Remote host closed the connection]
<abhinav> Johne: thanks.
chouhoulis has joined #ruby
hutch34 has joined #ruby
dionysus69 has joined #ruby
jshjsh has joined #ruby
vqrs has joined #ruby
<Johne> np, im doing sort of the same thing
<Johne> httparty is awesome
axsuul has joined #ruby
jazzonmym11nd has joined #ruby
conta1 has joined #ruby
JoshS has quit [Ping timeout: 240 seconds]
conta has quit [Read error: Connection reset by peer]
conta1 is now known as conta
pawnbox has joined #ruby
Pumukel has joined #ruby
lifted has joined #ruby
nankyokusei has joined #ruby
<shortCircuit__> justin biber is a male thing !!!
Hyuk has joined #ruby
<shortCircuit__> i mean the name had a male touch to it . I was just listening in youtube and then I switched the tab and I saw the video and a boy singing
<xpt> /join #ruby-offtopic ?
JakFrist has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
<Johne> lol
wisn has quit [Quit: Leaving]
nankyokusei has quit [Ping timeout: 265 seconds]
p0p0pr37_ has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
chihhsin has quit [Ping timeout: 265 seconds]
stamina has quit [Quit: WeeChat 1.5]
xdakdr has joined #ruby
aryaching has joined #ruby
arnonhongklay has quit [Remote host closed the connection]
rafadc has joined #ruby
p0p0pr37 has quit [Ping timeout: 265 seconds]
p0p0pr37_ is now known as p0p0pr37
arnonhongklay has joined #ruby
jphase has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
Pumukel has joined #ruby
weemsledeux has joined #ruby
aegis3121 has quit [Ping timeout: 248 seconds]
ctp has quit [Read error: No route to host]
mistermocha has joined #ruby
akashdeep_ has quit [Quit: Konversation terminated!]
LoneHermit has joined #ruby
bsrd has joined #ruby
Pumukel has quit [Ping timeout: 265 seconds]
aegis3121 has joined #ruby
<Johne> I'm not doing something right with vars or puts in this each https://gist.github.com/procdaddy/b2f8aa0047d2ae8a145221051dd86c7a output error is at the bottom.
Zamyatin has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
JakFrist has quit [Quit: Textual IRC Client: www.textualapp.com]
shinnya has quit [Ping timeout: 244 seconds]
count has left #ruby [#ruby]
<shortCircuit__> when inserting data from csv stream, I would generally run a pgclient.execute "INSERT ..." and then open the connection. so that at first it pools and then when I open the connection then it batches the data
<shortCircuit__> and then close the connection
ta_ has quit [Remote host closed the connection]
<shortCircuit__> with events this was easy .. how to design in ruby :P
LoneHermit has quit [Ping timeout: 255 seconds]
ramortegui has joined #ruby
nando293921 has joined #ruby
RedNifre has joined #ruby
vasilakisfil has quit [Read error: Connection reset by peer]
vasilakisfil_ has joined #ruby
malconis has joined #ruby
RedNifre_ has quit [Ping timeout: 255 seconds]
ta_ has joined #ruby
arnonhon_ has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
ebraga has joined #ruby
arnonhongklay has quit [Read error: Connection reset by peer]
[k- has joined #ruby
blaxter has joined #ruby
pragmaticus has joined #ruby
conta has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
lxsameer has quit [Quit: WeeChat 1.5]
nankyokusei has quit [Remote host closed the connection]
araujo_ has joined #ruby
hotpanca_ has quit [Remote host closed the connection]
hotpancakes has joined #ruby
a7d7p has quit [Quit: a7d7p]
rafadc has quit [Remote host closed the connection]
conta has joined #ruby
pavshn has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
araujo_ has quit [Max SendQ exceeded]
rafadc has joined #ruby
maletor1 has joined #ruby
araujo_ has joined #ruby
ebraga has quit [Ping timeout: 265 seconds]
araujo__ has quit [Ping timeout: 265 seconds]
ebraga has joined #ruby
maletor1 has quit [Ping timeout: 248 seconds]
gokulnath_ has quit [Ping timeout: 276 seconds]
rafadc has quit [Remote host closed the connection]
RedNifre has quit [Ping timeout: 255 seconds]
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
rafadc has joined #ruby
Robtop__ has joined #ruby
RedNifre has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rafadc has quit [Remote host closed the connection]
rafadc has joined #ruby
sai_ has quit [Remote host closed the connection]
wisn has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 250 seconds]
bmurt has joined #ruby
eljimmy has joined #ruby
wugy has quit []
anisha has quit [Quit: This computer has gone to sleep]
wethu has quit [Quit: This computer has gone to sleep]
wisn has quit [Client Quit]
AzureStigma has joined #ruby
wisn has joined #ruby
<shortCircuit__> https://gist.github.com/argentum47/ba89b2a06c35069b9003df0d94e06725#file-config-rb-L5 config/config.rb:6:in `get': undefined local variable or method `downcase' for Config:Class (NameError)
tdy has quit [Ping timeout: 244 seconds]
chwbacca has joined #ruby
arnonhon_ has quit [Ping timeout: 265 seconds]
<shortCircuit__> oh shi
<shortCircuit__> t
<shortCircuit__> nvm
chihhsin has joined #ruby
arnonhongklay has joined #ruby
zacts has joined #ruby
jblack has quit [Ping timeout: 250 seconds]
a7d7p has joined #ruby
bsrd has quit [Ping timeout: 265 seconds]
anisha has joined #ruby
stringer has joined #ruby
abhinav has quit [Quit: leaving]
sai_ has joined #ruby
anisha has quit [Client Quit]
ebraga has quit [Ping timeout: 248 seconds]
chihhsin_ has joined #ruby
<stringer> Hi, how to edit cookie using "open-uri" lib ? I need to access source of site which shows its conetent only when cookie "CookiesAccepted" is set to 1 (default 0)
chihhsin has quit [Ping timeout: 248 seconds]
<stringer> anybody >
<stringer> ?
tdy has joined #ruby
wombawomba has joined #ruby
Jardayn has joined #ruby
grh has quit [Ping timeout: 265 seconds]
ixti has joined #ruby
karmatr0n has joined #ruby
chihhsin_ has quit [Quit: leaving]
jkeeney has joined #ruby
chihhsin has joined #ruby
jrafanie has joined #ruby
weckl has quit [Ping timeout: 255 seconds]
ebraga has joined #ruby
f4cl3y has quit [Ping timeout: 272 seconds]
Silthias1 has left #ruby [#ruby]
Silthias has joined #ruby
jkeeney has quit [Client Quit]
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
<toretore> stringer: don't use open-uri
nando293921 has quit [Ping timeout: 265 seconds]
<stringer> toretore: so what else ?
<stringer> mechnize ?
dionysus69 has quit [Ping timeout: 240 seconds]
<toretore> they all suck in one way or another, just use net/http
wingwalker has joined #ruby
<stringer> can you provide some link with guide ?
hotpancakes has quit [Remote host closed the connection]
agent_white has joined #ruby
craigp_ has quit [Ping timeout: 240 seconds]
kobain has joined #ruby
Chelsea_ has joined #ruby
pwnd_nsfw` has joined #ruby
wisn has quit [Quit: Leaving]
axsuul has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
f4cl3y has joined #ruby
A124 has joined #ruby
mistermocha has joined #ruby
domgetter has joined #ruby
Robtop__ has quit [Ping timeout: 250 seconds]
dminuoso has quit [Ping timeout: 240 seconds]
weckl has joined #ruby
Fernando-Basso has joined #ruby
weemsledeux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
axsuul has joined #ruby
a7d7p has quit [Quit: a7d7p]
mistermocha has quit [Ping timeout: 260 seconds]
jespada has joined #ruby
dionysus69 has joined #ruby
<agent_white> Mornin!
axsuul has quit [Client Quit]
a7d7p has joined #ruby
hotpancakes has joined #ruby
_sfiguser has joined #ruby
ziyadb has joined #ruby
jblack has joined #ruby
AzureStigma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jtzero1 has joined #ruby
robfrawl1y has quit [Ping timeout: 244 seconds]
nando293921 has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
dminuoso has joined #ruby
submitnine has quit []
JakFrist has joined #ruby
JakFrist has quit [Client Quit]
Mentally_Ill is now known as hammond
sarkis has joined #ruby
weemsledeux has joined #ruby
futilegames has joined #ruby
rippa has joined #ruby
skweek has joined #ruby
GodFather has joined #ruby
soulisson has joined #ruby
shortCircuit__ has quit [Quit: Page closed]
<soulisson> Hi, let's say I defined a bunch of methods inside a module and I want to include them as class methods inside a class, how can I do this?
cabs has joined #ruby
sarkis has quit [Ping timeout: 244 seconds]
pavshn has joined #ruby
maletor1 has joined #ruby
Wolland has quit [Remote host closed the connection]
futilegames has quit [Ping timeout: 240 seconds]
aegis3121 has quit [Ping timeout: 272 seconds]
LemonJuice has joined #ruby
<domgetter> soulisson: You'll want to use "extend": https://gist.github.com/domgetter/69d2712a449a5498954f2b4901ff93bc
<soulisson> domgetter, ah ok, thanks
elenatanasoiu has quit [Ping timeout: 276 seconds]
<soulisson> domgetter, if I use include they are considered instance methods?
conta1 has joined #ruby
<domgetter> Of course, it will make every method in that module a class method. Yes, include tacks the methods on as instance methods
conta has quit [Ping timeout: 240 seconds]
conta1 is now known as conta
<soulisson> ok, thank you
gingray has joined #ruby
vasilakisfil__ has joined #ruby
vasilakisfil_ has quit [Quit: Konversation terminated!]
maletor1 has quit [Ping timeout: 255 seconds]
arnonhon_ has joined #ruby
arnonhongklay has quit [Ping timeout: 250 seconds]
sai_ has quit [Remote host closed the connection]
<apeiros> extend is basically include on the singleton_class
jespada has quit [Quit: WeeChat 1.5-dev]
JeanCarloMachado has quit [Quit: leaving]
conta1 has joined #ruby
stringer has quit [Quit: Lost terminal]
JeanCarloMachado has joined #ruby
conta has quit [Ping timeout: 248 seconds]
conta1 is now known as conta
ebraga has quit [Ping timeout: 265 seconds]
robfrawley has joined #ruby
robfrawley is now known as Guest60411
historypeats has joined #ruby
f4cl3y has quit [Ping timeout: 272 seconds]
wrkrcoop has joined #ruby
oncall-pokemon has joined #ruby
aegis3121 has joined #ruby
elenatanasoiu has joined #ruby
Gasher has joined #ruby
dminuoso has quit [Quit: Reconnecting]
dminuoso has joined #ruby
cajone has quit [Remote host closed the connection]
conta1 has joined #ruby
zipace has quit [Disconnected by services]
ziprar has joined #ruby
conta has quit [Read error: Connection reset by peer]
cajone has joined #ruby
mark_661 has joined #ruby
dminuoso has quit [Read error: Connection reset by peer]
f4cl3y has joined #ruby
dminuoso has joined #ruby
conta has joined #ruby
bjh13 has quit [Remote host closed the connection]
conta1 has quit [Read error: Connection reset by peer]
bjh13 has joined #ruby
cajone has quit [Remote host closed the connection]
mark_66 has quit [Ping timeout: 248 seconds]
JeanCarloMachado has quit [Ping timeout: 265 seconds]
fmcgeough has joined #ruby
chwbacca has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
aryaching has quit [Read error: Connection reset by peer]
cajone has joined #ruby
JeanCarloMachado has joined #ruby
conta has quit [Ping timeout: 248 seconds]
aryaching has joined #ruby
coolboy has joined #ruby
dminuoso has quit [Read error: Connection reset by peer]
dminuoso has joined #ruby
hotpancakes has quit [Remote host closed the connection]
grh has joined #ruby
etetz has joined #ruby
hotpancakes has joined #ruby
zacts has quit [Ping timeout: 255 seconds]
conta has joined #ruby
AzureStigma has joined #ruby
Burgestrand has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
historypeats has left #ruby [#ruby]
AzureStigma has quit [Client Quit]
hotpancakes has quit [Read error: Connection reset by peer]
nando293921 has quit [Ping timeout: 250 seconds]
saneax is now known as saneax-_-|AFK
conta has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
Oclair has joined #ruby
f4cl3y has quit [Read error: Connection reset by peer]
hotpancakes has joined #ruby
Pumukel has joined #ruby
polishdub has joined #ruby
SteenJobs has joined #ruby
joelwallis has joined #ruby
Oclair_ has quit [Ping timeout: 265 seconds]
vqrs has quit [Max SendQ exceeded]
craigp has joined #ruby
LuckyABA has joined #ruby
mistermocha has joined #ruby
dminuoso has quit [Read error: Connection reset by peer]
Pumukel has quit [Ping timeout: 265 seconds]
LuckyABA has quit [Client Quit]
vqrs has joined #ruby
evidex has quit [Ping timeout: 265 seconds]
skweek has quit [Ping timeout: 255 seconds]
wingwalker has quit [Ping timeout: 248 seconds]
pandaant has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
dionysus69 has quit [Ping timeout: 244 seconds]
wombawomba has quit [Quit: leaving]
cabs has quit [Ping timeout: 248 seconds]
craigp has quit [Ping timeout: 264 seconds]
arnonhon_ has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
Mrgoose has joined #ruby
<Mrgoose> anyone have a recommened book for learning ruby
hotpancakes has quit []
rafadc has quit [Ping timeout: 265 seconds]
Renich has joined #ruby
cabs has joined #ruby
f4cl3y has joined #ruby
a7d7p has quit [Quit: a7d7p]
pandaant has quit [Ping timeout: 265 seconds]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
Sashimi has joined #ruby
jose_leeto has joined #ruby
pandaant has joined #ruby
yardenbar has quit [Ping timeout: 265 seconds]
craigp has joined #ruby
aganov has quit [Remote host closed the connection]
nankyokusei has joined #ruby
teclator has quit [Remote host closed the connection]
cabs has quit [Ping timeout: 244 seconds]
conta has joined #ruby
dionysus69 has joined #ruby
ixti has quit [Quit: WeeChat 1.5]
ixti has joined #ruby
skweek has joined #ruby
ixti has quit [Client Quit]
maletor1 has joined #ruby
ropeney has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
ziprar has quit [Ping timeout: 244 seconds]
amclain has joined #ruby
<oddmunds> Mrgoose: i've heard good things about the pickaxe https://pragprog.com/book/ruby4/programming-ruby-1-9-2-0
jrafanie has quit [Quit: Textual IRC Client: www.textualapp.com]
<oddmunds> but might be outdated some
elifoster has joined #ruby
conta has quit [Ping timeout: 264 seconds]
<oddmunds> it's appearantly 0.3.1 behind the times
maletor1 has quit [Ping timeout: 250 seconds]
LemonJuice has quit [Remote host closed the connection]
dminuoso has joined #ruby
snood1205_ has joined #ruby
ixti has joined #ruby
craigp has quit [Ping timeout: 244 seconds]
snood1205 has quit [Ping timeout: 244 seconds]
jsrn_ has quit [Quit: Leaving]
marxarelli has joined #ruby
vF3hNGxc47h8 has joined #ruby
edwinvdgraaf has quit [Ping timeout: 244 seconds]
ChiefAlexander has quit [Read error: Connection reset by peer]
nogic has joined #ruby
minimalism has joined #ruby
ChiefAlexander has joined #ruby
tomphp has quit [Ping timeout: 265 seconds]
Xiti` has joined #ruby
jose_leeto has quit [Quit: Leaving.]
aegis3121 has quit [Ping timeout: 276 seconds]
SteenJobs has quit [Quit: SteenJobs]
symm- has joined #ruby
hazelux has joined #ruby
Xiti has quit [Ping timeout: 265 seconds]
kedare has quit [Quit: Leaving]
arnonhongklay has quit [Read error: Connection reset by peer]
sarkis has joined #ruby
arnonhongklay has joined #ruby
craigp has joined #ruby
chelly has joined #ruby
a7d7p has joined #ruby
vqrs has quit [Max SendQ exceeded]
[Butch] has joined #ruby
vqrs has joined #ruby
JoshS has joined #ruby
ych has joined #ruby
ebraga has joined #ruby
sdwrage has joined #ruby
jshjsh has quit [Ping timeout: 265 seconds]
gilfoyle_ has quit [Quit: .]
maletor1 has joined #ruby
jshjsh has joined #ruby
claudiuinberlin has quit []
pawnbox has quit [Remote host closed the connection]
maletor1 has quit [Client Quit]
Bounga has quit [Ping timeout: 244 seconds]
JoshS has quit [Ping timeout: 260 seconds]
conta has joined #ruby
gagrio has quit [Quit: Leaving...]
eljimmy has quit [Quit: This computer has gone to sleep]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
Pumukel has joined #ruby
Jardayn has quit [Disconnected by services]
AndrewIsHere has joined #ruby
dipnlik has joined #ruby
anisha has joined #ruby
jeffreylevesque_ has joined #ruby
<jeffreylevesque_> How do I declare local variables
<jeffreylevesque_> And how do I declare global variables
Eiam has joined #ruby
SteenJobs has joined #ruby
<dminuoso> jeffreylevesque_: you declare by definining.
<jeffreylevesque_> What's the syntax?
<dminuoso> ?books jeffreylevesque_
<ruby[bot]> jeffreylevesque_: You can find a list of recommended books at http://ruby-community.com/pages/links
<dminuoso> jeffreylevesque_: I recommend a resource under "Tutorials & Learning"
<dminuoso> Or a book.
reaVer has quit [Remote host closed the connection]
<dminuoso> And to fully answer your initial question, global variables on the other hand require no declaration.
<jeffreylevesque_> Ah ok
<jeffreylevesque_> I'm defining a custom puppet fact
<dminuoso> (This also applies to instance and class instance variables)
<jeffreylevesque_> So it's ruby
pawnbox has joined #ruby
<jeffreylevesque_> But I want to declare a local variable in the little script
<apeiros> you don't really declare variables in ruby. you just assign to them.
reaVer has joined #ruby
<apeiros> first assignment is the quasi-declaration
<dminuoso> jeffreylevesque_: By assigning to them you are declaring them implicitly.
<dminuoso> Though there are tricks to declare without assigning...
<apeiros> I'd say those tricks are more "defining" than "declaring"
<jeffreylevesque_> So if I says $something = another
<jeffreylevesque_> Something is local?
<apeiros> no
<apeiros> $vars are globals
andikr has quit [Remote host closed the connection]
<jeffreylevesque_> something = another?
<dminuoso> apeiros: careful though. Im really not sure how all of this plays into puppet
<apeiros> local_variable, @instance_variable, @@class_variable, Constant, $global
Ishido has quit [Ping timeout: 260 seconds]
wrkrcoop has quit [Quit: wrkrcoop]
<apeiros> bleh, if there's differences in puppet, then that's #puppet's problem :-p
<dminuoso> :p
Ishido has joined #ruby
<jeffreylevesque_> @something = another?
<dminuoso> jeffreylevesque_: You should really ask your questions in puppet.
<jeffreylevesque_> Is an rb file
<dminuoso> Nevermind then.
<dminuoso> jeffreylevesque_: I recommend a Ruby tutorial then.
<dminuoso> This channel is not designed to teach you basic Ruby. :-)
mistermocha has joined #ruby
<jeffreylevesque_> I'm in line at a restaurant
<dminuoso> Grab me a burger while you are at it.
rodfersou is now known as rodfersou|lunch
<kyle__> jeffreylevesque_: I still recommend Why's Poignant Guide to Ruby, but it may be slightly dated now.
<dminuoso> It's an excellent book.
<dminuoso> I mean I haven't read it or know anything about it, but it comes with good recommendations. :p
ldnunes has joined #ruby
LoneHerm_ has joined #ruby
kx has joined #ruby
blackwind_123 has joined #ruby
craigp has quit [Ping timeout: 265 seconds]
<kyle__> dminuoso: You're missing out on a treat.
SteenJobs has quit [Quit: SteenJobs]
pandaant has quit [Remote host closed the connection]
<dminuoso> kyle__: I got so many things on my reading list. :|
pavshn has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
xdakdr has quit [Remote host closed the connection]
mistermocha has quit [Ping timeout: 248 seconds]
nando293921 has joined #ruby
weemsledeux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arnonhongklay has quit [Read error: Connection reset by peer]
jeffreylevesque_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
arnonhongklay has joined #ruby
sdwrage has quit [Quit: Leaving]
LoneHerm_ has quit [Ping timeout: 255 seconds]
<kyle__> dminuoso: If you already know ruby, it goes pretty quickly. But yeah. My reading list grows much faster than it's consumed :/
<kyle__> And most of what's on it isn't available in audio-book, so it's not like I can do that while commuting.
antgel has quit [Ping timeout: 240 seconds]
bodgix has left #ruby [#ruby]
jose_leeto has joined #ruby
weemsledeux has joined #ruby
hk238 has joined #ruby
NeverTired has joined #ruby
<snood1205_> Also, there's a free onion!
panpainter has joined #ruby
<dminuoso> kyle__: I only read one book on Ruby before, and that was Ruby under a Microscope
craigp has joined #ruby
<kyle__> I'm trying to remember what the pickaxe book's name was.... I don't think that was it.. But that and Why's are teh only two I've read.
cschneid_ has joined #ruby
weemsledeux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
SeepingN has joined #ruby
chouhoul_ has joined #ruby
<toretore> pickaxe = "Programming Ruby"
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
domgetter has quit [Ping timeout: 265 seconds]
chouhoulis has quit [Ping timeout: 244 seconds]
blaxter has quit [Quit: foo]
chouhoul_ has quit [Remote host closed the connection]
chouhoulis has joined #ruby
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
nitric has joined #ruby
<SeepingN> o.O
ych has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mark_661 has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 248 seconds]
RegulationD has quit [Remote host closed the connection]
a7d7p has quit [Quit: a7d7p]
_djbkd has joined #ruby
grh has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby
SteenJobs has joined #ruby
xcesariox has joined #ruby
JeanCarloMachado has quit [Ping timeout: 276 seconds]
ferr has quit [Quit: WeeChat 1.5]
weemsledeux has joined #ruby
<Mrgoose> LoadError: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory - /repos/csp/aaa/vendor/ruby/2.2.0/gems/mysql2-0.4.2-x86_64-linux/lib/mysql2/mysql2.so
<Mrgoose> any possible idea why i get this error?
<Mrgoose> the file is there
ych has joined #ruby
wrkrcoop has joined #ruby
flying has quit []
ych has quit [Max SendQ exceeded]
<havenwood> g'mornin'
<Johne> 12:08 here
CherryLady has joined #ruby
<havenwood> ?ugt Johne
<ruby[bot]> Johne: it's morning, see http://www.total-knowledge.com/~ilya/mips/ugt.html
elenatanasoiu has quit [Ping timeout: 276 seconds]
rafadc has joined #ruby
vuoto has quit [Remote host closed the connection]
<Johne> lol
<Johne> ffs
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhon_ has joined #ruby
nogic has quit [Ping timeout: 250 seconds]
rcvalle has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rafadc has quit [Ping timeout: 244 seconds]
SteenJobs has quit [Quit: SteenJobs]
johnmccabe has joined #ruby
aegis3121 has joined #ruby
Cohedrin has joined #ruby
ldnunes has quit [Ping timeout: 265 seconds]
tdy has quit [Ping timeout: 244 seconds]
RegulationD has joined #ruby
ldnunes has joined #ruby
DoubleMalt has quit [Ping timeout: 248 seconds]
ocbtec has quit [Quit: leaving]
phone has joined #ruby
<phone> what is top level method
<apeiros> a method defined at the top level scope. i.e. not within any module or class.
ebraga has quit [Read error: Connection reset by peer]
<phone> there wasn't clear explaination in book
ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<phone> thank you alot
Tempesta_ has joined #ruby
<phone> then. for example if method is in between any module and class then is it also top level?
joelwallis has quit [Quit: Leaving]
<apeiros> you mean like `module Foo; end; def bar; end; class Baz; end`?
Tempesta has quit [Ping timeout: 240 seconds]
dhollinger has quit [Read error: Connection reset by peer]
<phone> yes exactly
<phone> yes i mean that
<apeiros> as that's "not within any module or class", yes
nando293921 has quit [Ping timeout: 265 seconds]
<phone> oh. ok
<apeiros> oh, and additionally: not defined as a singleton method on an object.
<phone> understood. there weren't any clear explaination on commercial ruby books.
<apeiros> e.g. `x = "hi"; def x.foo; end` - while defined in the top level scope, it is not a top level method.
arnonhon_ has quit [Ping timeout: 265 seconds]
<phone> oh :) thx
mtkd has quit [Ping timeout: 260 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
<phone> ruby is a little different one than any other similar languages.
<apeiros> if they were the same, there would be no reason for their existence
mtkd has joined #ruby
eljimmy has joined #ruby
<phone> hmm. Before I started to learn ruby, I thought ruby and python are almost same one.
vuoto has joined #ruby
<phone> ruby is more expressive I feel. but confusing at the beginning.
mistermocha has joined #ruby
JoshS has joined #ruby
replay has joined #ruby
<ytti> i guess that's subjective, my experience was opposite
<phone> opposite?
<ytti> with all the sorted(list), len(obj), "string".join(list) etc made it confusing to me
<ytti> i perceived it lack of consistency
LoneHermit has joined #ruby
<phone> yes. I go that way. confusing...
<ytti> so probably highly dependant on what type of problems you run into, which forms your initial impression
<ytti> i happened to run into issues like that, which gave me initial impression that python was more inconsistent than ruby
<ytti> also: chunky bacon
<phone> I feel ruby is only suitable for command-line or for education :)
<phone> not for scalable web tech
<apeiros> oh dear
rodfersou|lunch is now known as rodfersou
jshjsh has quit [Ping timeout: 240 seconds]
<ytti> phone, interesting, what features would you say discriminate python and ruby in that manner?
mistermocha has quit [Ping timeout: 260 seconds]
pavshn has joined #ruby
<phone> python and ruby are almost same but they are different grammatically,
<phone> :) no differences for usage or for adoption
LoneHermit has quit [Ping timeout: 240 seconds]
mwlang has quit [Quit: mwlang]
<phone> but ruby and python both are not good for scaling or multicore
<phone> and slower for web application?
<phone> ruby wins at the point of expression
<apeiros> phone: you may want to reread the definition of "scale"
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> hint: "fast" != "scale"
<phone> yes
f4cl3y has quit [Ping timeout: 272 seconds]
firstdayonthejob has joined #ruby
<phone> i mean ruby is not fast enough for operating on the web
<phone> and scale. yes I say wrong word
<apeiros> if you say so.
<havenwood> phone: nonsense
<phone> ruby is the best for scale.
soulisson has quit [Quit: Quitte]
<havenwood> phone: please don't troll
<phone> sry for that troll, yes did, admit
<phone> is multiprocessing a good way for multicore processing for web application?
SteenJobs has joined #ruby
arnonhongklay has joined #ruby
Guest92264 has quit [Changing host]
Guest92264 has joined #ruby
symm- has quit [Ping timeout: 250 seconds]
Guest92264 is now known as nuck
SteenJobs has quit [Client Quit]
chouhoulis has joined #ruby
<SeepingN> ours scaled. but with the help of AWS and java backedn processors and whatnot
johnmccabe has joined #ruby
<havenwood> phone: Ruby webservers use threading, process forking, evented io or some combination thereof to optimize performance.
<phone> oh
nankyokusei has joined #ruby
<phone> yes why not
crdpink has quit [Quit: q term]
hk238 has quit [Quit: http://www.kvirc.net/ 4.9.2 Aria]
boxbeatsy has joined #ruby
<boxbeatsy> hi all, i'm new to ruby and using a class function from a gem. i'd like to monkey patch the class's function to automatically retry if it encounters a specific error. how can i do that?
crdpink has joined #ruby
arnonhongklay has quit [Ping timeout: 260 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
<apeiros> boxbeatsy: best is you don't, write your own method instead and use that.
blackmes1 has joined #ruby
<apeiros> boxbeatsy: but if you insist - you can simply redefine the method.
kaiks has joined #ruby
salut has quit [Quit: salut]
baweaver_away is now known as baweaver
spider-mario has left #ruby ["WeeChat 1.5"]
anisha has quit [Quit: This computer has gone to sleep]
kx has quit [Ping timeout: 265 seconds]
<boxbeatsy> apeiros: i see. how would i extend the gem's class to add my own method?
salut has joined #ruby
<apeiros> the same way as if you'd define the method for the first time.
<apeiros> last definition wins.
Sashimi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<boxbeatsy> apeiros: hmmm, but i don't "own" the class since i'm importing it from a gem
<apeiros> that doesn't matter
<boxbeatsy> o interesting, so i can redefine the class and and a new function, and it will just append instead of overwrite?
dminuoso has quit [Ping timeout: 272 seconds]
<apeiros> >> class Array; def self.new; ["woot"]; end; Array.new
<ruby[bot]> apeiros: # => /tmp/execpad-ad4260af0e63/source-ad4260af0e63:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/644791)
jackjackdripper has joined #ruby
grh has joined #ruby
<apeiros> hm, should probably use some less elementary part as an example :D
blackmes1 has quit [Ping timeout: 272 seconds]
salut has quit [Client Quit]
tdy has joined #ruby
<strongcode> is it possible to list gemfile dependencies inside my script so i can `bundle` without needing a separate gemfile
blackmes1 has joined #ruby
<strongcode> gs
stamina has joined #ruby
tomphp has joined #ruby
charliesome has joined #ruby
<boxbeatsy> nice, that worked. thanks!
<phone> what is big difference between ruby and python?
<apeiros> ruby starts with an r, python with a p.
conta has quit [Ping timeout: 265 seconds]
<phone> :0
nando293921 has joined #ruby
redpants has joined #ruby
nofxx has joined #ruby
<havenwood> phone: In Ruby there is more than one way to do it and in Python there is one--and preferably only on--obvious way to do it.
<havenwood> one*
Sashimi has joined #ruby
[k- has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
AnarchyAo has joined #ruby
phone_ has joined #ruby
<SeepingN> irb
<phone_> I feel it. I agree.
auxbuss has joined #ruby
<Johne> lol
phone has quit [Ping timeout: 244 seconds]
tdy has quit [Ping timeout: 255 seconds]
claudiuinberlin has joined #ruby
<phone_> but not necessary.
griff has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
[k- has joined #ruby
auxbuss has quit [Client Quit]
CherryLady has quit []
<phone_> so so top level method is automatically set as private right?
nando293921 has quit [Ping timeout: 264 seconds]
nando293921 has joined #ruby
bocaneri has quit [Remote host closed the connection]
LemonJuice has joined #ruby
phone has joined #ruby
symm- has joined #ruby
firstdayonthejob has quit [Quit: WeeChat 1.5]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
phone_ has quit [Ping timeout: 265 seconds]
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wrkrcoop has quit [Quit: wrkrcoop]
<Johne> how do i store a hash to a var? I feel like this is such a dumb question to ask but I'm not getting this to work. https://gist.github.com/procdaddy/b2f8aa0047d2ae8a145221051dd86c7a I've tried var =
phone has quit [Ping timeout: 255 seconds]
phone has joined #ruby
charliesome has joined #ruby
whathappens has joined #ruby
<SeepingN> make sur eyou check for nil responses
jaruga_____ has quit [Quit: jaruga_____]
Pupeno has quit [Remote host closed the connection]
elenatanasoiu has joined #ruby
LuckyABA has joined #ruby
phone has quit [Client Quit]
olspookishmagus has quit [Ping timeout: 244 seconds]
Xiti` has quit [Quit: Xiti`]
<baweaver> Johne: The block has its own scope
<baweaver> meaning any variable you put in there is not present in the outside
cdg has quit [Remote host closed the connection]
sonikspin has quit [Ping timeout: 244 seconds]
<baweaver> the naive solution: a = nil; b.each { ... a = something }; a
Tempesta_ has quit [Read error: Connection reset by peer]
<baweaver> the better solution (in your case): locations = data['dates'][0]['games'].map { |game| game['teams']['away']['team']['locationName'] }
<baweaver> &ri Enumerable
jshjsh has joined #ruby
<baweaver> read through that, make sure you understand these specifically: map, find, select, reduce
<baweaver> the rest are useful, but those four tend to be your powerhouses
elastix has joined #ruby
Dimik has joined #ruby
Pupeno has joined #ruby
mistermocha has joined #ruby
patarr has joined #ruby
zeroDi has joined #ruby
<baweaver> >> [1].each { |b| a = b }; a
<ruby[bot]> baweaver: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/644799)
<baweaver> >> a = nil; [1].each { |b| a = b }; a
<ruby[bot]> baweaver: # => 1 (https://eval.in/644800)
<baweaver> Johne ^
<baweaver> that's what happens
firstdayonthejob has joined #ruby
JoshS has quit [Ping timeout: 272 seconds]
<Johne> still processing this in my mind :D
ziyadb has quit [Quit: Connection closed for inactivity]
olspookishmagus has joined #ruby
olspookishmagus is now known as Guest81716
yardenbar has joined #ruby
mistermocha has quit [Ping timeout: 248 seconds]
dipnlik has quit [Quit: dipnlik]
elenatanasoiu has quit [Ping timeout: 264 seconds]
lifeai has quit [Ping timeout: 240 seconds]
nando293921 has quit [Quit: Lost terminal]
xemehc has joined #ruby
xemehc has quit [Quit: Textual IRC Client: www.textualapp.com]
jeffreylevesque has joined #ruby
<jeffreylevesque> is this ok - https://bpaste.net/show/3f3387a231af?
Guest94 has joined #ruby
elenatanasoiu has joined #ruby
dhollinger has joined #ruby
ta_ has quit [Remote host closed the connection]
nando293921 has joined #ruby
kobain has quit [Ping timeout: 248 seconds]
Guest94 is now known as xemehc
nando293921 has quit [Client Quit]
wrkrcoop has joined #ruby
xemehc has quit [Quit: I'm out]
nando293921 has joined #ruby
zipace has joined #ruby
xemehc has joined #ruby
minimalism has quit [Ping timeout: 265 seconds]
conta has joined #ruby
last_staff has joined #ruby
coolboy has quit [Remote host closed the connection]
chwbacca has joined #ruby
Node_036 has joined #ruby
nando294021 has joined #ruby
coolboy has joined #ruby
nando293921 has quit [Quit: leaving]
nando294021 has quit [Client Quit]
sai_ has joined #ruby
nando293921 has joined #ruby
JoshS has joined #ruby
Xiti has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
CherryLady has joined #ruby
vasilakisfil__ has quit [Quit: Konversation terminated!]
jshjsh has quit [Ping timeout: 244 seconds]
CherryLady has quit [Remote host closed the connection]
[k- has quit [Ping timeout: 244 seconds]
AndrewIsHere has quit [Remote host closed the connection]
AndrewIsHere has joined #ruby
NeverTired has quit [Quit: Connection closed for inactivity]
JoshS has quit [Ping timeout: 240 seconds]
loechel has joined #ruby
JoshS has joined #ruby
nadir has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
nadir has joined #ruby
Guest60411 has quit [Ping timeout: 250 seconds]
[k- has joined #ruby
<nofxx> jeffreylevesque, nope, always use 2 spaces
minimalism has joined #ruby
<nofxx> when identing*
<havenwood> ?tabs
<ruby[bot]> Ruby community standards recommend using 2 spaces as indentation (see https://github.com/bbatsov/ruby-style-guide#spaces-indentation and https://ukupat.github.io/tabs-or-spaces/).
dminuoso has joined #ruby
johnmilton has quit [Remote host closed the connection]
<nofxx> ops, pardon...indenting*
Pumukel has quit [Ping timeout: 265 seconds]
loechel has quit [Ping timeout: 248 seconds]
unreal has quit [Ping timeout: 265 seconds]
bsrd has joined #ruby
edwinvdgraaf has quit [Ping timeout: 265 seconds]
<Johne> baweaver: i've updated what I'm expecting. I'm not fully understanding where map would help me out: https://gist.github.com/procdaddy/b2f8aa0047d2ae8a145221051dd86c7a
ishe_ua has quit [Ping timeout: 260 seconds]
<baweaver> and what's the error?
<baweaver> because that should work, assuming all those hash keys are actually there.
<dminuoso> Johne: Let me introduce you to your newest bff. They are called pry.
<Johne> nhl.rb:10:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError)
JakFrist has joined #ruby
hazelux has quit [Read error: Connection reset by peer]
<dminuoso> Johne: That happens if Ruby attempts to evaluate nil[] or nil[something]
JakFrist has quit [Client Quit]
hazelux has joined #ruby
redpants has quit [Quit: leaving]
<baweaver> game['teams']['away']['home']['locationName']
<baweaver> look at the json response
<baweaver> that doesn't exist
<baweaver> now game['teams']['home']['team']['locationName'] on the other hand...
nando293921 has quit [Quit: Lost terminal]
ramfjord has quit [Ping timeout: 255 seconds]
newbie1 has joined #ruby
<Johne> data['dates'][0]['games'][0]['teams']['away']['team']['locationName']
<Johne> => "Columbus"
<Johne> wats why i did the .each
<Johne> am i doing that incorrectly?
rafadc has joined #ruby
Uranio has joined #ruby
Uranio has quit [Remote host closed the connection]
airstream66 has joined #ruby
<boxbeatsy> hi all, i have a module (from a gem) with many classes and class methods. is there a way to wrap every class method in this module with another function?
nitric_ has joined #ruby
<boxbeatsy> that is, i'd like to catch an error whenever a method of this module's classes is called, and do some specific logging
conta has quit [Ping timeout: 265 seconds]
<nofxx> boxbeatsy, make you own class that uses that one, rescue from it's errors and voilà
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
nitric has quit [Ping timeout: 240 seconds]
<baweaver> Look at what I put above Johne
<baweaver> read it carefully
_sfiguser has quit [Ping timeout: 276 seconds]
ramfjord has joined #ruby
<boxbeatsy> nofxx: ok, but how would i wrap all of a class's methods in a try/rescue?
rafadc has quit [Ping timeout: 244 seconds]
<baweaver> chances are you don't need to wrap everything
<baweaver> Look into Delegators
airstream66 has quit [Remote host closed the connection]
<dminuoso> boxbeatsy: Use a delegator class.
<havenwood> jeffreylevesque: yum list -q redis\*-2.4\* | tail -n+2 | awk '{print $2}'
<baweaver> read that ^
<dminuoso> boxbeatsy: You can also implement this easily with method_missing, im not entirely sure whether Ruby delegators allow you to hook in between methods like that.
_sfiguser has joined #ruby
<baweaver> boxbeatsy ^
<baweaver> Forwardable and SimpleDelegator allow you most anything you'd need
<dminuoso> baweaver: ah Forwardable, TIL
<nofxx> boxbeatsy, or maybe, pass the method as param... def your_wrapper(meth); ThatLib.send(meth); all your rescues....
<baweaver> (which is exactly what delegators can do)
<nofxx> baweaver, yup.. but how do you custom rescue em?
<baweaver> You delegate methods to another object but in override cases you call super
<nofxx> not rethorical, I don't know heh
<nofxx> ah, I see, thanks
<boxbeatsy> got it, thanks guys!
<baweaver> Point of a delegator is in 99% of the cases you don't care
<baweaver> but in that 1% you want to override it you can.
pwnd_nsfw` has quit [Read error: Connection reset by peer]
pwnd_nsfw has joined #ruby
TinkerTyper has joined #ruby
gp has joined #ruby
Node_036 has quit [Quit: Page closed]
lifeai has joined #ruby
blackmes1 has quit [Ping timeout: 255 seconds]
hazelux has quit []
skweek has quit [Ping timeout: 255 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has quit [Quit: WeeChat 1.5]
jenrzzz has joined #ruby
the_drow has quit [Quit: This computer has gone to sleep]
candelabra has joined #ruby
johnmilton has joined #ruby
<candelabra> can I do [1..24].each{|hour| puts hour.to_s}
yardenbar has quit [Ping timeout: 240 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weemsledeux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<etetz> you can but im not sure thatll give you what you are looking for
jrafanie has joined #ruby
<dminuoso> candelabra: you can do (1..24).each :-)
<candelabra> ahhh thats it
<dminuoso> candelabra: and also:
<dminuoso> ?tias
<ruby[bot]> dminuoso: I don't know anything about tias
* dminuoso hits apeiros
* apeiros blinks
mistermocha has joined #ruby
<candelabra> ?(1..24).each{|h| p h}
<dminuoso> Do we have some tias factoid?
<dminuoso> candelabra: try it in your ruby interpreter and see what happens
<candelabra> liek that?
dionysus69 has quit [Quit: dionysus69]
<dminuoso> I dont know. You tell me.
<candelabra> sorry I thought the ruby bot was going to do something
LoneHermit has joined #ruby
weckl has quit [Remote host closed the connection]
dionysus69 has joined #ruby
<Johne> lol
<Johne> ty baweaver
<Johne> im blind as a bat
<apeiros> ?try dminuoso
<ruby[bot]> dminuoso: Why don't you try it and see for yourself?
<apeiros> !fact alias tias try
<ruby[bot]> apeiros: I already know that try is Why don't you try it and see for yourself?
<Johne> ive got bad eyes as is, then had a stroke at age 30 to leave me half blind the left hemisphere of both eyes.
<apeiros> !fact alias try tias
<ruby[bot]> apeiros: I will remember that try is also called tias.
<dminuoso> apeiros: Thanks.
mistermocha has quit [Ping timeout: 260 seconds]
<dminuoso> candelabra: it can be used to that extend, but it's not to be used for experimentation in this channel.
LoneHermit has quit [Ping timeout: 248 seconds]
Sashimi has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lifeai has quit [Ping timeout: 248 seconds]
mrBen2k2k2k_____ has joined #ruby
tomphp has joined #ruby
a7d7p has joined #ruby
jshjsh has joined #ruby
pawnbox has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
JoshS has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Remote host closed the connection]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxx has quit [Ping timeout: 265 seconds]
nankyokusei has joined #ruby
tomphp has joined #ruby
pawnbox has joined #ruby
rippa has quit [Ping timeout: 264 seconds]
AndrewIs_ has joined #ruby
AndrewI__ has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
Andre____ has joined #ruby
mrBen2k2k2k_____ has quit [Max SendQ exceeded]
JakFrist has joined #ruby
symm- has quit [Ping timeout: 265 seconds]
<wrkrcoop> ive always wondered how you could implement a newsfeed feature … and this morning i woke up thinking “you can use a graph db” … does that sound like the most efficient way to create a newsfeed feature for a social network?
fmcgeough has quit [Quit: fmcgeough]
AndrewIsHere has quit [Ping timeout: 272 seconds]
JeanCarloMachado has joined #ruby
AndrewIs_ has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
maloik34 has quit [Remote host closed the connection]
AndrewI__ has quit [Ping timeout: 248 seconds]
maloik has joined #ruby
AndrewIsHere has joined #ruby
<xemehc> wrkrcoop: If I recall correctly that's what FB does
<wrkrcoop> nice
symm- has joined #ruby
<wrkrcoop> im currently looking at the db Cayley
<xemehc> might take a look at this gem - https://github.com/GetStream/stream-rails
<xemehc> see what they do
<wrkrcoop> thanks :D
<wrkrcoop> brb
AndrewIs_ has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
Pupeno has quit [Remote host closed the connection]
AndrewI__ has joined #ruby
Andre____ has quit [Ping timeout: 255 seconds]
Andre____ has joined #ruby
AndrewIsHere has quit [Ping timeout: 255 seconds]
Andr_____ has joined #ruby
AnarchyAo has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
claudiuinberlin has quit []
AndrewIsHere has joined #ruby
AndrewIs_ has quit [Ping timeout: 255 seconds]
zacts has joined #ruby
RedNifre_ has joined #ruby
blackgoat has joined #ruby
AndrewI__ has quit [Ping timeout: 250 seconds]
RedNifre has quit [Ping timeout: 240 seconds]
AndrewIsHere has quit [Client Quit]
Andre____ has quit [Ping timeout: 248 seconds]
ChiefAlexander has quit [Remote host closed the connection]
vF3hNGxc47h8 has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
Andr_____ has quit [Ping timeout: 272 seconds]
xemehc has quit [Quit: ZZZzzz…]
nikivi has joined #ruby
JoshS has joined #ruby
CherryLady has joined #ruby
jshjsh has quit [Ping timeout: 244 seconds]
ruby-lang065 has joined #ruby
cabs has joined #ruby
a7d7p has quit [Quit: a7d7p]
mrBen2k2k2k_____ has joined #ruby
marxarelli is now known as marxarelli|afk
ejnahc has quit [Ping timeout: 244 seconds]
sai_ has quit [Read error: Connection reset by peer]
ejnahc has joined #ruby
ruby-lang065 is now known as Leandro_Biciato
sai_ has joined #ruby
rippa has joined #ruby
xemehc has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
fredlinhares1 has joined #ruby
Leandro_Biciato has quit [Ping timeout: 240 seconds]
rippa has quit [Client Quit]
<havenwood> Or these days you can use Action Cable for such things: http://guides.rubyonrails.org/action_cable_overview.html
skweek has joined #ruby
ta_ has joined #ruby
_djbkd has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
vuoto has quit [Remote host closed the connection]
<xemehc> havenwood: isn't rails 5 not released yet?
<xemehc> or is actioncable in rails 4 as well?
lel has joined #ruby
<havenwood> xemehc: Rails 5 was released on June 30th!
<xemehc> whoa! i'm behind the times
mrBen2k2k2k_____ has quit [Max SendQ exceeded]
GodFather has joined #ruby
<dminuoso> xemehc: You should upgrade. There's lots of really neat features like...
<dminuoso> uh..
<dminuoso> mm..
<dminuoso> Well. There is ActionCable!
kobain has joined #ruby
jphase_ has joined #ruby
Madplatypus has joined #ruby
<xemehc> lol and API Mode \o/
hammond is now known as hammond-ey
<havenwood> Pie.where(filling: 'rhubarb').or(Pie.where(filling: 'strawberry'))
jphase has quit [Disconnected by services]
jphase_ is now known as jphase
nikivi has quit [Quit: irc]
<agent_white> Hrm that code looks wrong.
<agent_white> There's no cheesecake in there...
<agent_white> ;)
<baweaver> Also IN
<baweaver> Pie.where(filling: %w(rhubarb strawberry))
<dminuoso> havenwood: I think you can also do Pie.where(filling: 'apple').or.where(filling: 'strawberry')
symm- has quit [Quit: Leaving...]
mistermocha has joined #ruby
wrkrcoop has joined #ruby
gfvcastro has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<baweaver> Also note that this is #ruby, we have #RubyOnRails for Rails questions
_djbkd has joined #ruby
gfvcastro has joined #ruby
mistermocha has quit [Ping timeout: 260 seconds]
<havenwood> wrkrcoop: Ask about Action Cable in the #RubyOnRails channel ^
<wrkrcoop> what?
<wrkrcoop> i didnt ask about action cable
pwnd_nsfw` has joined #ruby
<havenwood> "wrkrcoop:ive always wondered how you could implement a newsfeed feature"
pwnd_nsfw has quit [Ping timeout: 255 seconds]
<wrkrcoop> oh ok
<wrkrcoop> thanks
ChiefAlexander has joined #ruby
fullofcaffeine has joined #ruby
jose_leeto has quit [Read error: Connection reset by peer]
d10n-work has joined #ruby
rafadc has joined #ruby
harai has joined #ruby
gp_tablet has joined #ruby
JakFrist has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sai__ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
symm- has joined #ruby
tdy has joined #ruby
patarr has quit [Ping timeout: 255 seconds]
gp has quit [Ping timeout: 240 seconds]
jeffreylevesque has quit [Ping timeout: 255 seconds]
gp_tablet has quit [Client Quit]
dminuoso has quit [Ping timeout: 244 seconds]
bsrd has quit [Read error: Connection reset by peer]
sai__ has quit [Read error: Connection reset by peer]
harai has quit [Quit: WeeChat 1.5]
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
harai has joined #ruby
GinoManWrx has quit [Quit: Leaving]
arnonhongklay has joined #ruby
sai_ has joined #ruby
fredlinhares1 has quit [Quit: WeeChat 1.4]
be_______ has joined #ruby
tris- is now known as tris
harai has quit [Quit: WeeChat 1.5]
rodfersou has quit [Quit: leaving]
fullofcaffeine has quit [Remote host closed the connection]
marxarelli|afk is now known as marxarelli
fullofcaffeine has joined #ruby
marxarelli is now known as marxarelli|afk
biberu has quit [Read error: Connection reset by peer]
aegis3121 has quit [Ping timeout: 264 seconds]
grh has quit [Ping timeout: 260 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_sfiguser has quit [Ping timeout: 250 seconds]
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
Moosashi has joined #ruby
karmatr0n has quit [Ping timeout: 248 seconds]
Sashimi has joined #ruby
ldnunes has quit [Quit: Leaving]
cibs has quit [Ping timeout: 268 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jphase_ has joined #ruby
amclain has quit [Quit: Leaving]
skweek has quit [Ping timeout: 250 seconds]
jeffreylevesque has joined #ruby
jackjackdripper has quit [Ping timeout: 264 seconds]
kaiks has quit [Read error: Connection reset by peer]
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
jphase has quit [Ping timeout: 272 seconds]
jphase_ has quit [Ping timeout: 248 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aegis3121 has joined #ruby
_sfiguser has joined #ruby
xcesariox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jshjsh has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
skweek has joined #ruby
cibs has joined #ruby
crank1988_ has joined #ruby
JoshS has quit [Ping timeout: 272 seconds]
Renich has quit [Ping timeout: 260 seconds]
renderful has joined #ruby
postmodern has joined #ruby
Renich has joined #ruby
Immune has joined #ruby
amclain has joined #ruby
Amoeba_ has joined #ruby
CherryLady has quit []
xemehc has quit [Quit: ZZZzzz…]
stamina has quit [Ping timeout: 240 seconds]
Puffball has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
Renich has quit [Quit: leaving]
blackmes1 has joined #ruby
xemehc has joined #ruby
Amoeba_ has left #ruby [#ruby]
chwbacca has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
blackmes1 has quit [Ping timeout: 248 seconds]
charliesome has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
last_staff has quit [Quit: going moo moo]
ur5us has quit [Remote host closed the connection]
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
JakFrist has joined #ruby
symm- has quit [Ping timeout: 265 seconds]
ChiefAlexander has quit [Quit: Leaving...]
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
koooge has joined #ruby
wrkrcoop has joined #ruby
sai_ has joined #ruby
<wrkrcoop> are any of you leads or managers? i wonder how you can be on IRC all the time and be a lead
Puffball has quit [Remote host closed the connection]
sai_ has quit [Read error: Connection reset by peer]
<havenwood> wrkrcoop: multitasking
<havenwood> wrkrcoop: i'm drinking a milkshake, on a conference call and shaving my mustache right now as I talk to you
<wrkrcoop> lmao
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
Sashimi has quit [*.net *.split]
Guest81716 has quit [*.net *.split]
chouhoulis has quit [*.net *.split]
chelly has quit [*.net *.split]
kobain has quit [*.net *.split]
snood1205_ has quit [*.net *.split]
elifoster has quit [*.net *.split]
Chelsea_ has quit [*.net *.split]
priodev has quit [*.net *.split]
seggy has quit [*.net *.split]
apeiros has quit [*.net *.split]
Evan- has quit [*.net *.split]
mozzarella has quit [*.net *.split]
Guest27131 has quit [*.net *.split]
Technodrome has quit [*.net *.split]
Hobbyboy has quit [*.net *.split]
monoprotic has quit [*.net *.split]
rprimus has quit [*.net *.split]
Mekkis has quit [*.net *.split]
rubirc has quit [*.net *.split]
heyimwill has quit [*.net *.split]
mikeiniowa has quit [*.net *.split]
ohcibi has quit [*.net *.split]
ewilliam has quit [*.net *.split]
Mrgoose has quit [*.net *.split]
zack6849 has quit [*.net *.split]
mitsuhiko has quit [*.net *.split]
manveru has quit [*.net *.split]
codepete has quit [*.net *.split]
Nanuq has quit [*.net *.split]
Mr_Pancake has quit [*.net *.split]
ptx0 has quit [*.net *.split]
Rabbit_ has quit [*.net *.split]
lele has quit [*.net *.split]
techietrash has quit [*.net *.split]
Olipro has quit [*.net *.split]
bairyn has quit [*.net *.split]
krasnus has quit [*.net *.split]
vedu has quit [*.net *.split]
nemesit|znc has quit [*.net *.split]
soahccc has quit [*.net *.split]
koma has quit [*.net *.split]
rubirc has joined #ruby
Chelsea has joined #ruby
olspookishmagus has joined #ruby
Evan has joined #ruby
Rickmasta has quit [Quit: Textual IRC Client: www.textualapp.com]
rprimus_ has joined #ruby
lele has joined #ruby
seggy has joined #ruby
techietrash has joined #ruby
bairyn has joined #ruby
Rabbit_ has joined #ruby
symm- has joined #ruby
ptx0 has joined #ruby
ptx0 has joined #ruby
ptx0 has quit [Changing host]
hosttor has joined #ruby
Nanuq has joined #ruby
monoprotic has joined #ruby
monoprotic has quit [Changing host]
monoprotic has joined #ruby
snood1205 has joined #ruby
apeiros has joined #ruby
Mekkis has joined #ruby
sai_ has joined #ruby
Mrgoose has joined #ruby
nankyokusei has joined #ruby
priodev has joined #ruby
Olipro has joined #ruby
Evan is now known as Guest85038
olspookishmagus is now known as Guest21796
elifoster has joined #ruby
rprimus_ is now known as Guest7611
chouhoulis has joined #ruby
mozzarella has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
Mr_Pancake has joined #ruby
Sashimi has joined #ruby
Affix has joined #ruby
<wrkrcoop> so does programming just get easier as you gain more experience? or is it always hard. im coming up on 2 years (6 months of paid programming) and it seems to be getting easier … but im wondering if with progress comes more responsibilities and if thats something i want
sai_ has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
ohcibi has joined #ruby
Affix is now known as Guest40356
sai_ has joined #ruby
<eam> yes it gets very easy
dminuoso has joined #ruby
<eam> but then they'll ask you to manage other programmers
<wrkrcoop> and is that not easy?
<eam> same kind of learning curve
<wrkrcoop> interesting
codepete has joined #ruby
ghostlight has quit [Ping timeout: 244 seconds]
<wrkrcoop> the leads on my team seem to be working constantly and im @ my desk chilling because i finished my story for the sprint
arnonhongklay has quit [Read error: Connection reset by peer]
<eam> right about when you find managing people is easy you'll realize you've been paid so much and are in so much demand that you don't need to work anymore
chelly has joined #ruby
Rickmasta has joined #ruby
<eam> and then you'll ascend to a higher plane
arnonhongklay has joined #ruby
Gasher has quit [Quit: Leaving]
mitsuhiko has joined #ruby
<baweaver> called retirement
manveru has joined #ruby
zack6849 has joined #ruby
zack6849 has quit [Changing host]
zack6849 has joined #ruby
gingray has quit [Ping timeout: 272 seconds]
nankyokusei has quit [Ping timeout: 240 seconds]
<wrkrcoop> :D
ewilliam has joined #ruby
RedNifre has joined #ruby
<eam> wrkrcoop: btw, you should pull in more tasks to your sprint if you're done early :)
jeff0x68 has joined #ruby
<baweaver> shhhhh eam
dminuoso has quit [Ping timeout: 265 seconds]
<eam> maybe add a feature so your product can send emails
<eam> that's always a god one
<eam> good, even
RedNifre_ has quit [Ping timeout: 265 seconds]
<baweaver> you could add God too
<wrkrcoop> because its the nice thing to do?
<baweaver> we're joking by the way
<eam> wrkrcoop: are you familiar with jwz's law of software development?
<wrkrcoop> no not really
<eam> "Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can."
<wrkrcoop> ah man hottie just walked by ><
gp has joined #ruby
Joufflu has joined #ruby
jrozner has joined #ruby
wrkrcoop has quit [Quit: wrkrcoop]
<jrozner> If I have a variable declared outside of a block how can I update it within a block without shadowing it when the scope changes?
<baweaver> eam: interesting note to leave on there
<eam> jrozner: what do you mean?
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LuckyABA has joined #ruby
nemesit|znc has joined #ruby
<havenwood> >> jrozner = 42; 5.times { |n; jrozner| jrozner = n }; jrozner
<ruby[bot]> havenwood: # => 42 (https://eval.in/644913)
soahccc has joined #ruby
jackjackdripper has joined #ruby
* baweaver blinks
<baweaver> havenwood what black magic is this?
<jrozner> I want the value of resp passed in ActiveSupport::Notifications.instrument to be updated by the block once it runs
<havenwood> baweaver: ;-)
wrkrcoop has joined #ruby
blackwind_123 has quit [Ping timeout: 265 seconds]
duncannz has joined #ruby
JeanCarloMachado has quit [Ping timeout: 276 seconds]
duncannz has quit [Max SendQ exceeded]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
<eam> havenwood: he wants the opposite of that though, right? Which is the default
duncannz has joined #ruby
<eam> no one ever uses the ;
tdy has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 244 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
duncannz has quit [Max SendQ exceeded]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
elenatanasoiu has quit [Quit: WeeChat 1.5]
duncannz has joined #ruby
blackwind_123 has joined #ruby
elenatanasoiu has joined #ruby
Puffball has joined #ruby
blackmes1 has joined #ruby
snockerton has quit [Quit: Leaving.]
* baweaver didn't know ; existed for blocks
nofxx has joined #ruby
maxrez has quit [Read error: Connection reset by peer]
csk has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
ghostlight has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
AzureStigma has joined #ruby
<jrozner> havenwood: is the binding in my example not possible?
Hobbyboy has joined #ruby
elastix has quit [Quit: elastix]
kobain has joined #ruby
arnonhon_ has joined #ruby
<havenwood> eam: ah, i'm in opposite-land
<havenwood> jrozner: does it not work?
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jrozner> havenwood: no
blackwind_123 has quit [Ping timeout: 264 seconds]
arnonhongklay has quit [Ping timeout: 264 seconds]
<jrozner> I want the code inside the block to update the value in resp that's passed to instrument
<eam> oh
<eam> jrozner: I see what you're doing
<jrozner> execution will pass to instrument and when it yields inside it I want it to update that value
<eam> you're defining resp as a method parameter
<jrozner> is that possible?
<eam> ('prevoty:content', payload: resp)
<jrozner> the api is designed for timing operations and passing information about the data the operation is using, not passing the result
cyphase has quit [Ping timeout: 264 seconds]
<jrozner> eam: is resp in the method call shadowing the value defined above?
blackwind_123 has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
ap4y has joined #ruby
<jrozner> eam: basically I just want the second parameter to be the return value of the block
Puffball has quit [Remote host closed the connection]
<jrozner> but I need the operation itself to occur in the block rather than call the method in the second parameter place so the timing information is present
Zamyatin has quit [Ping timeout: 248 seconds]
Puffball has joined #ruby
cyphase has joined #ruby
heyimwill has joined #ruby
newbie1 has quit [Ping timeout: 255 seconds]
AndrewIsHere has joined #ruby
xemehc has quit [Quit: ZZZzzz…]
Moosashi has quit [Quit: Moosashi]
arnonhon_ has quit [Read error: Connection reset by peer]
jeff0x68 has left #ruby [#ruby]
arnonhongklay has joined #ruby
sai_ has quit [Read error: Connection reset by peer]
newbie1 has joined #ruby
sai_ has joined #ruby
Puffball has quit [Ping timeout: 248 seconds]
Rickmasta has joined #ruby
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aries_liuxueyang has quit [Ping timeout: 240 seconds]
polishdub has quit [Quit: Leaving]
ruby_ has joined #ruby
Moosashi has joined #ruby
flying has joined #ruby
aegis3121 has quit [Ping timeout: 265 seconds]
sai_ has quit [Remote host closed the connection]
charliesome has joined #ruby
charliesome has quit [Client Quit]
krasnus has joined #ruby
sai_ has joined #ruby
ap4y has quit [Remote host closed the connection]
ap4y has joined #ruby
elenatanasoiu has quit [Ping timeout: 255 seconds]
<jrozner> is there a way in ruby to get the nanoseconds since epoch from a Time object in ruby?
znz_jp has quit [Remote host closed the connection]
<baweaver> &ri Time
<baweaver> (faster than google for me :P)
ruby_ has quit [Read error: Connection reset by peer]
<baweaver> &ri Time#nsec
gfvcastro has quit [Read error: Connection reset by peer]
ruby_ has joined #ruby
<jrozner> baweaver: Time.now.nanoseconds isn't epoch time with nanosecond resolution
Moosashi has quit [Quit: Moosashi]
<jrozner> errr Time.now.nsec
d0nn1e has quit [Ping timeout: 250 seconds]
rafadc has quit [Ping timeout: 265 seconds]
<baweaver> "The lowest digits of to_f and nsec are different because IEEE 754 double is not accurate enough to represent the exact number of nanoseconds since the Epoch."
[k- has quit [Ping timeout: 265 seconds]
<jrozner> baweaver: I've read that. It doens't tell me if I can get a milisecond or nanosecond representation though
bjh13 has quit [Remote host closed the connection]
* baweaver is confused
ta_ has quit [Read error: Connection reset by peer]
<baweaver> it says on the doc that it's returning nanoseconds since epoch
ta_ has joined #ruby
<baweaver> ah
<jrozner> Time.now.nsec doesn't return a constantly incrementing number
<baweaver> why do you need nanoseconds?
<jrozner> milliseconds is probably fine
<jrozner> just looking for something close to that resolution. Second is definitely not high enough
<baweaver> in any case, beyond my knowledge of Time.
nitric has joined #ruby
<baweaver> Time#to_f would probably be the best shot though doubles are finnicky enough I couldn't tell you if you could rely on them for anything.
<jrozner> I'm looking specifically for timing information so it needs to be fairly accurate
<jrozner> anything better than second is reasonable
nitric_ has quit [Ping timeout: 240 seconds]
firstdayonthejob has quit [Ping timeout: 250 seconds]
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
LemonJuice has quit [Quit: Leaving]
GodFather has quit [Remote host closed the connection]
Bellthoven has joined #ruby
Bellthoven has quit [Client Quit]
RegulationD has quit [Remote host closed the connection]
Moosashi has joined #ruby
<havenwood> jrozner: to_r
fullofcaffeine has quit [Remote host closed the connection]
Bellthoven has joined #ruby
arnonhongklay has quit [Read error: Connection reset by peer]
arnonhongklay has joined #ruby
fullofcaffeine has joined #ruby
ekem is now known as rashiekmemakeman
znz_jp has joined #ruby
<havenwood> jrozner: "This methods is intended to be used to get an accurate value representing the nanoseconds since the Epoch."
dminuoso has joined #ruby
elenatanasoiu has joined #ruby
Moosashi has quit [Client Quit]
whathappens has quit [Quit: Leaving...]
charliesome has joined #ruby
arnonhongklay has quit [Read error: Connection reset by peer]
Paradox has quit [Ping timeout: 276 seconds]
fullofcaffeine has quit [Ping timeout: 272 seconds]
rashiekmemakeman is now known as licken
fullofcaffeine has joined #ruby
licken is now known as lichen
chelly has quit [Quit: Connection closed for inactivity]
astrobunny has joined #ruby
weemsledeux has joined #ruby
mikeiniowa has joined #ruby
lichen is now known as ekem
arnonhongklay has joined #ruby
dminuoso has quit [Ping timeout: 240 seconds]
elenatanasoiu has quit [Ping timeout: 265 seconds]
Paradox has joined #ruby
cschneid_ has quit [Remote host closed the connection]
sai_ has quit [Read error: Connection reset by peer]
Moosashi has joined #ruby
fullofcaffeine has quit [Remote host closed the connection]
mim1k has quit [Read error: Connection reset by peer]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sai_ has joined #ruby
mim1k has joined #ruby
fullofcaffeine has joined #ruby
jrozner has quit [Ping timeout: 276 seconds]
tectonic has joined #ruby
arnonhongklay has quit [Read error: Connection reset by peer]
madgen has joined #ruby
arnonhongklay has joined #ruby
Moosashi has quit [Client Quit]
sai_ has quit [Read error: Connection reset by peer]
sai_ has joined #ruby
ramfjord has quit [Ping timeout: 244 seconds]
<al2o3-cr> wrkrcoop: if you've been getting paid, get me a job
ramfjord has joined #ruby
johnmccabe has joined #ruby
pwnd_nsfw` has quit [Read error: Connection reset by peer]
<wrkrcoop> al2o3-cr: why?
<al2o3-cr> for fucks sake
agent_white has quit [Quit: backlater]
<wrkrcoop> ?
ap4y has quit [Remote host closed the connection]
UserOO7 has joined #ruby
<al2o3-cr> wino
twistedpixels has quit [Ping timeout: 276 seconds]
<baweaver> al2o3-cr: be nice
<wrkrcoop> why was the interview question
pwnd_nsfw has joined #ruby
ap4y has joined #ruby
<wrkrcoop> are you saying i suck? i wrote a split method today ;)
replay has quit [Ping timeout: 240 seconds]
twistedpixels has joined #ruby
twistedpixels has joined #ruby
twistedpixels has quit [Changing host]
<baweaver> ?offtopic
<ruby[bot]> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
wethu has joined #ruby
<al2o3-cr> wrkrcoop: you don't suck, i do!
jenrzzz has quit [Ping timeout: 250 seconds]
coolboy has quit [Ping timeout: 250 seconds]
wrkrcoop has left #ruby [#ruby]
therealtesseract has joined #ruby
jrozner has joined #ruby
therealtesseract is now known as tesseract
tesseract is now known as therealtesseract
herbmillerjr has quit [Quit: Konversation terminated!]
marr has quit [Ping timeout: 255 seconds]
duderonomy has joined #ruby
flying has quit []
jenrzzz has joined #ruby
blackmes1 has quit [Ping timeout: 260 seconds]
Moosashi has joined #ruby
therealtesseract has quit [Remote host closed the connection]
SteenJobs has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eam> jrozner: you can get #nsec out of a ruby Time object
<eam> and yeah, don't use #to_f because base ten fractions aren't going to give you the same thing
<eam> er, base two
elenatanasoiu has joined #ruby
<havenwood> to_f docs: "Note that IEEE 754 double is not accurate enough to represent the number of nanoseconds since the Epoch."
<eam> that's kinda half why
<al2o3-cr> use rational then
<eam> it's more like they're representing ns in a float as a fraction
<eam> and simply by using a fractional representation you change the meaning -- because X/base isn't the same thing as an integer sequence
<eam> the whole 0.1 in a float can't be accurately represented issue
JeanCarloMachado has joined #ruby
replay has joined #ruby
Moosashi has quit [Quit: Moosashi]
ratatine has joined #ruby
<eam> consider: with time you might want to count each discrete nanosecond between two seconds, to step through all billion of them
jenrzzz has quit [Ping timeout: 265 seconds]
<eam> forget about how many since epoch - just think about the billion ns in one second
hornairs has joined #ruby
* ratatine joins the channel and has his head explode.
<ratatine> Thanks eam.
<eam> if you have a tuple of [sec, nsec] then you can do this
elenatanasoiu has quit [Ping timeout: 276 seconds]
<eam> but if you have an IEEE floating point representation then you can't, because some of the discrete values can't be represented as a fractional base
<eam> which is why the underlying system apis like gettimeofday() or clock_getime() always use an integer for the seconds component and a second integer for the ns or us component
sai_ has quit [Remote host closed the connection]
<eam> ratatine: happy to be of service
bmurt has joined #ruby
<eam> but anyway yeah a double can't even handle accurate ns timekeeping within a single second window
LoneHerm_ has joined #ruby
_sfiguser has quit [Ping timeout: 265 seconds]
AzureStigma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BackEndCoder has quit [Excess Flood]
BackEndCoder has joined #ruby
mistermocha has joined #ruby
saneax-_-|AFK is now known as saneax
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
etetz has quit [Remote host closed the connection]
cdg has quit [Remote host closed the connection]
etetz has joined #ruby
jazzonmym111nd has joined #ruby
ledestin has quit [Ping timeout: 276 seconds]
<al2o3-cr> 0.33333 is near enough to 10/3... trust mine to stop for a shit....
jazzonmym11nd has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
herbmillerjr has joined #ruby
<al2o3-cr> fixed.com
Paradox has quit [Ping timeout: 244 seconds]
hfp_work has quit [Ping timeout: 244 seconds]
<al2o3-cr> bhr is not legit
weemsledeux has quit [Ping timeout: 244 seconds]
shtirlic has quit [Ping timeout: 244 seconds]
mistermocha has quit [Ping timeout: 260 seconds]
Paradox has joined #ruby
jaequery has joined #ruby
eregon has quit [Quit: No Ping reply in 180 seconds.]
arnonhongklay has quit [Ping timeout: 265 seconds]
etetz has quit [Ping timeout: 250 seconds]
hfp_work has joined #ruby
<al2o3-cr> couldn't get worse
Rabbit_ has quit [Ping timeout: 244 seconds]
eregon has joined #ruby
Rabbit_ has joined #ruby
pocketprotector has quit [Ping timeout: 244 seconds]
<jaequery> hello
elenatanasoiu has joined #ruby
johnmccabe has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jaequery> is there any library that lets you perform async tasks as easily as this? async do { ...some background job ... }
shtirlic has joined #ruby
pocketprotector has joined #ruby
pragmaticus has quit [Remote host closed the connection]
ghostlight has quit [Ping timeout: 255 seconds]
<havenwood> al2o3-cr: wrong subject matter for this channel. please keep it on-topic or take it to the #ruby-offtopic channel!
<jazzonmym111nd> jaequery: Thread.new {} :p
<jaequery> whats the downside of it?
_sfiguser has joined #ruby
<jaequery> because seems like everyone is opting for sidekiq/etc
<havenwood> jaequery: Ruby itself has threading and process forking or there are a number of gems. See the concurrent-ruby gem: https://github.com/ruby-concurrency/concurrent-ruby
madgen has quit [Ping timeout: 244 seconds]
<havenwood> jaequery: Say more about what you're doing? Or just asking in general?
<jaequery> im just trying to send out emails and not block the page
jphase has quit [Remote host closed the connection]
<jazzonmym111nd> in rails?
<jaequery> nothing crazy
<jaequery> actually in sinatra
<jazzonmym111nd> i see
<jazzonmym111nd> then sidekiq is probably what youre looking for
<havenwood> jaequery: so no Active Job? :-P
<havenwood> or Resque
jphase has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
<jaequery> whats wrong with Thread.new?
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arnonhongklay has joined #ruby
<jazzonmym111nd> it won't survive the lifetime of a http request.
LuckyABA has joined #ruby
<havenwood> jaequery: You might like Sucker Punch: https://github.com/brandonhilkert/sucker_punch
<jazzonmym111nd> in most setups.
elenatanasoiu has quit [Ping timeout: 250 seconds]
<havenwood> jaequery: Storing the job in Redis with disk-backing means you can turn it off and back on again and have jobs mostly still be queued.
<jaequery> why is there no ruby libs that deals async in a fashion where the code to be ran asynchronously can be passed in as a block ?
RegulationD has joined #ruby
<jazzonmym111nd> there is plenty of those but they don't all fit into the web paradigm
<havenwood> jaequery: There are many!
AzureStigma has joined #ruby
<jaequery> im turned off by Object.perform_async("some_method_to_run")
nebg has quit [Ping timeout: 265 seconds]
<jaequery> oh, then pls tell me more!
nankyokusei has joined #ruby
ghostlight has joined #ruby
blackgoat has quit [Ping timeout: 244 seconds]
eregon has quit [Quit: No Ping reply in 180 seconds.]
<Papierkorb> jaequery: Thread.new?
<jazzonmym111nd> if you just do get "/foo" { Thread.new {} } then as soon as the request finishes the thread will likely die too, even if it is doing something, you'd have to call Thread#join at which point you're no longer asynchronous.
<Papierkorb> ?try
<ruby[bot]> Why don't you try it and see for yourself?
yeticry has quit [Ping timeout: 244 seconds]
<jaequery> ohh
blackgoat has joined #ruby
<Papierkorb> Why should it just die?
yeticry has joined #ruby
<Papierkorb> Another option would be #fork
<jaequery> wow that is kind of sad
<jazzonmym111nd> it depends on the web server you're using.
jphase has quit [Ping timeout: 250 seconds]
eregon has joined #ruby
<havenwood> jaequery: Give the concurrent-ruby gem a good look if you're wondering generally. Then take a look at Sidekiq, Resque, DelayedJob, Sucker Punch and other worker queues and consider why you might want to use something like that that instead.
<jaequery> im used to node.js style i guess
AzureStigma has quit [Client Quit]
nebg has joined #ruby
zz_barkerd427 has quit [Ping timeout: 250 seconds]
r4z3r has quit [Ping timeout: 250 seconds]
<Papierkorb> jaequery: Ah for web dev stuff. Yeah, use an external worker process
<havenwood> jaequery: Node doesn't have threading or forking so it can't really use such a strategy. You're free to used evented io in Ruby as well.
<jaequery> was wondering if ruby had something similar, i mean i do prefer ruby's synchronous by default
<jaequery> but sometimes i do miss node.js async nature
<jaequery> i want something as elegant as, async do { ..... chunk of code .... }
dminuoso has joined #ruby
<havenwood> jaequery: It seems you haven't looked at the popular Ruby concurrency libraries like concurrent-ruby and celluloid.
<jaequery> im surprised im having such a hard time finding something like that
<jazzonmym111nd> sidekiq is built on celluloid.
<Papierkorb> Not anymore jazzonmym111nd
<havenwood> jazzonmym111nd: it used to be
r4z3r has joined #ruby
<jazzonmym111nd> oh wow. why did that change?
<havenwood> Sucker Punch used to be as well.
jphase has joined #ruby
LuckyABA has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zz_barkerd427 has joined #ruby
<Papierkorb> jazzonmym111nd: He wrote a blog post about it. TL;DR: No problem if you only did I/O anyway, horrible change if you did not :)
nankyokusei has quit [Ping timeout: 260 seconds]
<jaequery> sucker punch , you have to do obj.async_perform("some_method")
<jaequery> can i pass in a block there too?
<jaequery> i guess im a bit picky about elegance of use, so please bear with me
<jaequery> sidekiq wasn't elegant from what i see
<jaequery> maybe im looking at the wrong areas?
<Papierkorb> jaequery: Probably not, why do you insist on using a block btw? That would get quite messy real quick
<jaequery> its just a preference
<havenwood> jaequery: def async &block; Thread.new &block end; async { puts 'is this what you want jaequery?' }
JeanCarloMachado has quit [Quit: leaving]
NetSage has joined #ruby
JeanCarloMachado has joined #ruby
<jaequery> lol i guess i can do that
<jazzonmym111nd> damn, nice speed up
<jaequery> but are there any libs out there that is like that by default usage?
<Papierkorb> jazzonmym111nd: Was a phenomenal slowdown for me. I didn't do just I/O, so...