CrazyEddy has quit [Remote host closed the connection]
cthu| has quit [Ping timeout: 256 seconds]
CrazyEddy has joined #ruby
MuffinPimp has joined #ruby
ericm has quit [Ping timeout: 256 seconds]
MuffinPimp has quit [Quit: Goodbye.]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
conta has joined #ruby
ldepandis has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
howdoi has quit [Quit: Connection closed for inactivity]
Garb0_ has quit [Read error: Connection reset by peer]
infernix has quit [Ping timeout: 272 seconds]
BTRE has joined #ruby
mikecmpbll has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 240 seconds]
gordie has joined #ruby
chouhoulis has joined #ruby
infernix has joined #ruby
mikecmpbll has joined #ruby
<gordie>
Hi, I have a nested hash (working with json schemas) and I would like to remove all attributes named "properties" from it. In fact, I don't want to delete those attributes, I want to "level up" them. Is that possible ? https://gist.github.com/gordielachance/36520b2ab250a56610c29288c38ca581
Xiti has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
ur5us has joined #ruby
chalkmonster has joined #ruby
pandakekok9 has quit [Ping timeout: 256 seconds]
<rapha>
jhass: I know I shouldn't but I made the mistake of using constants for a config file and now I realised I want to divide that up into two: one that can be kept under version control, with sensible defaults, and the other for local use, that can overwrite stuff from the first. And rn I need a quick fix, I'll think of some more sensible way of doing it latr. Thank you!
<jhass>
not sure what you did exactly but it shouldn't be hard to use the more sensible way for the defaults and maybe even new config files but still read the constants. like Config.foo || Config::FOO || Defaults.foo
Xiti has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
BH23 has quit [Remote host closed the connection]
donofrio has quit [Remote host closed the connection]
BH23 has joined #ruby
TCZ has joined #ruby
<sergioro>
rapha: you could use -W0 option. see: `ruby -h | grep -- -W`
sergioro has quit [Quit: leaving]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
jetchisel has joined #ruby
<rapha>
Yes, I thought of that, but it'd quelch all the other warnings, too.
<rapha>
do people usually use some library for that?
<jhass>
I can't say there's a defacto standard
<jhass>
it depends a lot on what you're configuring and who should do it in what context
<jhass>
there's a slight bias to yaml based configuration maybe
<jhass>
what you could maybe do is just make sure the user config is loaded in before your default config and just put an unless const_defined?(...) behind each in the default
<rapha>
hmm. the whole thing is a thingo for reading excel files, doing stuff with the data in them, and outputting yaml files. so why not also make the configuration files yaml.
<jhass>
not saying that's cleanest but maybe most minimal
<rapha>
what do you personally prefer, jhass?
<jhass>
depends on context
<rapha>
by context you mean what kind of and how many users?
<jhass>
yeah, but also what kind of tool or a library or so. server/daemon or single invocation. One time use vs regular use vs cronjob
<jhass>
I don't have strict rules, more of a yeah this way makes sense here
ur5us has quit [Ping timeout: 252 seconds]
<jhass>
also multiple configs or just a single one can be an important consideration
<jhass>
how frequently will it be changed
<rapha>
ah, okay. it's a script that is being invoked half-hourly with one file as the argument and nightly with a whole folder of files as an argument, and there's half a dozen people invoking it a couple of times per day manually. there's around 30 settings in the config.rb file that change every once in a while, and half a dozen settings in config-local.rb that are different on each machine.
<rapha>
that very minimal setup has worked fine so far, with almost no overrides in the "config-local.rb", but now ppl have started doing that and are getting annoyed at the warnings.
<jhass>
if it's edited heavily a forgetting format like toml can make sense
* rapha
googles toml
<jhass>
*forgiving I mean
<rapha>
"Tom's Obvious, Minimal Language" ... I already like it :-D
<rapha>
looks a bit like a Samba config file
<jhass>
it's basically a better defined INI
<jhass>
YAML being indentation/whitespace sensitive can break fairly easily with hard to understand error messsages
<jhass>
but then it leaves more structure, has the reference stuff etc
<rapha>
indeed. it was not the best of choices to have non-technical users enter YAML into Excel cells.
<rapha>
otoh we needed the hierarchical representation...
<rapha>
i like having a library that provides a simple interface like that
<jhass>
I'm not sure I'd write it like this today though
<jhass>
see the gotchas section
<jhass>
it's quite big gotchas
<rapha>
loks like ... 300-odd lines? you can still have another go at it :)
<rapha>
and the list of gotchas has exactly two entries, i think one can get used to those
chalkmonster has joined #ruby
<jhass>
yeah, implementation is not the issue, design is :D
<rapha>
You said you wouldn't do it like that _anymore_. That sounded like you do have an alternative design in mind?
<jhass>
no, just grudges against the one I picked there
<jhass>
did cause more than one bug in the project I did this for
ellcs has joined #ruby
<rapha>
Hmm. In both cases you say to use .get ... why can't that be the default behind .some.setting?
<jhass>
For appending ? it is
<jhass>
so in either case appending ? will work
<jhass>
but of course that doesn't look too nice
<jhass>
but given the dotted.chain.syntax and the fact that you don't have to pre-declare the complete possible tree of possible keys, the gem has to return a proxy object to support diving in deeper
<rapha>
Well, I, for one, am looking forward to your new TOML provider. Which will by necessity result in a commit.
<jhass>
I'll push one to see how much breaks on ruby 2.7 :D
<jhass>
hah, not even a warning apparently :D
<rapha>
See! :-D
<rapha>
Hmm. In my memory, everybody used to have Gemfile.lock committed. A while ago I started removing mine but didn't think about it much. You also just did that. Interesting.
<jhass>
policy is to commit is for applications and don't for libraries
<jhass>
since libraries generally should strive for broader compatibility and define their version restrictions in the .gemspec
<jhass>
so, how does one install rubinius via RVM these days...
<rapha>
I don't know, I gave up on RVM for rbenv and have been much happier since. If rubinius==rbx, then rbenv install rbx-4.15 but according to https://github.com/rbenv/ruby-build/issues/862, "Rubinius seems unmaintained. (FYI rubinius/rubinius#3813)" ... never used Rubinius, either.
<jhass>
yeah me neither, just have been running CI against it for this gem for why not
sergushakov has joined #ruby
fercell has joined #ruby
burningserenity has joined #ruby
burningserenity has quit [Read error: Connection reset by peer]
burningserenity has joined #ruby
conta has joined #ruby
aesthe has joined #ruby
nutcr4ck3r has joined #ruby
gordie has quit [Remote host closed the connection]
drincruz_ has joined #ruby
Tempesta has joined #ruby
greengriminal has quit [Quit: Leaving]
nutcr4ck3r has left #ruby [#ruby]
fuzzface has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
drincruz_ has quit [Ping timeout: 256 seconds]
sagax has quit [Read error: Connection reset by peer]
ua_ has quit [Ping timeout: 256 seconds]
ua_ has joined #ruby
sergushakov has quit [Quit: WeeChat 2.3]
drincruz_ has joined #ruby
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
cschneid1 has joined #ruby
cschneid has quit [Ping timeout: 260 seconds]
cschneid1 is now known as cschneid
greypack has quit [Read error: Connection reset by peer]
greypack has joined #ruby
howdoi has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
chalkmonster has joined #ruby
ChmEarl has joined #ruby
akem has quit [Ping timeout: 240 seconds]
troulouliou_div2 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.8]
akem has joined #ruby
<adam12>
Just FYI, they backtracked on ignoring Gemfile.lock and now it's recommended to commit it in libraries as well.
fuzzface has quit [Quit: Leaving]
akem_ has joined #ruby
<havenwood>
There's general disagreement. Bundler now says always commit it.
<havenwood>
I don't, because I'm old, and old people don't commit Gemfile.lock.
<havenwood>
(For gems.)
<havenwood>
At least everyone agrees commit it for apps. :)
<havenwood>
adam12: The new Bunder recommendation of always committing it is at least easier to explain.
akem has quit [Ping timeout: 260 seconds]
<havenwood>
I guess it was years ago, but still feels newish.
<havenwood>
I think it's a tossup whether to commit it with gems. Neither the argument to commit it or not is compelling. It just doesn't matter.
<adam12>
I'm on the fence. I was doing some contributions to simplecov and CI was failing where locally it wasn't. Without a Gemfile.lock, it was hard to know if it was a dependency issue. I can't remember the end result but it was a bit frustrating debugging without that lock.
<adam12>
I've always never committed them but changed that recently for new projects.
<havenwood>
adam12: Looking at my new projects, I now seem to waffle. >.>
akem_ has quit [Ping timeout: 256 seconds]
<havenwood>
jhass: Rubinius is looking less like a Ruby and more like it's own thing so I've stopped testing against it.
akem has joined #ruby
<havenwood>
I'd like to go ahead and remove it from ruby-install too. Fun to have an experimental language, just no a Ruby implementation trying to conform to the reference implementation.
<havenwood>
From the new docs... "Rubinius is a time machine. When you use it, you travel into the future."
<havenwood>
"Consider Rubinius a mostly compatible superset of Ruby for now."
<adam12>
I had high hopes for Rubinius.
<havenwood>
adam12: Much of its source code lives on in TruffleRuby. The Ruby Spec project also panned out.
<havenwood>
adam12: It just got its JIT back!
<adam12>
havenwood: Rubinius? It's been hard to follow.
<havenwood>
adam12: Yeah, just very recently brixen restored the JIT, after yanking it out years ago right before Rubinius work slowed.
chalkmonster has joined #ruby
TomyWork has quit [Remote host closed the connection]
<havenwood>
It sounds from the new README that they're moving to a time-machine-based JIT, where they compile to machine code in the past so its actually ready ahead of time.
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
gix has joined #ruby
chalkmonster has quit [Remote host closed the connection]
cthu| has joined #ruby
ldepandis has quit [Read error: Connection reset by peer]
schne1der has quit [Ping timeout: 256 seconds]
troulouliou_div2 has quit [Ping timeout: 264 seconds]
d3bug has joined #ruby
leitz has joined #ruby
dandaman has joined #ruby
<dandaman>
hi all, can someone help me debug an issue i'm having with my rails project? I'm having some trouble with thin —ssl the server starts up just fine, but as soon as I try to access the site on chrome I get this massive flood of text in my console which i have pasted here: https://gist.github.com/dsauerbrun/ab68a9f300aa6a0566aeb5117ed4d7d1
<dandaman>
i asked in the rails channel but it seems like this is more of a ruby issue than rails
<rapha>
adam12: what a guilty pleasure! thank you for the link!
bvdw has joined #ruby
sagax has joined #ruby
<rapha>
as for the Gemfile.lock thing, I think what I'll do from now on is to keep it on the ignore list until a project has matured enough to wander outside of my own boxes, then start to commit it.
<leftylink>
it needs to have output when it's false
<leftylink>
note also that I don't think `puts` in erb has any effect
<leftylink>
it seems I have jumped to a conclusion too quickly and misdiagnosed the problem
<leftylink>
whereas the actual problem was that puts in erb has no effect
<leftylink>
I failed to follow the advice of Yoda ("do not draw a conclusion too quickly / time is it's yet early")
<leftylink>
I apologise for that!
Emmanuel_Chanel has quit [Quit: Leaving]
<apotheon>
The puts method has an effect, but its effect goes to stdout, not into HTML. The return value of puts ends up in HTML, and puts returns nil, which doesn't show up in the HTML from erb.
<apotheon>
I think erb treats it as an empty string.
<apotheon>
Depending on context, stdout might be directed to logs, or to a console in which the application is running.
<apotheon>
I'm pretty sure there are other places it might point, but nothing comes to mind.
<leftylink>
it just goes to show that it is often an unwise idea for me to give advices on things I don't know, like erb. too often, I give the wrong advice and then people get the wrong idea. sometimes, silence is golden
<leftylink>
I must again apologise
troulouliou_div2 has quit [Remote host closed the connection]
Emmanuel_Chanel has joined #ruby
TCZ has joined #ruby
<leftylink>
the most dangerous situation is "when you don't know it but you think you know it". in things where it's "you don't know it, and you know you don't know", then it's easy to know to stay silent and refrain from giving bad advice
<leftylink>
but if I don't know it but think "it can't be so hard to give good advice about this thing I don't know, because it's so similar to a thing I know!" then that is the most dangerous time and easiest to give wrong advice
<apotheon>
Calling that file "erbtest.rb", I get this:
<apotheon>
$ ruby erbtest.rb
<apotheon>
<strong>pull-right</strong>
<apotheon>
<strong>pull-left</strong>
<apotheon>
I'm surprised I recalled how erb works well enough to do all that off the top of my head.
<apotheon>
It has been a while.
davispuh has joined #ruby
cschneid3 has joined #ruby
cschneid has quit [Ping timeout: 240 seconds]
cschneid3 is now known as cschneid
jinmiaol2 has quit [Ping timeout: 260 seconds]
schne1der has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
EvanR has joined #ruby
<EvanR>
when C code called from ruby blocks for some reason, e.g. waiting on I/O, does that block all Threads ?
gr33n7007h has joined #ruby
oneeggeach has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
gr33n7007h has quit [Quit: WeeChat 2.8]
drincruz_ has quit [Ping timeout: 246 seconds]
impermanence has joined #ruby
<CommunistWolf>
can do
<CommunistWolf>
depends on the ruby, and the c
<jhass>
mainly whether the C releases the GVL
<jhass>
whether it's called from within a block or not should be irrelevant though
<CommunistWolf>
e.g. jruby calling c via jni woul dbe unaffected
<CommunistWolf>
cruby calling c via, um, c? it's going to block harder than suzy hotrod
al2o3-cr has joined #ruby
<EvanR>
for example, cruby in a Thread calls a C function that calls recv or read (on not non-blocking socket) which could block as expected.
<EvanR>
but other Threads are waiting to run
<EvanR>
releasing the GVL ??
<EvanR>
I guess all the threads are blocked in this case
<jhass>
depends on whether the GVL is released or not ;)
<jhass>
GVL is Global VM lock
<jhass>
so CRuby has a lock around the VM, preventing any parallel execution of ruby code. Or in other words any two threads entering the VM at the same time
<EvanR>
it's funny you should mention that because on this page describing ruby C API, it says "As long as your dfree function doesn’t unlock the GVL (why would you do that???) you can" https://silverhammermba.github.io/emberb/c/
<jhass>
however most of its in C implemented stdlib functions, especially those around IO, release the lock. So while those are waiting on the IO syscall, other threads can enter the VM
<EvanR>
so surrounding a recv or read with an unlocking and relocking of GVL is a sane thing to do
<jhass>
yeah, totally
<EvanR>
interesting
<jhass>
anything that'll block for while and for sure won't try to enter the VM