Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:07
    Blacksmoke16 labeled #12783
  • 00:07
    Blacksmoke16 labeled #12783
  • Nov 26 23:55
    carlhoerberg opened #12783
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 11:21
    straight-shoota milestoned #12781
  • Nov 26 02:15
    straight-shoota assigned #11331
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota labeled #12782
  • Nov 25 23:24
    straight-shoota opened #12782
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota labeled #12781
  • Nov 25 23:17
    straight-shoota opened #12781
  • Nov 25 23:01
    straight-shoota synchronize #11635
  • Nov 25 22:56
    straight-shoota synchronize #11840
  • Nov 25 22:49
    straight-shoota labeled #12636
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota labeled #12780
  • Nov 25 19:21
    straight-shoota opened #12780
  • Nov 25 19:11
    straight-shoota labeled #12779
George Dietrich
@Blacksmoke16
whats the error exactly again?
Jonathan Silverman
@mixflame
i'm back to this IRC based error, "ERROR :Closing link: (97KAAAAEC@c-107-2-145-228.hsd1.co.comcast.net) [Registration timeout]"
it happens when you don't do this fast enough:
```
  def login
    return unless @response_count == 3
    ssl_socket.as(OpenSSL::SSL::Socket::Client).unbuffered_write "PASS #{password}\r\n".to_slice
    ssl_socket.as(OpenSSL::SSL::Socket::Client).unbuffered_write "NICK #{nick}\r\n".to_slice
    ssl_socket.as(OpenSSL::SSL::Socket::Client).unbuffered_write "USER #{user} 8 * :#{user}\r\n".to_slice
    @logged_in = true
  end
George Dietrich
@Blacksmoke16
so at this point it sounds like it's a logic problem
Jonathan Silverman
@mixflame
surely
but the SSL socket simply isn't sending, i ran into this before
George Dietrich
@Blacksmoke16
do you need to use that socket directly versus just like HTTP::Client with tls enabled?
Jonathan Silverman
@mixflame
there's no TLS enable IRC socket in the crystal lang lib
it's speaking the Internet Relay Chat protocol
George Dietrich
@Blacksmoke16
ah right, and it's not HTTP based i take it?
Jonathan Silverman
@mixflame
nope, non http
George Dietrich
@Blacksmoke16
gotcha
Jonathan Silverman
@mixflame
this part is usually simple
and not hard
and i had it working before
there seems to be a bug in the ssl socket, not sure if this is related but i can't decode it: crystal-lang/crystal#5375
he (RX14) says call #flush... but the doc's don't say this...
i tried calling flush tho.. didn't write
George Dietrich
@Blacksmoke16
did you try using << "some str" then .flush
Jonathan Silverman
@mixflame
i did try, that...
just changed it to this...
```
  def login
    return unless @response_count == 3
    ssl_socket.as(OpenSSL::SSL::Socket::Client) << "PASS #{password}\r\n"
    ssl_socket.as(OpenSSL::SSL::Socket::Client) << "NICK #{nick}\r\n"
    ssl_socket.as(OpenSSL::SSL::Socket::Client) << "USER #{user} 8 * :#{user}\r\n"
    ssl_socket.as(OpenSSL::SSL::Socket::Client).flush
    @logged_in = true
  end
no send
whoa!
i got it to login
see the response count think
turns out my server only sends 2
yeah protocol code lol :D
George Dietrich
@Blacksmoke16
mmk
Jonathan Silverman
@mixflame
if you were wondering here is the full code that works https://gist.github.com/mixflame/057abeff96311c91f0d2e81fbd0edb26
IRC SSL in Crystal ^
Gabor Szabo
@szabgab
I accidentally ran "crystal spe" (without the trailing c) and it executed all the spec test. Why and how?
George Dietrich
@Blacksmoke16
when "spec/".starts_with?(command)
is what the logic for the CLI is
Gabor Szabo
@szabgab
Oh, thanks
Taupiqueur
@alexherbo2
Is there a built-in way to manipulate trees (from a filesystem walk and json)?
Taupiqueur
@alexherbo2
I need to collect a list of file names and contents (snippets) from a root. each folder contains a scope.yml to test whether the snippets should apply on a given file, for example having rails, rails/ruby, rails/ruby/controller, rails/ruby/migration.
likely, rails/scope.yml will have roots = ["config/environment.rb"] to pass
Taupiqueur
@alexherbo2
rails/ruby/scope.yml extensions = [".rb"] and so on
I wonder if I should cache the filesystem exploration as json, or if it's ok to request the filesystem for scoping a file
1 reply
From IRC (bridge bot)
@FromIRC
<straight-shoota> depends... shrug
<straight-shoota> stdlib has no dedicated tree data structure. I guess JSON::Any comes close. There are also shards.
<straight-shoota> But you need to decide whether caching even makes sense for your use case
From IRC (bridge bot)
@FromIRC
<straight-shoota> We're having a live talk about the upcoming Crystal 1.0 Conference: https://youtu.be/tYb3YlDY4lE
Chris Watson
@watzon
Good chat
Benjamin Wade
@RespiteSage
I'm really looking forward the the conference next week.
Chris Watson
@watzon
Same my dude
bew
@bew:matrix.org
[m]
Will the conference talks be public some time after the event?