laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Client Quit]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 245 seconds]
absolutejam1 has quit [Ping timeout: 245 seconds]
<FromGitter>
<girng> @absolutejam yep, lots of good examples
<FromGitter>
<girng> too, i love the docs
<FromGitter>
<mwlang> @watzon I didn't know about refinements, either and I'm usually on top of what's going on in Rubyland.
<FromGitter>
<mwlang> @rkeene I have not been to Binance's offices. Maybe one day.
absolutejam1 has joined #crystal-lang
sorcus has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 272 seconds]
alex`` has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 245 seconds]
gangstacat has quit [Quit: Ĝis!]
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 258 seconds]
<FromGitter>
<dscottboggs_gitlab> Is there any way to have the compiler guarantee a method returns? Like, the opposite of annotating a method with ` : NoReturn`, meaning all exceptions are rescued and no method calls `exit`?
<FromGitter>
<dscottboggs_gitlab> (I have to go for now but I will be on for a while later, sorry)
<absolutejam>
can anyone suggest a good CLI library? Admiral looks like the best so far but it hasn't been updated in => 8months and there's a few outstanding issues
<robacarp>
absolutejam: what are you looking for in a CLI lib? options parsing? screen layout?
<absolutejam>
I saw that lib but I didn't really want to write huge data structures. I'll have a look and see how I get on with it
<absolutejam>
j8r for my first comment
<absolutejam>
Saw that Blacksmoke16 but I was hoping for something to do the heavy lifting of args, flags, subcommands, etc.
<absolutejam>
I realise i'm just saying 'give me a tool that will do all the hard work' but I'm just curious if there's something appropriate out there
<FromGitter>
<j8r> Clicr is aimed to be declarative and compile time validation. Usefull for bigger projects
<FromGitter>
<j8r> For little projects `OptionParser` is perfectly fine
<FromGitter>
<Blacksmoke16> way im using it is a class with properites
<FromGitter>
<Blacksmoke16> new up a obj, use the parser to set properties on the obj from option parser, then execute some method on the obj to do you want
<FromGitter>
<dscottboggs_gitlab> I often just do a `while arg = args.shift?` loop for smaller stuff
<FromGitter>
<Blacksmoke16> idk if there are better ways
absolutejam1 has joined #crystal-lang
<FromGitter>
<j8r> @dscottboggs_gitlab this involves lot of boilerplating
<robacarp>
absolutejam: honestly, I'd say do the absolute simplest thing possible. it's pretty uncommon that I need a full fledged option parsing library... either a bare loop as @dscottboggs mentioned, or using OptionParser from stdlib is what I use. Less external dependencies is better.
<robacarp>
I do wish that the stdlib option parsing were better, but I'd rather deal with the inadequacies of it than import a third party library for it.
<absolutejam>
hm, looks like crystal itself uses OptionParser so I'll give that a go
<absolutejam>
*shrug* don't see harm in a third party lib as long as it's active
<absolutejam>
Blacksmoke16: Any chance you have any examples?
<FromGitter>
<Blacksmoke16> this only matches files?
<FromGitter>
<Blacksmoke16> or things without `-`
<robacarp>
eh, it matches a bunch of stuff. you can't really _know_ that a file doesn't start with `-` without asking the filesystem
<robacarp>
it matches anything which wasn't declared as an opt
<FromGitter>
<Blacksmoke16> which is diff than the `invalid_option` one?
<FromGitter>
<Blacksmoke16> ah
<robacarp>
I'm not sure. Older api maybe?
<FromGitter>
<Blacksmoke16> that is specific ones but the `unknown_args` returns array of *ALL* them
<FromGitter>
<Blacksmoke16> thats prob the diff
<robacarp>
oh, you get all of them at once
<FromGitter>
<Blacksmoke16> gotcha, might look into that. seems like a better solution for something im doing
<robacarp>
I find the notion of "a command line interface" to be way too vague. To me a command line interface is like vim or weechat. But a _lot_ of people seem to think a command line interface is the flags you pass to a command.
<robacarp>
absolutejam: thanks for defining CLI and TUI for me, I think that clarifies a bunch of misunderstandings I've had
absolutejam1 has quit [Ping timeout: 272 seconds]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Client Quit]
<FromGitter>
<mwlang> just spent a couple hours reading through Crystal issues and specifically splitting out stdlib to shards as well as the related Markdown discussion.
<FromGitter>
<mwlang> glad to see others see the same issues with markdown and ```crystal docs``` as I do.
absolutejam1 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 248 seconds]
<FromGitter>
<mwlang> This is starting to get old and it's happening more frequently, to the point, even direct calls to ```crystal spec``` is leading to this error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d1ce951be7a46664462b66c]
<FromGitter>
<mwlang> any idea how I can even begin to debug this one or set up a test scenario that can be replicated so I can open a proper issue ticket?
<FromGitter>
<watzon> Do you know where the error is occurring? Looks like it has something to do with `Process#initialize`
<FromGitter>
<watzon> When I get errors like this I always comment things out until the error is gone and then go over the code that's causing the error with a fine tooth comb
rohitpaulk has joined #crystal-lang
<FromGitter>
<mwlang> I'm not at all sure where it's occurring.
<FromGitter>
<mwlang> but will see if I can flush this puppy out with a bit of commenting.
<FromGitter>
<mwlang> I'll also start running the specs with -d and --error-trace to see if more info presents itself.
<FromGitter>
<Blacksmoke16> going to say it again, make sure all your paths/requires are correct
<FromGitter>
<Blacksmoke16> if possible try this on `0.28.0`
<FromGitter>
<Blacksmoke16> was a bug that allows you to reference nonexisting paths, vs now it doesnt compile
<FromGitter>
<Blacksmoke16> but i suppose you could define some method on the enum to do something similar
<FromGitter>
<watzon> That's true
<FromGitter>
<mwlang> I'm on 0.29.0 and I think as of couple days ago with fixing the shards.lock issue, my paths should all be correct at this point.
absolutejam1 has joined #crystal-lang
return0e_ has quit [Ping timeout: 258 seconds]
<FromGitter>
<watzon> Is it possible to write to an IO at a specific point? I know you can `read_at`, but I don't see a `write_at`
return0e has joined #crystal-lang
<FromGitter>
<watzon> I guess I could probably set `pos`?
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 246 seconds]
<FromGitter>
<mwlang> d-oh! Finally figured out reason for my tmp file woes. I had guardian running in another terminal window, so two guardians were running at once.
<FromGitter>
<Blacksmoke16> :S
<FromGitter>
<Blacksmoke16> nice one
<FromGitter>
<Blacksmoke16> pebkac
<FromGitter>
<girng> what is guardian
<FromGitter>
<Blacksmoke16> rebuilds your code on change
<FromGitter>
<mwlang> auto runs crystal specs on file saves.
<FromGitter>
<girng> wtf i want that
<FromGitter>
<mwlang> or really any command you give it.
<FromGitter>
<girng> work on WSL?
<FromGitter>
<girng> i used to use something like that when i did development in nodejs
<FromGitter>
<Blacksmoke16> yea, i use `nodemon`, this would prob be easier :S
<FromGitter>
<girng> nice!!
<FromGitter>
<girng> this will save a lot of up arrow and enter key presses LOLOL
<FromGitter>
<mwlang> It's nice not to have to keep toggling back and forth, too.
<FromGitter>
<mwlang> can just stay in the editor and keep on hacking away.
<FromGitter>
<mwlang> The challenge for me is I got used to Ruby taking it's sweet ole time running specs. I'm not used to this 263.8 milliseconds crap.
<FromGitter>
<Blacksmoke16> :P
<FromGitter>
<mwlang> I've been heavily refactoring the binance shard I've been working on and happy how it's coming together.
gangstacat has quit [Ping timeout: 252 seconds]
gangstacat has joined #crystal-lang
absolutejam2 has joined #crystal-lang
absolutejam1 has quit [Ping timeout: 248 seconds]
tdc_ has joined #crystal-lang
tdc has quit [Ping timeout: 245 seconds]
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 245 seconds]
<FromGitter>
<j8r> Unfortunaltly file watchers don't use inotify :(
<FromGitter>
<mwlang> and with that, I'm now feature complete on REST endpoint for Binance. TGIF. Next up is Websocket endpoints, but very happy to be done with the REST side of things as that was a beast.
<FromGitter>
<mwlang> suggestions to improve welcome. I did a fair amount of refactoring today to try to improve areas I have learned in Crystal language along the way.
<FromGitter>
<dscottboggs_gitlab> Oh I remember now, that's super cool
<FromGitter>
<watzon> I'm aware, but add "exchange" and it might as well be the same word
<FromGitter>
<mwlang> yeah, non-programmers tend to shorten it to "cryptos" but I think the trend is trying to move away from crypto in any of the naming to "digital currencies" to be more "general populace friendly"
<FromGitter>
<Blacksmoke16> Still don't really know what that does