Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 28 21:02
    Blacksmoke16 labeled #13025
  • Jan 28 21:02
    Blacksmoke16 labeled #13025
  • Jan 28 21:02
    Blacksmoke16 labeled #13024
  • Jan 28 21:02
    Blacksmoke16 labeled #13024
  • Jan 28 18:45
    asterite opened #13025
  • Jan 28 16:23
    meatball133 synchronize #13024
  • Jan 28 15:53
    meatball133 edited #13024
  • Jan 28 15:51
    meatball133 opened #13024
  • Jan 28 15:10
    meatball133 ready_for_review #13008
  • Jan 28 13:24
    straight-shoota closed #13014
  • Jan 28 02:34
    Blacksmoke16 labeled #13023
  • Jan 28 02:19
    cyangle labeled #13023
  • Jan 28 02:19
    cyangle opened #13023
  • Jan 28 00:41
    devnote-dev labeled #13022
  • Jan 28 00:41
    devnote-dev opened #13022
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota labeled #13021
  • Jan 27 23:05
    straight-shoota opened #13021
From IRC (bridge bot)
@FromIRC
<terminalpusher> where can I watch the recorded video of the Crystal 1.0 conference?
George Dietrich
@Blacksmoke16
they're not released publicly yet
From IRC (bridge bot)
@FromIRC
<terminalpusher> alright then I will wait for longer
Benjamin Wade
@RespiteSage
Is there any way to use a module with macro included to include an inner class in a generic class which has an instance variable of the type of that generic class?
That was complicated to write, so here's an example: https://carc.in/#/r/bjqq
George Dietrich
@Blacksmoke16
@RespiteSage https://carc.in/#/r/bjra nice
i feel like what you have should work as i would think it would pick up T from the including type
respitesage
@respitesage:matrix.org
[m]
Huh. Yeah, I would also expect it to work.
George Dietrich
@Blacksmoke16
respitesage
@respitesage:matrix.org
[m]
Ah, so that's the problem in your code. Mine is just a language semantics thing, I guess.
George Dietrich
@Blacksmoke16
are class methods not inherited?

A class inherits all instance variables and all instance and class methods of a superclass, including its constructors (new and initialize).

seems they should

George Dietrich
@Blacksmoke16
that doesn't seem right...
duplicate of crystal-lang/crystal#8093 prob
Quinton Miller
@HertzDevil
InnerClass must also be a generic
Taupiqueur
@alexherbo2
how about adding path.match?(pattern) to wrap around File.match?(pattern, path)? https://crystal-lang.org/api/1.0.0/File.html#match?(pattern:String,path:Path%7CString)-class-method
From IRC (bridge bot)
@FromIRC
<mfiano> Hi again. I spent the last couple days reading the language reference and stdlib api docs. I think I could really become comfortable with this as a secondary language.
Taupiqueur
@alexherbo2
how to get the mime type from a file content?
George Dietrich
@Blacksmoke16
mfiano glad to hear
@alexherbo2 there's a MIME module you can use to get it from the filename/ext
but there isn't a method to do that based on content
From IRC (bridge bot)
@FromIRC
<mfiano> Thanks, it really is nice, and seems to borrow a lot from my primary language, yet seems to check off the items I'm looking for
George Dietrich
@Blacksmoke16
primary lang being Ruby?
Taupiqueur
@alexherbo2
I'm having issues with file without extensions, like bash scripts, using shebangs.
From IRC (bridge bot)
@FromIRC
<mfiano> No, Lisp :⁠)
George Dietrich
@Blacksmoke16
(()ah i see)()()
From IRC (bridge bot)
@FromIRC
<mfiano> I tried Nim a couple years ago, but the compiler was very buggy for a 1.0 release, and the community was quite toxic.
George Dietrich
@Blacksmoke16
@alexherbo2 is a method that you can specify a default for those cases
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)