havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
alveric1 has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Remote host closed the connection]
<foul_owl> How can I run RAILS_ENV=production bundle exec rake redmine:load_default_data passing in the language I want via terminal?
<foul_owl> ie, non interactively
<havenwood> MarkBilk: It seems you're looking for the src attribute of each image?: page.css('img').map { |img| img.attr 'src' }
<havenwood> foul_owl: you want to run it as a background process? or?
<foul_owl> I'm automating via ansible
<foul_owl> So user input cannot happen
Lord_of_Life has joined #ruby
<foul_owl> Is there a way to ask rake what it will prompt me for? and then provide it with env vars or other params perhaps?
DeeJayh has joined #ruby
<foul_owl> Maybe something like: AILS_ENV=production bundle exec rake redmine:load_default_data --language=en ?
<havenwood> foul_owl: You want to pass an argument to the rake task?
<havenwood> foul_owl: Are you writing the rake task? I don't quite get what you're asking.
<foul_owl> I am not writing a rake task, I'm just an end user
<havenwood> foul_owl: I'm not familiar with redmine rake tasks. Is that one that is provided for you? Ah, okay.
<havenwood> foul_owl: And that Redmine rake task is prompting you for input?
<foul_owl> Yes indeed
<foul_owl> I am wondering how I can provide answers non-interactively
<foul_owl> Not just for this particular rake task
<foul_owl> But in general :)
<foul_owl> Thank you!!
<havenwood> foul_owl: Don't make rake tasks interactive.
<havenwood> ;-P
<foul_owl> Sure, but I'm just the end user :P
<foul_owl> There must be some way to avoid it
<havenwood> If you're using them, check the docs. You might need to make your own.
<havenwood> Check the redmine rake task you're using.
enterprisey has joined #ruby
bheesham has joined #ruby
<foul_owl> Ahhhh
<foul_owl> Ok so I can just use an env var
<foul_owl> Thanks! :)
<havenwood> export REDMINE_LANG=whatev
<havenwood> or prefix it like your other env var
<foul_owl> Awesome
<foul_owl> Thanks again!
<havenwood> You're welcome.
Rodya_ has joined #ruby
Rodya_ has quit [Client Quit]
patr0clus has quit [Quit: WeeChat 1.4]
t-recx has quit [Quit: t-recx]
bronson has joined #ruby
romank has quit [Read error: Connection reset by peer]
b0mbnet has joined #ruby
cfec0b8d has quit [Ping timeout: 268 seconds]
romank has joined #ruby
bkxd has joined #ruby
charliesome has joined #ruby
bkxd has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 240 seconds]
dviola has quit [Quit: WeeChat 1.8]
DeeJayh has quit [Ping timeout: 246 seconds]
bronson has quit [Remote host closed the connection]
b0mbnet has quit [Remote host closed the connection]
ornerymoose has joined #ruby
im0nde has quit [Ping timeout: 246 seconds]
d^sh has quit [Ping timeout: 260 seconds]
d^sh has joined #ruby
cschneid_ has joined #ruby
marr has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
NightMonkey has quit [Quit: ZNC - http://znc.in]
foul_owl has quit [Ping timeout: 272 seconds]
NightMonkey has joined #ruby
BSAlb has joined #ruby
BSaboia has quit [Ping timeout: 246 seconds]
DeeJayh has joined #ruby
drudrud555 has joined #ruby
drudrud555 has left #ruby [#ruby]
SenpaiSilver has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
<MarkBilk> havenwood: Thanks! It works! Now I just have to figure out why. Don't know the map {} business. Presumably that's standard Ruby. I'll look it up.
gizmore|2 has joined #ruby
blackwind_123 has joined #ruby
gizmore has quit [Ping timeout: 268 seconds]
al2o3-cr has quit [Ping timeout: 260 seconds]
tristanp has joined #ruby
ecuanaso has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
tristanp has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
volty has quit [Ping timeout: 246 seconds]
DeeJayh has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
bkxd has joined #ruby
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
Vile` has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 272 seconds]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
d^sh has quit [Ping timeout: 240 seconds]
romank has joined #ruby
exchgr has quit [Quit: ZNC - http://znc.in]
d^sh has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
apparition has joined #ruby
nofxxxx has quit [Remote host closed the connection]
nofxx has joined #ruby
b0mbnet has joined #ruby
raul782 has joined #ruby
b0mbnet has quit [Remote host closed the connection]
b0mbnet has joined #ruby
oborot has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
bronson has joined #ruby
romank has quit [Read error: Connection reset by peer]
DTZUZU has quit [Ping timeout: 240 seconds]
MarkBilk_ has joined #ruby
romank has joined #ruby
bronson has quit [Ping timeout: 246 seconds]
romank has quit [Read error: Connection reset by peer]
MarkBilk has quit [Ping timeout: 255 seconds]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
jameser has joined #ruby
romank has joined #ruby
genpaku has quit [Remote host closed the connection]
DeeJayh has joined #ruby
genpaku has joined #ruby
b0mbnet has quit [Ping timeout: 240 seconds]
b0mbnet has joined #ruby
jrafanie has joined #ruby
houhoulis has joined #ruby
b0mbnet has quit [Remote host closed the connection]
b0mbnet has joined #ruby
minimalism has quit [Ping timeout: 260 seconds]
KeyJoo has joined #ruby
stupidsenpai has joined #ruby
DTZUZU has joined #ruby
eckhardt has joined #ruby
minimalism has joined #ruby
stupidsenpai has quit [Client Quit]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschnei__ has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
cschnei__ has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 268 seconds]
jphase has quit [Remote host closed the connection]
rdavila has joined #ruby
ddffg has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
jphase has joined #ruby
Paradox has quit [Ping timeout: 240 seconds]
raceho is now known as anyone
hahuang65 has quit [Ping timeout: 246 seconds]
cschneid_ has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
jphase has quit [Client Quit]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
hndk has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
alveric2 has quit [Remote host closed the connection]
Paradox has joined #ruby
Puppet_ has joined #ruby
cschneid_ has joined #ruby
romank has quit [Read error: Connection reset by peer]
DeeJayh has quit [Ping timeout: 246 seconds]
jrafanie has joined #ruby
Silthias1 has joined #ruby
hahuang65 has joined #ruby
Silthias has quit [Ping timeout: 246 seconds]
romank has joined #ruby
cschneid_ has quit [Ping timeout: 255 seconds]
cschneid_ has joined #ruby
HoierM has quit [Ping timeout: 246 seconds]
b0mbnet has quit [Remote host closed the connection]
cschneid_ has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 260 seconds]
b0mbnet has joined #ruby
houhoulis has quit [Remote host closed the connection]
captaintuffy has quit [Quit: ChatZilla 0.9.93 [Firefox 51.0.1/20170201180315]]
Krebsgewehr has joined #ruby
rdavila has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has quit [Remote host closed the connection]
jeffreylevesque has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
b0mbnet has quit [Remote host closed the connection]
b0mbnet has joined #ruby
romank has quit [Read error: Connection reset by peer]
bronson has joined #ruby
romank has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
bronson has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Quit: WeeChat 1.5]
gix has quit [Ping timeout: 246 seconds]
raul782 has quit [Remote host closed the connection]
claw has quit [Ping timeout: 240 seconds]
raul782 has joined #ruby
gix has joined #ruby
b0mbnet has quit [Remote host closed the connection]
pb122 has joined #ruby
zapata has quit [Quit: WeeChat 1.8]
pb122 has quit [Max SendQ exceeded]
pb122 has joined #ruby
enterprisey has joined #ruby
DeeJayh has joined #ruby
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Mia has quit [Read error: Connection reset by peer]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nadir has joined #ruby
claw has joined #ruby
Axy has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 246 seconds]
romank has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
romank has joined #ruby
eightlimbed has joined #ruby
claw has quit [Ping timeout: 246 seconds]
Paradox has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
Paradox has joined #ruby
ur5us_ has joined #ruby
claw has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby
nebiros has quit [Quit: 🤷‍♂️]
tristanp has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
donske has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
jane_booty_doe has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
zapata has joined #ruby
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
nebiros has joined #ruby
latemus has quit [Quit: leaving]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
renchan has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
zepy_aq has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
ndrei has joined #ruby
sneakerhax has quit [Quit: Back later]
eightlimbed has quit [Ping timeout: 268 seconds]
sneakerhax has joined #ruby
hndk has quit [Quit: Leaving]
mim1k has joined #ruby
cyclonis has joined #ruby
apparition has joined #ruby
benlieb has joined #ruby
b0mbnet has joined #ruby
romank has quit [Read error: Connection reset by peer]
pankaj_ has joined #ruby
Vile` has quit [Ping timeout: 240 seconds]
romank has joined #ruby
mim1k has quit [Ping timeout: 272 seconds]
ndrei has quit [Quit: Lost terminal]
ndrei has joined #ruby
eputnam_ has quit [Quit: eputnam_]
xall has joined #ruby
boringcp1 has joined #ruby
hahuang65 has joined #ruby
stormbytes has quit [Quit: Textual IRC Client: www.textualapp.com]
boringcpg has quit [Ping timeout: 268 seconds]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
yirabbit has joined #ruby
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
cagmz has quit [Read error: Connection reset by peer]
oleo has quit [Quit: irc client terminated!]
jamesaxl has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
jamesaxl has joined #ruby
stormbytes has joined #ruby
bkxd has joined #ruby
nofxxx has joined #ruby
oborot has quit [Ping timeout: 240 seconds]
raul782 has quit []
cschneid_ has quit [Ping timeout: 245 seconds]
jaruga has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
nofxx has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 258 seconds]
bkxd has joined #ruby
ornerymoose has quit [Quit: ornerymoose]
tildes has joined #ruby
bronson has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
romank has quit [Read error: Connection reset by peer]
biberu has joined #ruby
romank has joined #ruby
jusa has joined #ruby
bronson has quit [Ping timeout: 268 seconds]
benlieb has quit [Quit: benlieb]
ur5us_ has quit [Remote host closed the connection]
anisha has joined #ruby
minimalism has quit [Quit: minimalism]
Tomthetom has joined #ruby
minimalism has joined #ruby
uZiel has joined #ruby
alazred has joined #ruby
xall has quit [Ping timeout: 272 seconds]
b0mbnet has quit [Remote host closed the connection]
aufi has joined #ruby
b0mbnet has joined #ruby
ledestin has joined #ruby
__Yiota has joined #ruby
Fysicus has quit [Ping timeout: 260 seconds]
bernd9000 has quit [Remote host closed the connection]
nowhere_man has joined #ruby
hahuang65 has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ndrei has quit [Quit: Lost terminal]
cyclonis has joined #ruby
anyone is now known as acemo
hahuang65 has quit [Ping timeout: 272 seconds]
blackwind_123 has quit [Ping timeout: 255 seconds]
tildes has quit [Ping timeout: 268 seconds]
cyclonis has quit [Ping timeout: 246 seconds]
Mortomes|Work has joined #ruby
blackwind_123 has joined #ruby
cfec0b8d has joined #ruby
FastJack_ has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
romank has quit [Read error: Connection reset by peer]
romank has joined #ruby
benlieb has joined #ruby
ndrei has joined #ruby
romank has quit [Read error: Connection reset by peer]
conta has joined #ruby
yogg-saron has joined #ruby
pandaant has joined #ruby
xall has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
conta has quit [Client Quit]
conta has joined #ruby
romank has joined #ruby
b0mbnet has quit [Remote host closed the connection]
b0mbnet has joined #ruby
b0mbnet has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
dionysus69 has joined #ruby
DoubleMalt has quit [Read error: Connection reset by peer]
b0mbnet has joined #ruby
bheesham has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Client Quit]
pankaj_ has quit [Ping timeout: 268 seconds]
charliesome has joined #ruby
dionysus69 has joined #ruby
benlieb has quit [Quit: benlieb]
<dionysus69> has anyone worked with google api? I have an error with `require 'google/api_client/client_secrets'` after installing gem `google-api-client`
<dionysus69> i am just trying to make a hello world connection. I was successful with a public file but no luck with google authentication system
b0mbnet has quit [Remote host closed the connection]
pankaj_ has joined #ruby
jackrandom has joined #ruby
jgnagy has quit [Remote host closed the connection]
robotmay has joined #ruby
jgnagy has joined #ruby
romank has quit [Read error: Connection reset by peer]
SaschaVoid has joined #ruby
hahuang65 has joined #ruby
romank has joined #ruby
FastJack_ has quit [Quit: leaving]
cyclonis has joined #ruby
FastJack has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xall has quit [Quit: xall]
ecuanaso has joined #ruby
cyclonis has quit [Ping timeout: 246 seconds]
Kug3lis has joined #ruby
romank has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
kith has quit [Ping timeout: 268 seconds]
oborot has joined #ruby
antgel_ has joined #ruby
P4f73k has quit [Ping timeout: 268 seconds]
P4f73k has joined #ruby
b0mbnet has joined #ruby
moei has quit [Quit: Leaving...]
mark_66 has joined #ruby
romank has joined #ruby
anvor has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
oborot has quit [Ping timeout: 260 seconds]
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
andikr has joined #ruby
anvor has joined #ruby
bronson has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zacts has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
marr has joined #ruby
al2o3-cr has quit [Ping timeout: 272 seconds]
romank has quit [Read error: Connection reset by peer]
blackmesa has joined #ruby
kmhn has quit [Remote host closed the connection]
User458764 has joined #ruby
User458764 has quit [Remote host closed the connection]
kmhn has joined #ruby
romank has joined #ruby
yogg-saron has joined #ruby
b0mbnet has quit [Remote host closed the connection]
hanmac has quit [Ping timeout: 245 seconds]
b0mbnet has joined #ruby
ddffg has joined #ruby
stan has joined #ruby
Burgestrand has joined #ruby
romank has quit [Read error: Connection reset by peer]
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
Silthias has joined #ruby
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
moei has joined #ruby
Silthias1 has quit [Ping timeout: 260 seconds]
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
romank has joined #ruby
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
mim1k has joined #ruby
hahuang65 has joined #ruby
hanmac has joined #ruby
mdw has joined #ruby
jane_booty_doe has quit [Quit: Leaving]
cyclonis has joined #ruby
hahuang65 has quit [Ping timeout: 255 seconds]
haxrbyte has quit [Quit: Leaving...]
Silox| has joined #ruby
ur5us has joined #ruby
Beams has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Doow has joined #ruby
djbkd has joined #ruby
morfin has joined #ruby
<morfin> hello again
<morfin> did anybody build Ruby with OpenSSL 1.1?
cyclonis has quit [Ping timeout: 258 seconds]
b0mbnet has quit [Remote host closed the connection]
<Doow> Hi! What's the fastest way of doing simple string matching? I.e. I want to find all lines in a log containing a specific substring. It's a fixed string, not a regular expression.
<SpComb> /bin/grep
b0mbnet has joined #ruby
<Doow> SpComb, I'd prefer not relying on external dependencies, I also want to do things with the lines I find in a convenient way. =)
b0mbnet has quit [Remote host closed the connection]
<canton7> Doow, String#include?
<Doow> canton7, I'll try that
<SpComb> depending on the substring, something optimized like grep is presumably going to be significantly faster than `lines.each do line.include? ... end`. How much that matters depends on how big your logfiles are
<Doow> SpComb, they're around 1GB
<canton7> yeah, grep pulls some very clever tricks
jenrzzz has quit [Ping timeout: 240 seconds]
<morfin> like what?
<morfin> ah i started remembering
jameswatling has joined #ruby
<SpComb> http://blog.burntsushi.net/ripgrep/#mechanics also this blog post about benchmarking grep implementations
jameswatling has left #ruby [#ruby]
b0mbnet has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
blackwind_123 has quit [Ping timeout: 255 seconds]
djbkd has quit [Ping timeout: 260 seconds]
jackrandom has quit [Remote host closed the connection]
blackwind_123 has joined #ruby
drcode has quit [Quit: ZNC 1.6.5 - http://znc.in]
<SpComb> for a 35MB logfile with 300k lines, grepping for 'foo' with 12 matches, ruby -e `STDIN.read.split("\n").each do |line| puts line if line.include? "foo" end` is ~1100ms real 600ms user, ruby -e `'STDIN.each do ... end` is ~600ms real 460ms user, and `grep -F` is ~130ms real 50ms user
<SpComb> so an ~order of magnitude difference for grep vs ruby loop with String#include?
<SpComb> you might already start noticing that difference with 1GB logfiles :)
<Doow> SpComb, that's quite significant, thanks for input
<Doow> SpComb, yeah, especially as I search for several different items, so it can easily match each line 20 times or more.
uZiel has quit [Ping timeout: 260 seconds]
<Doow> SpComb, I'll do the naive implementation first as I don't really that quick response time, but it's good to have some options if it gets too slow
drcode has joined #ruby
yirabbit has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
mdw has quit [Quit: cya! http://www.somerobots.com]
belmoussaoui has quit [Ping timeout: 268 seconds]
belmoussaoui has joined #ruby
futilegames has joined #ruby
romank has quit [Read error: Connection reset by peer]
b0mbnet has quit [Remote host closed the connection]
mim1k has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
futilegames has quit [Quit: futilegames]
romank has joined #ruby
volty has joined #ruby
hahuang65 has joined #ruby
romank has quit [Read error: Connection reset by peer]
mim1k has quit [Read error: Connection reset by peer]
sonicm has joined #ruby
MarkBilk_ has quit [Ping timeout: 260 seconds]
cyclonis has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
awer_ has quit [Quit: Lost terminal]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
cyclonis has quit [Ping timeout: 240 seconds]
b0mbnet has joined #ruby
anisha has quit [Ping timeout: 246 seconds]
pankaj_ has quit [Ping timeout: 260 seconds]
pankaj_ has joined #ruby
bigkevmcd has joined #ruby
anisha has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
psmmr has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
stormbytes has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<dminuoso> SpComb: Why do folks still use grep?
<dminuoso> It's awful, its slow
<dminuoso> Use ack or better yet silversearcher.
<ljarvis> or now ripgrep, which is considerably faster than them all
<dminuoso> TIL.
blackmesa has quit [Ping timeout: 260 seconds]
b0mbnet has quit [Remote host closed the connection]
bronson has joined #ruby
b0mbnet has joined #ruby
uZiel has joined #ruby
<dminuoso> ljarvis: "ripgrep combines the usability of The Silver Searcher with the raw speed of grep."
<dminuoso> Is that meant to be a joke?
<morfin> i will try use that paches for OpenSSL hmm
<ljarvis> dminuoso: heh, i don't know
<manveru> i use ag in term and fzy for vim
<ljarvis> me too
bronson has quit [Ping timeout: 255 seconds]
kassav_ has joined #ruby
<ljarvis> er, fzf
<ljarvis> is fzy something different?
<ljarvis> thanks
konsolebox has joined #ruby
<ljarvis> keeping up with this stuff is a tad boring :)
<manveru> hehe
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has quit [Remote host closed the connection]
pankaj_ has quit [Quit: Leaving]
bheesham has joined #ruby
tvw has joined #ruby
bheesham has quit [Ping timeout: 240 seconds]
romank has joined #ruby
belmoussaoui has quit [Quit: belmoussaoui]
Silthias has quit [Ping timeout: 272 seconds]
belmoussaoui has joined #ruby
dionysus70 has joined #ruby
nowhere_man has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus70 is now known as dionysus69
nowhere_man has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Client Quit]
mtkd has joined #ruby
nowhere_man has joined #ruby
Silthias has joined #ruby
b0mbnet has quit [Remote host closed the connection]
xall has joined #ruby
<dminuoso> I wonder whether zsh has something like that bolted in already
yirabbit_ has joined #ruby
belmoussaoui_ has joined #ruby
mim1k has joined #ruby
hahuang65 has joined #ruby
belmoussaoui has quit [Ping timeout: 240 seconds]
yirabbit_ has quit [Ping timeout: 260 seconds]
psmmr has quit [Remote host closed the connection]
nobitanobi has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
cyclonis has joined #ruby
cschneid_ has joined #ruby
belmoussaoui_ has quit [Read error: Connection reset by peer]
cyclonis has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
kassav__ has joined #ruby
im0nde has joined #ruby
oborot_ has joined #ruby
yirabbit_ has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
kassav_ has quit [Ping timeout: 246 seconds]
<Bish> how do i chunk into pairs?
<Bish> [a,b,c,d] => [[a,b],[c,d]] ?
<ljarvis> >> [:a,:b,:c,:d].each_slice(2).to_a
<ruby[bot]> ljarvis: # => [[:a, :b], [:c, :d]] (https://eval.in/802560)
<dminuoso> Bish: each_slice
<Bish> thanks
<dminuoso> Bah.
<dminuoso> Beat me it.
oborot_ has quit [Ping timeout: 240 seconds]
<dminuoso> Actually I transmitted this information with faster-than-light speed, and ljarvis just copied his answer based on mine.
<ljarvis> it's true, im a fraud
<dminuoso> Also you violated causality.
<dminuoso> You should be hanged.
<ljarvis> *blows pistol and whips it back into holster*
belmoussaoui_ has quit [Ping timeout: 240 seconds]
<Bish> okay, how do i get this?
<Bish> [a,b,c] => [a..b,b..a,b..c] ?
<canton7> >> [:a, :b, :c].each_cons(2).to_a
<ruby[bot]> canton7: # => [[:a, :b], [:b, :c]] (https://eval.in/802564)
<dminuoso> you also want b..a?
<canton7> oh, missed b..a. What's that doing in there? Why isn't there a c..b?
<dminuoso> or a c..a?
<Bish> [a,b,c] => [a..b,b..c] ?
<Bish> sorry
<Bish> only 2
<canton7> what I said, then
<Bish> what does cons stand for?
<canton7> consecutive, probably
<ljarvis> consecutive
aspiers has joined #ruby
workmad3_ is now known as workmad3
<ljarvis> also, .. is for ranges
<ljarvis> do you want ranges?
Burgestrand has quit [Ping timeout: 272 seconds]
<Bish> yes, i just mapped it
volty has quit [Ping timeout: 260 seconds]
belmoussaoui has joined #ruby
<Bish> first_day = Date.new(Date.today.year,1,1);first_mon = first_day+(first_day.wday+1%7);(first_mon..first_datum+52*7).step(7).each_cons(2).map { |x| x.first..x.last }
<Bish> any mistake in here? or something stupid?
<Bish> ( i want all calendar weeks of the current year )
<Bish> first_day = Date.new(Date.today.year,1,1);first_mon = first_day+(first_day.wday+1%7);(first_mon..first_mon+52*7).step(7).each_cons(2).map { |x| x.first..x.last } < rather
drcode has quit [Quit: ZNC 1.6.5 - http://znc.in]
<canton7> Bish, 'first_day.wday+1%7' <-- watch your precedence
<ljarvis> tbh im a bit confused about what you want even reading that
<Bish> a year has 52 weeks, i want an array of beginning and end of each
<ljarvis> array of dates? for the monday and sunday of every week?
<Bish> kinda
<ljarvis> lol
<Bish> what's so funny about that :(
Burgestrand has joined #ruby
<canton7> heh, that's useless. Now we know that ljarvis was almost right, but not what's wrong or right about it...
<canton7> "You don't know quite know what my problem is. Now help me fix it!"
<Bish> i don't follow :(
<tobiasvl> Bish: what do you mean by "kinda"
<Bish> i mean yes
<tobiasvl> you want "kinda" what ljarvis said, what's different from what ljarvis said?
<Bish> but the 1.1.YYYY doesn't need to be a monday
<canton7> what are you trying to do? you said that "array of dates? for the monday and sunday of every week?" was "kinda" right. So, in what way is it right, and in what was is it wrong?
<Bish> so it's not just monday to sunday
<Bish> it might be the first week of the year starts friday
FastJack has quit [Remote host closed the connection]
<ljarvis> So this year starts on Sunday, what are the first 3 values of your array?
<Bish> >> first_day = Date.new(Date.today.year,1,1);first_mon = first_day+(first_day.wday+1%7);(first_mon..first_mon+52*7).step(7).each_cons(2).map { |x| x.first..x.last }[1..3]
<Bish> :p
<ljarvis> no
<ljarvis> that doesn't help
<ljarvis> So this year starts on Sunday, what are the first 3 values of your array?
<canton7> "here's my incorrect code: this answers your question!"
<Bish> the first should be the first week.. meaning sunday to sunday
<manveru> did the bot die?
<ljarvis> so it's *every day*?
<canton7> Bish, what are the *actual* first 3 values of the array?
<ljarvis> ^
<canton7> as actual numbers?
<Bish> no it's [Sunday..Sunday,Monday..Sunday,Monday..Sunday]
<Bish> 52 times, until the last week of the year
drcode has joined #ruby
<canton7> ok, so the first partial week appears as the first element, and the last partial week appears as the last element?
<canton7> and are those first two 'Sunday's the same value? Or are they the 1st and 7th?
<manveru> (Date.new(Date.today.year,1,1)..Date.new(Date.today.year,12,31)).group_by{|d| d.cweek }.map{|k,v| (v.first..v.last) }
<canton7> so is it [yyyy-01-01..yyyy-01-01, yyyy-01-02..yyyy-01-08] or [yyyy-01-01..yyyy-01-08, yyyyy-08-09..yyyy-01-15] ?
<manveru> hmm, got a bug somwhere
<manveru> 01.01 counts as calendar week 52 :P
tvw has quit []
tvw has joined #ruby
<manveru> oh well, was worth a try
soahccc_ is now known as soahccc
nobitanobi has quit [Remote host closed the connection]
SaschaVoid has quit [Quit: die();]
belmoussaoui has quit [Read error: Connection reset by peer]
belmoussaoui_ has joined #ruby
alazred has quit [Ping timeout: 260 seconds]
alazred has joined #ruby
alazred has quit [Changing host]
alazred has joined #ruby
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
yirabbit_ has quit [Ping timeout: 268 seconds]
hahuang65 has joined #ruby
yirabbit_ has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
Fernando-Basso has joined #ruby
Silox| has quit [Quit: Connection closed for inactivity]
yirabbit_ has quit [Remote host closed the connection]
yirabbit_ has joined #ruby
jameswatling has joined #ruby
cyclonis has joined #ruby
qguv has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
yirabbit_ has quit [Remote host closed the connection]
yirabbit_ has joined #ruby
DeeJayh-L has joined #ruby
DeeJayh has quit [Remote host closed the connection]
DeeJayh has joined #ruby
anisha has joined #ruby
jameswatling has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
belmoussaoui has joined #ruby
anisha_ has joined #ruby
belmoussaoui_ has quit [Remote host closed the connection]
anisha has quit [Ping timeout: 258 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kassav_ has joined #ruby
FastJack has joined #ruby
kassav__ has quit [Read error: Connection reset by peer]
Mortomes|Work has quit [Ping timeout: 260 seconds]
xall has quit [Ping timeout: 240 seconds]
nhhc has joined #ruby
HoierM has joined #ruby
anisha_ has quit [Read error: Connection reset by peer]
User458764 has joined #ruby
anisha_ has joined #ruby
bronson has joined #ruby
nowhere_man has quit [Ping timeout: 268 seconds]
DeeJayh-L_ has joined #ruby
DeeJayh-L has quit [Ping timeout: 258 seconds]
<dionysus69> I have stylistic question
<dionysus69> let's say I have this method and it has 17 lines https://gist.github.com/anonymous/a8b54f851d7dfcf1700f63973787a4e6 rubocop complains with its default set to 10 line length per method
<dionysus69> how would you make this shorter? I just want to see what can be done in general.
bronson has quit [Ping timeout: 260 seconds]
sonOfRa has quit [Remote host closed the connection]
sonOfRa has joined #ruby
nowhere_man has joined #ruby
DeeJayh has quit [Ping timeout: 258 seconds]
jameswatling has joined #ruby
<dminuoso> dionysus69: you wouldn't.
<dminuoso> dionysus69: The issue is you.
<dminuoso> dionysus69: You think that if rubocop tells you something you have to fix it.
catbusters has joined #ruby
<dminuoso> dionysus69: Disable the cop using # rubocop:disable ThatStupidRule
<dionysus69> I haven't written that method :P google did, I just wanted to know how I would refactor it if I wanted to
<dionysus69> :D :D :D
<dminuoso> dionysus69: Rules are meant to find code smells.
<dminuoso> Some code smells are not issues.
<dminuoso> They just smell.
<dminuoso> But sometimes engine oil smells, that's not proof of it being bad.
<dionysus69> ok ok, I know how to disable it, I just wanted to know if it was possible to make it shorter :P :) I guess it is but I didnt want to do it an uglier way than it is
<dminuoso> dionysus69: I would do only one thing. restructure the if block to say:
bheesham has joined #ruby
<dminuoso> if !credentials.nil?; return credentials; end;
anisha_ has quit [Read error: Connection reset by peer]
<dionysus69> the idea is that the rest wouldnt have to be parsed by the interpreter?
<dminuoso> or I guess you could go straight if credentials (depending on whether `true' is a possibility)
anisha_ has joined #ruby
<dminuoso> dionysus69: I just dislike unnecessary indention. It reduces readability in general.
<workmad3> dionysus69: I'd also explore extracting the fallback OOB auth into a separate method, which would allow you to do `credentials ||= oob_authentication(...)` rather than a big chunk of code in the `if`
<workmad3> dionysus69: and I suspect you'll also a lose a line when you stop hard-coding the user ID
<dionysus69> oh well ye, that user id is irrelevant since i am just building a single user script, won't be part of an app
<dminuoso> dionysus69: And you could create a method that obtains the authorizer which might actually be a good idea.
<workmad3> dionysus69: oh, if it's a script, I wouldn't even bother running rubocop on it
<dionysus69> xD
bheesham has quit [Ping timeout: 240 seconds]
<dminuoso> dionysus69: The other problem is again that particular rule. I think it's the most problematic of them all.
<workmad3> code-style for one-off or isolated scripts is pretty different from code-style for application code...
<dminuoso> dionysus69: If a method is long it's usually an indicator of bad code design, but often you can't "make it shorter" because the problem is a design problem, not a code problem
DeeJayh has joined #ruby
ldnunes has joined #ruby
<workmad3> dminuoso: hmm... you can normally extract stuff out into helper methods, and then move them around to places where they fit better, which improves the code design... so the warning can be an indicator that you should take a look at it IMO ):
<workmad3> *:)
<dionysus69> ok ok thanks allot guys, I learned something new xD
bkxd has joined #ruby
<dminuoso> workmad3: Yeah, but as you put it: its just an indicator that something _may_ be off.
<workmad3> so I wouldn't just turn off the rule... I'd consider setting it to a threshold where I'd want to take a look at a method though
<dionysus69> by the end of the day you could just create a module and include it, that will cut down any size method into needed size
<workmad3> dminuoso: heh :) that's true of all rubocop rules
qguv has quit [Quit: bye]
<dminuoso> workmad3: I lint my code to enforce strict conventions and catch bugs. ==/=== in JS for example :P
<workmad3> dionysus69: I prefer to leave the method as is rather than do a crappy hack-job like that to quiet a rubocop warning though
jameser has joined #ruby
<dminuoso> ^-
<dionysus69> ye I wouldn't bother in this case
<dminuoso> which brings us back to my initial:
<dminuoso> dminuoso | dionysus69: Disable the cop using # rubocop:disable ThatStupidRule
<dionysus69> i just asked out of curiousity
<workmad3> dminuoso: heh :) I wouldn't even disable the rule
<dionysus69> :D
<dminuoso> workmad3: For the file
synthroid has joined #ruby
<workmad3> dminuoso: because I'd want it to pop up again for that method next time I looked at it, as a reminder to take a look once I know more
<dminuoso> oh.
<dminuoso> workmad3: If I did that, my eslint would emit thousands of warnings..
<dminuoso> :P
blackmesa has joined #ruby
<workmad3> I leave the odd bit of 'mess' around when I don't know exactly what I want to clean it up to yet :)
<workmad3> rather than disable the warnings or sweep it under the rug with a hacky workaround to the rule
<workmad3> dminuoso: heh :) I've got rubocop on in codeclimate and I only really pay attention to them in PRs... so I only bother looking at warnings for code I've touched rather than every file on every build
<dminuoso> workmad3: Half my react components have a "// eslint-disable-line react/prefer-stateless-function" for example because there are some edge cases where I cant use stateless components for other reasons.
<dminuoso> Or "// eslint-disable-line func-names" because you can't have anonymous generator functions in JavaScript.. :(
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> workmad3: Mmmm. Do you have a custom tweaked config?
jameser has quit [Client Quit]
jackrandom has joined #ruby
<dminuoso> *arrow generator functions I meant btw.
<workmad3> dminuoso: I don't do much JS atm tbh
jameswatling has quit [Remote host closed the connection]
<workmad3> and I've not got much in the way of tweaked config for rubocop or code-climate in general...
jameswatling has joined #ruby
pandaant has quit [Remote host closed the connection]
<dminuoso> Oh I just talk about eslint because I barely use actual rubocop, figured it didn't make much difference
<workmad3> it's annoying to keep config synced between the dozen or so repos that my team has to keep on top of, so we tend to stick fairly close to normal :)
<dminuoso> workmad3: git submodules?
<workmad3> ewwww
<dminuoso> :D
<workmad3> (also, while it solves that problem, submodules tend to introduce so many other problems that I never bother with them nowadays :) )
hashrocket has joined #ruby
<workmad3> dminuoso: and I only brought up that I don't do much JS because it's relevant for tweaked configs, not for the rest of the discussion :)
<dminuoso> Oh heh.
<dminuoso> workmad3: Fair enough.
bernd27 has joined #ruby
<matthewd> Rubocop does have an 'inherit_gem' thing to keep configs in sync
tvw has quit [Ping timeout: 245 seconds]
nobitanobi has joined #ruby
jameswatling has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
jackrandom has quit [Ping timeout: 246 seconds]
Burgestrand has quit [Read error: Connection reset by peer]
ddffg has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
bkxd has joined #ruby
tvw has joined #ruby
andrewhl has joined #ruby
mim1k has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
Mortomes|Train has joined #ruby
dachi has joined #ruby
DeeJayh has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 245 seconds]
kassav__ has joined #ruby
jameser has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bernd9000 has joined #ruby
kube has joined #ruby
belmoussaoui_ has joined #ruby
nobitanobi has quit []
belmoussaoui has quit [Read error: Connection reset by peer]
dachi has quit [Client Quit]
kassav_ has quit [Ping timeout: 260 seconds]
bernd27 has quit [Ping timeout: 268 seconds]
houhoulis has joined #ruby
oborot_ has joined #ruby
jeffreylevesque has quit [Ping timeout: 240 seconds]
DeeJayh has joined #ruby
oborot_ has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
belmoussaoui_ has quit [Read error: Connection reset by peer]
DeeJayh-L has joined #ruby
DeeJayh-L_ has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
<dionysus69> `get_spreadsheet_values': wrong number of arguments (given 3, expected 2) (ArgumentError)
<dionysus69> I am passing majorDimension as "ROWS" but it says it cant expect 3 params
<dionysus69> whereas documentation clearly supports the param I am passing
sonicm_ has joined #ruby
sonicm has quit [Ping timeout: 260 seconds]
ResidentBiscuit has joined #ruby
t-recx has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
belmoussaoui has quit [Ping timeout: 260 seconds]
yirabbit_ has quit [Ping timeout: 240 seconds]
<universa1> dionysus69: your code?
blackmesa has quit [Ping timeout: 240 seconds]
ResidentBiscuit has quit [Read error: Connection reset by peer]
<dionysus69> one sek
<dionysus69> trying one more thing
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Read error: Connection reset by peer]
zepy_aq has joined #ruby
ResidentBiscuit has joined #ruby
<universa1> dionysus69: and?
<dminuoso> Yes please do share.
xall has joined #ruby
DeeJayh-L has quit [Ping timeout: 240 seconds]
ornerymoose has joined #ruby
DeeJayh has quit [Ping timeout: 260 seconds]
ornerymoose_ has joined #ruby
ornerymoose has quit [Ping timeout: 260 seconds]
ornerymoose_ is now known as ornerymoose
bernd9000 has quit [Remote host closed the connection]
yqt has joined #ruby
jeffreylevesque has joined #ruby
gnufied has joined #ruby
bkxd has quit [Ping timeout: 255 seconds]
yirabbit_ has joined #ruby
uZiel has quit [Ping timeout: 246 seconds]
DeeJayh has joined #ruby
<dionysus69> universa1, dminuoso: sheets_service.get_spreadsheet_values(spreadsheet_id, range, major_dimension: "ROWS")
<dionysus69> I tried once like this majorDimension: "ROWS"
<dminuoso> dionysus69: Which gem version?
<dionysus69> the line i posted works
<dminuoso> dionysus69: Also, you didn't read the documentation clearly :=P
<dionysus69> google-api-client (0.11.2)
<dminuoso> or? wait
<dminuoso> this is so bizarre
<dionysus69> i tried all combinations and finally this worked (spreadsheet_id, range, major_dimension: "ROWS")
<dionysus69> or COLUMNS instead of rows
Mortomes|Train has quit [Ping timeout: 260 seconds]
<matthewd> dionysus69: So the above is code that's working?
<dionysus69> yep
<dionysus69> range = "Sheet1!A2:B5"
<dionysus69> status2_response = sheets_service.get_spreadsheet_values(spreadsheet_id, range, major_dimension: "ROWS")
<dionysus69> sheets_service = Google::Apis::SheetsV4::SheetsService.new, also sheets_service needs authorization if it is not public
<dionysus69> sheets_service.authorization = authorize is the method i posted in gist before
<dionysus69> google has great api for ruby too ! enjoy :D
Bhootrk_ has joined #ruby
Bhootrk_ has quit [Max SendQ exceeded]
<dionysus69> i spent hours to get started since there's no straightforward one place to get started on Oauth authentication, and there are many unknown variables at once when you are starting
mim1k has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
insanedreamer has joined #ruby
hahuang65 has joined #ruby
andrewhl has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
stokachu_ has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
DLSteve has joined #ruby
jameser has joined #ruby
SteenJobs has joined #ruby
DeeJayh has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 240 seconds]
<dminuoso> dionysus69: Start by understanding how OAuth2 works.
<dminuoso> So you dont have to randomly guess.
patarr has joined #ruby
<dminuoso> dionysus69: Which flow are you using?
<dminuoso> (And by "flow" I mean grant type)
qguv has joined #ruby
<dminuoso> dionysus69: https://www.digitalocean.com/community/tutorials/an-introduction-to-oauth-2 this is an excellent resource covering the exact terminology, and it talks about all the 4 possible grants.
hanna has quit [Remote host closed the connection]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hanna has joined #ruby
<dionysus69> dminuoso: not sure which one, i think its application
<dionysus69> I am just making a script
jameser has joined #ruby
<dionysus69> for automation
charliesome has joined #ruby
ddffg has joined #ruby
FastJack has quit [Remote host closed the connection]
insanedreamer has left #ruby [#ruby]
<dionysus69> i read those 4 grants, I dont really get what those use cases really are anyway xD
<dminuoso> dionysus69: The problem is delegated authorization. How do you have a server A give permission to server B to act on behalf of a user C that owns some data behind server D.
bronson has joined #ruby
<dionysus69> ye thats some mind twister
<dionysus69> i have a client pc which needs to read/write to gdoc and google auth needs to authorize that :D thats how I see it :)
<dminuoso> dionysus69: Or from another perspective: A user "dion" wants to give server A permission to access personal information stored on server B, but without giving server "A" a password.
<dminuoso> and OAuth tackles this problem exactly in a way that server A will never receive anything that can be used to cause (much) damage.
tlaxkit has joined #ruby
<dminuoso> dionysus69: And OAuth does this by introducing a fourth party, the "OAuth server" which basically hands out some security token that can be used by anyone to gain access to "dions personal information at server B" -> now the grant types describe 4 different ways how that token can be obtained
<dminuoso> With different security perspectives
<dminuoso> Can B be trusted with the password of the user?
bronson has quit [Ping timeout: 258 seconds]
<dminuoso> Is the token long lived? Do we need a mechanism to get new tokens without re-doing the whole authentication process?
<dionysus69> I guess oauth is based on RSA architecture, isn't it?
<dminuoso> dionysus69: No.
DeeJayh has joined #ruby
<dminuoso> dionysus69: Are you talking about OAuth2 btw?
<dminuoso> Because OAuth2 is significantly different from OAuth1
<dionysus69> I know nothing about either of those
<dminuoso> dionysus69: Then it's probably OAuth2. There's no encryption defined in OAuth2.
<dionysus69> i just know there is secret key and there are access tokens generated acting as passwords :P
<dminuoso> dionysus69: They are just random numbers with no meaning.
<dminuoso> The only thing with meaning is the final "access token", and oauth2 does not define the format of that at all.
houhoulis has quit [Remote host closed the connection]
kassav_ has joined #ruby
<dionysus69> for security reasons?
<dminuoso> no, for implementatoin freedom.
<dminuoso> oauth just defines a format and flow *how* tokens are exchanged.
<dminuoso> not what they contain.
<dionysus69> oh I see
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
cdg has joined #ruby
<dminuoso> though for everything except the final access token you just use random numbers
<dionysus69> I ll dive into that sometime I guess, but atm I think just reading google guides is enough for my purposes :D
<dminuoso> the final access token can have various forms, JWT, but random numbers also wor
<dminuoso> *work
<dminuoso> dionysus69: And as for encryption, OAuth2 assumes TLS for secrecy for the entire communication.
<dminuoso> Which means OAuth2 has no signature/encryption itself.
bheesham has joined #ruby
<dminuoso> And whether your final access token has some (RSA for example) encryption or digital signature is up to you really.
<dionysus69> TLS meaning https right?
<dminuoso> dionysus69: Sure.
<dionysus69> ok, I ll keep that in mind xD for my own deployed apps
kassav__ has quit [Ping timeout: 240 seconds]
<dionysus69> i just started working on some real production project in rails, you ll see me in rails channel allot xD
<dminuoso> dionysus69: the authorization grant is the hardest to grasp. I recommend you wrap your head around the "implicit grant" which is the most natural
jrafanie has joined #ruby
MarkBilk has joined #ruby
<dionysus69> kk i ll google that thanks ))
<dminuoso> dionysus69: Beyond that, that flow chart describes the choice of which grant to use.
bheesham has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
<dionysus69> ok :)
<dionysus69> I dont know what most of the things mean on that chart :D
<dionysus69> so client credential grant would be used for server to server communication?
nadir has quit [Quit: Connection closed for inactivity]
oleo has joined #ruby
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
griffindy has joined #ruby
MarkBilk has left #ruby ["Leaving"]
MarkBilk has joined #ruby
kristofferR has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FastJack has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alazred has quit [Ping timeout: 260 seconds]
tlaxkit has quit [Ping timeout: 272 seconds]
DeeJayh has quit [Ping timeout: 268 seconds]
ResidentBiscuit has quit [Read error: Connection reset by peer]
tlaxkit has joined #ruby
qguv has quit [Quit: bye]
xall has quit [Ping timeout: 240 seconds]
andikr has quit [Remote host closed the connection]
qguv has joined #ruby
User458764 has joined #ruby
qguv has quit [Client Quit]
DeeJayh has joined #ruby
hahuang65 has joined #ruby
redaudit has joined #ruby
theunraveler has joined #ruby
qguv has joined #ruby
Beams has quit [Quit: .]
cdg_ has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
xall has joined #ruby
cdg has quit [Ping timeout: 245 seconds]
patarr has quit [Ping timeout: 255 seconds]
<dminuoso> dionysus69: That depends on what you are talking about..
<dminuoso> dionysus69: The right side is server-to-server communication.
tlaxkit has quit [Ping timeout: 260 seconds]
<dminuoso> d
<dminuoso> dionysus69: the question is who does the access token belong to? a user? or a machine?
oborot has joined #ruby
<dminuoso> And by "user" I mean, is this some interactive scenario with a human person involved?
<dminuoso> if not, then its client credentials grant all the way.
<dionysus69> ye, then i guess i did it the wrong way for my scenario
<dionysus69> i just have a script and I would prefer not to have interactive token granting
<dminuoso> dionysus69: So no user interacts with that script?
<dminuoso> (say through a website)
<dionysus69> but now I am told by the script to go to browser authorize app and get token
<dminuoso> Right.
<dionysus69> no, this is a standalone one time script to do specific job, will be used by admins only
<dminuoso> That's the main purpose of OAuth2. The client credentials grant doesnt really have anything to do with the concept of delegated authorization, and it's just bolted in for completeness.
<dminuoso> does "by admins" mean each requires a different token?
<dminuoso> or do you have an application-based token?
<dionysus69> no no each copy of the script will be used only by one admin
<dminuoso> right, then client credentials grant.
<dminuoso> or password grant
<dionysus69> other people could use it and they would have to provide their own configuration
<dminuoso> kinda would have to know more to say exactly, but both work
<dionysus69> can you explain to me what happens in those cases?
<dionysus69> atm i have it as I explained, I have to go to browser, authorize and get token
Toledo is now known as croberts
<dionysus69> what happens in client credentials grant case
<dionysus69> does password grant just ask for preset password?
oborot has quit [Ping timeout: 255 seconds]
<dminuoso> dionysus69: Right. So basically with client credentials you use clientID + clientSecret
<dionysus69> yep thats what I use too
<dminuoso> dionysus69: And with passwort grant you supply some meaningful username + password. They are kind of the same
<dminuoso> But one is based on identifying a client, the other is based on identifying a person
ndrei has quit [Quit: Lost terminal]
<dionysus69> this is full script, btw i couldnt correctly create body = Google::Apis::SheetsV4::ValueRange.new(values), says wrong number of arguments (given 1, expected 0) (ArgumentError)
Beams has joined #ruby
<dionysus69> right now i have client id + client secret but it anyways gives me this interactive browser thing
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dionysus69> I suppose that's not what's supposed to happen in my case
<dionysus69> atm I act as a client and not as a user
irc4r has joined #ruby
centrx has joined #ruby
patarr has joined #ruby
oliv_____ has joined #ruby
rdavila has joined #ruby
banisterfiend has joined #ruby
mim1k has joined #ruby
tlaxkit has joined #ruby
AlexRussia has quit [Ping timeout: 240 seconds]
nickman5050 has joined #ruby
tgragnato has joined #ruby
DeeJayh has quit [Ping timeout: 240 seconds]
b0mbnet has joined #ruby
chouhoulis has joined #ruby
slackR has joined #ruby
slackR has quit [Client Quit]
SteenJobs has quit [Quit: SteenJobs]
DeeJayh has joined #ruby
jackrandom has joined #ruby
<nickman5050> hey
irc4r has quit [Remote host closed the connection]
<nickman5050> do anyone knows of any sites teaching people about ruby on msfconsole or meatsploit
irc4r has joined #ruby
<nickman5050> like the modules or exploits used in them
rippa has joined #ruby
<havenwood> ?metasploit nickman5050
<ruby[bot]> nickman5050: Please join #metasploit for help with it.
<nickman5050> alright thanks
<havenwood> nickman5050: If you'd like to learn Ruby, this is a good place.
marr has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<nickman5050> alright I now I can just type this on google but do u know like a good site to learn ruby from your perspective
patarr_ has joined #ruby
cschneid_ has joined #ruby
irc4r has quit [Remote host closed the connection]
<havenwood> nickman5050: Here are some links: https://ruby-community.com/pages/links
<havenwood> nickman5050: And some more links: https://www.ruby-lang.org/en/documentation/
patarr has quit [Ping timeout: 255 seconds]
<havenwood> nickman5050: Maybe give tryruby.org a try to get started then move onto rubymonk.com and then a book.
irc4r has joined #ruby
KeyJoo has quit [Ping timeout: 268 seconds]
b0mbnet has quit [Quit: Leaving]
SteenJobs has joined #ruby
jaruga has quit [Quit: jaruga]
irc4r has quit [Remote host closed the connection]
kurajber has joined #ruby
kurajber has joined #ruby
kurajber has quit [Changing host]
dionysus69 has quit [Ping timeout: 260 seconds]
sepp2k has joined #ruby
DeeJayh has quit [Ping timeout: 255 seconds]
jgnagy has quit [Remote host closed the connection]
jgnagy has joined #ruby
sds_ has joined #ruby
nickman5050 has quit [Quit: Page closed]
DeeJayh has joined #ruby
hahuang65 has joined #ruby
hobodave has joined #ruby
yogg-saron has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hobodave has quit [Client Quit]
gizmore|2 is now known as gizmore
hahuang65 has quit [Ping timeout: 240 seconds]
uZiel has joined #ruby
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
al2o3-cr has joined #ruby
rkazak has joined #ruby
kurajber has quit [Remote host closed the connection]
ascarter has joined #ruby
ahrs has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
ahrs has joined #ruby
Burgestrand has quit [Quit: Closing time!]
marlinc has quit [Ping timeout: 246 seconds]
psychicist__ has joined #ruby
jackrandom has quit [Remote host closed the connection]
bmurt has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
qguv has quit [Quit: bye]
nadir has joined #ruby
mikecmpbll has joined #ruby
_joes__ has joined #ruby
skweek has quit [Ping timeout: 268 seconds]
ResidentBiscuit has quit [Read error: Connection reset by peer]
SteenJobs has joined #ruby
jrafanie has joined #ruby
conta has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
blackmesa has joined #ruby
bronson has joined #ruby
lightstalker has quit [Ping timeout: 240 seconds]
railswebdev has joined #ruby
tvw has quit [Read error: Connection reset by peer]
mim1k has quit [Read error: Connection reset by peer]
bronson has quit [Ping timeout: 260 seconds]
troulouliou_dev2 has joined #ruby
lightstalker has joined #ruby
Lord_of_Life has quit [Changing host]
Lord_of_Life has joined #ruby
Lord_of_Life has quit [Changing host]
Lord_of_Life has joined #ruby
<troulouliou_dev2> hi in ruby the if expression will be always executed in order of declaration ? for intsance => unless myarray.empty? and myarray[0].length > 0 then ... will never fail ?
[Butch] has joined #ruby
<Papierkorb> troulouliou_dev2: don't use `and`, use `&&`
raspado has joined #ruby
<troulouliou_dev2> Papierkorb, ok
bheesham has joined #ruby
<Papierkorb> troulouliou_dev2: And you already ran into a trap with unless, which is why you shouldn't use unless with complex conditions. unless x == if !(x).
<Papierkorb> `if !ary.empty? && ary.first.size > 0` is what you intended.
<troulouliou_dev2> Papierkorb, ok yuo kinf of figured out my issue :) thanks
kassav_ has quit [Read error: Connection reset by peer]
kassav__ has joined #ruby
polishdub has joined #ruby
mim1k has joined #ruby
bheesham has quit [Ping timeout: 255 seconds]
nobitanobi has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
centrx has quit []
synthroid has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
SteenJobs has quit [Quit: peaceee]
bkxd has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
rakm has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
bkxd has quit [Ping timeout: 245 seconds]
banisterfiend has joined #ruby
tgragnato has quit [Remote host closed the connection]
shinnya has joined #ruby
tgragnato has joined #ruby
nowhere_man has quit [Ping timeout: 246 seconds]
nitric has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
boringcp1 has quit [Ping timeout: 246 seconds]
anisha_ has quit [Quit: Leaving]
yqt has quit [Ping timeout: 240 seconds]
armyriad has quit [Ping timeout: 240 seconds]
mim1k has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
uZiel has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
mim1k has joined #ruby
im0nde has quit [Ping timeout: 258 seconds]
brent__ has joined #ruby
robouk has joined #ruby
hobodave has joined #ruby
hahuang65 has quit [Ping timeout: 240 seconds]
uZiel has joined #ruby
blackmesa has joined #ruby
oborot_ has joined #ruby
patarr_ has quit [Ping timeout: 246 seconds]
skweek has joined #ruby
haylon has joined #ruby
kmhn has quit [Ping timeout: 272 seconds]
blackwind_123 has quit [Ping timeout: 246 seconds]
oborot_ has quit [Ping timeout: 240 seconds]
patarr has joined #ruby
boringcpg has joined #ruby
aufi has quit [Quit: Leaving]
mim1k has quit [Read error: Connection reset by peer]
mark_66 has quit [Remote host closed the connection]
boombox_ has joined #ruby
haylon has quit [Remote host closed the connection]
haylon has joined #ruby
synstack has quit [Read error: Connection reset by peer]
synstack has joined #ruby
synstack has joined #ruby
synstack has quit [Changing host]
rkazak has quit [Quit: Sleep.....ing....]
Uranio has joined #ruby
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
Uranio has left #ruby [#ruby]
nobitanobi has quit [Remote host closed the connection]
uZiel has quit [Changing host]
uZiel has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
rgr_ has joined #ruby
rkazak has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
TomyLobo has joined #ruby
robouk has quit [Quit: Konversation terminated!]
rgr has quit [Ping timeout: 260 seconds]
boombox_ has quit [Remote host closed the connection]
znz_jp has quit [Ping timeout: 272 seconds]
DarkBushido has joined #ruby
DarkBushido has joined #ruby
DarkBushido has quit [Changing host]
Cesario_ has joined #ruby
nobitanobi has joined #ruby
hahuang65 has joined #ruby
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
enterprisey has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
antgel_ has quit [Ping timeout: 246 seconds]
nobitanobi has quit [Ping timeout: 240 seconds]
tlaxkit has quit [Quit: tlaxkit]
patarr has joined #ruby
gusrub has joined #ruby
Beams has quit [Quit: .]
jameswatling has joined #ruby
troulouliou_dev2 has quit [Quit: Leaving]
eightlimbed has joined #ruby
skweek has quit [Ping timeout: 268 seconds]
haylon has quit [Ping timeout: 246 seconds]
renchan has quit [Quit: Leaving...]
jameswatling has quit [Ping timeout: 240 seconds]
Silthias has left #ruby [#ruby]
patarr has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
boringcp1 has joined #ruby
Kero has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
pankaj has joined #ruby
skweek has joined #ruby
jackrandom has joined #ruby
<eam> is this kind of hack-around still necessary to avoid spawning a shell on exec? https://gist.github.com/eam/b70f2e5ae118808f157c
boringcpg has quit [Ping timeout: 240 seconds]
tgragnato has quit [Quit: Sto andando via]
Truenigma_Work has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
<havenwood> eam: Hrm, if you don't care about the argv[0] value in the process listings: Kernel.exec *Shellwords.split(cmd_string)
cyclonis has quit [Quit: leaving]
<havenwood> >> Kernel.exec *Shellwords.split('echo hello *') #>> hello *
<ruby[bot]> havenwood: # => uninitialized constant Shellwords (NameError) ...check link for more (https://eval.in/802956)
<havenwood> (Of course that triggers bot, I need coffee.)
jackrandom has quit [Remote host closed the connection]
jackrandom has joined #ruby
xall has quit [Ping timeout: 246 seconds]
<eam> havenwood: ah, what I have is an already-tokenized array and I want to prevent any interpretation of it
brent__ has quit [Remote host closed the connection]
<havenwood> eam: ah, gotcha
<eam> that stuff above is necessary to prevent exec from deciding to pass a single arg command, say "/bin/program with whitespace in name" through a shell
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> are you stripping meta characters, or there just aren't any?
oborot has joined #ruby
<eam> there may be some, I don't want them interpreted
<eam> so a file called "/bin/*" should be fine
<eam> I'm currently copying this little method around and I was kinda hoping someone could tell me "nah ruby can call exec without invoking a shell easily now"
volty has joined #ruby
<havenwood> even if it's the single argument style it should be no shell if there are no meta chars, shell reserved words or builtins
<eam> yeah, but there might be
<havenwood> i don't think they've added an option flag for forcing no shell ;-(
<eam> and I believe even if a metachar doesn't invoke a shell it will still tokenize
<eam> ruby's pretend-shell thing
<havenwood> right, mm
patarr has joined #ruby
<eam> avoiding unnecessary shells and being explicit about process args is one of the standards I tend to carry
<havenwood> they support a variety of options documented in Kernel#spawn, but just use arg magic afaik for shell use/non-use
<havenwood> it'd sure be a nice option to be abel to enforce
<eam> the above works, it's just a bit clunky and I end up pulling it into everything
<havenwood> shell: false
oborot has quit [Ping timeout: 260 seconds]
<eam> and then folks ask me what the hell it is
swills has quit [Ping timeout: 258 seconds]
<eam> and suddenly I'm explaining some magical ruby behaviors to them :)
swills has joined #ruby
<havenwood> and then fun with builtins where shell is invoked in OS with the builtin but not in say Windows
nowhere_man has joined #ruby
<havenwood> very unpredicatable
<baweaver> FAKE SHELLS
User458764 has joined #ruby
jshjsh has quit [Quit: Leaving]
<havenwood> alias cat="unalias cat && echo \"=^.^=\""
stormbytes has joined #ruby
jrafanie has joined #ruby
__Yiota has joined #ruby
Guest51193 is now known as jds
jds is now known as jdelstrother
dmtd has joined #ruby
baweaver is now known as lemur
lemur is now known as baweaver
enterprisey has quit [Ping timeout: 240 seconds]
<eightlimbed> a = ["albatross", "dog", "horse"] ........... a.max => "horse"
bronson has joined #ruby
<eightlimbed> b = ["hoqq", "bbllkw", "oox", "ejjuyyy", "plmiis", "xxxzgpsssa", "xxwwkktt", "znnnnfqknaz", "qqquuhii", "dvvvwz"] ...... b.max => "znnnnnfgknaz"
<eightlimbed> in ruby-doc it says .max returns the object of greatest value
<eightlimbed> in an array of strings, shouldn't it always be the last element in the array?
<eightlimbed> oh shoot
<havenwood> >> 'z' > 'a'
<ruby[bot]> havenwood: # => true (https://eval.in/802965)
<eightlimbed> just realized it's returning the object with the greatest letter
<baweaver> ding ding ding
centrx has quit [Remote host closed the connection]
<baweaver> lexical sort
<baweaver> >> %w(z bb aaaa).max(&:length)
<ruby[bot]> baweaver: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/802966)
rkazak has quit [Quit: Sleep.....ing....]
<baweaver> &ri Enumerable#max
belmoussaoui has joined #ruby
<baweaver> ah
<eightlimbed> sorry to bother
<baweaver> >> %w(z bb aaaa).max_by(&:length)
<ruby[bot]> baweaver: # => "aaaa" (https://eval.in/802967)
<eightlimbed> havenwood: hey man! :)
<havenwood> eightlimbed: hi!
ur5us has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
rkazak has joined #ruby
centrx has joined #ruby
bheesham has joined #ruby
alazred has joined #ruby
alazred has joined #ruby
alazred has quit [Changing host]
belmoussaoui has quit [Ping timeout: 246 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 245 seconds]
benlieb has joined #ruby
robouk has joined #ruby
TreyG has quit [Ping timeout: 240 seconds]
bheesham has quit [Ping timeout: 245 seconds]
dionysus69 has joined #ruby
robouk has quit [Client Quit]
robouk has joined #ruby
blackmesa has joined #ruby
nahra has quit [Remote host closed the connection]
pankaj has quit [Ping timeout: 240 seconds]
robouk has quit [Client Quit]
rkazak has quit [Quit: Sleep.....ing....]
yogg-saron has joined #ruby
SeepingN has joined #ruby
robouk has joined #ruby
hobodave_ has joined #ruby
yogg-saron has quit [Client Quit]
jameswatling has joined #ruby
hobodave has quit [Ping timeout: 240 seconds]
centrx has quit [Remote host closed the connection]
jrafanie_ has joined #ruby
rkazak has joined #ruby
jrafanie has quit [Ping timeout: 268 seconds]
TreyG has joined #ruby
robouk has quit [Remote host closed the connection]
jameswatling has quit [Ping timeout: 260 seconds]
robouk has joined #ruby
velocity64 has joined #ruby
velocity64 has quit [Remote host closed the connection]
belmoussaoui_ has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
mtkd has joined #ruby
cdg_ has quit [Ping timeout: 246 seconds]
haylon has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
NapoleonWils0n has joined #ruby
<NapoleonWils0n> hi all
<baweaver> alo
<NapoleonWils0n> im having an issue with rack
<NapoleonWils0n> i had this code in my config file for rack 1.9
<NapoleonWils0n> __DIR__ = File.expand_path(File.dirname(__FILE__))
Kero has left #ruby ["bye"]
<NapoleonWils0n> but it no longer works with rack 2, keeps complaining about expecting 4 arguments but recieving 2 args
<SeepingN> quote your paths
<SeepingN> wait that won't matter here
<SeepingN> that's very odd... which part is expecting _4_ arguments?
<NapoleonWils0n> i think its the code above
<SeepingN> `basename __FILE__` ? :)
jphase has joined #ruby
<NapoleonWils0n> this is my config file
<NapoleonWils0n> worked fine with ruby 1.9 but not newer ruby
belmoussaoui has joined #ruby
nahra has joined #ruby
centrx has joined #ruby
cjohnson has joined #ruby
<cjohnson> I'm coming from JS and PHP and just started a new job doing ruby, wondering if anybody has any recommended first readings. I've gotten metaprogramming ruby 2 so far
<baweaver> ohai
tgragnato has joined #ruby
<cjohnson> Also what's the modern way to bootstrap a ruby env? in JS it's nvm to install node/npm
<havenwood> cjohnson: Here's a list of books: https://gist.github.com/baweaver/57a7c8296ca2c03effbd8fac1e7f6b40
<baweaver> you're in my realm now
<cjohnson> hey baweaver
<cjohnson> thanks havenwood
* baweaver laughs maniacally
<havenwood> ;-)
belmoussaoui_ has quit [Ping timeout: 246 seconds]
<havenwood> cjohnson: Ruby ships with RubyGems. It provides the `gem` command.
<SeepingN> works here on 2.0.0
<havenwood> cjohnson: gem install blarg
<cjohnson> Is the gem/ruby install that comes on OS X pretty up to date?
<havenwood> cjohnson: Some of the Ruby stdlib ships with Ruby as gems.
<cjohnson> I know using the built in tooling in some linux distros leaves you well behind
<cjohnson> thanks
centrx has quit [Remote host closed the connection]
<baweaver> That'll take you through most of it
<havenwood> cjohnson: While the Ruby that ships with macOS is useable, you're better off with latest stable Ruby from ruby-install ^
<havenwood> Now that's in my realm! :)
<baweaver> including Rails setup
centrx has joined #ruby
<havenwood> muahahaha
<cjohnson> cool so chruby is sorta like nvm
haylon has quit [Ping timeout: 260 seconds]
<cjohnson> install several versions and switch between them
<NapoleonWils0n> if you use a mac be ready for everything to break with any update
<cjohnson> I intend to ultimately run this stuff in a linux VM but for the time being I'm keeping it on the mac
<NapoleonWils0n> macs where good about 10 years ago
haylon has joined #ruby
polishdub has quit [Read error: Connection reset by peer]
<baweaver> Radar keeps them updated
<havenwood> cjohnson: Yup, chruby lets you switch between various versions and implementations of Ruby by setting a few environment variables like RUBY_ROOT, GEM_HOME, GEM_PATH, etc and putting Ruby and gem bins in PATH.
<cjohnson> beautiful
<SeepingN> better than rvm?
<baweaver> !pry
<havenwood> It's the simplest thing that can possibly work.
<baweaver> ?pry
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<cjohnson> I'm a pretty experienced dev and I've got familiarity with perl, php, js, a little python. Am I ok skipping to the "advanced" section of this list of books?
<baweaver> You'll want to poke around into that one too
<baweaver> Read over Eloquent Ruby
<baweaver> It's basically how to Ruby like a Rubyist
<havenwood> SeepingN: RVM is tens of thousands of lines of shell, while chruby is about a hundred.
<havenwood> SeepingN: They are different scopes of things.
<cjohnson> sweet
nicesignal has quit [Remote host closed the connection]
<SeepingN> ah
NapoleonWils0n has quit [Quit: WeeChat 1.8]
<baweaver> cjohnson: Anything specific you want to learn?
nicesignal has joined #ruby
<havenwood> cjohnson: Then most folk use a Gemfile for managing deps. You run `bundle` to create a Gemfile.lock from your Gemfile. The Gemfile.lock gets checked into version control and gets everyone on the exact same versions of gem dependencies and their deps.
<baweaver> It's like an actually useful npm shrinkwrap
<cjohnson> baweaver: I am still doing HR training for 3 days, I'm sure I'll be back with a lot more specific questions
<baweaver> Fair fair
<cjohnson> in fact I'm due for another training meeting ha
<baweaver> Have fun
<havenwood> cjohnson: It's like how Yarn handles deps.
<cjohnson> Thanks for getting me started everybody
<cjohnson> cool, seems straight forward
<havenwood> cjohnson: (Yarn was written by some of the folk that wrote Bundler.)
<baweaver> off to lunch for me
<havenwood> nom
patarr_ has joined #ruby
polishdub has joined #ruby
patarr has quit [Read error: Connection reset by peer]
PatrikasZvaigzde has quit [Ping timeout: 240 seconds]
Meow has joined #ruby
yirabbit_ has quit [Ping timeout: 260 seconds]
belmoussaoui has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
belmoussaoui has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
hobodave_ is now known as hobodave
<dionysus69> panic
<dionysus69> nokogiri can't get utf-8 text
<dionysus69> ok that was easy
sonicm has joined #ruby
yirabbit_ has joined #ruby
sonicm has quit [Max SendQ exceeded]
sonicm has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
milardovich has quit []
sonicm_ has quit [Ping timeout: 240 seconds]
rkazak has quit [Quit: Sleep.....ing....]
marlinc has joined #ruby
sonOfRa has quit [Read error: Connection reset by peer]
sonOfRa has joined #ruby
bheesham has joined #ruby
<dminuoso> There's nothing nokogiri cant do.
<dminuoso> We use nokogiri for big data even.
romank has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dionysus69> :) dminuoso i just got started with it
<dionysus69> it's awesome !
<dminuoso> nokogiri is our go-to solution for activation functions in deep neural networks too.
<dionysus69> I guess it would be used for parsing xml resource api too right?
<dminuoso> Nothing cant not be solved with nokogiri.
<dionysus69> can it be used for json?
belmoussaoui has quit [Ping timeout: 240 seconds]
<dminuoso> Say what?
<dionysus69> i have project coming up where i might need to consume json with rails
belmoussaoui has joined #ruby
<dionysus69> parsing json I mean, I can see it can parse html and xml
<dminuoso> That's because html and xml are very similar.
<dminuoso> To parse json Ruby has this for you
<dminuoso> &ri JSON
<dminuoso> Built right into Ruby itself.
<dionysus69> oh haha
<dionysus69> json parsing lib called json
<dminuoso> Who would have guessed.
<dionysus69> that's why i love ruby xD
<dminuoso> dionysus69: It can not only parse json, but it can also generate JSON!
<dionysus69> I think I have done that
<dionysus69> but never realized what i was using
<dminuoso> It mixes into all the common classes..
<dminuoso> >> {a:1}.to_json
<ruby[bot]> dminuoso: # => undefined method `to_json' for {:a=>1}:Hash ...check link for more (https://eval.in/802995)
<dminuoso> >> require 'json'; {a:1}.to_json
<ruby[bot]> dminuoso: # => "{\"a\":1}" (https://eval.in/802996)
<elomatreb> Can nokogori parse JSON though
<dminuoso> elomatreb: Im sure that nokogiri is turing complete!
<dminuoso> Oh regarding that..
belmoussaoui has quit [Excess Flood]
<dionysus69> well as i understand nokogiri can handle tag based structures
bheesham has quit [Ping timeout: 240 seconds]
<dminuoso> elomatreb: Have you seen this? https://www.youtube.com/watch?v=uNjxe8ShM-8
gnufied has joined #ruby
<dminuoso> This is not a joke by the way. :-)
<elomatreb> Yeah, that ones good
<elomatreb> There is a similar paper that showed that Java Generics are turing complete
sonicm has quit [Quit: Leaving]
<dminuoso> Same research has been done on C++ templates
<dminuoso> elomatreb: How do Java Generics achieve output? Compiler warnings/errors?
<dionysus69> dminuoso: since you seem to be experienced with nokogiri I ll ask you that too, what about SPA generated html? nokogiri can't see it :S
<elomatreb> Don't remember, at the time I didn't even know Java
rdavila has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
nobitanobi has joined #ruby
<dminuoso> dionysus69: I do not understand your question.
skweek has quit [Ping timeout: 240 seconds]
<dionysus69> dminuoso: i meant spa as in single page application
<dionysus69> react for example
<elomatreb> It would need to execute the JS for that
<dionysus69> so what workaround can I use for this?
<dminuoso> I do not understand your question.
<al2o3-cr> any of you tried ox gem
<dionysus69> because I really really need to get text out of that
<dminuoso> dionysus69: Start making sense real fast.
<elomatreb> You want a headless browser probably
Pierreb|home has quit []
<dionysus69> dminuoso: I am on khan academy and it uses react apparently, most of the page html is generated client side
nobitanobi has quit [Ping timeout: 260 seconds]
<dminuoso> dionysus69: Yes. So?
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dionysus69> so nokogiri can't parse ungenerated html so i am wondering how do i make it generate and then parse xD
<dminuoso> What?
<dminuoso> I want you
<dminuoso> to draw a picture
<dionysus69> :D
<dminuoso> of either an elephant, or your problem
<dminuoso> use crayons or chalk if your street is big enough.
<dionysus69> well client side needs to generate html right, in single page app
<dminuoso> We have established that I understood the SPA part because I didnt make fun of you until then.
<elomatreb> It does this by executing Javascript. Nokogiri is just a parser that looks at HTML, it doesn't know about Javascript
<dminuoso> Where do you want to run this nokogiri and why?
<dminuoso> And crayon picture please!
<dionysus69> yes so there's no workaround it? what if I make it render javascript if it's possible
<dminuoso> Say what?
<dionysus69> it will run from a client computer, part of a larger automation script :P
<dminuoso> Is there any more confusing way in that made any less sense?
<elomatreb> Once you glue executing Javascript on top of a HTML parser you basically built a browser
<dminuoso> elomatreb: How do you make any sense of that..
<dminuoso> at all
<dminuoso> This to me is pure gibberish
<elomatreb> I think they want to extract data from a React app page
<dminuoso> dionysus69: plug a template into your recursive algorithm.
<dionysus69> ye come on dminuoso i didnt really ask anything that weird :D
<dminuoso> dionysus69: no you did.
<dminuoso> until the SPA part everything is fine
<dionysus69> why ? :D
<dminuoso> then you suddenly talk about nokogiri
<dminuoso> and rendering javascript
<dionysus69> ye, i am trying to parse a page with js rendering html
<dionysus69> by now i get that nokogiri can't do that :D
<dminuoso> dionysus69: Where does the ruby code run?
<dminuoso> client side? server side?
<dionysus69> so I am asking is it even possible ? :D
alazred has quit [Ping timeout: 272 seconds]
<dminuoso> what?
<dionysus69> client side
<dminuoso> sure it's possible.
<dionysus69> oh wait what do you mean?
<dminuoso> Use your mouse towards that thing that says "File" (or whatever that means in Russian), click on "Save Page As..." (or equivalent) ...
<dionysus69> what do you mean by ruby code running on client side?
<dminuoso> What do I mean?
<dionysus69> i am not russian wtf
<dminuoso> my bad.
eckhardt has joined #ruby
<dminuoso> Must have confused you with someone else
<dminuoso> ;)
<dionysus69> dunno where you got that from lol :D...
eelster has joined #ruby
<dionysus69> i cant do that for every page of the side right
<dionysus69> meaning, saving page as :D
<dionysus69> so is there no other way?
eelster has quit [Client Quit]
eelster has joined #ruby
mim1k has joined #ruby
eckhardt has quit [Client Quit]
eelster has quit [Client Quit]
ozzy3 has joined #ruby
volty has quit [Ping timeout: 268 seconds]
eelster has joined #ruby
<dminuoso> dionysus69: Beyond me how elomatreb made any sense of that..
ddffg has quit [Quit: Leaving]
<dminuoso> but yeah.
<dminuoso> elomatreb | You want a headless browser probably
eckhardt has joined #ruby
<dminuoso> PhantomJS probably
<elomatreb> Chrome recently got an official headless mode, I haven't tried it though
mim1k has quit [Ping timeout: 240 seconds]
<dminuoso> elomatreb: hats off.
ecuanaso has joined #ruby
eckhardt has quit [Client Quit]
<dionysus69> what do you mean
bheesham has joined #ruby
<SeepingN> who needs the GUI part of Chrome anyway!
<dionysus69> so from whichever pc I am running this, i make a page call, render the page into headless browser, generate full page and then parse with nokogiri?
gusrub has quit [Remote host closed the connection]
<dminuoso> Wait what?
<SeepingN> !?!?!
<dminuoso> Back to not making sense again.
<dminuoso> Need more elomatreb
<dionysus69> what?
<dionysus69> :D
<SeepingN> have you missed the existence of things like curl and lynx/links/whatever
gusrub has joined #ruby
<dionysus69> what does headless browser let me do, perhaps save a fully generated html of an spa page right?
govg has joined #ruby
<dminuoso> SeepingN: Have you missed the existence of things like curl and lynx/links/whatever that are ES5+ compatible and support the full HTML5 API?
gizmore has quit [Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/]
<dionysus69> so I would later use nokogiri to parse that html
<dminuoso> dionysus69: A headless browser lets you do anything a normal browser does.
<dminuoso> It's a browser without a head (the visualization/rendering)
<dionysus69> so?
<dminuoso> So?
<dionysus69> i dont understand implication of that
<dminuoso> Oh, it has an API instead.
<dminuoso> To interact with the browser.
<dionysus69> yes I would assume that
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<SeepingN> sounds like the page you're interacting with needs an API ;)
<dminuoso> dionysus69: What is your goal?
<dionysus69> so i am guessing, in that case I wouldn't need nokogiri at all?
<dminuoso> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<dminuoso> ?xy
<dminuoso> ^^^ that.
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<dionysus69> i am trying to get a text from specific html tag on a page which is rendered client side
<dionysus69> that's all
mim1k has joined #ruby
<SeepingN> such secrets
<dminuoso> dionysus69: Is this your SPA?
<dionysus69> well ye :D
<dionysus69> oh
<dionysus69> no
<dionysus69> it is khanacademy
gizmore has joined #ruby
<dionysus69> if it were mine i guess the solution would be simpler
mtkd has quit [Read error: Connection reset by peer]
gusrub has quit [Ping timeout: 245 seconds]
mtkd has joined #ruby
benlieb has quit [Quit: benlieb]
<dminuoso> 21:16:03 dionysus69 | i dont understand implication of that │ akkad
haylon has quit [Quit: WeeChat 1.5]
gusrub has joined #ruby
nhhc has quit [Quit: Leaving]
<dionysus69> dminuoso: why didnt you mention curl in a more straightforward way lol
PatrikasZvaigzde has joined #ruby
<dminuoso> dionysus69: Talking about headless browsers.
mim1k has quit [Ping timeout: 260 seconds]
haylon has joined #ruby
<dionysus69> well i didnt know curl was one at all
<dminuoso> its not.
<dionysus69> :D
<dminuoso> PhantomJS
<dminuoso> That chrome thing
<dminuoso> selenium
<dminuoso> those work
<dionysus69> ye fine but curl did the job too
<dionysus69> it just got full html
<dionysus69> including the one that is client side
<SeepingN> huh?
haylon has quit [Client Quit]
<al2o3-cr> dionysus69: what curl command did you run?
haylon has joined #ruby
<dionysus69> lol
<dionysus69> i forgive you all for making fun of me all this time
belmoussaoui has quit [Read error: Connection reset by peer]
oliv_____ has quit [Remote host closed the connection]
brent__ has joined #ruby
belmoussaoui has joined #ruby
<al2o3-cr> a simple get request?
oliv_____ has joined #ruby
<dionysus69> yep and it got full data back
oliv_____ has quit [Remote host closed the connection]
<SeepingN> curl -o http://some.server.com/page.html | sed 's/<div (.*)>/\1/p`
oliv_____ has joined #ruby
<SeepingN> wtf does "got full data back" mean?
<dionysus69> including data that doesnt show up at ctrl + U in browser
<SeepingN> 301 moved. have to set it to follow forwarders
jenrzzz has quit [Ping timeout: 246 seconds]
jamesaxl has quit [Read error: Connection reset by peer]
yqt has joined #ruby
jamesaxl has joined #ruby
<SeepingN> curl -L "that long url" then have fun parsing raw source
brent__ has quit [Ping timeout: 260 seconds]
ornerymoose has quit [Quit: ornerymoose]
<dionysus69> can you explain to me the regex you used there?
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dionysus69> I need to get text under h1.someClass
eightlimbed has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
<havenwood> dionysus69: This is an aside, but tools like httpie, jq and pup are nice for quick command line http/json/html queries.
<havenwood> #>> Adding &amp; subtracting rational expressions: like denominators
patarr has joined #ruby
ledestin has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> dionysus69: On macOS you can install them with: brew install httpie jq pup
<dionysus69> you sure I can't do same thing with curl?
ascarter has joined #ruby
<SeepingN> xmllint seems to be very popular for this too
<dionysus69> curl is available for windows too and I want to use tools that are cross platform
curti_ has joined #ruby
<SeepingN> it's hard to use things like grep against html since it only searches 1 line at a time
BTRE has quit [Ping timeout: 272 seconds]
<SeepingN> and nothing says your h1 tag has to fit on 1 line
patarr_ has quit [Ping timeout: 246 seconds]
<havenwood> dionysus69: httpie, jq and pup should all be cross-platform
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
rkazak has joined #ruby
<havenwood> dionysus69: (written in Python, C and Go)
<havenwood> Also, WSL! Use eet!
<havenwood> Windows Subsystem for Linux works great. ;-)
<dionysus69> i am building a tool that many people could use
<dionysus69> i should make it as easy to setup as possible
<dionysus69> on as many platforms as possible
bheesham has quit [Ping timeout: 246 seconds]
Krebsgewehr has quit [Ping timeout: 272 seconds]
ozzy3 has left #ruby [#ruby]
<dionysus69> with tools that would have higher chances of being backwards compatible
BTRE has joined #ruby
<dminuoso> havenwood: Until it doesn't.
<dminuoso> havenwood: From what I hear from the osdev community it's pretty shitty if you want to do kernel development.
<Papierkorb> Someone said osdev?
<havenwood> dminuoso: touche
mtkd has quit [Read error: Connection reset by peer]
^mtkd has joined #ruby
KeyJoo has joined #ruby
haylon has quit []
haylon has joined #ruby
bronson has joined #ruby
gnufied has quit [Ping timeout: 245 seconds]
<SeepingN> alright, I'll bite. What in the world will this tool-for-the-people do?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<SeepingN> rip off Khan Acadamy?
<dionysus69> auto uploading videos to youtube for those who internationalize khan academy videos
belmoussaoui has quit [Ping timeout: 240 seconds]
<dionysus69> i am going to be hired by people responsible for georgian language section
belmoussaoui has joined #ruby
<dionysus69> it's contributing, instead of ripping off ;)
bronson has quit [Ping timeout: 258 seconds]
sds_ has quit [Quit: Leaving]
kmhn has joined #ruby
HoierM has quit [Ping timeout: 260 seconds]
kmhn has quit [Remote host closed the connection]
kmhn has joined #ruby
eckhardt has joined #ruby
BTRE has quit [Ping timeout: 260 seconds]
morfin has quit []
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kmhn has quit [Ping timeout: 240 seconds]
kaleido has quit [Quit: Lost terminal]
bernd27 has joined #ruby
gnufied has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
eckhardt has quit [Client Quit]
jenrzzz_ has quit [Ping timeout: 268 seconds]
jackrandom has quit [Ping timeout: 255 seconds]
BTRE has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
recondite has joined #ruby
cdg has joined #ruby
jenrzzz has joined #ruby
eckhardt has joined #ruby
eckhardt has quit [Client Quit]
jeffreylevesque has quit [Ping timeout: 240 seconds]
eightlimbed has joined #ruby
banisterfiend has joined #ruby
BTRE has quit [Ping timeout: 260 seconds]
psychicist__ has quit [Quit: Lost terminal]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kmhn has joined #ruby
volty has joined #ruby
jrafanie has joined #ruby
eckhardt has joined #ruby
marr has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
potatoe` has quit [Quit: ZNC 1.6.4 - http://znc.in]
BTRE has joined #ruby
uZiel has quit [Ping timeout: 268 seconds]
Silox| has joined #ruby
potatoe has joined #ruby
patarr has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
potatoe has quit [Quit: ZNC 1.6.4 - http://znc.in]
qguv has joined #ruby
potatoe has joined #ruby
kmhn has quit [Read error: No route to host]
ryanong has joined #ruby
kmhn has joined #ruby
BTRE has quit [Ping timeout: 240 seconds]
ryanong is now known as seraph787
belmoussaoui has joined #ruby
jeffreylevesque has joined #ruby
ascarter has joined #ruby
lacuna has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
BTRE has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jusa has quit [Ping timeout: 240 seconds]
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
cyphase has joined #ruby
jrafanie has joined #ruby
blackmesa has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rgr_ has quit [Quit: rgr_]
synthroid has quit []
<seraph787> anybody here ever use stackprof with flame graphs? i am getting some weird valleys when io is happening
jrafanie_ has joined #ruby
rdavila has joined #ruby
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
skweek has joined #ruby
jrafanie has quit [Ping timeout: 260 seconds]
lacuna has quit [Ping timeout: 268 seconds]
blackmesa has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
benlieb has quit [Client Quit]
milardovich has joined #ruby
kube has quit [Quit: leaving]
bernd9000 has joined #ruby
<dminuoso> 1anyone
<dminuoso> !anyone
<dminuoso> ?anyone
<ruby[bot]> Just ask your question, if anyone has, is or can, they will respond.
* dminuoso hits ruby[bot]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> Never does the right (tm) thing.
blackmesa has joined #ruby
<dminuoso> seraph787: look at your question and tell me whether someone looking at the channel can provide you with any meaningful insights whatsoever based on what you have given us.
bernd27 has quit [Ping timeout: 260 seconds]
eckhardt has joined #ruby
pupsicle has quit [Quit: pupsicle]
ResidentBiscuit has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
mrconfused has joined #ruby
skweek has quit [Ping timeout: 268 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
eelster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
sepp2k has quit [Ping timeout: 268 seconds]
zachk has joined #ruby
tgragnato has quit [Quit: Sto andando via]
jenrzzz has quit [Quit: Lost terminal]
ldnunes has quit [Quit: Leaving]
biberu has quit []
sepp2k has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
eckhardt has joined #ruby
dviola has quit [Quit: WeeChat 1.8]
sepp2k has quit [Ping timeout: 260 seconds]
theunraveler has quit []
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kumarat9pm has joined #ruby
kumarat9pm has quit [Client Quit]
kumarat9pm has joined #ruby
<kumarat9pm> Hi guys..
<havenwood> kumarat9pm: hi
ascarter has joined #ruby
<al2o3-cr> hello
<kumarat9pm> I am basically from Python background where if I want to see what methods do a variable have I use dir(var_name) which list all the methods available.
<kumarat9pm> Do ruby have such facility
postmodern has joined #ruby
<havenwood> kumarat9pm: In Ruby you can ask an object directly about its methods.
<baweaver> &ri Object#methods
<Papierkorb> kumarat9pm: `my_variable.methods`
<havenwood> kumarat9pm: It's also popular to use Pry's introspection tools, like: ls
<baweaver> ?pry
<havenwood> ?pry kumarat9pm
<kumarat9pm> I am curious to know for a variable say var1='xyz', it have var1.class which shows what type of variable it is?
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<ruby[bot]> kumarat9pm: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<baweaver> ninja :D
lucz has joined #ruby
<kumarat9pm> Papierkorb: Thanks.
<baweaver> &ri Object
<baweaver> Do some reading in there
milardovich has quit []
<havenwood> kumarat9pm: Asking it its class wouldn't tell you what kind of variable. Try using `defined?` like: defined? foo
<havenwood> >> foo = :bar; defined? foo # kumarat9pm
<ruby[bot]> havenwood: # => "local-variable" (https://eval.in/803023)
al2o3-cr_ has joined #ruby
<havenwood> kumarat9pm: Note that `foo.class` is: Symbol
<havenwood> (`:bar` is a Symbol literal.)
mrconfused has quit [Remote host closed the connection]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
centrx has quit []
fxa has joined #ruby
patr0clus has joined #ruby
fxa has quit [Client Quit]
fxa has joined #ruby
patr0clus has quit [Client Quit]
Vegitto has joined #ruby
kumarat9pm has quit [Quit: Leaving.]
Guest20275 is now known as bougyman
Vegitto has quit [Client Quit]
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
blackmes1 has joined #ruby
bernd9000 has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
ozcanesen has joined #ruby
Scriptonaut has joined #ruby
<Scriptonaut> can someone help me understand this. I can do method(:puts), but why can't I do method(:+) ?
blackmesa has quit [Ping timeout: 246 seconds]
<Scriptonaut> oh, I just realized, I can do 4.method(:+)
<dminuoso> havenwood: There it is again.
<elomatreb> Yep, Object (the default receiver) has no + defined
<dminuoso> That monstreous "defined?"
<dminuoso> It's one of the worst hacks in Ruby..
<dminuoso> How that even works is beyond me,.
<elomatreb> I don't think I've ever seen it in actual code
<elomatreb> Checking for undefined variables feels like PHP
davidmichaelkarr has joined #ruby
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
bronson has quit [Ping timeout: 260 seconds]
Meow has quit [Ping timeout: 260 seconds]
kumarat9pm has joined #ruby
haylon has quit []
HoierM has joined #ruby
kumarat9pm has quit [Client Quit]
tomphp has joined #ruby
ixti has joined #ruby
ixti has quit [Client Quit]
ixti has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> elomatreb: Do you know how it works?
al2o3-cr_ is now known as al2o3-ct
al2o3-ct is now known as al2o3-cr
<elomatreb> No, haven't gotten into Ruby internals yet
ixti has quit [Client Quit]
ixti has joined #ruby
recondite has quit [Remote host closed the connection]
bronson has joined #ruby
Hobbyboy has quit [Ping timeout: 246 seconds]
ixti has quit [Client Quit]
ixti has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
blackmes1 has joined #ruby
cschneid_ has quit [Remote host closed the connection]
robouk has quit [Quit: Konversation terminated!]
im0nde has joined #ruby
kke has quit [Ping timeout: 240 seconds]
kke has joined #ruby
fxa has quit [Ping timeout: 240 seconds]
jameswatling has joined #ruby
robouk has joined #ruby
jphase has quit [Remote host closed the connection]
jameswatling has quit [Ping timeout: 260 seconds]
Pumukel has joined #ruby
mim1k has joined #ruby
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
patarr has quit [Ping timeout: 240 seconds]
boringcp1 has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
hobodave has quit [Quit: Computer has gone to sleep.]
jusa has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
robouk has quit [Quit: Konversation terminated!]
zach_ has joined #ruby
SeepingN_ is now known as SeepingN
robouk has joined #ruby
ecuanaso has joined #ruby
<zach_> So there's this nice shortcut where `foos.map { |foo| foo.bar }` can be `foos.map(&:bar)`. But if I want to initialize a Foo object, is there any shorter way to express `foos.map { |foo| Foo.new(foo) }`?
boringcpg has joined #ruby
<Scriptonaut> not really
<Scriptonaut> zach_: **
<Scriptonaut> I don't think there's a practical way to pass arguments to that
<Scriptonaut> there is in Crystal, not ruby though
<havenwood> zach_: foos.map &Foo.method(:new)
<baweaver> class Foo; def self.init; -> *args { self.new(args) } end end; foos.map &Foo.init
<baweaver> :D
<havenwood> zach_: no nice way
<baweaver> pretty much
P4f73k has quit [Ping timeout: 240 seconds]
<havenwood> zach_: It's currently best to just use small, straighforward blocks for such cases.
P4f73k has joined #ruby
<baweaver> .....havenwood
<baweaver> I just had an evil idea
Hobbyboy has joined #ruby
<havenwood> pray telll?
<baweaver> make a gem that monkeypatches object and gives a proc that pipes to new
Cohedrin has joined #ruby
<zach_> ha
kumarat9pm has joined #ruby
konsolebox has quit [Quit: Leaving]
<kumarat9pm> Hi all, how about getting help on each method of a variable?
<zach_> alright cool, thanks for the sanity!
<baweaver> &ri Enumerable
<baweaver> &ri Array#each
<baweaver> kumarat9pm: might be a good idea to read a basic Ruby book
<havenwood> kumarat9pm: Or Pry will show you the code or docs for a given method with ? or $.
<havenwood> ?pry kumarat9pm
<ruby[bot]> kumarat9pm: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<kumarat9pm> like pythons help(var1.join())
<havenwood> kumarat9pm: http://pryrepl.org/
ResidentBiscuit has joined #ruby
<Scriptonaut> some_var.method(:method_name).methods.sort - methods
<kumarat9pm> Thanks, havenwood.
<Scriptonaut> then you can look at things like arity, etc
<Scriptonaut> find where it's defined
curti_ has quit [Quit: Leaving]
<havenwood> reminds me of: https://bugs.ruby-lang.org/issues/9076
Silox| has quit [Quit: Connection closed for inactivity]
mikecmpbll has quit [Quit: inabit. zz.]
nobitanobi has joined #ruby
chouhoulis has quit [Ping timeout: 268 seconds]
ski7777 has quit [Ping timeout: 268 seconds]
Hobbyboy has quit [Ping timeout: 246 seconds]
ski7777 has joined #ruby
kumarat9pm has quit [Quit: Leaving.]
nobitanobi has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dasher00 has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
HoierM has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
HoierM has joined #ruby
dasher00 has joined #ruby
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
kies has quit [Ping timeout: 246 seconds]
ResidentBiscuit has quit [Ping timeout: 240 seconds]
bronson has quit [Remote host closed the connection]
lucz has quit [Remote host closed the connection]
lucz has joined #ruby
kies has joined #ruby
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
atmosx has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
atmosx has joined #ruby
lucz has quit [Ping timeout: 240 seconds]
railswebdev has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
cdg has quit [Remote host closed the connection]
gusrub has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
musl has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Hobbyboy has joined #ruby
brent__ has quit [Ping timeout: 240 seconds]
eightlimbed has quit [Ping timeout: 240 seconds]
Puffball has quit [Remote host closed the connection]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
KeyJoo has quit [Ping timeout: 240 seconds]
eelster has joined #ruby