baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.2, 2.6.6, 3.0.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Pyrophilia has joined #ruby
burgestrand has quit [Ping timeout: 244 seconds]
donofrio has quit [Remote host closed the connection]
orbyt has joined #ruby
orbyt has quit [Client Quit]
orbyt has joined #ruby
Pyrophilia has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
mnathani has quit []
ur5us has joined #ruby
ap4y1 has quit [Ping timeout: 240 seconds]
meinside has joined #ruby
ramfjord has joined #ruby
djellemah has joined #ruby
burgestrand has joined #ruby
burgestrand has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
gueorgui_ has joined #ruby
gueorgui has quit [Ping timeout: 264 seconds]
ap4y1 has joined #ruby
donofrio has joined #ruby
rafadc has joined #ruby
rafadc has quit [Ping timeout: 256 seconds]
gix has quit [Ping timeout: 246 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
_whitelogger has joined #ruby
rafadc has joined #ruby
rafadc has quit [Ping timeout: 260 seconds]
queip has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
rafadc has quit [Ping timeout: 258 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
dfucci has joined #ruby
ramfjord has joined #ruby
Swyper has quit [Remote host closed the connection]
dfucci has quit [Ping timeout: 264 seconds]
Swyper has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 264 seconds]
roshanavand_ is now known as roshanavand
rafadc has joined #ruby
rafadc has quit [Ping timeout: 260 seconds]
queip has joined #ruby
Swyper has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
ramfjord has joined #ruby
Swyper has joined #ruby
rafadc has joined #ruby
orbyt has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
rafadc has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
<Seich> The nicest really
ramfjord has quit [Ping timeout: 264 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
djellemah has quit [Ping timeout: 244 seconds]
Swyper has quit [Remote host closed the connection]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 246 seconds]
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dfucci has joined #ruby
ChmEarl has quit [Quit: Leaving]
cd has quit [Quit: cd]
orbyt has joined #ruby
orbyt has quit [Client Quit]
dfucci has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
ur5us has quit [Ping timeout: 258 seconds]
rafadc has joined #ruby
rafadc has quit [Ping timeout: 258 seconds]
dfucci has joined #ruby
cb_ has quit [Ping timeout: 265 seconds]
dfucci has quit [Ping timeout: 260 seconds]
dfucci has joined #ruby
vondruch has joined #ruby
tsujp has quit [Ping timeout: 265 seconds]
tsujp has joined #ruby
Seich has quit [Quit: Gone fishing.]
Seich has joined #ruby
Ediz has joined #ruby
a-l-e has joined #ruby
burgestrand has joined #ruby
Rudd0 has quit [Ping timeout: 244 seconds]
ur5us has joined #ruby
Ediz has quit [Remote host closed the connection]
neozor has joined #ruby
ellcs1 has joined #ruby
neozor has quit [Client Quit]
rafadc has joined #ruby
rafadc has quit [Ping timeout: 256 seconds]
mikecmpbll has joined #ruby
vondruch has quit [Quit: vondruch]
ramfjord has joined #ruby
vondruch has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
zapata has quit [Ping timeout: 260 seconds]
zapata has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
ur5us has quit [Ping timeout: 260 seconds]
imode has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
blender_ has joined #ruby
blender has quit [Ping timeout: 246 seconds]
neozor has joined #ruby
hogetarog has joined #ruby
neozor_ has joined #ruby
neozor has quit [Read error: Connection reset by peer]
x0n- has joined #ruby
x0n has quit [Ping timeout: 260 seconds]
supercoven has joined #ruby
gray-_-wolf has joined #ruby
dionysus69 has joined #ruby
supercoven has quit [Ping timeout: 272 seconds]
supercoven has joined #ruby
ur5us has quit [Ping timeout: 244 seconds]
elxbarbosa has joined #ruby
supercoven has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
supercoven has joined #ruby
supercoven has quit [Max SendQ exceeded]
supercoven has joined #ruby
mytestuser98 has joined #ruby
burgestrand has quit [Quit: burgestrand]
mytestuser98 has quit [Client Quit]
ap4y1 has quit [Ping timeout: 240 seconds]
Rudd0 has joined #ruby
mikecmpbll has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
rafadc has joined #ruby
leitz has joined #ruby
rafadc has quit [Ping timeout: 265 seconds]
TCZ has joined #ruby
gray-_-wolf has quit [Quit: WeeChat 2.9]
gueorgui_ is now known as gueorgui
burgestrand has joined #ruby
PaulePanter has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
PaulePanter has joined #ruby
akem has quit [Quit: Leaving]
hiroaki has quit [Ping timeout: 260 seconds]
hiroaki has joined #ruby
rafadc has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
cow[moo] has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
dfucci has quit [Quit: Lost terminal]
ramfjord has joined #ruby
alfiemax has joined #ruby
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #ruby
rapha has left #ruby ["WeeChat 2.3"]
ramfjord has quit [Ping timeout: 260 seconds]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
Swyper has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rudd0 has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Ping timeout: 256 seconds]
mohsen_in has joined #ruby
mohsen_in has quit [Client Quit]
mikecmpbll has joined #ruby
brunosaboia_ has joined #ruby
brunosaboia_ has quit [Remote host closed the connection]
cow[moo] has joined #ruby
BSaboia has quit [Ping timeout: 260 seconds]
mohsen_in has joined #ruby
prestorium has joined #ruby
bmurt has joined #ruby
braincrash has quit [Read error: Connection reset by peer]
cow[moo] has quit [Client Quit]
elxbarbosa has quit [Ping timeout: 260 seconds]
rafadc has quit [Read error: Connection reset by peer]
braincrash has joined #ruby
cow[moo] has joined #ruby
rafadc has joined #ruby
drincruz has joined #ruby
Jonopoly has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
mohsen_in has quit [Quit: Leaving]
BSaboia has joined #ruby
Ediz has joined #ruby
mohsen_in has joined #ruby
dka- has quit [Quit: My Ex-Girlfriend once told me: I'm not a slut, I'm just popular]
<Ediz> Hello everyone
<havenwood> Ediz: hi
<Ediz> I've a question regarding requiring files from sub directories in the lib folder within a gem I'm trying to create - the lib folder is in the loadpath but when I do " require 'Domain/file.rb' " I get a loaderror , file is located in lib/Domain/file.rb within the gem
Fire-Dragon-DoL has quit [Remote host closed the connection]
<Ediz> any ideas? I'm confusing myself with these requires - in my main project I solved it by adding all files to my load path recursively
<Ediz> folders*
Fire-Dragon-DoL has joined #ruby
<havenwood> Ediz: You can omit the `.rb` extension when requiring, but I don't see anything wrong with what you've shown other than gem directories should be lower case by convention.
<havenwood> Ediz: Do you have a public repo where you can share the code?
<Ediz> no I don't unfortunately, but - I will do a few more trials and get back here if it doesn't work, keeping in mind the convention and the .rb
<havenwood> Ediz: require 'domain/file'
<havenwood> $LOAD_PATH.include? "/path/to/lib"
<Ediz> ok incoming paste
<havenwood> Please paste a link to the code, not the code itself. :)
drincruz has quit [Ping timeout: 256 seconds]
<Ediz> thats what I meant lol
<Ediz> its weird, file is there, loadpath has the lib, requiring the right way
<Ediz> right?
<havenwood> Ediz: Ah, ActiveSupport loading not plain Ruby. The loader expects the class name to mirror the file name.
<havenwood> Ediz: The file lib/domain/rate_limiter_config should be Domain::RateLimiterConfig class.
rafadc has quit [Read error: Connection reset by peer]
<havenwood> class Domain; class RateLimiterConfig; def initialize
rafadc has joined #ruby
<Ediz> I've an extra module around it :/
Nowaker has quit [Ping timeout: 256 seconds]
<Ediz> havenwood, I've removed the module. same issue.
<havenwood> Ediz: Did you rename the class to match the file? RateLimiterConfig
<havenwood> Ediz: Do follow naming convention strictly but for reference you can also do custom inflections. https://guides.rubyonrails.org/autoloading_and_reloading_constants.html#customizing-inflections
<Ediz> module Domain , class RateLimiterConfig
<Ediz> was the same
Nowaker has joined #ruby
<havenwood> Ediz: Then add a `Rails.autoloaders.log!` to your config/application.rb to see what's going on.
<havenwood> Ediz: With Rails, you shouldn't need to require at all since there's autoloading.
weaksauce has quit [Ping timeout: 240 seconds]
<Ediz> I'm on sinatra
Ediz has quit [Read error: Connection reset by peer]
dka has joined #ruby
Ediz has joined #ruby
<Ediz> ugh did I miss anything
<adam12> Ediz: Nothing since 'I'm on sinatra'
<Ediz> ty :p
dfucci has joined #ruby
<adam12> Ediz: is rate-limiter your gem?
<Ediz> yeah I'm trying to start it and use it in my main project (its local)
<adam12> Ediz: Common culprit is library files not shipping with gem
<adam12> Ediz: Especially if you use bundler gemspec example that does `git ls-files`.
<Ediz> is this because I'm using subfolders?
<adam12> Ediz: Doubtful. Paste the `spec.files` line from your rate-limiter gemspec.
<Ediz> s.files = ['lib/rate-limiter.rb']
<Ediz> ahh so this is just loading one file :')
iloveitaly has joined #ruby
<adam12> Ediz: Yea.
<adam12> Ediz: Either hand-manage that line or use someting like Rake's FileList.
iloveitaly has quit [Client Quit]
<Ediz> I will check this line further. what it does
drincruz has joined #ruby
ntt has joined #ruby
<ntt> Hi, I'm trying to use a template in an application built with RoR 6. I have some "no route matches error" related to fonts. Basically it seems that simple-line-icons tries to access via url a file like this: <server_ip>:port/fonts/Simple-Line-Icons.woff2. It seems that relative url is hard coded in many css (using ../fonts/Simple-Line-Icons.woff2). How can I solve the issue? I tried with a fonts folder inside assets but it doesn't work
<adam12> ntt: I don't have a great answer for you, but if all else fails I bet it would work if you stuck it in public/
<neozor_> If you are using sass-rails you can use the font-url that works this out for you
<Ediz> adam12, one line code ok to send here?
<neozor_> ntt: font-url helper
<adam12> Ediz: Yeah.
<Ediz> This works well :) s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) }
<Ediz> ty, solves my problem
<adam12> Ediz: Nice.
mohsen_in has quit [Quit: Leaving]
mohsen_in has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
mohsen_in has quit [Client Quit]
mohsen_in has joined #ruby
Ediz has quit [Quit: Leaving]
mohsen_in has quit [Quit: Leaving]
mohsen_in has joined #ruby
ntt has quit [Remote host closed the connection]
ntt has joined #ruby
goyangi has joined #ruby
exkith has quit [Ping timeout: 256 seconds]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
goyangi has quit [Quit: goyangi]
exkith has joined #ruby
ChmEarl has joined #ruby
akem has joined #ruby
ntt has quit [Ping timeout: 272 seconds]
guest1 has quit [Quit: guest1]
braincrash has quit [Ping timeout: 256 seconds]
kinduff48 has quit [Ping timeout: 260 seconds]
guest1 has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
orbyt has joined #ruby
neozor_ has quit [Remote host closed the connection]
orbyt has quit [Client Quit]
neozor has joined #ruby
Emad has joined #ruby
Liothen has quit [Ping timeout: 260 seconds]
ntt has joined #ruby
neozor has quit [Ping timeout: 256 seconds]
alexherbo2 has joined #ruby
Liothen has joined #ruby
alexherbo2 has quit [Ping timeout: 240 seconds]
djellemah has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
ellcs1 has quit [Ping timeout: 240 seconds]
ntt has quit [Ping timeout: 265 seconds]
Jonopoly has quit [Quit: WeeChat 2.9]
akem has quit [Ping timeout: 272 seconds]
alexherbo2 has joined #ruby
ntt has joined #ruby
powerhouse has quit [Remote host closed the connection]
braincrash has joined #ruby
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo26 has joined #ruby
Emad has quit [Quit: Leaving]
Emad has joined #ruby
alexherbo26 has quit [Client Quit]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SeepingN has joined #ruby
bmurt has joined #ruby
alfiemax has quit [Remote host closed the connection]
neozor has joined #ruby
burgestrand has quit [Quit: burgestrand]
pgib has joined #ruby
neozor has quit [Ping timeout: 244 seconds]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
powerhouse has joined #ruby
BSaboia has joined #ruby
<Frankenlime> is there any way to delay connecting in a TCPSocket? I'd like to create the socket in the constructor of a class, then do some work on the class, then connect it to the endpoint once the work is done
<havenwood> Frankenlime: Why doesn't it work to just delay connecting until you want to connect? I don't follow.
<adam12> Frankenlime: None that I'm aware. Without seeing code, you could always lazy-initialize it in another method (`@socket ||= TCPSocket.new`) or make some sort of closure that you get the value eventually. `@socket = ->() { TCPSocket.new }` and elsewhere (`@socket.call` then save)
<havenwood> Frankenlime: s = Socket.new Socket::AF_INET, Socket::SOCK_STREAM
ellcs1 has joined #ruby
braincrash has quit [Ping timeout: 260 seconds]
<havenwood> s.connect ...
<Frankenlime> as in create the socket in my connect function? I guess I could, although I normally like to make it in initialize so everything is ready to go
<Frankenlime> yeah I may just need to use a regular socket
<Frankenlime> thanks guys, i'll play around with both
<adam12> Using Socket class is a nice alternative maybe.
<adam12> Frankenlime: Depending on the class purpose and cohesion of the rest of the methods in the class, you could always have your own constructor. Client.build(); where build does new(socket: TCPSocket.new)
<adam12> Frankenlime: This opens up the option to pass in your own socket class for testing. Client.new(socket: DummySocket)
<Frankenlime> yeah that could work too. i'll see how that looks in the design
<Frankenlime> thanks
akem has joined #ruby
rippa has joined #ruby
orbyt has joined #ruby
Rudd0 has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
<adam12> havenwood: Saw that. Very nice.
<havenwood> adam12: I like `Ref` as a name better than `TVar` but agreed.
<adam12> havenwood: Yeah. Consistency with concurrent maybe? I'm not sure.
<adam12> Naming sucks.
rafadc has joined #ruby
ntt has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
alfiemax has joined #ruby
cthulchu_ has joined #ruby
Technodrome has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
BSaboia has joined #ruby
ramfjord has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
skryking has quit [Quit: Konversation terminated!]
skryking has joined #ruby
prestorium has quit [Ping timeout: 246 seconds]
howdoi has joined #ruby
pgib has quit [Ping timeout: 240 seconds]
pgib has joined #ruby
cthulchu_ has quit [Ping timeout: 260 seconds]
<isene> How can I check if a symlink is orphaned? (https://ruby-doc.com/docs/ProgrammingRuby/html/ref_m_filetest.html does not include a check for orphaned files)
vondruch has quit [Ping timeout: 240 seconds]
factormystic has quit [Quit: The Lounge - https://thelounge.chat]
dfucci has quit [Ping timeout: 240 seconds]
chamunks has quit [Quit: Don't worry I'm not gone yet.]
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
BSaboia has quit [Quit: This computer has gone to sleep]
factormystic has joined #ruby
cd has joined #ruby
<havenwood> isene: File.readlink(foo) rescue Errno::ENOENT
<havenwood> isene: File.readlink('orphan.example') #!> Errno::ENOENT (No such file or directory @ rb_readlink - orphan.example)
<havenwood> isene: Is that what you're looking for? If not, say more about how you'd like to check?
<isene> havenwood: That works (writing a file manager that parses LS_COLORS)
al2o3-cr has quit [Quit: WeeChat 2.9]
<isene> If we were to rewrite that to something that yields ftype = "or" if the error is raised - what's the most elegant way of doing that?
al2o3-cr has joined #ruby
akem_ has joined #ruby
akem has quit [Ping timeout: 256 seconds]
gix has joined #ruby
<havenwood> isene: That'll ^ traverse the current directly looking for symlinks.
<havenwood> isene: Does that answer your question? If not, say more about what you're doing?
mohsen_in has quit [Quit: Leaving]
<havenwood> isene: def symlink_fpath(path); File.ftype File.readlink(path) end
<havenwood> isene: rereading your question... does that ^ method do the trick?
<isene> havenwood: No, actually - it still reads the orphaned symlink as a valid symlink. Case: 'Touch 123' 'ln -s 123 456' 'rm 123' - in irb/pry: 'File.readlink('456') => true
rafadc has quit [Read error: Connection reset by peer]
<havenwood> isene: That's not what I'd have expected. Sec.
rafadc has joined #ruby
davispuh has joined #ruby
mensvaga has joined #ruby
<havenwood> isene: File.ftype File.readlink '456' #=> Errno::ENOENT (No such file or directory @ rb_file_s_ftype - 123)
<havenwood> isene: Isn't that ^ what you want? I may be misunderstanding.
<mensvaga> Aside from what's missing, is this an OK repository layout for a Ruby project?
r29v has joined #ruby
<mensvaga> (we can get to what's missing in a bit; I know tests are something)
BSaboia has joined #ruby
<havenwood> mensvaga: Nope, not quite right.
<mensvaga> I'm interested mainly in criticism related to "src/lib/ruby2" "src/bin", and the gemspec
<mensvaga> What specifically is wrong?
<mensvaga> (please)
<apotheon> The ruby2 directory seems unnecessary and contrary to common practice. Why is it there?
<apotheon> Also . . . it's typical for gems to place lib/ and bin/ in the same directory as the gemspec.
<havenwood> mensvaga: Get rid of the src/ dir and have bin/ and lib/ at top level. In the bin/ dir, get rid of the extension. In the lib/ dir, get rid of ruby2/ dir and HelloRuby/ dir and rename lib/ruby2/HelloRuby/HelloRepoLayout.rb to lib/hello_repo_layout.rb instead.
<mensvaga> For lib/ruby2, because that might not be the only language that's going to be in a repo.
<mensvaga> So, is that particularly "wrong" if the gemspec works?
<havenwood> Yes. Many tools presume proper naming conventions.
<mensvaga> (I'm not trying to be a pain in the ass)
<havenwood> mensvaga: Follow those ^ strictly.
<havenwood> mensvaga: And this directory structure: https://guides.rubygems.org/patterns/
<mensvaga> I believe I'm following this pattern with the naming scheme: rdoc-datarequire 'rdoc/data'RDoc::Data
<mensvaga> Just stuff is under lib/ruby2 , as stated in the gemspec
<havenwood> mensvaga: No caps in filenames or directories, ever.
<mensvaga> I can get rid of those.
<apotheon> mensvaga: I'd say, if you want multiple languages for different implementations, that you should have language subdirectories at the project's root level, and you should move the gemspec within the Ruby subdirectory.
<havenwood> ^ +1
<havenwood> Have the gem be a distinct directory and follow gem conventions precisely.
<apotheon> I get the impression mensvaga is going for a HelloRuby::HelloRepoLayout namespace, though, possibly with a hello_ruby.rb file in hello_ruby/, with hello_repo_layout.rb in hello_ruby/hello_repo_layout/ . . .
<apotheon> . . . in which case having nested directories makes sense.
<mensvaga> Gem also seems to support that
<mensvaga> s.files = Dir['src/lib/ruby2/**/*']
<mensvaga> s.require_paths = ['src/lib/ruby2']
<mensvaga> When installed as a gem, it seems to work
<mensvaga> Changes pushed.
<mensvaga> Though, because I don't "code ruby often enough", I don't know what exactly I'm doing "contrary" to the documentation, as opposed to "differently"
neozor has joined #ruby
<mensvaga> (but in a way that works with gem)
<apotheon> This is my take on how to reorganize (let me know if I missed something):
<mensvaga> I'll use underscores.
<apotheon> mensvaga: Part of the importance of conforming to expectations is that sometimes code can break when you break expectations beyond what you yourself can reasonably test, because sometimes the breakage occurs with code others are writing while using your code, instead of just in cases of the gem itself not building and installing.
<mensvaga> With regard to the src/lib , and src/bin organization, I need to know if its contrary to something, and specifically to what.
<havenwood> mensvaga: FWIW, Ruby 3 is coming out this Christmas and Ruby 1.0 is terribly old.
<mensvaga> I hear ya there.
<apotheon> . . . so the importance of meeting expectations is more than just "it builds; ship it".
<mensvaga> Oh, I'm not one of "those" people.
<havenwood> mensvaga: Maybe just call it "ruby" with no "2" but I'd put the gem in a separate dir entirely.
hiroaki has quit [Ping timeout: 260 seconds]
ellcs1 has quit [Ping timeout: 240 seconds]
<apotheon> mensvaga: Having src/ within the same directory as the gemspec is definitely contrary to all expectations and norms and "best practices" in the Ruby community at large.
<havenwood> mensvaga: `sample_project/ruby2/lib/hello_ruby.rb` file and `sample_project/ruby2/lib/hello_ruby/` dir.
<mensvaga> No; I want the major version of the programming language to be explicitly stated in the path. It's not like Ruby breaks backward comparability without bumping the major version number often (unlike some OTHER programming languages)
<mensvaga> s/comparability/compatibility/
<havenwood> mensvaga: Ruby 3 should *just work* for the most part.
<mensvaga> Next version fixes everything :-D
<apotheon> If you're likely to support 2 and 3 separately, I don't really see a problem.
<havenwood> mensvaga: You can go ahead and try the gem on Ruby 3. It likely will have the same behavior.
<apotheon> (with having 2 and 3 definitions)
neozor has quit [Ping timeout: 246 seconds]
<havenwood> I'd not draw a distinction in particular between Ruby 2 and 3.
<havenwood> You could call Ruby 3 a Ruby 2.8 release instead.
<havenwood> It doesn't matter, particularly.
<mensvaga> Yep. Perl's doing the same thing with 7.
<havenwood> Matz has opposed any major breaking changes.
<apotheon> havenwood: That seems like the opposite of what happened with 1.9 . . .
<havenwood> Some globals are removed but I doubt you'd rely on them.
<apotheon> 2.0 was called 1.9, and 2.8 is getting called 3.0 . . . ?
<havenwood> apotheon: Yeah, 1.9 was a major change. Not as much pain as Python 3, but major.
<apotheon> mensvaga: Is Perl just skipping 6 because of the Raku/6 debacle?
<mensvaga> Yeah
<havenwood> mensvaga: Ruby is just Ruby. Ignore the 2/3. :P
<apotheon> I see.
<mensvaga> It's not like there's a 3.4, 3.7, 3.8, and whatever on every damn major distro though ;)
<havenwood> mensvaga: sample_project/ruby/lib/hello_ruby/hello_repo_layout.rb
<mensvaga> I'm working on renaming things now; but I'd prefer it to be lib/rubyX
<havenwood> mensvaga: 3.0 in 2 mo, 3.1 in 14.
<mensvaga> Yep
<havenwood> And your code will just work on them, but have a 2.
mohsen_in has joined #ruby
<havenwood> ¯\_(ツ)_/¯
<apotheon> The ruby2 is outside of the Ruby world, so I'm of the opinion it doesn't matter in this case if you want to use ruby2/ instead of ruby/, but if you're doing it for the sake of maintaining multi-version compatibility you're better off maintaining release branches.
mohsen_in has quit [Client Quit]
<apotheon> . . . or, rather, release target version branches in your DVCS.
<mensvaga> That's a matter of "politics" with regard to major version numbers for a specific language. For now, because "2 is kind of standard with ruby", I can get away with calling things "ruby2" until I come up with another naming convention that covers multiple versions.
<apotheon> That is, the "ruby2" name exists outside the actual Ruby package, as long as the gemspec and everything else associated with the gem itself is inside ruby2/.
Rudd0 has quit [Ping timeout: 260 seconds]
<apotheon> I'm not sure there's a reason to call it ruby2/, though, given I haven't seen any meaningful explanation for why.
<mensvaga> The name itself is less important than the layout.
leitz has quit [Quit: Leaving]
<mensvaga> Reason being: even though some of this is "different" (but not contrary), I can generate multiple artifacts in multiple languages from the same repository.
<mensvaga> It's more about "If somebody writes a bash script for a project, and it's all in the same repository, how do I organize all of the code to work so I can deploy it as a gem, and as a package?"
<mensvaga> OK; for the most part, the file names have changed, (got rid of caps, used underscores), and I removed the extension. I'll test if the gem builds.
<mensvaga> Hrm. In the gemspec, because I was only installing binaries that end with "*.rb", it didn't install "sample_ruby_script".
<mensvaga> I'll see if I can work around the "no extension" thing.
<mensvaga> probably just look for all files that have ruby at the first line or something
<havenwood> mensvaga: It's still not quite right with the hierarchy. The file structure in lib/ should mirror the module/class namespace.
<mensvaga> It does; but AFTER src/lib/rubyX
<mensvaga> and Gem does have "require_paths"
<havenwood> mensvaga: HelloRuby should be a lib/hello_ruby.rb file and HelloRuby::HelloRepoLayout should be lib/hello_ruby/hello_ruby_layout.rb
<havenwood> mensvaga: Autoloading requires the files and namespaces match, so it's fairly important.
hiroaki has joined #ruby
<mensvaga> Isn't that what require_paths takes care of?
<havenwood> mensvaga: Foo::BarBaz::Wombat should be lib/foo/bar_baz/wombat.rb, and so on.
rafadc has quit [Read error: Connection reset by peer]
<havenwood> mensvaga: We just always have the namespace and file paths match.
<havenwood> mensvaga: That way, everyone knows where the files are and autoloading and such *just work*.
<havenwood> mensvaga: It's highly recommended to follow the gem naming and structure guidelines.
rafadc has joined #ruby
<havenwood> mensvaga: Use consistent naming. https://guides.rubygems.org/patterns/#consistent-naming
<mensvaga> I understand that. And, again, not trying to be a pain in the ass. But what does require_paths do, if not that?
<mensvaga> I think I am correctly using underscores in the filenames
<havenwood> mensvaga: But they're in the wrong directories.
<mensvaga> strictly because of src/lib/ruby2 ?
<havenwood> mensvaga: X::Y::Z should be lib/x/y/z.rb
<havenwood> mensvaga: If you need a ruby2/ dir, don't put it in lib/ dir.
<havenwood> mensvaga: You *can* violate the convention, but then it breaks autoloading and confuses Rubyists.
<havenwood> mensvaga: If you must have lib/ruby2/, still follow the conventions for namespaces matching file structure as best you can.
<havenwood> mensvaga: So X::Y::Z could be lib/ruby2_uhg/x/y/z.rb but the folders matter. Your Config is in the wrong directory.
<mensvaga> OK. So, with that, I THINK I already named things according to the conventions, as per the link that was sent to me:
<mensvaga> my "config"?
<havenwood> mensvaga: There's an extra hello_repo_layout/ dir here: hello_repo_layout/hello_repo_layout.rb
<mensvaga> you mean the gemspec?
<havenwood> mensvaga: Sec, let me just show you a correct one.
<mensvaga> Oh; that. That's just to have a module that's under something else; not just one level deep
<havenwood> mensvaga: Easier to show ^ than tell.
<mensvaga> (as it stands now, the gem builds, installs, and I can run sample_ruby_script.rb . I'll work on file extensions in a bit)
<havenwood> mensvaga: Note, the hello_repo_layout.rb file is in lib/hello_ruby/ directory.
<havenwood> mensvaga: The hello_ruby.rb file is in lib/ directory.
<mensvaga> Yeah, I see that. You don't like "src", and you swapped "ruby2" and "lib"
<mensvaga> ah
<apotheon> mensvaga: Note that naming conventions do matter, e.g. making sure that HelloRuby is inside hello_ruby.rb which, in turn, is inside lib/ . . . and making sure that HelloRuby::HelloRepoLayout is inside hello_repo_layout.rb which is, in turn inside lib/hello_repo_layout/ . . . is important for automatic directory traversal when including libs.
<mensvaga> I see what you're getting at, but would I put a bash script under ruby2/bin ?
<havenwood> mensvaga: I'd translate the bash script to Rake probably and have a top level Rakefile. It depends.
<apotheon> s/turn /turn, /
<mensvaga> OK. Thanks for all the help.
<havenwood> mensvaga: Usually gems don't have shell scripts. I'd put it outside the gem directory, presuming it's not shipping with the gem.
<apotheon> mensvaga: I would either go with Rake or ash/dash/ksh compatible .sh instead of a Bash file, for portability.
imode has joined #ruby
<apotheon> Making Bash a dependency for a Ruby script limits portability amongst Unix-like systems, and might annoy people with having to manually install Bash if they want to use the gem.
<apotheon> The exception would be the case when the gem is somehow *for* Bash things.
<apotheon> (specifically Bash, not just "shell script")
<mensvaga> It's bigger than that (believe it or not)
Eiam has joined #ruby
<mensvaga> Basically, the source tree layout was designed to be compatible with Ruby Gems, Python Pip, Perl. (Maybe PHP composer. Maybe). I can generate all of those artifacts from the same repository layout. I can also add shell scripts (and "libraries) to it to.
BSaboia has quit [Quit: This computer has gone to sleep]
<mensvaga> It's not that "Bash" has to be supported, it's that if any one of those scripting languages is arbitrarily added to a project then there's a place for it, and it doesn't interfere with anything else.
<mensvaga> I find myself in a situation where somebody writes a python script to go against a web api, which generates a JSON file that I need to have a Ruby module convert to some configuration template
akem_ is now known as akem
<mensvaga> And then there are "shell scripts" that are entry points, or called from cron, or something
Sauvin has quit [Remote host closed the connection]
BSaboia has joined #ruby
weaksauce has joined #ruby
<mensvaga> And, I'm having problems finding documentation on the require_paths variable for the spec; I'm pretty sure that's designed to take care of the autoloading issues
<mensvaga> As for the "spec.executables" thing, it seems like it's popular to do regex foo inside of the specification, such as spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
<mensvaga> anyway
BSaboia has quit [Client Quit]
<mensvaga> So, provided I adhere to the "naming conventions" , but just with a "deeper" directory structure, stuff "should just work"
BSaboia has joined #ruby
BSaboia has quit [Client Quit]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
burgestrand has joined #ruby
<mensvaga> Granted, if I *publish* something, like a "mature" gem, It'll probably be in its own project.
ruby-lang297 has joined #ruby
TCZ has joined #ruby
coniptor has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
rafadc has quit [Ping timeout: 272 seconds]
rafadc has joined #ruby
supercoven has quit [Ping timeout: 272 seconds]
dfucci has quit [Ping timeout: 246 seconds]
turt2live has quit [Quit: killed]
MeVegan[m] has quit [Quit: killed]
Arkaniad has quit [Quit: killed]
sepp2k has quit [Quit: killed]
finn[m] has quit [Quit: killed]
stan has quit [Quit: killed]
linuus[m] has quit [Quit: killed]
nod0n[m] has quit [Quit: killed]
hsiktas[m] has quit [Quit: killed]
arichiardi[m] has quit [Quit: killed]
Eiam has quit [Ping timeout: 250 seconds]
Eiam has joined #ruby
<isene> havenwood: Sorry, afk; I get ' => "link" '
hsiktas[m] has joined #ruby
<isene> i.e. no error
cnsvc has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
alfiemax has quit [Remote host closed the connection]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
ruby-lang297 has quit [Client Quit]
chamunks has joined #ruby
ruby-lang297 has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neozor has joined #ruby
a-l-e has quit [Ping timeout: 258 seconds]
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ur5us has joined #ruby
neozor has quit [Ping timeout: 256 seconds]
GodFather has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ap4y1 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
orbyt has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
neozor has joined #ruby
neozor has quit [Client Quit]
rafadc has quit [Read error: Connection reset by peer]
stan has joined #ruby
arichiardi[m] has joined #ruby
Arkaniad has joined #ruby
nod0n[m] has joined #ruby
turt2live has joined #ruby
finn[m] has joined #ruby
sepp2k has joined #ruby
linuus[m] has joined #ruby
MeVegan[m] has joined #ruby
Romain[m] has joined #ruby
r34lp0w3r[m] has joined #ruby
rafadc has joined #ruby
orbyt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
yasumi2136 has joined #ruby
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
prestorium has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r29v has quit [Quit: r29v]
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
kinduff48 has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
ruby-lang297 has quit [Client Quit]
rafadc has joined #ruby
ruby-lang297 has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
mikecmpbll has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
pyrophilia has joined #ruby
Technodrome has joined #ruby
xco has joined #ruby
pyrophilia has quit [Remote host closed the connection]
BSaboia has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
LenPayne has quit [Quit: ZNC 1.8.1 - https://znc.in]
LenPayne has joined #ruby
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
braincrash has joined #ruby
roshanavand_ has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
roshanavand_ is now known as roshanavand
ramfjord has quit [Ping timeout: 272 seconds]
ruby-lang297 has quit [Client Quit]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
splud has quit [Ping timeout: 256 seconds]
BSaboia has quit [Quit: This computer has gone to sleep]
TCZ has quit [Quit: Leaving]
Swyper has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 260 seconds]
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
splud has joined #ruby
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
rafadc has quit [Read error: Connection reset by peer]
ruby-lang297 has joined #ruby
rafadc has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
cnsvc has quit [Remote host closed the connection]
<djellemah> isene: FileTest.symlink? some_file and FileTest.exist? some_file looks like it will do what you're after.
cnsvc has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
dka has quit [Quit: My Ex-Girlfriend once told me: I'm not a slut, I'm just popular]
ramfjord has joined #ruby
yasumi2136 has quit [Ping timeout: 240 seconds]
rafadc has quit [Read error: Connection reset by peer]
dka has joined #ruby
rafadc has joined #ruby
akem has quit [Quit: Leaving]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
TCZ has joined #ruby
ruby-lang297 has joined #ruby
orbyt has joined #ruby
orbyt has quit [Client Quit]
Rudd0 has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
burgestrand has quit [Quit: burgestrand]
hagabaka has quit [Remote host closed the connection]
hagabaka has joined #ruby
orbyt has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc has joined #ruby
akem has joined #ruby
akem has quit [Max SendQ exceeded]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
Swyper has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
markong has joined #ruby
ruby-lang297 has joined #ruby
tris has quit [Ping timeout: 246 seconds]
tris has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
rafadc has quit [Read error: Connection reset by peer]
dfucci has joined #ruby
rafadc has joined #ruby
ruby-lang297 has joined #ruby
dfucci has quit [Ping timeout: 240 seconds]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
Emad has quit [Remote host closed the connection]
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
Swyper has quit [Remote host closed the connection]
ruby-lang297 has joined #ruby
braincrash has quit [Ping timeout: 256 seconds]
Swyper has joined #ruby
ruby-lang297 has quit [Client Quit]
rafadc has quit [Read error: Connection reset by peer]
ruby-lang297 has joined #ruby
rafadc has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ap4y1 has quit [Quit: WeeChat 2.9]
ruby-lang297 has joined #ruby
Swyper has quit [Remote host closed the connection]
prestorium has quit [Quit: prestorium]
ruby-lang297 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
dionysus69 has joined #ruby
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ap4y has joined #ruby
ruby-lang297 has joined #ruby
ruby-lang297 has quit [Client Quit]
ruby-lang297 has joined #ruby