brent__ has quit [Remote host closed the connection]
leandrobighetti has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
brent__ has quit [Read error: Connection reset by peer]
brent___ has joined #ruby
mim1k has joined #ruby
BackEndCoder has quit [Ping timeout: 276 seconds]
brian_penguin has joined #ruby
eregon has quit [Quit: No Ping reply in 180 seconds.]
_sfiguser has quit [Quit: Leaving]
[spoiler] has quit [Ping timeout: 276 seconds]
hanmac has quit [Ping timeout: 276 seconds]
KevinMGranger has quit [Ping timeout: 276 seconds]
torarne has quit [Ping timeout: 276 seconds]
turt2live has quit [Ping timeout: 276 seconds]
sneep has quit [Ping timeout: 276 seconds]
SuperTaz has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
cats has quit [Ping timeout: 276 seconds]
rileyy has quit [Ping timeout: 276 seconds]
[spoiler] has joined #ruby
mbr has quit [Ping timeout: 240 seconds]
sneep has joined #ruby
brent___ has quit [Remote host closed the connection]
hutch34 has joined #ruby
eregon has joined #ruby
rileyy has joined #ruby
cats has joined #ruby
BackEndCoder has joined #ruby
wilbert has joined #ruby
ArtCorvelay has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
domgetter has quit [Ping timeout: 246 seconds]
turt2live has joined #ruby
torarne has joined #ruby
KevinMGranger has joined #ruby
profsimm has quit [Ping timeout: 260 seconds]
rahult is now known as rahult_
hanmac has joined #ruby
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
enterprisey has joined #ruby
gusrub_ has quit [Remote host closed the connection]
bronson has joined #ruby
raspado has quit [Quit: Leaving...]
mbr has joined #ruby
<rapha>
if i have lots of [{foo: 1.2, bar: 2.3}, {foo: 3.2, bar: 3.0}] but need lots of [{foo: [1.2, 3.2]}, {bar: [2.3, 3.0]}] is that something I would use .map for? my brain is a bunch of knots right now :(
amclain has quit [Quit: Leaving]
griffindy has joined #ruby
phate408 has quit [Ping timeout: 240 seconds]
griffindy has quit [Client Quit]
bronson has quit [Ping timeout: 268 seconds]
mim1k has joined #ruby
aurelien has quit [Ping timeout: 276 seconds]
rahult has joined #ruby
<Radar>
rapha: You could probably reduce it.
<Radar>
I'll give you some code, one moment
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<rapha>
I'm playing around with something that's probably quite ugly, no rush :)
<Radar>
>> src = [{foo: 1.2, bar: 2.3}, {foo: 3.2, bar: 3.0}]; src.each_with_object({foo: [], bar: []}) { |data, acc| acc[:foo] << data[:foo]; acc[:bar] << data[:bar] }
<Radar>
rapha: ^ is that what you're after? Or did you want foo + bar to be in two separate hashes?
mim1k has quit [Ping timeout: 240 seconds]
<rapha>
Radar: no, that's exactly what I was after!
* rapha
reads
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rapha>
oh.
<rapha>
what sort of construct is "p begin"?
<rapha>
oic that's just the bot's code
ozcanesen has joined #ruby
duderonomy has joined #ruby
<rapha>
Radar: what do you mean by "acc"?
<Radar>
accumulator,
<Radar>
The acc starts off being the object passed in as the argument to each_with_object, and then that object changes every time the block is called
hutch34 has quit [Ping timeout: 276 seconds]
<Radar>
So the first time it would go from {foo: [], bar: []} to {foo: [1.2], bar: [2.3]} and then the 2nd time it goes to {foo: [1.2, 3.2], bar: [2.3, 3.0]}
<Radar>
Then there are no more elements, so it returns the final result
<rapha>
ah, that's an apt name then
<rapha>
i think i need to read up on each_with_object
ArtCorvelay has quit [Quit: WeeChat 1.9]
nacsurte has quit [Ping timeout: 240 seconds]
cahoots_ has quit [Ping timeout: 240 seconds]
gizmore|2 has joined #ruby
jdawgaz has joined #ruby
charliesome has joined #ruby
gizmore has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
<rapha>
oh
<rapha>
the _with_object part is what i give it in the argument array, not in the block
<rapha>
so it's not that complicated even :)
rahult has quit [Read error: Connection reset by peer]
rahult_ has joined #ruby
brian_penguin has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rahult_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* rapha
marvels at how many packets his router routes
duderonomy has joined #ruby
<Radar>
Gruff is a name I haven't seen in a while.
carnegie has quit [Remote host closed the connection]
carnegie has joined #ruby
<rapha>
:)
<rapha>
It's a nice little Gem!
<rapha>
Radar: say, is something like each_with_object crossing over into the functional programming realm?
<Radar>
rapha: Well it is running a function (proc) for each element in the list, so yeah, I think it is.
carnegie has quit [Remote host closed the connection]
bruno- has joined #ruby
<rapha>
Hmm. I will have to tell my Haskell-wielding friends to stop laughing at Ruby and me.
Derperperd has quit [Quit: Peace out]
dcunit3d has quit [Ping timeout: 246 seconds]
<Radar>
I think they'll still keep doing that.
milardovich has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
jrafanie has joined #ruby
cahoots has joined #ruby
<rapha>
I guess, but then I'll just call them Haskellipsters or something.
milardovich has quit [Ping timeout: 260 seconds]
sleepee has quit [Read error: Connection reset by peer]
runescape07rsps has quit [Quit: Leaving]
<konsolebox>
"dmark is a function to mark Ruby objects referred from your struct. It must mark all references from your struct with rb_gc_mark or its family if your struct keeps such references."
<konsolebox>
What happens if I don't specify dmark?
<konsolebox>
@extension.rdoc
<konsolebox>
the example further below it does not specify any: {0, free_dbm, memsize_dbm,},
grant has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
guacamol_ has joined #ruby
guacamol_ has quit [Client Quit]
<cahoots>
hi, i'm having a strange issue. if a gem, mygem, isn't installed, and i run `gem install mygem` and then 'gem "mygem", "=1.0"' immediately after, it tells me that it can't find the gem. but then on subsequent runs, where the gem has been installed, that call to the gem function works. how can i fix this?
<cahoots>
is gem install starting some async task that i need to wait for?
poloych has quit [Remote host closed the connection]
guacamole has quit [Ping timeout: 260 seconds]
<baweaver>
>> [{foo: 1.2, bar: 2.3}, {foo: 3.2, bar: 3.0}].reduce { |a,b| a.merge(b) { |_,o,n| Array(o) << n } } # Radar / rapha :D
<cahoots>
meh, looks like this fixed more elegantly anyways by using Gem::Commands::InstallCommand
sleepee has joined #ruby
<konsolebox>
(nevermind i got it. i just forgot the concept)
<Radar>
cahoots: why are you doing it that way? Why not use a Gemfile to install the gems?
leandrobighetti has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 260 seconds]
<cahoots>
Radar, this is a script that will run on a remote CI machine. so i want to only install gems within the directory of the script, and then i want to delete all untracked files on a fresh run
<ruby[bot]>
Radar: I don't know anything about next
<Radar>
ruby[bot]: I thought you loved me.
rahult has joined #ruby
QualityAddict has quit [Quit: Leaving]
<cahoots>
Radar, but then i still have to install the bundle gem, no?
swills_ has joined #ruby
rahult has quit [Client Quit]
<cahoots>
also, if i went the bundle route, i would need to remember to run "bundle exec ruby" instead of "ruby" every time, correct?
swills has quit [Ping timeout: 255 seconds]
<nofxxxx>
cahoots, not necessarly, if there's no gem clashs just ruby will work, but yeah, that ensures it'll
rahult has joined #ruby
swills_ has quit [Client Quit]
<nofxxxx>
cahoots, also, if you're running something do a executable so you just ./myapp
swills has joined #ruby
swills has joined #ruby
swills has quit [Changing host]
<nofxxxx>
and it starts it properly
rahult has quit [Client Quit]
empty_cup has quit [Ping timeout: 240 seconds]
guardianx has joined #ruby
<cahoots>
nofxxxx, how does that work, because i put "#!/usr/bin/env ruby" at the top which would make it just run /usr/bin/ruby, right? how does bundle get involved?
gusrub has quit [Remote host closed the connection]
<nofxxxx>
cahoots, actually I was talking about bin/env sh ... so inside you bundle exec, but that would be nice
<nofxxxx>
can we do that? heh
<nofxxxx>
bin/env bundle ... ?
mesamoo has quit [Quit: Konversation terminated!]
<cahoots>
nofxxxx, i'm confused, can you rephrase what you're talking about?
HoierM has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 260 seconds]
<nofxxxx>
cahoots, I meant use a sh script, #/usr/bin/env sh
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
bronson has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
<cahoots>
nofxxxx and Radar, thanks, i'll keep messing with bundler
bronson has quit [Ping timeout: 240 seconds]
siloxid has joined #ruby
<siloxid>
I'm trying to open a file, read a few filenames, then use those filenames to open more files. unfortunately when I use File.open(path) it always tells me "No such file". But 1. the path is correct and 2. if I open the file first, it works. does ruby only allow one file to be open at a time? something seems terribly wrong
xuanrui has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blznblzn2 has joined #ruby
<siloxid>
and I can puts the string and cat the filename in the terminal and the path is sane
xuanrui has quit [Ping timeout: 260 seconds]
wilbert has quit [Ping timeout: 240 seconds]
z3uS has quit [Remote host closed the connection]
__Yiota has joined #ruby
z3uS has joined #ruby
<siloxid>
but it appears that I can `cat #{path}` *facepasm*
wilbert has joined #ruby
minimalism has quit [Quit: minimalism]
hndk has joined #ruby
xuanrui has joined #ruby
tacoboy has quit [Remote host closed the connection]
siloxid has quit [Remote host closed the connection]
sneakerhax has quit [Read error: Connection reset by peer]
minimalism has joined #ruby
kent\n has quit [Quit: No Ping reply in 180 seconds.]
kent\n has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cahoots has quit [Ping timeout: 276 seconds]
brent__ has joined #ruby
hndk has quit [Ping timeout: 260 seconds]
sneakerhax has joined #ruby
umaaji has joined #ruby
segy_ has joined #ruby
dviola has quit [Quit: WeeChat 1.9]
brent__ has quit [Remote host closed the connection]
gusrub has joined #ruby
segy- has joined #ruby
segy has quit [Ping timeout: 260 seconds]
rahult has joined #ruby
segy has joined #ruby
segy_ has quit [Ping timeout: 240 seconds]
segy- has quit [Ping timeout: 240 seconds]
segy_ has joined #ruby
mesamoo has joined #ruby
segy has quit [Ping timeout: 260 seconds]
emers2n has joined #ruby
<emers2n>
Could someone explain what the multiplication/asterisk (*) means here: myCustomHash.inject(Hash[ *myCustomHash.first ]) do |tmp,kv|
<havenwood>
emers2n: This is nearly what you asked for, but nils instead of falling back to the last time: data_hash.keys.first.step(data_hash.keys.last, 1/1440r).map { |datetime| [datetime, data_hash[datetime]] }.to_h
Bock has joined #ruby
Bock has quit [Max SendQ exceeded]
moeabdol has joined #ruby
<emers2n>
havenwood: awesome, I'll check that out. Thanks so much
tens0r has joined #ruby
<havenwood>
emers2n: lemme think, gotta get those fallback times
pwnd_nsfw has joined #ruby
vuoto has joined #ruby
<emers2n>
havenwood: Well now that I have that I can just loop through from the start date and if null is encountered it is set to the previous date's vale
<emers2n>
value*
<havenwood>
emers2n: yeah, that's true
pwnd_nsfw` has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
pwnd_nsfw` has joined #ruby
milardovich has joined #ruby
yabbes has joined #ruby
iMadper` has quit [Read error: Connection reset by peer]
pwnd_nsfw has quit [Ping timeout: 246 seconds]
mim1k has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 255 seconds]
mtkd has joined #ruby
P_R_Deltoid has quit [Quit: Leaving]
ana_ has joined #ruby
roshanavand has joined #ruby
leandrobighetti has joined #ruby
rabajaj has joined #ruby
TomyLobo3 has joined #ruby
leandrobighetti has quit [Ping timeout: 240 seconds]
tvw has joined #ruby
govg has quit [Ping timeout: 240 seconds]
BrokenBard has joined #ruby
BrokenBard has left #ruby ["Leaving"]
govg has joined #ruby
tildes has quit [Ping timeout: 260 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
carnegie_ has joined #ruby
TomyLobo3 has quit [Ping timeout: 240 seconds]
vuoto has quit [Remote host closed the connection]
carnegie_ has quit [Ping timeout: 276 seconds]
andikr has joined #ruby
wilbert has quit [Ping timeout: 260 seconds]
tildes has joined #ruby
rahult has joined #ruby
worknick has quit [Ping timeout: 240 seconds]
rahult_ has joined #ruby
rahult has quit [Read error: Connection reset by peer]
ChewCraft has quit [Ping timeout: 240 seconds]
code_zombie has quit [Ping timeout: 246 seconds]
tvw has quit []
paradisaeidae has quit [Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170628145605]]
paradisaeidae_ has quit [Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170628145605]]
rahult_ has quit [Client Quit]
tildes has quit [Remote host closed the connection]
vali has joined #ruby
ledestin has joined #ruby
dcunit3d has joined #ruby
troys is now known as troys_
milardovich has joined #ruby
conta has joined #ruby
FahmeF has joined #ruby
troys_ is now known as troys
djbkd has joined #ruby
rahult has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
ana_ has quit [Quit: Leaving]
ana_ has joined #ruby
ltem has joined #ruby
vindvaki has joined #ruby
moeabdol has quit [Quit: WeeChat 1.9]
troys has quit [Ping timeout: 240 seconds]
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moeabdol has joined #ruby
jackjackdripper has joined #ruby
djbkd has quit []
nofxxx has joined #ruby
bronson has joined #ruby
TvL2386_ has joined #ruby
nofxxxx has quit [Ping timeout: 260 seconds]
Silthias1 has joined #ruby
Silthias has quit [Read error: Connection reset by peer]
TvL2386 has quit [Ping timeout: 240 seconds]
Trynemjoel has joined #ruby
tfitts has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
SenpaiSilver has joined #ruby
minimalism has quit [Quit: minimalism]
mim1k has quit [Ping timeout: 255 seconds]
leandrobighetti has joined #ruby
mark_66 has joined #ruby
ramfjord has joined #ruby
Trynemjoel has quit [Ping timeout: 276 seconds]
ramfjord has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
govg has quit [Ping timeout: 260 seconds]
Trynemjoel has joined #ruby
govg has joined #ruby
benjen has quit [Ping timeout: 260 seconds]
swills has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
benjen has joined #ruby
govg has quit [Ping timeout: 246 seconds]
govg has joined #ruby
cptAngry has joined #ruby
kkiero has joined #ruby
mikecmpbll has joined #ruby
domgetter has joined #ruby
lamppid has joined #ruby
workmad3 has joined #ruby
nunchuck has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
carnegie has joined #ruby
baroquebobcat has joined #ruby
marr has joined #ruby
DoubleMalt has joined #ruby
carnegie has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bambanx has quit [Quit: Leaving]
antgel_ has joined #ruby
dionysus69 has joined #ruby
tens0r has quit [Quit: tens0r]
duderonomy has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
sysvalve has joined #ruby
TomyWork has joined #ruby
mim1k has joined #ruby
duderonomy has quit [Client Quit]
bronson has joined #ruby
ByronJohnson has quit [Ping timeout: 276 seconds]
<dminuoso>
>> *{a:1}
<ruby[bot]>
dminuoso: # => /tmp/execpad-d627da89a4e6/source-d627da89a4e6:2: syntax error, unexpected '\n', expecting &. or :: o ...check link for more (https://eval.in/841016)
<dminuoso>
Okay, so splatarray ends up calling to_a
<dminuoso>
>> class Hash; def to_a; raise "NO"; end; end; a = *{a:1}
<ruby[bot]>
dminuoso: # => NO (RuntimeError) ...check link for more (https://eval.in/841018)
Ishido has joined #ruby
segy has joined #ruby
<dminuoso>
module Enumerable; def first; head, *rest = *self; return head; end; end # apeiros, there - without #each. We don't need the block return behavior as just proven! :P
bronson has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
charliesome has joined #ruby
Ishido has quit [Ping timeout: 246 seconds]
Derperperd has joined #ruby
enterprisey has quit [Remote host closed the connection]
ChewCraft has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
Beams has joined #ruby
claw has quit [Ping timeout: 255 seconds]
simmaniac has joined #ruby
Ishido has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
aupadhye has joined #ruby
sysvalve has quit [Ping timeout: 248 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cabotto has joined #ruby
FahmeF has quit [Ping timeout: 240 seconds]
ianfleeton has joined #ruby
postmodern has quit [Quit: Leaving]
claw has joined #ruby
bane_ has joined #ruby
benlieb has quit [Quit: benlieb]
algun has quit [Quit: algun]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
claw has quit [Ping timeout: 255 seconds]
FahmeF has joined #ruby
alex`` has joined #ruby
milardovich has joined #ruby
claw has joined #ruby
lel has quit [Ping timeout: 240 seconds]
yabbes has quit [Ping timeout: 255 seconds]
lel has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
cabotto is now known as cabotto_
cabotto_ is now known as cabotto
bronson has joined #ruby
cabotto has quit []
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
bronson has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
<rapha>
baweaver: cool, thanks for the alternative solution! :)
kkiero has left #ruby [#ruby]
ramfjord has quit [Ping timeout: 268 seconds]
yabbes has joined #ruby
emers2n has quit [Ping timeout: 260 seconds]
carnegie has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
Papierkorb has joined #ruby
carnegie has quit [Ping timeout: 276 seconds]
umaaji has quit [Ping timeout: 248 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
<Radeds>
dminuoso: Oh, I didn't know you can pass them both like way. How can I handle it on public_send method then? it also can get both as parameters?
hoangtg has quit [Remote host closed the connection]
<dminuoso>
ineb: the second star at kwargs is not necessary.
carnegie has joined #ruby
bruno- has quit [Ping timeout: 240 seconds]
<dminuoso>
or neither star in fact.
<dminuoso>
Radeds: in the parameter list a single splat *foo means "put rest args into an array named foo", and **bar means "put kwargs into a hash named bar".
<dminuoso>
Radeds: So you need to splat that rest args array back.
<Radeds>
dminuoso: how can I splat it back?
howdoi has quit [Quit: Connection closed for inactivity]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
Radeds: But really just use delegator :P
tens0r has quit [Quit: tens0r]
<ineb>
dminuoso: no star on kwargs works, but not one star
<dminuoso>
ineb: Mmm, one star turns it into an array right.
<dminuoso>
And the second splats that array of a single element back...
<dminuoso>
So... :D
carnegie has quit [Ping timeout: 246 seconds]
jdawgaz has joined #ruby
bronson has joined #ruby
InfinityFye has quit [Quit: Leaving]
<Radeds>
dminuoso: yea, I probably just delegate it like you mentioned. It's much more elegent. It will require some refactoring, for now I will try using what you mentioned. Will test it on pry soon:
<Radeds>
I'm guessing it's splating the hash and method_missing can't find a keyword argument called 'c'.
<ineb>
Radeds: a is missing in your example call
<Radeds>
ineb: why? my a is number argument. I'm passing Hash.
<Radeds>
number = normal.
<Radeds>
It just splat the hash, so it thinkg I'm trying to access a keyword parameter call c which does not exists on the method.
kkiero has joined #ruby
<Radeds>
I probably need to sit down and refactor it. I was just looking for a quick-hack until I do it. Seems like it's not possible to handle both cases.
bruno- has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spheric has joined #ruby
synthroi_ has joined #ruby
<ineb>
ohh yes. hmm youre right
<ineb>
but it works here
<ineb>
your code. i get {:c=>"d"} and b as parameters
__Yiota has joined #ruby
<matthewd>
Don't use kwsplat if you don't need it
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
ryzokuken has quit [Remote host closed the connection]
<dgarstang>
matthewd: What's foo in this case if job is the job?
<matthewd>
impermanence: But yeah, this is a behaviour of Struct, not some general concept
<matthewd>
dgarstang: The argument(s)
ryzokuken has joined #ruby
tryfan has joined #ruby
<dgarstang>
matthewd: but it's being read as a single string, as if executed from the command line, in the format ns:job[args]
<dgarstang>
matthewd: so, I guess Rake needs to call itself
cagomez has joined #ruby
<matthewd>
Rake.application.invoke_task("ns:job[args]") then maybe?
<dgarstang>
matthewd: I don't want to split the arguments out and parse as I want to keep generic in case the args change
<tryfan>
not a dev, and I'm trying to figure out a problem with a ruby script. I'm hitting a 120s delay on the first write to a log, using logging 1.8.2. is there any way I can debug the call to that class?
<matthewd>
I'm just googling and reading this off stackoverflow ¯\_(ツ)_/¯
cagomez has quit [Read error: Connection reset by peer]
carnegie has joined #ruby
cagomez has joined #ruby
carnegie has quit [Remote host closed the connection]
<matthewd>
tryfan: Easiest is probably to open the method you're calling and add some tracing (`puts`)
<tryfan>
matthewd: so I'm on the right track then
<dgarstang>
matthewd: That was it, thanks
carnegie has joined #ruby
<tryfan>
I did that from the origination point, but nothing delays until the first logger.info call
Guest14429 has quit [Changing host]
Guest14429 has joined #ruby
Guest14429 is now known as Kestrel-029
t-recx has quit [Read error: Connection reset by peer]
<matthewd>
tryfan: Right, so you can just keep going deeper; the library is all just ruby code (probably, but almost certainly), so there's no need to stop at the edge of the application boundary
cagomez_ has joined #ruby
<dgarstang>
matthewd: ok, sort of worked, it seems that the Rakefile just stops after the first job
<matthewd>
tryfan: Totally uninformed guess would be that's a network timeout, though, so I'd probably go looking for any configuration on where it's supposed to be sending those logs before I got too far in the weeds
<matthewd>
?xy dgarstang
<ruby[bot]>
dgarstang: 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
<tryfan>
matthewd: it's sending them to my home directory, and perms are good
<matthewd>
dgarstang: (just maybe..) but maybe we can help with a higher level discussion of your goal
carnegie has quit [Ping timeout: 276 seconds]
<dgarstang>
matthewd: So, basically if the jobs are loaded from a yaml file, and with projects['projects'].each do |p| Rake.application.invoke_task(p) end... the first one runs fine but the second does not
kies has joined #ruby
<dgarstang>
matthewd: It doesn't even try and execute the 2nd one, it just stops. If I replace the rake command with a simple puts(p) it shows both jobs
Rr4sT has joined #ruby
cagomez has quit [Ping timeout: 276 seconds]
<dgarstang>
So, it seems like when you use Rake.application.invoke_task(), execute doesn't return to the point it left off after it's finished
cagomez_ has quit [Ping timeout: 260 seconds]
howdoi has joined #ruby
hutch34 has joined #ruby
milardovich has quit [Read error: Connection reset by peer]
<dgarstang>
matthewd: Yes?
<matthewd>
dgarstang: I guess I'd start by checking whether that's invoke_task, or something about the particular task you're calling
<dgarstang>
hm maybe it does
<dgarstang>
matthewd: Ok, so the loop is executing twice. The second task returns an error but none of that output is displayed
MarkBilk_ has joined #ruby
<dgarstang>
matthewd: ie If I run the task through rake, it shows errors, if it's run via the invoke, no output is shown. Weird
<tryfan>
matthewd: does seem to be outputting anything when I place puts in the various methods in the logger
<tryfan>
matthewd: doesn't, rather
Kestrel-029 has quit [Read error: Connection reset by peer]
<dgarstang>
matthewd: ok if I call the same task twice, ie a working one twice, same thing. Output is shown for the first one , but no output is shown for the 2nd one. I know its executing both because I put a puts statement after each in the loop
<matthewd>
dgarstang: Does invoke just return the output / something, instead of writing directly, maybe?
<dgarstang>
jeez I dunno
<matthewd>
dgarstang: Okay that's a different thing: rake tasks run once by design
<dgarstang>
matthewd: Ok, so.. what if it's the same task with different arguments?
<matthewd>
dgarstang: Are you sure you actually want to do this? Where's the yaml file coming from?
<dgarstang>
Won't that run twice?
<matthewd>
dgarstang: Same task, AFAIK
<dgarstang>
matthewd: The yaml file has a list of projects to build
MarkBilk has quit [Ping timeout: 246 seconds]
<dgarstang>
matthewd: Ok, what's the right way to do this? How do you have a Rakefile iterate over a list of projects, and be able to build one or all depending on how it's called?
<matthewd>
tryfan: Might need to explicitly use $stderr.puts or $stdout.puts -- possible the logger object has its own puts defined that's going elsewhere (e.g. the log)
<matthewd>
dgarstang: I guess the easy option would be to run rake in a subprocess for each one
<dgarstang>
If rake only ever executes a task once inside a Rakefile, I don't see how a Rakefile could build for multiple projects if the tasks are the same, but the args differ. This must be a common problem
<dgarstang>
matthewd: you mean drive it from a script, which defeats the purpose of Rake
<dgarstang>
or a second Rakefile, which I presume can call the other, seems hacky
<matthewd>
I don't remember the last time I saw a rake task that took an argument, so...
baroquebobcat has joined #ruby
<dgarstang>
matthewd: There's a bazillion examples of rake tasks taking arguments
milardovich has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsul has quit [Ping timeout: 240 seconds]
<matthewd>
Maybe I've just been looking in the wrong places, then
davidmichaelkarr has quit [Quit: Connection closed for inactivity]
<matthewd>
I know it's *possible* -- I'm speaking to real-world usage, leading into "must be a common problem"
<matthewd>
dgarstang: In other words: it sounds like your rakefile structure is unusual... "how a Rakefile could build for multiple projects if the tasks are the same, but the args differ" - I can vaguely picture what that might look like, but it doesn't sound like an everyday rakefile to me
tsul has joined #ruby
milardovich has quit [Ping timeout: 276 seconds]
bronson has joined #ruby
<dgarstang>
matthewd: Build for a single project, with args, no problem. Building for ALL the projects, if so desired, how?
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
<dgarstang>
matthewd: or, put anothe way, if you want to build for multiple projects, what drives that?
<dgarstang>
matthewd: Stick the call to rake inside a shell script that iterates over them?
SeepingN has joined #ruby
<matthewd>
I'd normally expect a rakefile to exist within a project, so.. probably?
ltem has quit [Quit: Leaving]
bronson has quit [Ping timeout: 246 seconds]
<dgarstang>
matthewd: I wanted to have the ability to build specific projects if needed, and also the ability to build multiple based off a list. I don't want to build all in case there's an issue and it blocks everything else
<dgarstang>
some idiot checks in something that breaks, ok, remove their project from the build list
AxelAlex has joined #ruby
<matthewd>
Using the same rake tasks? Yeah, that just sounds measurably different from how I'd expect a thing to work.
<dgarstang>
matthewd: Different rake tasks, same Rakefile
aupadhye has quit [Ping timeout: 260 seconds]
vuoto has joined #ruby
mikecmpbll has joined #ruby
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Beams has quit [Quit: .]
cagomez has quit [Ping timeout: 240 seconds]
lungi has joined #ruby
<lungi>
hey anyone around?
<lungi>
i hope this is a good place to ask rexml question...
<lungi>
matthewd thank you so much! i know nokogiri is becoming more of a standard now but its just takes too long to install and rexml can do everything i want to
tvw has quit []
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
xuanrui has quit [Ping timeout: 276 seconds]
duderonomy has joined #ruby
kobain has joined #ruby
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
t-recx has quit [Ping timeout: 258 seconds]
carnegie has joined #ruby
t-recx has joined #ruby
guacamole has joined #ruby
gusrub has quit [Remote host closed the connection]
sneakerhax has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
lungi has quit [Quit: Page closed]
romankapitonov has joined #ruby
ramfjord has joined #ruby
minimalism has joined #ruby
xuanrui has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros>
matthewd: sometimes you lose, sometimes the others win… ;-)
bronson has joined #ruby
t-recx has quit [Ping timeout: 260 seconds]
amitchellbullard has joined #ruby
conta1 has joined #ruby
Dimik has joined #ruby
<impermanence>
my question has become: if I had something like: things = [Thing1, Thing2, Thing3, ...] where things are structs, and a method like self.my_method(things) ...how can I access ThingN values from things? things.something...? I tried to be more specific in the gist.
t-recx has joined #ruby
carnegie has quit [Ping timeout: 255 seconds]
<matthewd>
impermanence: `select` seems like you're on the right path
vee_ has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
Bock has quit [Ping timeout: 260 seconds]
conta1 has quit [Ping timeout: 246 seconds]
bronson has quit [Ping timeout: 276 seconds]
<impermanence>
matthewd: my sense too, but in my select block: my_params.select { |x| x #something }... what syntax do I use to actually get at the Struct (methods) (values) whatever?
<matthewd>
x.val1
<impermanence>
matthewd: hm. I think I'm leaving something out then (which is my fault :) )
<matthewd>
(I'm assuming you intend select here, and not map, say)
<impermanence>
matthewd: yeah. I just need to return certain things from the array is all.
tomphp has joined #ruby
cabotto has joined #ruby
andrzejk_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ltem has joined #ruby
guacamole has joined #ruby
normie1 has joined #ruby
dennisvennink has quit [Read error: Connection reset by peer]
dennisvennink has joined #ruby
jdawgaz has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
cabotto has quit [Remote host closed the connection]
cabotto has joined #ruby
minimalism has joined #ruby
Archrove- has quit [Changing host]
Archrove- has joined #ruby
ryzokuken has quit [Quit: Leaving]
cabotto has quit [Ping timeout: 240 seconds]
vindvaki has joined #ruby
zapata has quit [Quit: WeeChat 1.9]
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
baroquebobcat has quit [Quit: baroquebobcat]
nobitanobi has quit [Remote host closed the connection]
nobitanobi has joined #ruby
Murda has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
carnegie has joined #ruby
nobitanobi has quit [Ping timeout: 258 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SenpaiSilver has quit [Read error: Connection reset by peer]
nopolitica has joined #ruby
nobitanobi has joined #ruby
guacamole has joined #ruby
SenpaiSilver has joined #ruby
<impermanence>
havenwood: Indeed, it is a Value Object implementation and I am having the darndest time accessing its values, apparently because they're immutable but it's a bit baffling...
brent__ has quit [Remote host closed the connection]
<havenwood>
impermanence: Look at it with Pry
<havenwood>
?pry impermanence
<ruby[bot]>
c
<ruby[bot]>
impermanence: 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-do
<impermanence>
I am trying :)
<impermanence>
loving pry
<impermanence>
use it everyday
code_zombie has joined #ruby
vuoto has quit [Remote host closed the connection]
vindvaki has joined #ruby
dcunit3d has quit [Ping timeout: 240 seconds]
carnegie has quit [Quit: Leaving...]
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
thecommongeek has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
__Yiota has joined #ruby
Dimik has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
naprimer2 has quit [Ping timeout: 240 seconds]
bsartek has joined #ruby
FahmeF has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has joined #ruby
dionysus69 has quit [Remote host closed the connection]
_sfiguser has joined #ruby
swills has quit [Remote host closed the connection]
<impermanence>
Havenwood: any insight into how I might go about accessing [#<SomeClass val1: number, val2: "string", val3: number>]? When I try to do param.val1 say it complains (because I happen to know that the values of this data structure are immutable).
jdawgaz has joined #ruby
<havenwood>
impermanence: How would getting the value mutate? What is the class? What methods are available?
bronson has quit [Ping timeout: 276 seconds]
milardovich has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
vindvaki has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_sfiguser has quit [Ping timeout: 276 seconds]
<impermanence>
havenwood: hm...
jdawgaz has quit [Ping timeout: 276 seconds]
baroquebobcat has joined #ruby
profsimm has joined #ruby
<profsimm>
Ok, what is the most efficient way to implement a read/write byte/text buffer? Where I have a separate "read" and "write" seek position? I write always in the end, and I read from the point I last read?
<havenwood>
profsimm: Are you familiar with stdlib's StringScanner?
<havenwood>
&ri StringSCanner
<`derpy>
No results
Neo95 has quit [Read error: Connection reset by peer]
thecommongeek has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
imajes has quit [Quit: Leaving...]
m27frogy has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
kt has joined #ruby
InfinityFye has joined #ruby
InfinityFye has quit [Client Quit]
ResidentBiscuit has quit [Ping timeout: 248 seconds]
InfinityFye has joined #ruby
runescape07rsps has joined #ruby
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[Butch] has quit [Quit: I'm out . . .]
cagomez has quit [Ping timeout: 276 seconds]
kt has quit [Ping timeout: 248 seconds]
dstrunk has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dennisvennink has joined #ruby
rabajaj has quit [Quit: Leaving]
romankapitonov has joined #ruby
benlieb has joined #ruby
<impermanence>
havenwood: Is there a way to do multiple &:things?
<impermanence>
i.e. &:prop1 &:prop2 &:prop3 ?
baroquebobcat has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
<impermanence>
also is map(&:price) old syntax? It's working against 2.4.1 but I'm just wondering if it is outdated...?
ramfjord has joined #ruby
baroquebobcat has quit [Client Quit]
cagomez has joined #ruby
bronson has joined #ruby
goyox86 has joined #ruby
goyox86 has quit [Client Quit]
benlieb has quit [Quit: benlieb]
<havenwood>
impermanence: `map(&:price)` is a fine syntax, if you want to map three times you have to `map(&:prop1).map(&:prop2).map(&:prop3)`, there's no shorthand - just the long form
<havenwood>
impermanence: at that point you might prefer to: map { |thing| thing.prop1.prop2.prop3 }
goyox86 has joined #ruby
<impermanence>
havenwood: ah, okay. I am curious about a concise way to add multiple Integer attributes from an array of objects
ramfjord has quit [Ping timeout: 246 seconds]
<havenwood>
impermanence: show the code you have so far? or what you have and what you want?