jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
quiller has joined #ruby
charliesome has joined #ruby
charliesome has quit [Client Quit]
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
apparition has quit [Ping timeout: 246 seconds]
cagomez has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jhooker has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
<randomA>
why does rails runs on port 3000 and not 80
jackjackdripper has quit [Quit: Leaving.]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
cagomez has quit [Ping timeout: 268 seconds]
ixti has joined #ruby
ixti has quit [Client Quit]
bhrgunatha has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
ixti has joined #ruby
gizmore|2 has joined #ruby
milardovich has quit [Ping timeout: 268 seconds]
eputnam has joined #ruby
ta_ has quit [Ping timeout: 255 seconds]
jhooker has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
jhooker has joined #ruby
shinnya has quit [Ping timeout: 260 seconds]
gizmore has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
charliesome has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
umaaji has quit [Ping timeout: 260 seconds]
jhooker has joined #ruby
juggler has quit [Ping timeout: 240 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
bhrgunatha has quit [Quit: ChatZilla 0.9.93 [Firefox 52.2.1/20170710112451]]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dennisvennink has joined #ruby
uranellus has quit [Ping timeout: 255 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
uranellus has joined #ruby
cagomez has joined #ruby
d^sh has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: Connection reset by peer]
__Yiota has joined #ruby
jhooker has joined #ruby
d^sh has joined #ruby
rundor has joined #ruby
PaulCape_ has quit [Quit: .]
jhooker has quit [Read error: Connection reset by peer]
uranellus has quit [Ping timeout: 276 seconds]
cagomez has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Francy has quit [Quit: Leaving]
jhooker has joined #ruby
charliesome has joined #ruby
PaulCapestany has joined #ruby
mim1k has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Quit: WeeChat 1.9]
hahuang65 has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jameser has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
DK2 has quit [Ping timeout: 260 seconds]
nb_bez_____ has quit [Quit: Connection closed for inactivity]
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
jameser_ has joined #ruby
cagomez has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
tacoboy has quit [Remote host closed the connection]
mrconfused has joined #ruby
genpaku has quit [Quit: Lost terminal]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
DK2 has joined #ruby
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
mrconfused has quit [Ping timeout: 246 seconds]
jhooker has quit [Read error: Connection reset by peer]
genpaku has joined #ruby
jhooker has joined #ruby
randomA has quit [Remote host closed the connection]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
uZiel has joined #ruby
meshsmith has quit [Remote host closed the connection]
ecuanaso has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
ta_ has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
choke has joined #ruby
planigan has quit [Ping timeout: 248 seconds]
jhooker has quit [Read error: No route to host]
__Yiota has joined #ruby
jhooker has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
planigan has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
umaaji has joined #ruby
rivalomega has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
cam27 has joined #ruby
<rubycoder37>
given (1..100).to_a, how can I rotate this array in a loop? the elements of the array, and limit it to 5 elements, e.g. arr[0,5]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
mtkd has quit [Ping timeout: 255 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
mtkd has joined #ruby
cagomez has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
<elomatreb>
rubycoder37: What do you mean by rotate?
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
PorcoRex has joined #ruby
<PorcoRex>
Evening.
tunaBee has joined #ruby
<rubycoder37>
I have a rails app with a range of dates, e.g. start_date..end_date, let's say the array results in a month (so ~30 elements), I want to be able to pass these elements to a function and return different dates for each result
ta_ has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: Connection reset by peer]
<elomatreb>
So you want #map? Get a new array with a different value for each original element?
jhooker has joined #ruby
Rr4sT has joined #ruby
<PorcoRex>
elomatreb, I think they might be interested in a mock implementation.
jhooker has quit [Read error: Connection reset by peer]
<elomatreb>
The rotate part they asked about earlier has me thinking about #each_cons
cagomez has quit [Ping timeout: 246 seconds]
jhooker has joined #ruby
<PorcoRex>
Just came in, missed that one.
<rubycoder37>
in my application an owner sets an mount of money and a date (start_date and end_date), I need to figure out a way to display each item with different dates
<rubycoder37>
s/owner/user/
<rubycoder37>
s/mount/amount/
<elomatreb>
You should probably put some example input/expected output in a gist, I'm not quite sure what you mean
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
<rubycoder37>
ok
<PorcoRex>
rubycoder37, you need to step back from you app and consider that we don not know anything about it. Then ponder on what the thing you don't completely understand is. Then as a question, with a simplified example for everyones convenience.
<PorcoRex>
ask*
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
<rubycoder37>
yes, I agree
GinoMan has quit [Ping timeout: 276 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
bronson has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
<rubycoder37>
I think it's a design issue, I'm basically entering an amount and a date range, I have to be able to extract a specific set of elements out of that array for each product I'm showing, without the product itself knowing about this data, I have no idea how to do that
dviola has quit [Quit: WeeChat 1.9]
<elomatreb>
Extracting an array of elements from another array is done with #select. The interesting part is how you decide which elements you want to select
<PorcoRex>
elomatreb, it's not an array though, it's a range.
<elomatreb>
In the earlier message they mentioned they have turned the range into an array
moei has quit [Quit: Leaving...]
rundor has quit [Remote host closed the connection]
<rubycoder37>
I currently have a method with something like this: (user.target.start_date..user.target.end_date).to_a
jhooker has quit [Read error: Connection reset by peer]
<rubycoder37>
in my model
jhooker has joined #ruby
rundor has joined #ruby
<rubycoder37>
but it doesn't feel right to be picking a bunch of dates randomly also
bronson has quit [Ping timeout: 276 seconds]
<rubycoder37>
something tells me I might have misunderstood something about the specification, I think I'll go back to that
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
rundor has quit [Ping timeout: 240 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cahoots has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tunaBee has quit [Ping timeout: 268 seconds]
larissa has quit [Ping timeout: 255 seconds]
larissa has joined #ruby
cahoots has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: No route to host]
umaaji has quit [Quit: Leaving...]
jhooker has joined #ruby
br0d1n has quit [Quit: Leaving]
<PorcoRex>
rubycoder37, so let's say, you have an array of dates (is each representing a different calendar day?). And then if I understand correctly there is some sort of ammount (is this a single value representing an ammount?). After an operation we want (a new array? with what kind of values?)
rivalomega has quit [Remote host closed the connection]
jhooker has quit [Read error: Connection reset by peer]
daivyk has quit [Quit: Quit]
jhooker has joined #ruby
milardovich has joined #ruby
<rubycoder37>
PorcoRex: yes, different days, the amount is a single value (integer), yes
<rubycoder37>
PorcoRex: I'm still undecided if I should be returning a new array or a hash for my rails view to parse the data, in that case, I'm also not sure how to convert the array to a hash
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
<elomatreb>
At this point a gist with example input and expected result for that input would be helpful, we can then help you implement it
<PorcoRex>
Well, if you must employ a hash, what would be the key?
<PorcoRex>
The dates?
<rubycoder37>
that's my problem, the specifications are a bit lacking
<PorcoRex>
rubycoder37, what specification, you're designing this, right?
<rubycoder37>
thanks for your help
<rubycoder37>
PorcoRex: no, it's something I've been told to do
<PorcoRex>
rubycoder37, ok. Assume that is terribly wrong. How would you rather do it?
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubycoder37>
good question
rundor has joined #ruby
daivyk has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
daivyk has quit [Client Quit]
<PorcoRex>
rubycoder37, I'm sure you've had a couple of fringe ideas.
<PorcoRex>
Did you not?
gix has quit [Ping timeout: 260 seconds]
jhooker has joined #ruby
<rubycoder37>
yes, I think I'll keep working on it until I solve it, I think it's a good way to keep learning ruby
<PorcoRex>
I mean, you've got dates... you've got ammounts. Are we leaving these two things out to fend for themselves or are we actually creating a class, that defines how both of these people can coexist peacefully?
cyfr0n has joined #ruby
daivyk has joined #ruby
daivyk has quit [Client Quit]
<PorcoRex>
And if we do create a shelter for these peoples, what should it be called? DateDollar? Not too friendly certainly.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
daivyk has joined #ruby
<PorcoRex>
Maybe the whole thing does not make sense.
daivyk has quit [Client Quit]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
<PorcoRex>
rubycoder37, what do you think?
gix has joined #ruby
jameser has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
ta_ has joined #ruby
jhooker has joined #ruby
__Yiota has joined #ruby
cdg has joined #ruby
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
<rubycoder37>
PorcoRex: I have an amount and dates (30 days), I also have stores in my app, this amount needs to be distributed between the stores and sellers, my problem is how to select the elements from the date array and display them in my rails views in a way that makes sense
<rubycoder37>
sorry for the vagueness
mim1k has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
umaaji has joined #ruby
<rubycoder37>
I'm listing the stores in my app for each user and I don't know how select different dates from that array for each store without duplicating results (in the same view)
jhooker has joined #ruby
<elomatreb>
So you want to assign each store a date from your array, without duplicates?
<rubycoder37>
yes
<PorcoRex>
rubycoder37, seems a bit of a Rails question.
cdg has quit [Ping timeout: 260 seconds]
<rubycoder37>
right
<PorcoRex>
But is it more query related?
<PorcoRex>
I mean DB query.
rivalomega has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
<rubycoder37>
not sure about that, I think so, yes
jhooker has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
<elomatreb>
If they're both arrays of something, Array#zip can "zip" two arrays together, creating pairs of values from both arrays
<PorcoRex>
But uhm, let me be blunt. So for instance in your latest reply you say you're listing "apps" for each "user", there are "dates", there are "stores". But in that latest explanation there is nothing about the "ammount", which was a principal issue. I think you need to give us a mock example of your problem instead.
jhooker has quit [Read error: No route to host]
jhooker has joined #ruby
<rubycoder37>
PorcoRex: no, users can have many stores
<PorcoRex>
rubycoder37, you need to try and sinthesise your problem.
<PorcoRex>
rubycoder37, what is your problem, in a little box?
GodFather has quit [Ping timeout: 276 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
nowhereman has quit [Ping timeout: 240 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubycoder37>
I'm still confused about what I have to do
<rubycoder37>
sorry
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
renchan has joined #ruby
nowhereman has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
tunaBee_ has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<PorcoRex>
rubycoder37, your problem, it's hard to understand. What is it?
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
ta_ has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
ascarter has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
auzty has joined #ruby
jhooker has joined #ruby
conta has joined #ruby
ascarter has quit [Ping timeout: 240 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
moei has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubycoder37>
PorcoRex: let me see if I can be a little more clear, this is how my application looks at the moment: https://i.imgur.com/Qf0C5WW.png -- and this is my code: https://gist.github.com/anonymous/f7c8a4860b36997e6e7bb5e62de1a9e9 -- I want to be able to show different dates, I don't understand how to generate different dates from that helper code, I don't understand why it's duplicating the data
cyfr0n has quit [Quit: Bye!]
julian has quit [Ping timeout: 246 seconds]
chouhoul_ has joined #ruby
eightlimbed has joined #ruby
SteenJobs_ has quit [Quit: SteenJobs_]
jottr has joined #ruby
<PorcoRex>
rubycoder37, this is definitely a Rails question. Do you have their IRC channel?
chouhoulis has quit [Ping timeout: 240 seconds]
dennisvennink has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rubycoder37>
yes
<rubycoder37>
I will ask there, thanks
<PorcoRex>
rubycoder37, before you go.
<PorcoRex>
Keep on it, rubycoder37, don't give up.
<rubycoder37>
I understand why 'date = (current_user.target.start_date..current_user.target.end_date).to_a' would give me the same output, but I don't know what I have to do to show different results in that loop
<PorcoRex>
rubycoder37, what loop?
<rubycoder37>
PorcoRex: my display_dates function is being called inside that @stores.each loop
alamar has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
alamar is now known as Guest73807
<PorcoRex>
Yeah, but what does that mean?
Derperperd has quit [Ping timeout: 268 seconds]
<PorcoRex>
rubycoder37, I'm sorry rubycoder37, maybe it's just me, but the thing is you need to take your real problem and make it smaller.
PorcoRex has quit [Quit: Leaving]
cdg has joined #ruby
<rubycoder37>
calling shuffle on the array gives me different results as I was expecting
<rubycoder37>
I think my problem solving skills is lacking, or maybe my imagination
<rubycoder37>
:/
<rubycoder37>
thanks for your help
rubycoder37 has quit [Quit: leaving]
dviola has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
shiranuidong has quit [Quit: Leaving]
anisha has joined #ruby
shiranuidong has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit []
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
sagax has quit [Quit: Konversation terminated!]
kies has joined #ruby
nickjj_ has joined #ruby
weaksauce has joined #ruby
nickjj has quit [Ping timeout: 255 seconds]
Dimik has joined #ruby
Bock has joined #ruby
uZiel has joined #ruby
cdg has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
ecuanaso has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
rundor has quit [Remote host closed the connection]
rundor has joined #ruby
oleo has quit [Quit: irc client terminated!]
aupadhye has joined #ruby
brent__ has quit [Remote host closed the connection]
rundor has quit [Ping timeout: 246 seconds]
dviola has quit [Quit: WeeChat 1.9]
szymon has joined #ruby
<szymon>
hello
szymon is now known as Guest43584
<Guest43584>
i have a question i try to build method where args can by hash or number
<Guest43584>
i try do def some_method(*args)
<Guest43584>
if args[0].is_a?(Intiger) .... elsif args[0].is_a?(Hash)
<Guest43584>
but i think it is simply way
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Guest43584>
someone can help
aufi has joined #ruby
szymon_ has joined #ruby
szymon_ has quit [Client Quit]
nicolai86 has quit [Remote host closed the connection]
jaruga has joined #ruby
nicolai86 has joined #ruby
nicolai86 has quit [Remote host closed the connection]
nicolai86 has joined #ruby
Neptu has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
nicolai86 has quit [Remote host closed the connection]
chouhoul_ has quit [Remote host closed the connection]
cdg has joined #ruby
nicolai86 has joined #ruby
roshanavand has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
<cjohnson>
Guest43584: sounds like code smell. Why wouldn't you just make one method for each input? You can abstract the common logic into a third method
cdg has quit [Ping timeout: 246 seconds]
<cjohnson>
Or assuming the number-input method is really just controlling one of the options in the hash, make it the wrapper for the hash method
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
TomyLobo has quit [Ping timeout: 255 seconds]
<Guest43584>
cjohnson, thanks i do rekrut exerise and in Rspec i have 2 option in this method so it must br in one method
DK2 has quit [Ping timeout: 268 seconds]
enterprisey has joined #ruby
dcluna has quit [Ping timeout: 276 seconds]
andrzejk_ has joined #ruby
dcluna has joined #ruby
jaruga has quit [Quit: jaruga]
andikr has joined #ruby
jottr has joined #ruby
DK2 has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
nanoz has joined #ruby
nanoz has quit [Changing host]
nanoz has joined #ruby
ahrs has quit [Read error: Connection reset by peer]
ahrs has joined #ruby
ecuanaso has joined #ruby
workmad3 has joined #ruby
bronson has joined #ruby
m4sk1n has joined #ruby
nickjj__ has joined #ruby
nickjj_ has quit [Ping timeout: 260 seconds]
eightlimbed has quit [Ping timeout: 260 seconds]
bronson has quit [Ping timeout: 240 seconds]
choke has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 248 seconds]
Rr4sT has quit [Quit: Connection closed for inactivity]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyWork has joined #ruby
patarr has joined #ruby
nanoz has left #ruby ["Leaving"]
patarr has quit [Ping timeout: 240 seconds]
nofxxxx has joined #ruby
pandaant has joined #ruby
Neptu has joined #ruby
nofxxx has quit [Ping timeout: 246 seconds]
DK2 has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
cdg has joined #ruby
conta has quit [Quit: conta]
ur5us has joined #ruby
hs366 has joined #ruby
latemus has quit [Ping timeout: 248 seconds]
latemus has joined #ruby
garathem has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
cdg has quit [Ping timeout: 246 seconds]
shiranuidong has quit [Ping timeout: 240 seconds]
hanmac has quit [Ping timeout: 258 seconds]
hs366 has quit [Quit: Leaving]
hs366 has joined #ruby
oded has joined #ruby
himynameisvic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruby[bot]>
dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
workmad3 has quit [Ping timeout: 276 seconds]
koenrh has joined #ruby
tacoboy has joined #ruby
workmad3 has joined #ruby
bronson has joined #ruby
nowhereman has quit [Remote host closed the connection]
guardianx has joined #ruby
nowhereman has joined #ruby
oleo has joined #ruby
chouhoulis has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
AgentVenom has quit [Ping timeout: 248 seconds]
nowhereman has quit [Remote host closed the connection]
nowhereman has joined #ruby
sgen has joined #ruby
nowhereman has quit [Client Quit]
nowhereman has joined #ruby
bkxd_ has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 260 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
psychicist__ has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
minimalism has joined #ruby
aclark has quit [Remote host closed the connection]
aclark has joined #ruby
DK2 has quit [Ping timeout: 246 seconds]
rkellermeyer has joined #ruby
Dry_Lips has quit [Ping timeout: 248 seconds]
<dminuoso>
>> %w%w%*$$
<ruby[bot]>
dminuoso: # => ["w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", "w", ...check link for more (https://eval.in/832632)
<dminuoso>
This is amazing!
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
DLSteve has joined #ruby
<Guest43584>
wow
<Guest43584>
:)
DK2 has joined #ruby
<mrgrieves>
I'm getting 'bundler: failed to load command' whenever I try to run rake tasks despite the fact the gem is present. Any ideas what I might be missing?
__Yiota has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has quit [Changing host]
<Guest43584>
why is 9951 elements ??
millerti has joined #ruby
ascarter has joined #ruby
shiranuidong has joined #ruby
shiranuidong has quit [Max SendQ exceeded]
<dminuoso>
Guest43584: I'll let you riddle on that! :-)
sekmo has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 255 seconds]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
jottr has joined #ruby
cam27 has joined #ruby
ar1a_ has joined #ruby
ar1a has quit [Ping timeout: 240 seconds]
RustyJ has joined #ruby
jottr has quit [Ping timeout: 260 seconds]
bigkevmcd has joined #ruby
bigkevmcd has quit [Client Quit]
<Bish>
dminuoso: the fuq
<Bish>
>> %w
<ruby[bot]>
Bish: # => /tmp/execpad-62e579807435/source-62e579807435:2: unterminated string meets end of file ...check link for more (https://eval.in/832645)
<Bish>
>> %w%w
<ruby[bot]>
Bish: # => /tmp/execpad-7453c835b7a9/source-7453c835b7a9:2: unterminated string meets end of file ...check link for more (https://eval.in/832646)
* Bish
opens up a console
vondruch has quit [Remote host closed the connection]
<Bish>
wat.. why
<Bish>
%w%w% <=
vondruch has joined #ruby
<Bish>
Guest43584: i can tell you for 45 schmeckles
misery_ has quit [Ping timeout: 240 seconds]
<Bish>
asm>> %w%w%
<ruby[bot]>
Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<dminuoso>
Bish: But yes to your earlier question. Everything that is not alphanumeric becomes a delimiter. And if it happens to be either (, [, { or < the closing has to be the respective closing paren.
garathem has joined #ruby
<Bish>
its really amazing ruby syntax is not amgibious enough to break stuff
vondruch has quit [Remote host closed the connection]
rundor has joined #ruby
vondruch has joined #ruby
shiranuidong has joined #ruby
shiranuidong has quit [Max SendQ exceeded]
rundor has quit [Remote host closed the connection]
rundor has joined #ruby
choke has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
<dminuoso>
Bish: The parser regularly chokes when you start leaving parens away.
rundor has quit [Ping timeout: 240 seconds]
<dminuoso>
Bish: f g {} // without trying out, could you tell me from the top off your head which function the block is associated with?
<Bish>
uhm
<Bish>
i write lines like that
<Bish>
so i should
romankapitonov has joined #ruby
* Bish
guesses g
rickumali has joined #ruby
vondruch has quit [Remote host closed the connection]
<dminuoso>
Congratulations.
<dminuoso>
You have just earned a minus point.
<Bish>
:(
vondruch has joined #ruby
<dminuoso>
Smartass. :|
<Bish>
but what does f get?
<Bish>
the return value of g?
<Bish>
what if g is not a function?
<Bish>
btw, as a ruby beginner i got super confused by hash-syntax and block syntax
<Bish>
things like
<Bish>
a {a:1,b:2}
bkxd_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 246 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
<dminuoso>
Bish: That's the thing.. the decision whether g is a method or variable is decided during lexing.
<dminuoso>
So there's no grammatical confusion.
dionysus69 has joined #ruby
<dminuoso>
Bish: But essentially that is the correct answer you have just given indirectly.
<dminuoso>
The question of whether the block is associated with f or g depends on whether g is a method or not :P
<dminuoso>
But I guess I made the mistake of implying both are `functions'
nowhereman has quit [Ping timeout: 240 seconds]
<dminuoso>
Bish: an example where lack of parens leads to a parser error:
<dminuoso>
>> p {} {}
<ruby[bot]>
dminuoso: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
sp00ky_spooooky has quit [Ping timeout: 240 seconds]
Xeago has joined #ruby
choke has joined #ruby
sarmiena_ has joined #ruby
kies has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
eightlimbed has joined #ruby
choke has quit [Ping timeout: 260 seconds]
jnollette has joined #ruby
Seenox has quit [Quit: Connection closed for inactivity]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has quit []
psychicist__ has quit [Ping timeout: 240 seconds]
nowhereman has quit [Remote host closed the connection]
__Yiota has joined #ruby
cagomez has quit [Remote host closed the connection]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
roshanavand has quit [Quit: roshanavand]
chouhoulis has joined #ruby
nowhereman has joined #ruby
dionysus69 has joined #ruby
cagomez has joined #ruby
psychicist__ has joined #ruby
ajnulo has quit [Quit: WeeChat 1.9]
ajnulo has joined #ruby
daivyk has quit [Quit: Quit]
rohitpaulk has quit [Ping timeout: 268 seconds]
cagomez has quit [Ping timeout: 260 seconds]
antgel has joined #ruby
roshanavand has joined #ruby
psychicist__ has quit [Quit: leaving]
psychicist__ has joined #ruby
cwood has joined #ruby
Dimik has joined #ruby
knight33 has joined #ruby
antgel has quit [Ping timeout: 246 seconds]
tau has joined #ruby
mark_66 has quit [Remote host closed the connection]
SeepingN has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
tau has left #ruby [#ruby]
bronson has joined #ruby
dionysus69 has quit [Quit: dionysus69]
cagomez has joined #ruby
eckhardt has joined #ruby
blackwind_123 has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
dennisvennink has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
InfinityFye has quit [Ping timeout: 255 seconds]
dasher00 has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
dennisvennink has joined #ruby
rippa has joined #ruby
<cwood>
Not sure where I ask about rubocop... but why doesn't it like code such as: x, y = This.that
<cwood>
I get a "useless assignment to variable", but it's not useless when that returns an array.
<bougyman>
that's a specific cop
<bougyman>
cwood: you're not using either x or y somewhere after that.
<cwood>
Oh, ok. I thought it means nothing would be assigned to the variable. Thank you
<bougyman>
np
rohitpaulk has joined #ruby
InfinityFye has joined #ruby
vuoto has joined #ruby
graft has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
mim1k has joined #ruby
uZiel has quit [Remote host closed the connection]
workmad3_ has quit [Ping timeout: 240 seconds]
SteenJobs_ has joined #ruby
SteenJobs_ has quit [Client Quit]
vuoto has quit [Quit: Lost terminal]
t-recx has quit [Quit: t-recx]
sepp2k has quit [Ping timeout: 240 seconds]
mim1k has quit [Ping timeout: 258 seconds]
kies has joined #ruby
cagomez has quit [Remote host closed the connection]
dstrunk has joined #ruby
cagomez has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
boto has quit [Quit: boto]
__Yiota has joined #ruby
uZiel has joined #ruby
<uZiel>
hi
Ishido has quit [Read error: Connection reset by peer]
<uZiel>
I want an 8 byte long integer to increment so I created x = "\x00"*8 and do x.next
<uZiel>
but after 57 increments x becomes 9 bytes long as it changes from "\u0000\u0000\u0000\u0000\u0000\u0000\u00009" to "\u0000\u0000\u0000\u0000\u0000\u0000\u000010"
<uZiel>
any workaround or any better solutions?
ResidentBiscuit has quit [Quit: Critical Miss]
boto has joined #ruby
duderonomy has joined #ruby
chouhoul_ has joined #ruby
centrx has joined #ruby
InfinityFye has quit [Quit: Leaving]
<SeepingN>
real numbers not numbers created from strings ;)
hndk has joined #ruby
cagomez has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 240 seconds]
nb_bez______ has joined #ruby
cagomez has joined #ruby
bmurt_ has joined #ruby
bmurt_ is now known as bmurt-
bmurt- is now known as bmurts
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cwood has quit [Quit: ERC (IRC client for Emacs 25.2.1)]
ajnulo has quit [Remote host closed the connection]
bmurts is now known as bmurt
theunraveler has joined #ruby
andikr has quit [Remote host closed the connection]
himynameisvic has joined #ruby
himynameisvic has quit [Client Quit]
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 255 seconds]
Guest43584 has quit [Quit: Leaving]
Bock has quit [Ping timeout: 240 seconds]
rundor has joined #ruby
centrx has quit []
sepp2k has joined #ruby
Timba-as has joined #ruby
dennisvennink has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
guacamole has quit [Quit: Lost terminal]
daivyk has joined #ruby
guacamole has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<havenwood>
uZiel: Are you incrementing to 255 with all 8 positions or just the last?
mostlybadfly has joined #ruby
mrconfused has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
t-recx has joined #ruby
Paraxial has quit [Ping timeout: 255 seconds]
vondruch has joined #ruby
VeryBewitching has joined #ruby
andrzejku has joined #ruby
patarr_ has joined #ruby
gizmore|2 is now known as gizmore
patarr has quit [Ping timeout: 240 seconds]
Gavxn has joined #ruby
<Gavxn>
Woo! I figured it out. Took an hour or two
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Client Quit]
dennisvennink has joined #ruby
lxsameer has joined #ruby
<splitshot>
Right now the only thing I'm thinking is get Time.now, and then build a new Time object passing in the 7 params but was hoping for an easier way.
<havenwood>
splitshot: And it's not Rails/ActiveSupport?
<splitshot>
Does Rails have something like that?
<havenwood>
yeah
<havenwood>
DateTime.now.change(hour: 18)
<havenwood>
You could cherry pick the method from ActiveSupport.
<splitshot>
Fantastic just what I was looking for. Thanks.
noe has quit [Remote host closed the connection]
<havenwood>
Or there's a little repetition in pure Ruby.
balazs has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
gusrub has joined #ruby
<Ramddd>
thanks
AX3L has quit [Ping timeout: 240 seconds]
cagomez_ has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
bronson has joined #ruby
SteenJobs__ has quit [Ping timeout: 255 seconds]
sniffer has joined #ruby
dennisvennink has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
ldnunes has quit [Quit: Leaving]
psychicist__ has quit [Ping timeout: 260 seconds]
SteenJobs_ has joined #ruby
AX3L has joined #ruby
cadillac__ has joined #ruby
ecuanaso has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
brent__ has quit [Remote host closed the connection]
cadillac_ has quit [Ping timeout: 248 seconds]
cadillac__ is now known as cadillac_
cseder has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rivalomega has quit [Read error: Connection reset by peer]
rivalomega has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
vondruch has quit [Remote host closed the connection]
jottr has quit [Quit: WeeChat 1.9]
vondruch has joined #ruby
inoperable has joined #ruby
splitshot has quit [Remote host closed the connection]
AxelAlex has joined #ruby
AX3L has quit [Quit: AX3L]
rkellermeyer has quit [Quit: rkellermeyer]
nathan has joined #ruby
daivyk has quit [Quit: Quit]
mrconfused has joined #ruby
daivyk has joined #ruby
<nathan>
Anyone know if there's a good way to get active support's `Object#to_param` to use `URI.escape` rather than `CGI.escape`? I was trying to use a refinement, but the lexical scoping seems to make it difficult (in my scope, `to_param` is called on a hash, which then calls it on a string, and the string version is the one that needs patching)
AxelAlex has quit [Quit: AxelAlex]
AxelAlex has joined #ruby
tvw has joined #ruby
latemus has quit [Ping timeout: 260 seconds]
johnny56_ has quit [Ping timeout: 264 seconds]
latemus has joined #ruby
Ramddd has quit [Quit: Leaving]
mrconfused has quit [Ping timeout: 246 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56_ has joined #ruby
ecuanaso has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
sarmiena_ has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
mrconfused has joined #ruby
<SegFaultAX>
nathan: I don't know of a way to do that, but I probably would just write a helper method instead of trying to monkey patch a monkey patch. :)
ResidentBiscuit has quit [Quit: Critical Miss]
sarmiena_ has quit [Quit: sarmiena_]
inoperable has left #ruby ["User derezzed"]
inoperable has joined #ruby
noe has quit [Quit: noe]
tvw has quit []
jackjackdripper has quit [Ping timeout: 255 seconds]
jackjackdripper has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nathan>
Thanks SegFaultAX. I think that's probably what I'll do, but it _almost_ seemed like a great opportunity to finally try out refinements. Maybe some day!
ecuanaso has joined #ruby
dasher00 has quit [Ping timeout: 240 seconds]
VeryBewitching has quit [Quit: Konversation terminated!]
misery_ has joined #ruby
brent__ has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
SteenJobs_ has quit [Quit: SteenJobs_]
mrconfused has quit [Ping timeout: 246 seconds]
sarmiena_ has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
nathan has quit [Ping timeout: 260 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has joined #ruby
mim1k has joined #ruby
ltem has quit [Quit: Leaving]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
polishdub has quit [Quit: Leaving]
dennisvennink has quit [Read error: Connection reset by peer]
mim1k has quit [Ping timeout: 260 seconds]
rubycoder37 has joined #ruby
dennisvennink has joined #ruby
<rubycoder37>
hi
<havenwood>
rubycoder37: hi
nicholascho has joined #ruby
<rubycoder37>
I have the following code: Hash[(user.start_date..user.end_date).to_a.zip] -- I'm having a bit of trouble adding a value to the keys, e.g. if I do Hash[(user.start_date..user.end_date).to_a.zip, ['foo']] I think foo is added to the last key only
<rubycoder37>
I'm not sure what I'm doing wrong :(
nicholascho has quit [Client Quit]
ajnulo has quit [Quit: WeeChat 1.9]
<rubycoder37>
any ideas please?
<elomatreb>
rubycoder37: Hash[] expects an array containing arrays of the form [key, value]. You're creating a Hash that has only keys, since your array always have only one element
<rubycoder37>
oh
<rubycoder37>
that makes sense, thank you
mrconfused has joined #ruby
SteenJobs_ has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoul_ has quit [Remote host closed the connection]