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]
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
<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
<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?
<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>
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.
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 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
<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: 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…]
<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"
<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
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.
<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?
<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]
<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.
<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
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?
<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