<leftylink>
I might use if I want to return multiple named values and wnt it to be more convenient to be able to access them by foo.bar instead of foo[:bar] I suppose
<leftylink>
so it is possible
TCZ has joined #ruby
bmurt has joined #ruby
orbyt_ has joined #ruby
TCZ has quit [Quit: Leaving]
sniperwolf has quit []
skx86 has quit [Quit: Connection closed for inactivity]
tau has joined #ruby
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leitz>
adam12, sorry for not responding sooner, I was in a video chat. Compiled from source for 2.8.
<leitz>
adam12, I got tired of people griping at me for using old Ruby versions. :)
<adam12>
leitz: From the kettle into the fire... ;)
<leitz>
adam12, yup. Really, if I can keep at it, Ruby is the language that I enjoy the most. Naturally, work uses Perl. :(
neo_ has quit [Quit: Leaving]
Technodrome has joined #ruby
oddp has quit [Ping timeout: 240 seconds]
Garb0 has joined #ruby
s2013 has joined #ruby
mossplix has quit [Remote host closed the connection]
<roelof1967>
second question : How can I start rbi or pri on Windows 10 ?
stdedos has quit [Quit: Connection closed]
<sarna>
roelof1967: I think line 20 is wrong maybe?
<sarna>
it's kinda hard to check programs like these
<roelof1967>
I know , I do not have a idea what the programm exactly wants so I ask here and the error message is also not very clear what is wrong
<leftylink>
if there are any doubts about it, then it would be useful to narrow down the problem by e.g. rescuing a NoMethodError in any other context, and examining it
SeepingN has quit [Quit: The system is going down for reboot NOW!]
gavlee has joined #ruby
<roelof1967>
oke, before I started at this koan I saw this error message : ` The answers you seek... Expected "undefined method `some_method_nil_doesnt_know_about' for nil:NilClass" to match /__/ `
<roelof1967>
but I do not see how to fit it in this : ` assert_match(/__/, ex.message) `
bocaneri has quit [Ping timeout: 256 seconds]
<leftylink>
well that error message is correct, isn't it. the string "undefined method `some_method_nil_doesnt_know_about' for nil:NilClass" doesn't match /__/.
<roelof1967>
yep
<roelof1967>
but as I say earlier. I do not see how to fit it into the assert
<sarna>
`assert_match(/undefined method `some_method_nil_doesnt_know_about' for nil:NilClass/, ex.message)` ?
<leftylink>
it would probably help my case if I used clearer language such as "I yield the floor to someone who knows about this" - my bad for not saying that
<leftylink>
it is important to let people know when I don't know
<leftylink>
I apologise
<Industrial>
It seems the rbczmq package is superior atm
apotheon has quit [Ping timeout: 240 seconds]
apotheon has joined #ruby
oddp has joined #ruby
* roelof1967
takes a break from ruby koans, Thinks he goes somewhere this afternoon further on this
bocaneri has quit [Ping timeout: 256 seconds]
mossplix has quit [Remote host closed the connection]
bocaneri has joined #ruby
tau has quit [Remote host closed the connection]
Uncle_Cid has joined #ruby
UncleCid has quit [Ping timeout: 240 seconds]
<sarna>
how do you ship ruby scripts to environments you don't control? is docker the way to go?
<sarna>
or well, to environments in which you don't want to spend three hours configuring
Frobozz has joined #ruby
vondruch_ has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 256 seconds]
vondruch has quit [Ping timeout: 246 seconds]
vondruch_ is now known as vondruch
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
fabio_ is now known as MadLamb
<MadLamb>
I'm trying to figure out how I get sunspot to update the schema.xml of my "default" core when I make changes to the searchable on the models? I am not running solr with sunsput but rather a docker container. Does someone know how it works?
<leftylink>
> If obj is specified, this single object will be used for all default values.
<leftylink>
s/ss/dd/ btw
<roelof1967>
oke, I was exoecting that adding to a list would be `{ "one" => "uno"]
<leftylink>
well, now you know otherwise
<leftylink>
and thus you now know that you cannot get that behaviour by using Hash.new([])
<roelof1967>
oke, if I would see a hash I had to do `hash[:one] << "one" => "uno" `
<roelof1967>
so because I do not add a key all values have the same key if I understand you right
<leftylink>
I don't understand what you mean by "because I do not add a key". The reason all default values use the same object is the sentence I quoted in the documentation. did I misunderstand your question?
<roelof1967>
maybe , I try to see why it does what it does
<roelof1967>
`hash[:one] << "uno" ` gives a list , where `hash[:one] << "uno" ` gives a hash
<leftylink>
I can't see the difference between those two pieces of code
<roelof1967>
sorry I mean `hash[:one] = "uno" ` gives me a hash
<roelof1967>
time to dive what << exactly does compared with =
<leftylink>
&>> a = []; b = []; c = d = []; a << :added_to_a; c << :added_to_d; [a.object_id == b.object_id, c.object_id == d.object_id, a, b, c, d]
<leftylink>
as you can see, if two lists are the same list, adding to the same list through one reference to it is visible through any other reference to it. and if two lists are not the same list, then obviously adding to one will not add to the other
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
darkstardev13 has quit [Ping timeout: 260 seconds]
darkstardev13 has joined #ruby
drincruz has joined #ruby
TCZ has quit [Quit: Leaving]
bocaneri has quit [Ping timeout: 260 seconds]
MadLamb has quit [Read error: Connection reset by peer]
MadLamb has joined #ruby
bocaneri has joined #ruby
<MadLamb>
Any1 with sunspot (solr gem) experience? How can I force the gem to update my solr schema.xml when I make changes to the "searchable" in the model?
drincruz has quit [Ping timeout: 264 seconds]
teclator has quit [Ping timeout: 240 seconds]
burningserenity has joined #ruby
teclator has joined #ruby
bmurt has joined #ruby
Jonopoly has quit [Ping timeout: 265 seconds]
oddp has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
mossplix has joined #ruby
Industrial has quit [Ping timeout: 260 seconds]
lucasb has joined #ruby
drincruz has joined #ruby
mossplix_ has joined #ruby
mossplix has quit [Ping timeout: 264 seconds]
cd has joined #ruby
<dualfade>
does anyone know what the python equiv of "ECDSA::Format::SignatureDerString.encode" is in ecdsa ?
imadper has joined #ruby
<dualfade>
sorry wrong room
Technodrome has joined #ruby
Esa__ has joined #ruby
s2013 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ChmEarl has joined #ruby
sarna has quit [Quit: Connection closed]
roelof1967 has quit [Ping timeout: 245 seconds]
arahael1 has joined #ruby
Arahael has quit [Ping timeout: 256 seconds]
<adam12>
MadLamb: No experience, but how would you update schema.xml normally?
burningserenity has quit [Ping timeout: 260 seconds]
<leftylink>
elements may be deletd from a hash with Hash#delete. And they may be added with either Hash#merge!, Hash#[]= (mutating), or Hash#merge (not). thus, phone may be moved.
<leftylink>
one should not put unnecessary quotes in symbol-keyed hashes.
burningserenity has quit [Ping timeout: 260 seconds]
<adam12>
ruby647: I'd probably think about this in 2 steps; you can refactor down to 1 when it is working.
<adam12>
ruby647: First step is deleting the phone value from the moreData hash. Second step is merging it into the main hash.
colins has joined #ruby
<leftylink>
each_value is inappropriate because the operation is not concerned with acting on each value in the hash. it is only interested in acting on a hash. there may be a usage of Array#each, of course (since at 14:19 it was claimed there is an array of hashes), but not each_value. for example, the task presented has no interest in acting on "Tybalt"
orbyt_ has joined #ruby
sjt003 has joined #ruby
<ruby647>
@adam12 I can delete and append the key and value to hash
<ruby647>
but I want to append the key value at a fix position
<adam12>
ruby647: So you want it _before_ moreData?
<ruby647>
yes
<adam12>
ruby647: You'll have to create a new Hash, since they preserve order of insertion and I don't believe there's a way to insert in the middle of one.
<leftylink>
that sounds frustrating.
s_ has quit [Ping timeout: 260 seconds]
<ruby647>
But I have array of multiple hashes
s_ has joined #ruby
<ruby647>
for every I have to create new hash
<adam12>
ruby647: Yes.
<ruby647>
any other way
<leftylink>
that's why I assumed that Array#each would be used
<ruby647>
If you guys can provide the code snippet, I have taken way too much time in this
<leftylink>
my overall sentiment about any other way is that the code consuming the hashes should not rely on the order
<leftylink>
I remind what I said at 14:27
<leftylink>
14:27:49 < leftylink> I have given all necessary ingredients to create such a code snippet.
<ruby647>
:D Ok
rippa has joined #ruby
burningserenity has joined #ruby
<adam12>
ruby647: If you don't care about the position of the keys, it's nothing more than deleting the value from the moreData hash, and merging it into the main hash. It's appended at the end tho.
<adam12>
This mutates the original hash so obviously beware of that.
<leftylink>
if it is indeed necessary to use the order, I would take advantage of the fact that the only thing standing between the desired position of :phone vs the position where :phone will be inserted is :moreData, so I would just delete and reinsert :moreData unchanged
colins has quit [Quit: WeeChat 2.8]
colins has joined #ruby
<leftylink>
or perhaps I offer Hash#slice, to which you'd simply pass all the existing keys, but reordered in the desired way
ivan` has joined #ruby
<leftylink>
I would be far less hostile to the idea of relying on hash order if all values were of the same type
TCZ has quit [Quit: Leaving]
roelof1967 has joined #ruby
<roelof1967>
good evening from a very very Netherlands
<roelof1967>
I mean very very hot Netherlands
<adam12>
roelof1967: Good morning!
<leftylink>
as it stands, I am far more amenable to the consuming code being aware of the order in which it wants to extract k/v pairs
<leftylink>
so that ruby647 person was not worth my time. I would like to award demerits
chalkmonster has quit [Quit: WeeChat 2.8]
<leftylink>
but that's life, you never know
<leftylink>
just gotta go with the flow
<leftylink>
sometimes it works out, sometimes no
ivan` has quit [Quit: ivan`]
<roelof1967>
here 33 degrees Centigrade with a huminity of about 50%
<adam12>
roelof1967: It's actually cooler today here than it has been. 22C / 67% humid. I'll take it.
<roelof1967>
Can I swap with you. here in the evening/night thunderstorms so it cools down hopefully
<adam12>
Sure; until it hits 30C / 90% humid and feels like 40C :P
mossplix_ has quit [Remote host closed the connection]
<adam12>
The humidity is brutal.
<roelof1967>
I know
<roelof1967>
if it's above 25 degrees Centigrade in the Netherlands , the huminit is killing you
<adam12>
Heh
<roelof1967>
too hot, to type right. I mean the huminity is killing you
dionysus69 has quit [Ping timeout: 265 seconds]
imode has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<leftylink>
upon reflection, I think I was not clear enough when I said "I have given all necessary ingredients to create such a code snippet.", because it didn't make clear whose court I perceive the ball to be in. so that implies that I might consider "I have given all necessary ingredients you need to create such a snippet yourself.". however, that has the risk of sounding pretentious. the information may in fact
<leftylink>
not be sufficient
<leftylink>
so it is best to accompany it with an offer to provide more information
<leftylink>
something like "I believe I gave all necessary ingredients..." etc. "but am happy to provide more ingredients if that belief was incorrect"
<leftylink>
I will consider things like that next time
<leftylink>
I am always looking for ways in which I could be more clear
bocaneri has quit [Ping timeout: 260 seconds]
<roelof1967>
I have a Question. On rubykoans I have this question ` # Why do we convert the list of symbols to strings and then compare # against the string value rather than against symbols?` . Am I on the right track that symbols who contain the same , always get true because they are the same object
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<havenwood>
roelof1967: Show the code?
burningserenity has quit [Ping timeout: 240 seconds]
vondruch has quit [Client Quit]
<roelof1967>
show the code ? It's a question where I have to think about
vondruch has joined #ruby
<havenwood>
roelof1967: I don't understand what you're asking.
falconfox has joined #ruby
<roelof1967>
oke, on ruby koans this question is asked : ` # Why do we convert the list of symbols to strings and then compare # against the string value rather than against symbols?`
<havenwood>
roelof1967: That's the code I'm asking to see.
<roelof1967>
The question is do I think the right way that it is because symbols who contains the same , are the same object
<havenwood>
roelof1967: What list?
<havenwood>
roelof1967: A Symbol is like a number wearing a name badge.
<roelof1967>
moment, so a symbol `:a` or `:catsanddogs` is a number ?
falconfox has quit [Remote host closed the connection]
<havenwood>
roelof1967: A Symbol is like an Integer in that it's not mutable, there's just one copy of it, it has not text data, but unlike an Integer it has a name.
<havenwood>
Or at least a name badge.
<havenwood>
There's something you call it.
<havenwood>
roelof1967: It's just one way to think about Strings versus Symbols. Strings are arbitrary text data. Symbols just use text for their name.
<roelof1967>
oke
<roelof1967>
so in this code : ` symbol1 = :a_symbol symbol2 = :a_symbol `
<roelof1967>
symbol1 and symbol2 has the same number
<havenwood>
roelof1967: Yup
<roelof1967>
and therefore they are the same
<havenwood>
roelof1967: Same number with same nametag.
<roelof1967>
the question is : `# Why do we convert the list of symbols to strings and then compare # against the string value rather than against symbols? `
<roelof1967>
because a symbol is a number and a string not, the answer will always be false
bocaneri has joined #ruby
<MadLamb>
adam12, about sunspot solr.. which task you are talking about? I did try sunspot:start and sunspot:run (but both complain about the missing java environment) I am using a docker solr container...
burningserenity has joined #ruby
dionysus69 has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.8]
al2o3-cr has joined #ruby
<adam12>
MadLamb: I was looking through the source of sunspot gem and there's a rake task that mentions schema.
<MadLamb>
adam12, I'm probably running a very outdated version
<MadLamb>
adam12, after you said I did find it, but that still doesnt appear on my rake exec --tasks... I'm rebuilding the container to confirm
<adam12>
MadLamb: But there's nothing special in there really. You might be able to just do it with something like `ruby -rsunspot/schema -e 'File.write "new_schema.xml", Sunspot::Schema.new.to_xml'`
<MadLamb>
adam12, :U
<adam12>
MadLamb: Lunch time. Good luck.
<MadLamb>
adam12, thanks
entel has joined #ruby
ryzokuken_ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
stryek has joined #ruby
roelof1967 has quit [Ping timeout: 245 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
lunarkitty has quit [Ping timeout: 272 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has quit [Quit: dionysus69]
<MadLamb>
adam12, even with the upgrade it doesnt show the update tasks, but I think anyway this update needs to be done in the reindex task (the library docs say that).. Most of the fields are dynamic and the problem I was having was they were not getting updated. It seems however it was the library version because now I was able to see them in solr...
<MadLamb>
adam12, so, in the end the schema task wasnt the solution, but upgrading the library was, which came from your suggestion. Thanks
TCZ has quit [Quit: Leaving]
howdoi has joined #ruby
u0_a260 has joined #ruby
lunarkitty has joined #ruby
<u0_a260>
query colins witaj przyjacielu!
<u0_a260>
shit :D
<u0_a260>
not here
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
houhoulis has joined #ruby
Garb0 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
u0_a260 has quit [Quit: WeeChat 2.8]
FastJack has quit [Ping timeout: 240 seconds]
u0_a260 has joined #ruby
<adam12>
MadLamb: Cheers.
ellcs1 has joined #ruby
clemens3 has quit [Quit: WeeChat 2.7]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
davispuh has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
cd has quit [K-Lined]
vondruch has quit [Client Quit]
vondruch has joined #ruby
Xiti has quit [Quit: Leaving]
ams___ has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
schne1der has quit [Ping timeout: 258 seconds]
FastJack has joined #ruby
Esa__ has quit [Ping timeout: 246 seconds]
Xiti has joined #ruby
bocaneri has quit [Ping timeout: 258 seconds]
_aeris_ has quit [Excess Flood]
_aeris_ has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
cliluw has joined #ruby
roelof1967 has joined #ruby
<roelof1967>
I do not get this one from rubykoans : ` assert_equal "2", "num 42\n2 lines"[/^\d+/] `
<roelof1967>
I have tried rubular but cannot make it work
<adam12>
roelof1967: Can't make which part work? The regexp or the assertion?
<roelof1967>
the regex . According to rubulator there are no matches
<leftylink>
so, you can't change the string, because the exception is not yours. so, what do you do to the regex to make it match?
<roelof1967>
if I know that I would not ask here for help
<leftylink>
although, it may also be instructive to see what strings match that regex
<leftylink>
instead of only asking what changes can be made to the regex
aldoescudero has joined #ruby
aldoescudero is now known as ajescudero
<roelof1967>
I would think this one : ` "wrong number of arguments (given 0, expected 2) ` because that is the error message
<roelof1967>
because the test wants to see the error message
<leftylink>
great, well. the text wants you to give any regular expression that would match the error message. you now see that the regular expression /a (b)/ doesn't match the string "a (b)"
<havenwood>
roelof1967: Then monkeypatch those classes to support #palindrome?
<havenwood>
roelof1967: Finally, switch it to a refinement.
<havenwood>
roelof1967: Or continue the Koans. :)
<roelof1967>
I will sleep about it
<havenwood>
There is more than one path to enlightenment.
<roelof1967>
yep, as we say in the Netherlands. "there is more ways to Rome "
mossplix has joined #ruby
<leftylink>
out of curiosity is anyone here a koans, er..... graduate? what is the word for a person who has completed the koans
<leftylink>
tell us about your experiences
pgib has joined #ruby
pgib has left #ruby [#ruby]
<roelof1967>
for me now GN all
smccarthy has joined #ruby
jenrzzz has joined #ruby
<smccarthy>
why does "bundle install --without="test jenkins development default" --path vendor/bundle" install the dependencies with git sources to ./vendor/cache instead of ./vendor/bundle ?
cliluw has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
<adam12>
smccarthy: My _presumption_ is that it has to be 2 steps because of dependencies with C extensions. So git clone vendor/cache; gem install vendor/bundle.
<pgib>
Hi. I'm running into an issue on our staging server regarding bundler et.al. Maybe someone can help? Here is a description as well as CLI transcripts: https://dpaste.org/LhaC
roelof1967 has quit [Remote host closed the connection]
houhoulis has quit [Remote host closed the connection]
teej has joined #ruby
<leitz>
leftylink, I have not reached that stage of Nerdvana yet; but life should be calming down in a couple of weeks. I'll be getting back to them then, I think.
<leitz>
Unless life changes again, and I'm off on some other language/task/job/whatever...
bsdband97 has joined #ruby
<adam12>
pgib: `bundle show dalli` returns vendor/bundle path?
bsdbandit-01 has quit [Ping timeout: 272 seconds]
smccarthy has quit [Remote host closed the connection]
burningserenity has quit [Ping timeout: 264 seconds]
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
cliluw has quit [Ping timeout: 246 seconds]
drincruz has quit [Ping timeout: 256 seconds]
Bounga has joined #ruby
cliluw has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
wymillerlinux has joined #ruby
kinduff has joined #ruby
bsdband97 has quit [Quit: -a- Connection Timed Out]
drincruz has joined #ruby
bsdbandit-01 has joined #ruby
reyfi9e has joined #ruby
duderonomy has joined #ruby
ghanima has quit [Ping timeout: 240 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]