Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:13
    straight-shoota closed #11718
  • 13:12
    straight-shoota closed #11688
  • 13:12
    straight-shoota closed #11693
  • 13:12
    straight-shoota edited #11683
  • 13:12
    straight-shoota closed #11683
  • 13:11
    straight-shoota closed #11625
  • 13:11
    straight-shoota closed #11613
  • 13:11
    straight-shoota closed #11612
  • 13:08
    straight-shoota milestoned #11682
  • 13:05
    straight-shoota milestoned #11207
  • 10:03
    HertzDevil labeled #11781
  • 10:03
    HertzDevil labeled #11781
  • 10:03
    HertzDevil opened #11781
  • Jan 28 20:43
    wontruefree synchronize #11682
  • Jan 28 20:42
    wontruefree synchronize #11697
  • Jan 28 20:04
    beta-ziliani milestoned #11719
  • Jan 28 19:57
    beta-ziliani milestoned #11697
  • Jan 28 19:53
    beta-ziliani milestoned #11690
  • Jan 28 19:51
    beta-ziliani milestoned #11689
  • Jan 28 19:49
    beta-ziliani milestoned #11684
From IRC (bridge bot)
@FromIRC
<mfiano> Yeah vim-crystal seems to run the formatter (optionally [disabled by default for some reason]), and ameba if available, though no mention of that or switch for it
From IRC (bridge bot)
@FromIRC
<mfiano> Day 1 actually getting the tooling set up and writing a small amount of code, and I must say, Crystal was easier to get comfortable with than most of the few dozen or so languages I've tried.
George Dietrich
@Blacksmoke16
:thumbsup:
From IRC (bridge bot)
@FromIRC
<mfiano> development_dependencies are included when not building with --release, right, or is there some other criteria that classifies what "development" means?
George Dietrich
@Blacksmoke16
they're dependencies not used in the final build of the code
i.e. ameba, and testing stuff
From IRC (bridge bot)
@FromIRC
<mfiano> Right, I'm looking at debug.cr right now...they say you can call Debug.enabled = true if you don't want to set an env var, so I'm wondering if I can check some flag as to not call that in release builds
George Dietrich
@Blacksmoke16
{% unless flag? :release %}
  Debug.enabled = true
{% end %}
would be true whenever its built without --release
From IRC (bridge bot)
@FromIRC
<mfiano> You mean the inverse ;⁠)
<mfiano> But, thanks
George Dietrich
@Blacksmoke16
i mean Debug.enabled would be true w/o --release
From IRC (bridge bot)
@FromIRC
<mfiano> Oh yes you're right, I read your description wrong.
<mfiano> It might be about time for bed :⁠/
George Dietrich
@Blacksmoke16
but to answer your earlier question doing like shards build --release would also technically install dev dependencies, but is likely you're not requiring those in your main code anyway.
would want to use --production or --without-development, can do shards --help for more info
From IRC (bridge bot)
@FromIRC
<mfiano> Where is a good place to put such meta-code as the above?
George Dietrich
@Blacksmoke16
would need to go in your main entrypoint file, or some other file that requires it
oh i have an idea
have a debug.cr file that you put this stuff in
From IRC (bridge bot)
@FromIRC
<mfiano> Does it matter that it's before the main entry point's "require"s?
George Dietrich
@Blacksmoke16
then you can add a {% skip_file if flag?(:release) %} so that the code isn't processed in release mode
From IRC (bridge bot)
@FromIRC
<mfiano> Oh hmm...and where would that macro form go?
George Dietrich
@Blacksmoke16
first line of debug.cr
From IRC (bridge bot)
@FromIRC
<mfiano> Aha!
From IRC (bridge bot)
@FromIRC
<mfiano> I like that better. It probably means I have to explicitly require debug.cr before other requires for this to work properly, rather than an arbitrary *...or I could be wrong
George Dietrich
@Blacksmoke16
i would advise against using like require "./**"
From IRC (bridge bot)
@FromIRC
<mfiano> Yeah I would too
<mfiano> Though I must be doing something wrong here.
<mfiano> i did shards install, but get undefined constant Debug
George Dietrich
@Blacksmoke16
oh well you need to require the lib
require "debug" or whatever it's called
From IRC (bridge bot)
@FromIRC
<mfiano> Yeah I suppose that would help a tiny bit
<mfiano> Well there may be a problem with my crystalline setup or something
George Dietrich
@Blacksmoke16
i never used it so :shrug:
From IRC (bridge bot)
@FromIRC
<mfiano> I get editor error, saying it can't find file 'debug' on the line with require "debug", however, 'crystal run' works fine
George Dietrich
@Blacksmoke16
wonder if its conflicting with that file you just made
oh, or maybe it just doesnt know how to resolve deps like that? i never used it so ill defer to someone else
From IRC (bridge bot)
@FromIRC
<mfiano> That's out of the require path, in src. without a relative path it should only be looking in the stdlib or "lib"
<mfiano> so hmm
<mfiano> Ha you're right
George Dietrich
@Blacksmoke16
:ok_hand:
From IRC (bridge bot)
@FromIRC
<mfiano> and shards install makes a lib/debug/...
<mfiano> Renaming the above gist to debug2.cr and it works
<mfiano> how odd
<mfiano> I just have to keep in mind that I shouldn't have local files with the same name as 3rd party library directories or something
George Dietrich
@Blacksmoke16
pretty much yea