rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zzxc>
cahoots: The default ruby that comes with OSX installs its pretty old, and the whole sudo gem install is a know issue. I'd really recommend homebrew and chruby, or rbenv
<zzxc>
That being said, I'm still pretty new to ruby itself.
JeanCarloMachado has joined #ruby
benlieb has quit [Quit: benlieb]
skord has quit [Ping timeout: 240 seconds]
stan has quit [Ping timeout: 240 seconds]
s2013 has joined #ruby
<zzxc>
On that note... Does anyone know if there is a reason I can't seem to call Net::HTTP::Get::new in a self call? I keep getting an error saying "NoMethodError: undefined method `keys' for 3000:Integer". https://gist.github.com/anonymous/d83eec11694fdfdd1714e02c303e26ca
Derperperd has quit [Quit: Together, we will make America strong again. We will make America wealthy again. We will make America proud again. We will make America safe again. And, yes, together, we will make America great again. Thank you, God bless you, and God bless America.]
cam27 has joined #ruby
Derperperd has joined #ruby
<adam12>
zzxc: Are you sure those are the right arguments to that method?
<cahoots>
thanks, will keep thinking
<adam12>
zzxc: I feel like those are the args for Net::HTTP.start
alibby has quit [Read error: Connection reset by peer]
alibby1 has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
Rodya_ has joined #ruby
ericx2x has joined #ruby
<zzxc>
adam12: I'm pretty sure they are the same between new and start. I may be wrong, and I'll check in a second. I've run it withouth the instance class, def or instance variables (using just local vars) and it worked fine.
rakm has joined #ruby
<zzxc>
adam12: Whelp yeah that works.
cyphase has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
<adam12>
Good
<zzxc>
adam12: Ack. You're totally right. before I was using Net::HTTP.new(uri.host, uri.port). Sorry about that, boned-headed mistake on my part.
<zzxc>
Thanks adam12
<adam12>
It's cool. The net/http API is .. interesting
planigan has joined #ruby
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<darix>
adam12: for more advanced things i usually jump to mechanize
<adam12>
I prefer HTTP.rb
<zzxc>
That is definetly one way to put it... I'm working on a cli tool that makes a bunch of calls to a rest api with modified headers, so I'll definelty check that out. Thanks again.
<darix>
zzxc: there are some rest client libraries with some more helpers specific for that.
Rodya_ has joined #ruby
<zzxc>
darix: Really? That would be awesome. which ones? I didn't see any when I was looking earlier.
<havenwood>
zzxc: It has three deps, http-cookie, mime-types and netrc.
<BabyMario>
havenwood: Ah yeah, I meant open-uri, and I switched to rest-client as a result of that limitation
cyphase has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
<zzxc>
havenwood: Yeah rest-client looks awesome. I meant regarding the "there might be even a client for your specific rest api"
nobitanobi has joined #ruby
<zzxc>
darix: Yeah I was just looking at the gh page for this. I don't see a reason for the bump but hey its good its still being updated.
JeanCarloMachado has quit [Ping timeout: 260 seconds]
erlend has joined #ruby
gsilva has joined #ruby
JeanCarloMachado has joined #ruby
nobitanobi has quit [Ping timeout: 256 seconds]
planigan has quit [Quit: leaving]
aryaching has joined #ruby
cyphase has quit [Ping timeout: 264 seconds]
planigan has joined #ruby
agent_white has joined #ruby
<darix>
even the gh page lists commits
<darix>
github.com/rest-client/rest-client
<darix>
maybe you looked at something else :p
bungoman has joined #ruby
brent__ has quit [Remote host closed the connection]
cyphase has joined #ruby
rgtk has quit [Ping timeout: 246 seconds]
Asher has quit [Quit: Leaving.]
planigan has quit [Ping timeout: 260 seconds]
<havenwood>
zzak: ah, gotcha
<havenwood>
zzak: oops, MT, sorry about that
<havenwood>
zzxc: ^
<zzxc>
havenwood: Haha no worries.
<havenwood>
zzak: HTTP.rb is nice. There're quite a few nice HTTP clients in Ruby.
Vingador has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
<havenwood>
aack!
Asher has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
<havenwood>
zzxc: Typhoeus is great for parallel requests. Curb is the best libcurl wrapper. Excon and HTTPClient are excellent, full-featured pure-Ruby implementations.
<havenwood>
zzxc: I do really like the HTTP.rb API.
rgtk has joined #ruby
<zzxc>
For what I'm working on the rest-client gem sounds perfect. API looks pretty good do. But I'll probably avoid using Net::HTTP again...
<zzxc>
havenwood: That being said I may check out Typheus as well. I'm still kind of clueless how to do much in parallel in Ruby right now
chouhoulis has quit [Remote host closed the connection]
Arpanet69 has quit [Ping timeout: 260 seconds]
<dminuoso>
jdeen: The symptom you are experiencing happens because you blindly run rubocop over your application.
jgnagy has quit [Ping timeout: 264 seconds]
<dminuoso>
jdeen: Look at your code and tell me if it needs refactoring.
JoshS has quit [Ping timeout: 258 seconds]
<dminuoso>
And don't answer yes because rubocop told you to. Use your own judgement.
ta_ has joined #ruby
lel has quit [Ping timeout: 264 seconds]
<dminuoso>
jdeen: That being said, it would be sensible to have a singular is / elsif / else / end structure.
TomyWork has joined #ruby
nowhere_man has quit [Ping timeout: 260 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ddffg has quit [Quit: Leaving]
ddffg has joined #ruby
<elomatreb>
I'd probably also refactor that StreetViewImage instantiation into a method
marr has joined #ruby
maattdd has joined #ruby
<dminuoso>
jdeen: Also remove those code comments.
cajone has left #ruby [#ruby]
<dminuoso>
They have 0 value and just unnecessarily increase your method body.
<dminuoso>
(The TODO note is fine however)
<jdeen>
dminuoso: :) it is the first time i am using with rubocop... ya i was wondering how better it can be done... thanks on the comments if else and comments...
<jdeen>
elomatreb: thinking again it is a good idea... thanks
cyphase has quit [Ping timeout: 246 seconds]
<dminuoso>
jdeen: Rubocop can only identify potential smells with plenty of false positives. Ideally you should hand-configure rubocop to report about things you care about.
<dminuoso>
Not because it's configured that way by default.
<jdeen>
dminuoso: ah ha... you mean with a rubocop.yml to ignore/configure stuff?
maattdd_ has joined #ruby
<dminuoso>
jdeen: Precisely. :)
<jdeen>
great...
<jdeen>
thanks for the ideas...
JoshS has joined #ruby
jane_booty_doe has joined #ruby
maattdd has quit [Ping timeout: 268 seconds]
andikr has joined #ruby
SeepingN has joined #ruby
cyphase has joined #ruby
mark_66 has joined #ruby
SeepingN has quit [Client Quit]
millerti has quit [Read error: Connection reset by peer]
doublemalt_ has quit [Ping timeout: 240 seconds]
doublemalt_ has joined #ruby
kernelPaniq has quit [Remote host closed the connection]
grh has joined #ruby
charliesome has joined #ruby
Snickers has joined #ruby
JoshS has quit [Ping timeout: 240 seconds]
tau has joined #ruby
kazo has joined #ruby
cyphase has quit [Ping timeout: 258 seconds]
nobitanobi has joined #ruby
lel has joined #ruby
cyphase has joined #ruby
yurikoles has joined #ruby
aufi has joined #ruby
jsrn_ has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
sim0n has joined #ruby
sim0n has quit [Client Quit]
shinnya has joined #ruby
mikecmpbll has joined #ruby
tonini has joined #ruby
tonini is now known as zastav
zastav is now known as tonini
enterprisey has quit [Remote host closed the connection]
yurikoles has quit [Remote host closed the connection]
Xiti has quit [Quit: Xiti]
Pumukel has joined #ruby
yurikoles has joined #ruby
jaruga has joined #ruby
tvw has joined #ruby
cyphase has quit [Ping timeout: 260 seconds]
jaruga has quit [Client Quit]
Burgestrand has joined #ruby
cyphase has joined #ruby
blackmesa has joined #ruby
MittelDank has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
cyphase has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
NL3limin4t0r has joined #ruby
sarbs has quit [Ping timeout: 256 seconds]
jane_booty_doe has quit [Quit: Leaving]
tomphp has joined #ruby
sarbs has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
patarr has joined #ruby
djbkd_ has joined #ruby
phikes has joined #ruby
muelleme_ has joined #ruby
bkxd has joined #ruby
dn` has quit [Ping timeout: 256 seconds]
patarr has quit [Ping timeout: 256 seconds]
dn` has joined #ruby
mim1k has joined #ruby
mikecmpbll has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
muelleme_ has quit [Ping timeout: 246 seconds]
nofxxxx has joined #ruby
antgel has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
marr has quit [Ping timeout: 258 seconds]
nofxxx has quit [Ping timeout: 260 seconds]
JoshS has joined #ruby
Beams has joined #ruby
maattdd has joined #ruby
flying has joined #ruby
<mikecmpbll>
how do i parse a time from a string in the local timezone?
maattdd_ has quit [Ping timeout: 256 seconds]
<mikecmpbll>
e.g. parse('10:00') => 2017-03-30 10:00:00 +0100
<Burgestrand>
Hm, peculiar, documentation says that Time.parse assumes that the time parsed is in the current time zone.
<phikes>
^ this
<tobiasvl>
OK, it was UTC there, but on my computer it was mu timezone ;)
djbkd_ has quit [Remote host closed the connection]
djbkd has joined #ruby
<Burgestrand>
mikecmpbll What does `Time.parse("10:00").zone` output?
<tobiasvl>
Burgestrand: I first used DateTime.parse which maybe does not parse it in the current timezone
<tobiasvl>
but Time.parse _does_ use my correct timezone
<Burgestrand>
tobiasvl oh :)
<mikecmpbll>
eh, that's the trick
<Burgestrand>
I know Ruby and time zones isn't the most comfortable juggle.
<mikecmpbll>
Time.parse. derppppp
biberu has joined #ruby
* mikecmpbll
kicks DateTime in the face
<Burgestrand>
mikecmpbll be aware that time zones in general can be a bit tricky, so if your time string contains a timezone identifier/offset you might be in for a surprise.
<Burgestrand>
mikecmpbll if you can, I recommend using strptime and specifying your format.
<Burgestrand>
>> Time.parse("monkeys")
<ruby[bot]>
Burgestrand: # => undefined method `parse' for Time:Class (NoMethodError) ...check link for more (https://eval.in/764241)
<phikes>
The above even more concise is `1.day.from_now`
jaruga has joined #ruby
dionysus69 has joined #ruby
jaruga has quit [Remote host closed the connection]
jaruga has joined #ruby
cfec0b8d has joined #ruby
hutch34_ has joined #ruby
djbkd has quit [Remote host closed the connection]
jgnagy has joined #ruby
djbkd has joined #ruby
hutch34_ has quit [Ping timeout: 240 seconds]
maloik has quit [Remote host closed the connection]
lxsameer has joined #ruby
maloik has joined #ruby
mazeinmaze_ has quit [Ping timeout: 256 seconds]
jgnagy has quit [Ping timeout: 268 seconds]
chuff has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
dionysus70 has joined #ruby
mazeinmaze_ has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
dionysus70 is now known as dionysus69
Maven has joined #ruby
gdonald has quit [Read error: Connection reset by peer]
mjago has joined #ruby
gdonald has joined #ruby
marr has joined #ruby
jamesaxl has joined #ruby
Tagami[m] has quit [Remote host closed the connection]
Giphy[m] has quit [Remote host closed the connection]
travisr has quit [Remote host closed the connection]
dman[m] has quit [Remote host closed the connection]
MicaFox[m] has quit [Remote host closed the connection]
el_ocho[m] has quit [Read error: Connection reset by peer]
daveyboi[m] has quit [Write error: Connection reset by peer]
velu_aon[m] has quit [Read error: Connection reset by peer]
jakebriggs[m] has quit [Read error: Connection reset by peer]
heftig has quit [Remote host closed the connection]
bascht1 has quit [Write error: Connection reset by peer]
thulsa_legume[m] has quit [Write error: Connection reset by peer]
M107262[m] has quit [Write error: Connection reset by peer]
aviraldg has quit [Write error: Connection reset by peer]
<Burgestrand>
mikecmpbll Also depends, are you adding a day, or adding a certain amount of seconds?
<mikecmpbll>
Burgestrand : a day, preferably.
<Burgestrand>
mikecmpbll they can be very different regarding leap seconds, time zones and so on.
<mikecmpbll>
indeed
djbkd has quit [Remote host closed the connection]
<Burgestrand>
mikecmpbll DateTime allows you to easily add a day, I believe you should be able to convert your Time object to a DateTime and go from there.
djbkd has quit [Remote host closed the connection]
flopsec has joined #ruby
djbkd has joined #ruby
chuff has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
agent_white has quit [Quit: leaving]
synthroid has joined #ruby
duckpupp1 has joined #ruby
unshadow has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
hndk has joined #ruby
synthroi_ has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
synthroid has quit [Ping timeout: 260 seconds]
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #ruby
pmunt has joined #ruby
t-recx has joined #ruby
unreal has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
chouhoulis has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
loechel has joined #ruby
loechel has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
loechel has joined #ruby
Pumukel has quit [Read error: No route to host]
brent__ has quit [Ping timeout: 268 seconds]
JeanCarloMachado has joined #ruby
kjetilho has joined #ruby
<kjetilho>
hey! what's the recommended way of publishing my own gems internally? I tried gemirro, but it just fails in mysterious ways (the on-demand caching of any dependencies timeout or get forgotten.)
djbkd has quit [Remote host closed the connection]
ddffg has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby
<pagios>
does CORS apply on loading <script src="domainX"> or only on HTTP GET/POST / Xmlrequests?
jusa has joined #ruby
aupadhye has joined #ruby
<pmunt>
get doesnt have cors, but post does
<pmunt>
generally
jusa has quit [Ping timeout: 264 seconds]
herbmillerjr has quit [Quit: Konversation terminated!]
<workmad3>
pagios: CORS is only applicable to ajax requests
meshsmith_ has joined #ruby
meshsmith_ has quit [Remote host closed the connection]
<workmad3>
pagios: if you want to affect things like script sources, you should investigate the ContentSecurityPolicy header
<pagios>
workmad3, and even if cors is enabled, the ajax request would go to the malicious site but wont be read by client
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
<workmad3>
pagios: not sure what you're asking/saying there
<pagios>
cors is mainly to protect the client browser right
mim1k has joined #ruby
<workmad3>
cors is to allow you to break out of the same-origin sandbox
meshsmith has quit [Ping timeout: 260 seconds]
<pagios>
so if my siteA communicates with siteB i would including origin:siteB on my serverA and thus allow clients that load this site to communicate with siteB
<pagios>
right?
<workmad3>
no, that would allow siteB to talk to your server
ddffg has joined #ruby
<pagios>
oh ok
<pagios>
so users from siteB can talk using xhr to my siteA
<workmad3>
pagios: or are you meaning the 'origin' header? the browser doesn't let you set that
<workmad3>
and is only half of the CORS picture...
brent__ has joined #ruby
<pagios>
so if i want a user that loaded a page from google.com to communicate with my server, i would add origin:google.com to my server and thus users loading the google page and have a xhr to my server would go through
djbkd has quit [Remote host closed the connection]
<pagios>
if i want siteB to make xhr requests to my siteA without accessing siteA pages directly, i can include siteB in the origin of site siteA. on site A: allowed-origin: SiteB
<phikes>
rindolf: AFAIK transpec needs to run in a git repo
jrafanie has joined #ruby
<hxegon>
morning agent_white
<rindolf>
phikes: i run it there
<phikes>
rindolf: Are you absolutely sure? Try a `git status` in the same directory? To me it seems like the automatic discovery of the git repository root fails (and something else below, but let's sort out this one first)
bkxd has joined #ruby
jrafanie has quit [Client Quit]
<rindolf>
phikes: git status works fine
<phikes>
rindolf: Is it a git submodule or something? Or a plain non-bare git repository?
skweek has quit [Ping timeout: 246 seconds]
VoIPConference[m has joined #ruby
VoIPConference[m has left #ruby [#ruby]
djbkd has quit [Remote host closed the connection]
<rindolf>
phikes: the latter, but note that it's a subdir of the repo
<herwin>
(which is not absolute science of course)
<James123>
herwin, thank you :)
jgnagy has quit [Ping timeout: 268 seconds]
patarr has joined #ruby
slash_nick has joined #ruby
slash_nick has joined #ruby
slash_nick has quit [Changing host]
jrafanie has joined #ruby
synthroi_ has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 246 seconds]
jgnagy has joined #ruby
troulouliou_div2 has joined #ruby
cow[baby] has joined #ruby
djbkd has quit [Remote host closed the connection]
gdonald has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
gdonald has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[baby] has quit [Client Quit]
mark_66 has quit [Quit: Leaving.]
nobitanobi has quit []
ResidentBiscuit has joined #ruby
choke has joined #ruby
brent__ has joined #ruby
cow[baby] has joined #ruby
lxsameer has quit [Ping timeout: 264 seconds]
__Yiota has joined #ruby
synthroid has joined #ruby
synthroi_ has joined #ruby
xall has joined #ruby
lxsameer has joined #ruby
brent__ has quit []
Lord_of_Life has quit [Excess Flood]
synthroid has quit [Ping timeout: 240 seconds]
nowhere_man has quit [Ping timeout: 240 seconds]
Lord_of_Life has joined #ruby
Lord_of_Life has quit [Excess Flood]
Lord_of_Life has joined #ruby
raspado has joined #ruby
aganov has quit [Remote host closed the connection]
hfp has joined #ruby
<hfp>
Hey, I'm using schacon's ruby-git gem. Is there a way to get the name for the currently checked out branch with it? I want to save the name, checkout master, pull/merge master, and then checkout the branch that was originally checked out
jrafanie has joined #ruby
TheCompWiz has joined #ruby
<ytti>
dunno, but you probably should be using 'rugged' not 'ruby-git'
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
<TheCompWiz>
I have an interesting question... does anyone know how to use the "gets" method on a stream with multiple line separators instead of just 1? i.e. instead of just "\n" ... also separate on ":" or something else.
jrafanie has quit [Client Quit]
<TheCompWiz>
I really don't want to bang on the stream one byte at a time.
doublemalt__ has quit [Ping timeout: 258 seconds]
djbkd has quit [Remote host closed the connection]
<jonjitsu>
I used bundlers gem generator to create a cli app. Is there an easy way of installing this locally? Also, is there an easy way to dockerize this so I could do docker run cli-app [options]?
jsrn_ has quit [Quit: Leaving]
djbkd has joined #ruby
xall has quit [Ping timeout: 240 seconds]
rakm has joined #ruby
brent__ has joined #ruby
[Butch] has joined #ruby
chuff has joined #ruby
huddy has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
mjago has quit [Ping timeout: 240 seconds]
nowhere_man has joined #ruby
mim1k has joined #ruby
synthroid has joined #ruby
doublemalt__ has joined #ruby
nOwz has quit [Ping timeout: 240 seconds]
chouhoul_ has joined #ruby
GodFather has joined #ruby
synthroi_ has quit [Ping timeout: 240 seconds]
aufi has quit [Quit: Leaving]
uncertainty has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
<TheCompWiz>
well... I guess since nobody knows if I can use 2 separators instead of 1... how about this. Is there an equivalent "peek" method on streams that can see what is in the buffer without moving the current position in the stream?
<TheCompWiz>
i.e. a gets without consuming the data?
chouhoulis has quit [Ping timeout: 240 seconds]
gtifbv has quit [Remote host closed the connection]
xall has joined #ruby
somebody_ has joined #ruby
somebody_ has quit [Quit: Page closed]
MittelDank has joined #ruby
<hxegon>
TheCompWiz: Try getting an enumerator from the file and using #lazy
andikr has quit [Remote host closed the connection]
Xiti has joined #ruby
<TheCompWiz>
@hxegon.... sadly... it's not a stream :(
Arpanet69 has quit [Ping timeout: 260 seconds]
<TheCompWiz>
s/stream/file/
skweek has quit [Ping timeout: 246 seconds]
flying has quit []
chouhoul_ has quit [Remote host closed the connection]
gusrub has joined #ruby
<hxegon>
TheCompWiz: is it an IO?
<TheCompWiz>
yup
Lord_of_Life has quit [Excess Flood]
<hxegon>
you could try IO#foreach, but it's by line so not sure if you can use it
Lord_of_Life has joined #ruby
vhscrb has joined #ruby
<TheCompWiz>
the problem is... some lines end in newlines... others end in \r only. /sigh.
tenderl__ has quit [Remote host closed the connection]
tenderlove has joined #ruby
<TheCompWiz>
all in the same stream I will see both.
<hxegon>
TheCompWiz: hmm... there's also each_char
<hxegon>
and #each_byte, but it sounded like those wouldn't work :(
loechel has quit [Remote host closed the connection]
<TheCompWiz>
yeah... was hoping to avoid reading byte-by-byte.
Pumukel has joined #ruby
<TheCompWiz>
that puts a heavy toll on the CPU...
choke has quit [Ping timeout: 260 seconds]
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
polishdub has joined #ruby
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
<TheCompWiz>
I am hoping that there is a more elegant way than to setup my own buffer that I chunk together and parse every cycle.
Pumukel has quit [Remote host closed the connection]
Pumukel has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
uncertainty has quit [Ping timeout: 258 seconds]
<hxegon>
TheCompWiz: for #each_line, you can pass in the separator as a regex
<TheCompWiz>
it doesn't seem to match non-printable characters unfortunately. :(
tenderlove has quit [Ping timeout: 246 seconds]
<TheCompWiz>
i.e. [\r\n]
chuff has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
_aeris_ has quit [Ping timeout: 240 seconds]
TomyLobo2 has joined #ruby
tvw has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cfec0b8d has joined #ruby
Pumukel has quit [Ping timeout: 268 seconds]
marsjaninzmarsa has quit [Ping timeout: 258 seconds]
marcdel has quit [Ping timeout: 260 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<TheCompWiz>
grr... gets doesn't seem to like regex :(
_aeris_ has joined #ruby
<rob_>
anyone know how to recursively turn child hashes in a hash into a hashie type hash?
<TheCompWiz>
hashie?
<rob_>
well, substitute 'hashie' for any other type of object
__Yiota has joined #ruby
<hxegon>
Gonna have to be a bit more specific rob_
<cagomez>
what does this do? `Foo.someMethod do; methodCall(Foo); end` do? does it only run if `Foo.someMethod` exists?
<hxegon>
cagomez: it should give an error if someMethod is undefined on Foo, but are you asking what the do...end syntax is?
<cagomez>
hxegon: yes, that too
<ytti>
it's anonymous function passed to someMethod
<ytti>
which calls it via yield
enterprisey has quit [Max SendQ exceeded]
<cagomez>
in the first place, if that code exists, is the programmer assuming that `Foo` always has a `someMethod`?
<ytti>
yes
enterprisey has joined #ruby
<ytti>
and that someMethod takes block
<hxegon>
essentially you are passing a function as an argument to someMethod
<cagomez>
what if that `methodCall(Foo)` returns a value? is that value passed to `someMethod`?
<hxegon>
cagomez: no, you have to use yield in someMethod to pass a value to the block, but because the block doesn't have any arguments, it wouldn't do anything
<hxegon>
for example
gsilva has quit [Ping timeout: 260 seconds]
<hxegon>
[1, 2, 3].map { |n| n * 2 } # { = do, } = end here. map passes the elements of the list to the block, the block executes on each thing it's passed and map returns the values returned by the block
<moeSizlak>
nowhere in there do i ever write a \n to the file
<moeSizlak>
but the file ends up with 5 of them
<moeSizlak>
(it writes 80,000 lines to the file, so its not doing it on every line, probably only when it flushes some buffer. the last line in the file has a \n
enterprisey has joined #ruby
code_zombie has joined #ruby
code_zombie has quit [Max SendQ exceeded]
<adam12>
moeSizlak: so you want just \r and not \n or \r\n?
<moeSizlak>
yes
<adam12>
Seems weird that #write would be adding \n.
<moeSizlak>
only on 5 of the 80,000 lines it writes
workmad3 has quit [Ping timeout: 240 seconds]
<adam12>
Is it possible the \r is being converted to \n on the platform?
<moeSizlak>
inclusing the last line
pankaj has joined #ruby
<moeSizlak>
not possible
A124 has joined #ruby
<moeSizlak>
i changed the write line to this:
<moeSizlak>
file.write("some shit\rmore shit\ryadda yadda yadda\r")
<hfp>
I switched to rugged, but I still don't see how can I pull and rebase the master branch programatically
<hfp>
(from Ruby, manipulating a git repo on disk)
BTRE has joined #ruby
tenderlove has joined #ruby
tenderlo_ has joined #ruby
<moeSizlak>
fyi, it was just notepad++ seeing \n'es even though there were none
<moeSizlak>
never had np++ lie to me like that before :/
milardovich has quit [Remote host closed the connection]
<dminuoso>
havenwood: Im about to do a naughty.
<dminuoso>
Im about to do redux in ruby.
<dminuoso>
rubux.
tenderlove has quit [Ping timeout: 260 seconds]
hahuang65 has joined #ruby
tenderlo_ has quit [Quit: Leaving...]
cagomez has quit [Remote host closed the connection]
jdm has quit [Ping timeout: 240 seconds]
<KevinMGranger>
Why would that be naughty?
moeSizlak has left #ruby ["Leaving"]
<dminuoso>
KevinMGranger: I have stopped mutating Ruby objects left and right.
renchan has joined #ruby
<dminuoso>
I even started writing my rails views like react components..
<dminuoso>
:|
<baweaver>
dminuoso: nice pun
<KevinMGranger>
I'm relatively new to ruby compared to other langs, but that sounds like the opposite of naughty
<KevinMGranger>
Unless it truly results in bad performance
<dminuoso>
KevinMGranger: Leave your performance wishes outside the door if you enter this channel.
bmurt has joined #ruby
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
<KevinMGranger>
That's my philosophy. I've always seen immutability as a best practice, I wouldn't call it naughty. Heck, rails partials are pretty close to react components, no?
<dminuoso>
Not at all.
<dminuoso>
Like. Completely not at all.
<KevinMGranger>
As long as you don't use local state, I don't see how they're not the same
<KevinMGranger>
Or, similar, at least
<dminuoso>
The only thing they have in common is that they produce HTML somehow.
<dminuoso>
But thats the extend of it.
ozcanesen has joined #ruby
<dminuoso>
Well, technically a rails view can output other things too.
jusa has quit [Ping timeout: 240 seconds]
<KevinMGranger>
And are composable with other components / partials, and you can pass them local variables so they're not dependent on how you set up your instance variables. Close enough for me :P
<KevinMGranger>
Okay, a better question, then: how have you been changing your rails views so that they're closer to react components
<dminuoso>
KevinMGranger: Decomposing inside the same file using lambdas.. putting lambdas to calculate things inside the same view :D
<dminuoso>
Which is quite horrible but well. It reads nicer.
<KevinMGranger>
That sounds like you're putting redux reducers in your view, more than react components, but I might still be misunderstanding. Still sounds fun :P
mim1k has joined #ruby
<dminuoso>
No.
_sfiguser has joined #ruby
<dminuoso>
Redux reducers are a completely different thing again.
<baweaver>
dminuoso: I may pick your brain later on Redux
<ruby[bot]>
dminuoso: # => [1, 2, 3, 3, 4, 5, 6] ...check link for more (https://eval.in/764782)
<dminuoso>
Merging arrays like a professional!
patarr_ has joined #ruby
mikecmpbll has joined #ruby
mim1k has quit [Quit: Reconnecting]
mim1k has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
meshsmith has joined #ruby
naprimer has joined #ruby
x0f has joined #ruby
naprimer is now known as krzysztoff
patarr has quit [Ping timeout: 268 seconds]
biberu has quit []
TPug has joined #ruby
hahuang61 has joined #ruby
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
skweek has quit [Ping timeout: 246 seconds]
hahuang65 has quit [Ping timeout: 258 seconds]
biberu has joined #ruby
electrostat has quit [Quit: uwotm8]
hahuang65 has joined #ruby
electrostat has joined #ruby
slackR has quit [Ping timeout: 264 seconds]
hahuang61 has quit [Ping timeout: 260 seconds]
FoX_77 has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
ta_ has joined #ruby
hndk has quit [Quit: Leaving]
<FoX_77>
hi
hahuang61 has joined #ruby
jdm has joined #ruby
<pupsicle>
Ramda doesn't look like anything too groundbreaking.
hahuang65 has quit [Ping timeout: 240 seconds]
patarr_ has quit [Ping timeout: 256 seconds]
t-recx has quit [Quit: t-recx]
patarr has joined #ruby
jrafanie has joined #ruby
huddy has quit [Quit: Connection closed for inactivity]
PaulCapestany has quit [Ping timeout: 246 seconds]
loincloth has joined #ruby
tvw has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
haylon has joined #ruby
dhollinger has joined #ruby
montanonic has joined #ruby
skweek has joined #ruby
cagomez has joined #ruby
PaulCapestany has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has quit [Ping timeout: 240 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has quit [Remote host closed the connection]
PaulCapestany has quit [Ping timeout: 246 seconds]
pankaj has quit [Ping timeout: 264 seconds]
PaulCapestany has joined #ruby
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
johnzorn has quit [Read error: Connection reset by peer]
bmurt has joined #ruby
johnzorn has joined #ruby
DarkBushido has joined #ruby
DarkBushido has joined #ruby
DarkBushido has quit [Changing host]
PaulCapestany has quit [Ping timeout: 246 seconds]
jrafanie has joined #ruby
patarr has joined #ruby
__Yiota has joined #ruby
<Doow>
So, I was writing some code on windows and used the handy File.stat(myfile).birthtime(). But when I move it to the production environment (ubuntu 16.04 with ruby 2.3) I get "birthtime() function is unimplemented on this machine". What's the best alternative option?
<dminuoso>
Doow: Docker!
<dminuoso>
Clearly.
<Doow>
Also, is there some way to check when developing in windows what functions might not be available in linux? There may be several functions I'm using that's just not been called yet.
<dminuoso>
Doow: What is the filesystem?
<Doow>
dminuoso, ext4
<dminuoso>
Doow: Yeah you are screwed on Windows kind of.
PaulCapestany has joined #ruby
cagomez has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FoX_77 has quit [Quit: Leaving...]
<Doow>
The documentation says that birthtime() will return ctime() on platform where a birthtime is not available, however, I'm not quite sure what "Returns the change time for stat (that is, the time directory information about the file was changed, not the file itself)." means and in what situation that would change.
<Doow>
but I guess I should use ctime() instead?
<Doow>
damn it, I was reading the documentation for 2.2, not 2.3. Looks like it has changed
knight33 has joined #ruby
cow[baby] has quit [Quit: cow[baby]]
vayan has joined #ruby
mattwc has joined #ruby
bkxd has joined #ruby
enterprisey has quit [Remote host closed the connection]
Rodya_ has quit [Remote host closed the connection]
Rodya_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 246 seconds]
nOwz has joined #ruby
enterprisey has joined #ruby
kcning has joined #ruby
enterprisey has quit [Remote host closed the connection]
nOwz has quit [Ping timeout: 260 seconds]
crayfishx has quit [Ping timeout: 255 seconds]
mnemon has quit [Ping timeout: 258 seconds]
drale2k_ has quit [Ping timeout: 256 seconds]
dellavg has quit [Ping timeout: 255 seconds]
gremax has quit [Ping timeout: 255 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
cydrobolt_ has quit [Remote host closed the connection]
cydrobolt has joined #ruby
cydrobolt has quit [Changing host]
cydrobolt has joined #ruby
drale2k_ has joined #ruby
benlieb has quit [Quit: benlieb]
cdg has joined #ruby
jrafanie has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ozcanesen has joined #ruby
chouhoulis has joined #ruby
__Yiota has joined #ruby
cd-rum has quit [Read error: Connection reset by peer]
cd-rum has joined #ruby
benlieb has joined #ruby
matled has quit [Remote host closed the connection]
matled has joined #ruby
Nicmavr has quit [Ping timeout: 258 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
benlieb has quit [Client Quit]
mlehrer_ has quit [Ping timeout: 258 seconds]
cgibsonmm has joined #ruby
Nicmavr has joined #ruby
gremax has joined #ruby
renchan has quit [Remote host closed the connection]
gnufied has quit [Ping timeout: 246 seconds]
Nicmavr is now known as Guest80652
mlehrer has joined #ruby
crayfishx has joined #ruby
synthroi_ has joined #ruby
renatosilva has joined #ruby
g0d355__ has joined #ruby
g0d355__ has quit [Excess Flood]
dellavg has joined #ruby
synthro__ has joined #ruby
PaulCapestany has quit [Ping timeout: 246 seconds]
PaulCape_ has joined #ruby
synthroid has quit [Ping timeout: 268 seconds]
synthroi_ has quit [Ping timeout: 260 seconds]
gdonald has quit [Read error: Connection reset by peer]
gdonald has joined #ruby
svkurowski has quit [Ping timeout: 240 seconds]
gnufied has joined #ruby
tau has quit [Read error: Connection reset by peer]
hahuang61 has quit [Ping timeout: 256 seconds]
svkurowski has joined #ruby
ramortegui has quit [Quit: Ex-Chat]
Lyubo1 has quit [Ping timeout: 260 seconds]
DEac- has quit [Quit: leaving]
pankaj has joined #ruby
milardovich has joined #ruby
grillon has quit [Quit: Connection closed for inactivity]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DEac- has joined #ruby
ddffg has quit [Quit: Leaving]
<cgibsonmm>
hello
<cgibsonmm>
anyone here today>
tolerablyjake has joined #ruby
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
MrBusiness has joined #ruby
synthro__ has quit []
Lyubo1 has joined #ruby
Mutter has joined #ruby
millerti has joined #ruby
jusa has joined #ruby
<cagomez>
say I want to pass `foo.thing1` to a method bar like so: bar(foo.thing1) . I have `thing1` to `thingN` so I need to make N method calls. how do I do this in a loop? Is it
Mutter has quit [Client Quit]
duckpupp1 has quit [Ping timeout: 260 seconds]
<adaedra>
you can use public_send to make dynamic calls
<cagomez>
adaedra: what about `send`? what's the difference?
<adaedra>
`send` allows you to call private methods.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adaedra>
It has its uses, but you should use `public_send` by default, so you don't break the private line.
cgibsonmm has quit [Remote host closed the connection]
jrafanie has joined #ruby
jrafanie has quit [Client Quit]
jusa has quit [Ping timeout: 264 seconds]
dviola has quit [Quit: WeeChat 1.7]
hemebond has left #ruby [#ruby]
JeanCarloMachado has joined #ruby
Jayson_Virissimo has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meshsmith has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 260 seconds]
davorb has quit [Read error: Connection reset by peer]
davorb has joined #ruby
galeido has quit [Ping timeout: 240 seconds]
ruby[bot] has quit [Ping timeout: 240 seconds]
ikopico has quit [Ping timeout: 240 seconds]
gnufied has quit [Ping timeout: 246 seconds]
grh has quit [Ping timeout: 260 seconds]
[Butch] has quit [Quit: I'm out . . .]
jenrzzz has joined #ruby
CloCkWeRX1 has joined #ruby
hahuang61 has joined #ruby
knight33 has joined #ruby
ldnunes has quit [Quit: Leaving]
jdm has quit [Read error: Connection timed out]
tfitts has joined #ruby
CloCkWeRX has quit [Ping timeout: 240 seconds]
ikopico has joined #ruby
cd-rum has quit [Remote host closed the connection]
Jayson_Virissimo has quit [Remote host closed the connection]
jdm has joined #ruby
esObe_ has quit []
Jayson_Virissimo has joined #ruby
Jayson_V_ has joined #ruby
cd-rum has joined #ruby
rhyselsmore has joined #ruby
fuzzyhorns has joined #ruby
<fuzzyhorns>
pry question im having trouble googling:
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<fuzzyhorns>
the output of `whereami` shows line numbers of the file i'm in
<fuzzyhorns>
any way to execute what is on a line number from within pry?
Jayson_Virissimo has quit [Ping timeout: 246 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kcning has quit [Ping timeout: 258 seconds]
bmurt has joined #ruby
marsjaninzmarsa has quit [Ping timeout: 258 seconds]
ecnalyr has quit [Client Quit]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
bmurt has quit [Client Quit]
JeanCarloMachado has joined #ruby
rgtk has joined #ruby
<darix>
fuzzyhorns: copy paste?
kcning has joined #ruby
xenops has joined #ruby
haylon has quit [Quit: Leaving]
vircung has quit [Ping timeout: 240 seconds]
chouhoulis has joined #ruby
gloscombe_ has joined #ruby
<fuzzyhorns>
darix: i was hoping there'd be an equivalent of !line_number in shell
<z64>
i mean.. can read the file split into lines and then eval it
<z64>
if theres something to do that already, i dunno
<fuzzyhorns>
z64: it seemed like the kind of thing pry might already have an api for
mjuhl has quit [Ping timeout: 240 seconds]
TPug has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesaxl has quit [Ping timeout: 240 seconds]
jamesaxl has joined #ruby
bkxd has joined #ruby
jdm has joined #ruby
bastilian has left #ruby [#ruby]
jdm has quit [Max SendQ exceeded]
fuzzyhorns has quit [Quit: Leaving.]
pankaj has quit [Ping timeout: 264 seconds]
bkxd has quit [Ping timeout: 240 seconds]
vircung has joined #ruby
cagomez has quit [Remote host closed the connection]
mjuhl has joined #ruby
cagomez has joined #ruby
<patarr>
Is there a way to have an error "fall-through" to the next rescue block?
maattdd has joined #ruby
<patarr>
e.g. rescue SpecificError => e #check e.something, don't find what you want, pass it to the next block# .... rescue => e Logger.error(e)
TPug has joined #ruby
<SeepingN>
just rescue it in the outter block
rindolf has quit [Quit: Leaving]
<adam12>
patarr: you can re-raise
<adam12>
but we'd probably need to see some code to see what you're doing.
eb0t has quit [Quit: WeeChat 1.4]
postmodern has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
ruby[bot] has joined #ruby
JeanCarloMachado has joined #ruby
lpaste_ has quit [Ping timeout: 240 seconds]
Didac has quit [Ping timeout: 256 seconds]
blackwind_123 has quit [Ping timeout: 258 seconds]
<patarr>
adam12: if I re-raise, will that allow it to be evaluated by rescue blocks that come after?
cjk101010 has quit [Ping timeout: 255 seconds]
muelleme_ has quit [Ping timeout: 260 seconds]
<adam12>
patarr: in the same block, probably not.
<adam12>
could you rescue a bunch of exceptions and setup a case on them?
<adam12>
so only one block
tvw has quit []
blackwind_123 has joined #ruby
alibby1 has quit [Read error: Connection reset by peer]
alibby2 has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<patarr>
I could give that a shot. I can skin this cat a few different ways, I was just wondering if ruby had such a facility. Thank you adam12
<adam12>
patarr: You can always try re-raising, but I suspect it's not going to be in the same block as where the raise was handled the first time. Somewhere further up.
alibby1 has joined #ruby
<adam12>
Go get em :)
JeanCarloMachado has quit [Ping timeout: 268 seconds]
alibby2 has quit [Read error: Connection reset by peer]
JeanCarloMachado has joined #ruby
centrx has joined #ruby
knight33 has joined #ruby
cjk101010 has joined #ruby
hxegon is now known as hxegon_afk
lpaste has joined #ruby
gsilva has quit [Remote host closed the connection]
muelleme_ has joined #ruby
enterprisey has joined #ruby
kcning has quit [Quit: WeeChat 1.7]
enterprisey has quit [Read error: Connection reset by peer]
Didac has joined #ruby
CloCkWeRX1 has quit [Ping timeout: 260 seconds]
muelleme_ has quit [Ping timeout: 240 seconds]
kegster has quit [Read error: Connection reset by peer]
centrx has quit []
tau has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
patarr has quit [Ping timeout: 264 seconds]
biberu has quit []
kirun has quit [Quit: Konversation terminated!]
CloCkWeRX has joined #ruby
zipper has quit [Ping timeout: 264 seconds]
cagomez has quit [Remote host closed the connection]