laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<watzon> It would be really nice if they did. Hopefully someday.
waheedi has joined #crystal-lang
<FromGitter>
<watzon> Correct me if I'm wrong, but the shards cli currently doesn't allow you to globally install a shard like you can with rubygems right?
<FromGitter>
<watzon> It would be nice if one could do `shards install crystal-community/icr` to install icr globally without having to manually download, build, and then link the binary
waheedi has quit [Quit: waheedi]
waheedi has joined #crystal-lang
waheedi has quit [Quit: waheedi]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
tdc has joined #crystal-lang
laaron has quit [Remote host closed the connection]
<FromGitter>
<straight-shoota> @watzon No, dependencies are checked out directly into the `lib` folder of each shard. This is by design. Dependencies should not rely on global state. So everything's bundled in one place and there are no issues with mismatching version constraints.
<FromGitter>
<watzon> @straight-shoota oh I'm not referring to installing a shard globally in that way, but rather installing a binary for a shard that's designated as an `app` rather than a `lib`
<FromGitter>
<straight-shoota> That's not the purpose of `shards`.
<FromGitter>
<straight-shoota> You just need to install the `icr` executable somewhere in your `PATH`
<FromGitter>
<watzon> That's what I was wondering. It would be convenient if it could build and install a binary though.
<FromGitter>
<straight-shoota> Yes, that would certainly be great. It's not easy though. And I'd probably see this more as a separate tool from `shards`.
<FromGitter>
<r00ster91> no there's no way to make the usage of macros impossible
jeremycw has joined #crystal-lang
<FromGitter>
<r00ster91> I would just not use them. Or do you want to restric a user that uses your library maybe?
<FromGitter>
<parruda> yep, that’s what it is
<FromGitter>
<Blacksmoke16> could make the macro private
<FromGitter>
<Blacksmoke16> pretty sure they are also constrained by the private/protected modifiers
<FromGitter>
<parruda> actually that’s not what it is, I was confused
<FromGitter>
<parruda> the use case is: I am compiling things for the user
<FromGitter>
<r00ster91> ooh so you want to restrict a macro, not the usage of macros in general
<FromGitter>
<parruda> no i want to restrict use of macros
<FromGitter>
<parruda> Like crystal build —no-macros
<FromGitter>
<parruda> haha
<FromGitter>
<r00ster91> but why would it be bad for you that the user uses macros?
<FromGitter>
<r00ster91> you can compile things for the user though
<FromGitter>
<Blacksmoke16> and i lied, can only mark them private
<FromGitter>
<yxhuvud> that is not possible, there is a lot of macros all over the place in stdlib.
<FromGitter>
<parruda> Right ok. Just for security purposes, that’s all
<FromGitter>
<parruda> but there are other ways around it. I just thought of asking this first because that’d be the easier way
<FromGitter>
<straight-shoota> I could definitely see some kind of safe mode for macros to avoid executing arbitrary commands on the build system. You probably wouldn't need to disable macros alltogether (which would pretty much cripple parts of the stdlib) but disallowing features such as running commands (``` `` ``` ) and executing Crystal files (`run`).
DeBot has quit [Ping timeout: 252 seconds]
<FromGitter>
<mwlang> @Blacksmoke16 Thanks for sharing this Athena snippet. I'm needing this very pattern in what I'm building now. Really elegant solution, esp. in Crystal.
<FromGitter>
<Blacksmoke16> np, its up on github under the `di` branch if you wanted to play with it
<FromGitter>
<Blacksmoke16> but considering its still a WIP some things may change here and there
<FromGitter>
<Blacksmoke16> few more things id like to figure out before merging it in
<FromGitter>
<mwlang> it's ok...it's more like the working concept that was important for me. I couldn't figure out how to do this
<FromGitter>
<Blacksmoke16> ah fair enough
<FromGitter>
<Blacksmoke16> main things left to figure out would be auto injecting services for other services, as you would have to make sure to resolve dependencies in order so you do not try to inject one that hasn't be registered yet
<FromGitter>
<Blacksmoke16> also maybe a better way for the injection, are work arounds for this but it would be nice to be able to directly inject tagged services, or services of a given type into a class
<FromGitter>
<Blacksmoke16> TBD :p
<FromGitter>
<mwlang> you're talking about circular referencing, right?
<FromGitter>
<mwlang> at least that's what I kept bumping into myself.
<FromGitter>
<Blacksmoke16> not terrible but deff not optimal if you have multiple services depending on the one. have some ideas on how to fix this but will see how it goes
<FromGitter>
<mwlang> I'll keep an eye out here for your progress. I'm not in position to try to leverage this new knowledge yet, but definitely added to my refactor todo list.
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<mwlang> trying to push through getting a working MVP first and then come back around to refactoring for more robust and modularized approach.
<FromGitter>
<Blacksmoke16> sounds like a plan
<FromGitter>
<silmanduin66> Hello, is there a way to the client IP address from a get or post request to my Crystal server?