Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 08 18:26
    beta-ziliani milestoned #13043
  • Feb 08 18:26
    beta-ziliani milestoned #13043
  • Feb 08 18:00
    Blacksmoke16 labeled #13053
  • Feb 08 17:59
    straight-shoota labeled #13053
  • Feb 08 17:59
    straight-shoota labeled #13053
  • Feb 08 17:59
    straight-shoota assigned #13053
  • Feb 08 17:59
    straight-shoota opened #13053
  • Feb 08 12:19
    straight-shoota closed #13010
  • Feb 08 12:19
    straight-shoota closed #13050
  • Feb 08 12:18
    straight-shoota closed #13048
  • Feb 07 18:12
    HertzDevil labeled #13052
  • Feb 07 18:12
    HertzDevil labeled #13052
  • Feb 07 18:12
    HertzDevil labeled #13052
  • Feb 07 18:12
    HertzDevil opened #13052
  • Feb 07 17:49
    straight-shoota closed #13051
  • Feb 07 17:46
    beta-ziliani milestoned #13051
  • Feb 07 17:46
    beta-ziliani milestoned #13051
  • Feb 07 14:03
    beta-ziliani review_requested #13050
  • Feb 07 13:59
    straight-shoota labeled #13051
  • Feb 07 13:59
    straight-shoota assigned #13051
George Dietrich
@Blacksmoke16
if that helps
Taupiqueur
@alexherbo2
how to return from a capturing block?, I'm using next in my block, but would like to allow return
George Dietrich
@Blacksmoke16
did you try break?
From IRC (bridge bot)
@FromIRC
<mfiano> I thought break and return cant be used
George Dietrich
@Blacksmoke16
yea, next is the thing to return from a block
Taupiqueur
@alexherbo2
I implemented a filter iterator, taking a block for filtering, but it looks odd that I can't use return in it
emanzx
@emanzx
Hi guys..
today Im trying to learn about crystal Process
puts "Spawning watcher.."
        args = ["-q", "-r", "-m", "-e moved_to", "-e create", "-e delete", "-e modify", "--timeout #{watcher_timeout}", "-o #{watch_log_path}", "#{watch_path}"]
        inotify = Process.new("inotifywait",args: ["-q", "-r", "-m", "-e moved_to", "-e create", "-e delete", "-e modify", "--timeout #{watcher_timeout}", "-o #{watch_log_path}", "#{watch_path}"])
        puts "Inotify is running on PID: #{inotify.pid}"
        sleep watcher_timeout
        watcher_status = false
        if inotify.exists?
            puts "Killing inotify with PID:#{inotify.pid}"
            Process.kill(Signal::KILL,inotify.pid)
        end
it seem like the inotifywait does not run.. maybe exited
but it works ok if I used backtick
try to use Process.new as it will not wait for the process to finish.. I do this as sometimes.. inotifywait just freeze.. and I would force kill it with kill -9
George Dietrich
@Blacksmoke16
might be worth trying like "-e", "create", not sure if that would make a diff tho
versus "-e create"
emanzx
@emanzx
oh.. so I need to split all the args?
ok I test first
George Dietrich
@Blacksmoke16
maybe? could also define the output/error IOs to be the parent process which might give a clue
Process.new("inotifywait", args: args, output: :inherit, error: :inherit)
emanzx
@emanzx
deng it works.. hahaha
thanks @Blacksmoke16 I will add the extra for error checking
George Dietrich
@Blacksmoke16
:thumbsup: can also pass any IO for them
like if you wanted to capture it in an IO::Memory or something
emanzx
@emanzx
noted. for now I just read the process output from file. I think its okay for now..
but I will keep in mind about the IO::Memory
Benjamin Wade
@RespiteSage
What's up with 1.1.0? It looks like there's a GitHub release, but no blog post or forum thread.
From IRC (bridge bot)
@FromIRC
<mfiano> I'm confused about "require" and the default directory structure of "crystal init"
Benjamin Wade
@RespiteSage
What about it?
From IRC (bridge bot)
@FromIRC
<mfiano> The language reference says the typical project layout is to have project/src/file.cr with: require "mylib", and project/lib/mylib/mylib.cr would get loaded. Why then, is lib/ added to the git ignore file? Also why can't I just resolve my own code in the src directory?
George Dietrich
@Blacksmoke16
lib directory is for dependencies
Benjamin Wade
@RespiteSage
^
Your own code should go in src/, just like you want to.
George Dietrich
@Blacksmoke16
like external shards/libraires you depend on. e.g. vendor in composer/bundler
Benjamin Wade
@RespiteSage
When resolving your own code, you just need to use relative paths.
From IRC (bridge bot)
@FromIRC
<mfiano> So I must use the relative designator for require in src/file.cr, like: require "./mylib", and it should find src/mylib/mylib.cr ?
Benjamin Wade
@RespiteSage
Close, but you would need require "./mylib/mylib" in that case.
George Dietrich
@Blacksmoke16
i usually skip that extra directory under src
i dont really see the benefit of it
From IRC (bridge bot)
@FromIRC
<mfiano> I like having a directory with the entry point file alone, which imports anything else needed, and usually only does that
Benjamin Wade
@RespiteSage
I usually use directories under src, but I break them up by module.
George Dietrich
@Blacksmoke16
fair enough
From IRC (bridge bot)
@FromIRC
<mfiano> I'll take a look at your repo. I am very new at this coming from a 60 year old language :⁠)
George Dietrich
@Blacksmoke16
Benjamin Wade
@RespiteSage
It's not really that different from how you do it in oq. I just tend to put a little more of the logic in the subdirectories.
Oh? Fortran?
Or something else?
George Dietrich
@Blacksmoke16
Lisp ^
From IRC (bridge bot)
@FromIRC
<mfiano> Yep