<FromGitter>
<Daniel-Worrall> Raz you can check if the Spec constant is defined
<raz>
ahhh good idea. thanks!
<FromGitter>
<Daniel-Worrall> E.g. ⏎ {% skip_file if @top_level.has_constant? "Spec" %}
<FromGitter>
<Blacksmoke16> whats the use case?
<FromGitter>
<Daniel-Worrall> My use case was specing my runnable socks
<FromGitter>
<Daniel-Worrall> AoCs
<FromGitter>
<Blacksmoke16> could you define whatever within `spec_helper`?
<FromGitter>
<Blacksmoke16> that file is only loaded in spec context
<raz>
well i don't want to monkey patch around too much. checking if `Spec` is defined is perfect
<raz>
(i feel like i've even done that before but then forgot about it)
notzmv has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 240 seconds]
notzmv has joined #crystal-lang
taupiqueur has joined #crystal-lang
debayer9 has joined #crystal-lang
debayer9 has quit [Client Quit]
taupiqueur has quit [Ping timeout: 256 seconds]
<FromGitter>
<karan718> Hello ⏎ ⏎ Is it possible to define methods on generic classes. ⏎ For example, Is it possible to define an instance method called 'join' which takes instance of Array(String) as receiver but not instances of Array(T) ⏎ ... [https://gitter.im/crystal-lang/crystal?at=61d6eb67f5a3947800efff3a]
<FromGitter>
<Blacksmoke16> @karan718 i think you have a few options depending on your exact context
<FromGitter>
<Blacksmoke16> like I'm assuming you want this method on a custom type that wraps an array?
<FromGitter>
<karan718> @Blacksmoke16 ⏎ I would like for all the methods are that are defined for Array(T) to be available on this custom type. ⏎ I tried doing something like ⏎ `class ArrayOfStrings < Array(String) ⏎ ... [https://gitter.im/crystal-lang/crystal?at=61d6fd3c2a210c38c1b565f1]
<FromGitter>
<Blacksmoke16> i would suggest *not* extending the base array type and instead have a type that wraps the array. like a decorator
<FromGitter>
<Blacksmoke16> then you could force it to only accept an `Array(String)`
<FromGitter>
<karan718> @Blacksmoke16 can you point me to some documentation or example that uses this pattern
<FromGitter>
<Blacksmoke16> may need to make it `getter array : Array(String)` as you wouldnt be able to pass it to things restricted to `Array`
<FromGitter>
<karan718> I will give this a shot and get back to you. ⏎ How did you become familiar with the concept of `forward_missing_to` ? ⏎ Also, why do recommend against extending the base array type?
<FromGitter>
<Blacksmoke16> and i cant find the specific issue (if there is one), but afaik in the past it just causes issues
<FromGitter>
<Blacksmoke16> same with any of the built in collection types
taupiqueur has joined #crystal-lang
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #crystal-lang
taupiqueur_ has joined #crystal-lang
taupiqueur has quit [Ping timeout: 256 seconds]
notzmv has quit [Ping timeout: 240 seconds]
taupiqueur_ has quit [Remote host closed the connection]
taupiqueur has joined #crystal-lang
notzmv has joined #crystal-lang
ur5us has joined #crystal-lang
<FromGitter>
<amk:amk.ie> howdy, is there method to iterate over and recurse through a directory? I've found .each and stuff but they dont seem to recurse according to the docs