<FromGitter>
<trans> Could someone give me some direction. I created a project called "crystal-cli" (https://gitlab.com/transfire/crystal-cli), and it uses the namespace `CLI` from a file to be required at `src/cli.cr`. But when I go to use this lib in another project by adding a shard dependency I run into some problems.
<FromGitter>
<trans> First I put this, because I expected that would work just fine: ⏎ ⏎ ```dependencies: ⏎ cli: ⏎ gitlab: transfire/crystal-cli``` ⏎ ⏎ But when I did `shards install`, shards spat an error: `Error shard name (crystal-cli) doesn't match dependency name (cli)` [https://gitter.im/crystal-lang/crystal?at=5b35a08772b31d3691fce3e6]
greengriminal has joined #crystal-lang
<FromGitter>
<trans> So I changed it too: ⏎ ⏎ ```dependencies: ⏎ crystal-cli: ⏎ gitlab: transfire/crystal-cli``` ⏎ ⏎ That allowed it to install, and it placed it in `lib/crystal-cli`, but when I compile crystal says `while requiring "cli": can't find file 'cli'` [https://gitter.im/crystal-lang/crystal?at=5b35a17aa288503b3de88ddd]
<FromGitter>
<trans> What am I missing?
<FromGitter>
<trans> Hmm... just notice Shards docs says the name field `should not contain crystal.` Well, that's just fine and dandy except I use multiple languages and I can't exactly have a Gitlab repo just called `cli` b/c I may have a port of the project for other languages, e.g. Ruby. The lib is so simple, it's just a macro called `cli`, so I don't really want to give it some foo-foo name (I considered KissCLI).
<FromGitter>
<trans> So unless there is a way around this shards limitation, the only other possible option I can think of is moving all my Crystal projects into a "crystal" group. I think that could work, but only b/c Gitlab can do that, Github can't. Just so happened, I decided to give Gitlab a try for the first time with this project.
greengriminal has quit [Quit: This computer has gone to sleep]
rohitpaulk has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei_ has quit [Ping timeout: 260 seconds]
<FromGitter>
<rishavs> How do I get the params from a POST call to my Http::Server? the context object doesn't seems to have my params data.
DTZUZO has joined #crystal-lang
<FromGitter>
<rishavs> How do I get the params from a POST call (generated by a HTML form action) to my Http::Server? the context object doesn't seems to have my params data. ⏎ _
<FromGitter>
<reiswindy> @trans It could be because of a mismatch between the filename inside src (`cli`), the name used in your `shard.yml` file (`crystal-cli`) and the value you're requiring (`cli`). I tried adding `crystal-cli` as dependency and using `require "crystal-cli/cli"` and the file compiled without issues. Trying to use the example code in the Usage section of the README fails to compile though.
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
<FromGitter>
<rishavs> @reiswindy I am still confused. My browser sends the post data for username and password as `application/x-www-form-urlencoded`. In my route, I tried; ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Isn't the request.body generally where we have the params in the `x=y&a=b` format? [https://gitter.im/crystal-lang/crystal?at=5b35deed5862c35f47d1fdd9]
<FromGitter>
<straight-shoota> @reiswindy yes. But `HTTP::FixedLengthContent#to_s` returns a string representation of the object, not the body content itself. You could use `#gets_to_end`.
<FromGitter>
<trans> @reiswindy Thanks. Guess I could do it that way then, but I suppose I should probably follow Shards' guidelines and rename the project.
<FromGitter>
<vectorselector> i'm kinda losing my mind here... how is one supposed to check for nil if not_nil! assert fails?
<FromGitter>
<vectorselector> for example array(JSON::Any) | Nil and i only want the docs if they are not nil
rohitpaulk has joined #crystal-lang
<RX14>
@trans you can name the repo whatever you want, but the name inside the shards.yml is the require name
<RX14>
@trans if you had src/cli.cr with name: crystal-cli in the shard.yml, wou could require "crystal-cli/cli"
<RX14>
but if you changed the shards name you could just require "cli"
bazaar has quit [Ping timeout: 260 seconds]
bazaar has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter>
<vectorselector> rather, i see that [field]?.try is suggested, but i'm not sure what it wants inside the block, as i have a sequence of statements to make if the value exists, and i've only used blocks with map and other enumerable/iterator kind of things where one has {|thing| thing["field"] == "bob"} or something
<FromGitter>
<cserb> and it's not able to jump um to the definition of bar
<FromGitter>
<cserb> I also tried it in the console and it doesn't find the definition
<FromGitter>
<plainas> @fridgerator does he hang out in this chatroom?
<FromGitter>
<giuseongit> Hi, what's the difference between a crystal library and a crystal project? I can't find it on the docs :C
<FromGitter>
<fridgerator> @plainas yeah sometimes, but from looking at the code it looks like its mostly just the c lib definition and not helper / wrapper functions
<FromGitter>
<fridgerator> last commit was in January so he may not be actively working on it
<FromGitter>
<j8r> @giuseongit what do you mean?
<FromGitter>
<vectorselector> @j8r thank you for your response and help, any additional advice appreciated of course :)
<crystal-gh>
[crystal] asterite opened pull request #6292: Don't find unbound type parameter in main code inside generic type (master...bug/6168-dont-find-generic-type-parameter-in-main) https://git.io/f4NKb
<FromGitter>
<giuseongit> @j8r in the docs (https://crystal-lang.org/docs/using_the_compiler/) there's a paragraph titled 'Creating a project or library'. Also, in the help for the `crystal init` command there's a `TYPE` that could be `app` or `lib`. What are the differences between the two?
<FromGitter>
<asterite> @cserb spawn is a macro and `bar` is just an identifier being passed to it, there's no way to relate that to the method (that means, crystal tool implementations will never work for such case)
<FromGitter>
<asterite> @giuseongit I think the only difference is that shards.lock gets to be in .gitignore in one case and not in the other (I can't remember which one)
<FromGitter>
<yxhuvud> well, the argument must be a file that actually require the implementation. the ui for that is not totally obvious
jeet has quit [Ping timeout: 265 seconds]
<FromGitter>
<jspillers> hey creators, just wanted to say I am super excited about crystal! I fell in love with Ruby over 10 years ago and the excitement of using crystal reminds me of those early days. This team seems to have really nailed the balance of dev friendliness and performance. I think crystal has a super bright future - keep it up!
jeet has joined #crystal-lang
<FromGitter>
<hmans> Congratulations on the 0.25.1 release! \o/
<FromGitter>
<j8r> wait sorry `libcrypto` is the low level API
<crystal-gh>
[crystal] asterite opened pull request #6295: Fix: rebind while condition variables after while body (master...bug/6158-while-rebind-cond-var-after-body) https://git.io/f4NSD
<FromGitter>
<j8r> and not sha256, better to use `aes256` that is perfectly fitted
<FromGitter>
<vladfaust> Hey @faustinoaq you recently got so much drive for Sublime-Crystal, come on, there are a few PRs left ✋
<FromGitter>
<fridgerator> @jspillers I also got the same excitement, and have heard others describe this same feeling as well 👍 🔥
<FromGitter>
<jspillers> yeah Ruby is always my go to "get stuff done quick" language and crystal already feels equally immediate and efficient - oh and its about 90000000000000X faster? soon i will have no reason to use Ruby and every reason to just use crystal
<FromGitter>
<j8r> Furthermore you have the static typing safety net
<FromGitter>
<jspillers> absolutely love that
<FromGitter>
<jspillers> didn't used to, but i have really come to see its value
<FromGitter>
<j8r> Good Bye to all this runtime type errors 😄
<FromGitter>
<jspillers> catch em early, catch em often
<crystal-gh>
[crystal] Sija opened pull request #6297: Remove :nodoc: from singular method aliases, add Int#microsecond alias (master...singular-aliases) https://git.io/f4N7C
<FromGitter>
<codenoid> i'm confused to use bcrypt in crystal :(
<FromGitter>
<bcardiff> FYI I'm doing some test in CircleCI, you might see some OSX jobs cancelled for an hour or so.
fifr[m] has quit [*.net *.split]
Liothen has quit [*.net *.split]
Totoro has quit [*.net *.split]
greengriminal has quit [Ping timeout: 255 seconds]
greengriminal has joined #crystal-lang
graphene has joined #crystal-lang
graphene has quit [Remote host closed the connection]
Liothen has joined #crystal-lang
fifr[m] has joined #crystal-lang
Totoro has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.1]
graphene has joined #crystal-lang
Liothen has quit [Max SendQ exceeded]
Liothen has joined #crystal-lang
Liothen has joined #crystal-lang
graphene has quit [Remote host closed the connection]
graphene has joined #crystal-lang
cptaffe has quit [Ping timeout: 240 seconds]
olbat[m] has quit [Ping timeout: 245 seconds]
fifr[m] has quit [Ping timeout: 240 seconds]
kp666[m] has quit [Ping timeout: 240 seconds]
byteflame has quit [Ping timeout: 260 seconds]
f1refly has quit [Ping timeout: 240 seconds]
Renich has quit [Ping timeout: 255 seconds]
braidn[m] has quit [Ping timeout: 247 seconds]
kixune[m] has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
<FromGitter>
<rishavs> Hi guys. I am trying to implement a bare bone router. How can I implement a redirect function ? any ideas? While i can simply render the new page, the url in the addressbar remains unchanged.
<FromGitter>
<fridgerator> lookat how others do it
<FromGitter>
<rishavs> i am actually checking out that very page right now.
<FromGitter>
<paulcsmith> @RX14 Nice comments on the hacker news thread. Really appreciate your positive and thorough responses
<FromGitter>
<paulcsmith> Also excited to try out static linking with Alpine. That could be pretty dang cool
<robacarp>
Warning: Bottle installation failed: building from source.
<robacarp>
github must be having troubles today
<FromGitter>
<jspillers> must have moved their servers to azure 😄
<FromGitter>
<rishavs> I am not really able to grasp it. @sdogruyol is just setting a new header "location" and then setting up the status code. How is that driving the redirect? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b368e50960fcd4eb92ee1e9]
<FromGitter>
<rishavs> Damn, that worked! thanks @asterite
<FromGitter>
<rishavs> We take so much as granted when we use frameworks. I never even knew that 302 allows for a redirect. IN the last 3-4 days I have learned so much.
<FromGitter>
<paulcsmith> @robacarp It's a place where Amber/Lucky will be putting libs that can be shared :) I decided to extract some work @faustinoaq so it could be used by Lucky and others
<robacarp>
I'm confused, didn't `require "./**/*"` used to work
ua_ has joined #crystal-lang
<FromGitter>
<asterite> I don't think so, `*` or `**` are only allowed at the end of a require string
ua has quit [Ping timeout: 260 seconds]
<robacarp>
even require "./**" complains, I guess you can't target cwd with the glob
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Client Quit]
greengriminal has joined #crystal-lang
wontruef_ has joined #crystal-lang
wontruefree has quit [Ping timeout: 245 seconds]
<FromGitter>
<adamgotterer_twitter> Is there an easy way to access the request object from inside a websocket handler? I can't find an obvious way other then to write my own handler.
<FromGitter>
<j8r> Why there is `lchop`/`rchop` for `String`, and `shift`/`pop` for `Array`?
Jenz has joined #crystal-lang
<Jenz>
Where should I read if I am interested in the low-level elements of Crystal?
<FromGitter>
<adamgotterer_twitter> And I just figured it out! handler = HTTP::WebSocketHandler.new do |socket, context|
<robacarp>
@j8r I don't understand the question
<robacarp>
Jenz: it depends on which low level elements
<crystal-gh>
crystal/master bfd9e6d joshua stein: Spec: silence errors from system_spec on BSD platforms (#6289)
<Jenz>
Please tag me if anyone knows
<Jenz>
And why is there no macro: `LibNode` or similar
<Jenz>
I mean of course macro types not 'macro', i.e. ASTNodes
greengriminal has quit [Quit: This computer has gone to sleep]
<FromGitter>
<sam0x17> has anyone attempted to get crystal binaries to run in some capacity on android and/or IOS via NDK etc? I know there is ARM support so this should be theoretically possible right?