havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview2: 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!
phaul has quit [Quit: :wq]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
mossplix has quit [Read error: No route to host]
NL3limin4t0r_afk has quit [Ping timeout: 240 seconds]
NL3limin4t0r_afk has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
jacksoow has joined #ruby
jacksoow_ has quit [Ping timeout: 264 seconds]
drincruz has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FernandoBasso has quit [Ping timeout: 250 seconds]
matheusmoreira has quit [Ping timeout: 240 seconds]
matheusmoreira has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
Exuma has joined #ruby
MinSrodowiska has quit [Quit: Bye Bye]
tau has quit [Remote host closed the connection]
MinSrodowiska has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4351 is now known as AJA4350
drincruz has joined #ruby
Technodrome has joined #ruby
booboy has quit [Quit: ZNC - https://znc.in]
code_zombie has joined #ruby
booboy has joined #ruby
skx86 has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bvdw has joined #ruby
brool has quit [Ping timeout: 245 seconds]
dasher00 has quit [Ping timeout: 252 seconds]
brool has joined #ruby
Frankenstein is now known as Rudolph
eljimmy has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
orbyt_ has joined #ruby
AJA4350 has quit [Quit: AJA4350]
Sina has quit [Quit: Connection closed for inactivity]
victorgama has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
victorgama has joined #ruby
<leftylink> hmm
<leftylink> it wouldn't be sensible to assign and use the just-assigned thing in a modifier-if, would it... it would be legal code, but it'd always be nil because the assignment hasn't happened yet
MinSrodowiska has quit [Quit: Bye Bye]
<leftylink> &>> puts "hello #{a = 5}" if a # won't say hello, a is nil
<rubydoc> # => nil (https://carc.in/#/r/7w6u)
<leftylink> you also can't do it the other way around because
<leftylink> it's not defined at the lexical place
<leftylink> &>> puts "hello {a}" if a = 5
<rubydoc> # => hello {a}... check link for more (https://carc.in/#/r/7w6v)
<leftylink> oops
<leftylink> &>> puts "hello #{a}" if a = 5
<rubydoc> stderr: -e:4: warning: found `= literal' in conditional, should be ==... check link for more (https://carc.in/#/r/7w6w)
<leftylink> wow, how dare you warn me
<leftylink> maybe if I parenthesise it
<leftylink> &>> puts "hello #{a}" if (a = 5)
<rubydoc> stderr: -e:4: warning: found `= literal' in conditional, should be ==... check link for more (https://carc.in/#/r/7w6x)
<leftylink> wow, the nerve
<leftylink> anyway, it doesn't matter
<leftylink> it's undefined at that lexical location anyway
<leftylink> so the best you can do is something like
<leftylink> &>> if a = 5; puts "hello #{a}" end
<rubydoc> # => hello 5... check link for more (https://carc.in/#/r/7w6y)
<leftylink> .... although.
<leftylink> shrug, I don't think there's a real better way to do it
<leftylink> in situations where I need that behaviour, I just don't use modifier if
Frobozz has joined #ruby
dviola has quit [Quit: WeeChat 2.6]
levifig has quit [Ping timeout: 240 seconds]
MrCrackPot has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Read error: Connection reset by peer]
levifig has joined #ruby
strawberry has joined #ruby
brool has quit [Ping timeout: 268 seconds]
KeyJoo has joined #ruby
strawberry has quit [Quit: Quit]
iamayam has joined #ruby
thomas_25 has quit [Remote host closed the connection]
madper has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thomas_25 has joined #ruby
MzrE has joined #ruby
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
victorgama has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
victorgama has joined #ruby
xco has joined #ruby
victorgama has quit [Client Quit]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsujp has quit [Ping timeout: 265 seconds]
bambanx has quit [Quit: Leaving]
tsujp has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
gix has quit [Ping timeout: 240 seconds]
gix- has joined #ruby
cd has quit [Quit: cd]
xco has joined #ruby
chalkmonster has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
suukim has joined #ruby
MzrE has quit [Read error: Connection reset by peer]
mossplix has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
eljimmy has quit [Quit: This computer has gone to sleep]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
mossplix has quit [Ping timeout: 268 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has joined #ruby
xco has joined #ruby
cyclonis has joined #ruby
cyclonis has quit [Client Quit]
cyclonis has joined #ruby
cyclonis has quit [Client Quit]
cyclonis has joined #ruby
gix- has quit [Ping timeout: 276 seconds]
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
cyclonis_ has joined #ruby
absolutejam2 has joined #ruby
cyclonis has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
skx86 has quit [Quit: Connection closed for inactivity]
rippa has joined #ruby
yann-kaelig has joined #ruby
dionysus69 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
absolutejam2 has quit [Ping timeout: 264 seconds]
sandstrom has joined #ruby
dellavg has joined #ruby
kx has joined #ruby
schne1der has joined #ruby
cyclonis has joined #ruby
cyclonis_ has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
nowhere_man has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
dellavg has quit [Ping timeout: 268 seconds]
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
dasher00 has joined #ruby
dbugger has joined #ruby
mossplix has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 246 seconds]
bitwinery has quit [Quit: Leaving]
al2o3-cr has joined #ruby
mossplix has joined #ruby
Intelo has quit [Remote host closed the connection]
Intelo has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
mossplix has quit [Ping timeout: 268 seconds]
Intelo has quit [Remote host closed the connection]
TomyLobo has joined #ruby
Intelo has joined #ruby
Fernando-Basso has joined #ruby
cyclonis has quit [Ping timeout: 246 seconds]
conta has joined #ruby
Fernando-Basso has quit [Quit: Leaving]
cyclonis has joined #ruby
contradictioned has quit [Remote host closed the connection]
contradictioned has joined #ruby
queip has quit [Ping timeout: 240 seconds]
queip has joined #ruby
fanta1 has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
Technodrome has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
al2o3-cr has quit [Quit: WeeChat 2.6]
al2o3-cr has joined #ruby
Fira__ has quit [Ping timeout: 276 seconds]
queip has quit [Ping timeout: 240 seconds]
queip has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
conta has quit [Quit: conta]
Nicmavr has joined #ruby
Fernando-Basso has joined #ruby
AJA4350 has joined #ruby
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
dionysus69 has joined #ruby
dviola has quit [Quit: WeeChat 2.6]
MrCrackPot has quit [Remote host closed the connection]
gix has joined #ruby
MinSrodowiska has joined #ruby
thomas_25 has quit [Ping timeout: 240 seconds]
xGrind has joined #ruby
thomas_25 has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
poontangmessiah has joined #ruby
Axy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Mia has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
absolutejam2 has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 276 seconds]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
johnny56 has joined #ruby
Axy has quit [Ping timeout: 268 seconds]
shirak has joined #ruby
frocskos has joined #ruby
frocskos is now known as Inoriand
Inoriand has left #ruby [#ruby]
sandstrom has quit [Quit: My computer has gone to sleep.]
frocskos has joined #ruby
frocskos is now known as Inoriand
Inoriand has left #ruby [#ruby]
jottr has joined #ruby
jottr has quit [Client Quit]
brendan- has quit [Ping timeout: 245 seconds]
m3ssia has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
m3ssia has joined #ruby
phaul has joined #ruby
lucasb has joined #ruby
brendan- has joined #ruby
akemhp_ has joined #ruby
akem__ has quit [Ping timeout: 245 seconds]
absolutejam2 has quit [Ping timeout: 250 seconds]
absolutejam2 has joined #ruby
cyclonis_ has joined #ruby
cyclonis has quit [Ping timeout: 240 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
Fira__ has joined #ruby
Intelo_ has joined #ruby
Intelo has quit [Ping timeout: 240 seconds]
MinSrodowiska has quit [Quit: Bye Bye]
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 265 seconds]
queip_ has joined #ruby
queip has quit [Ping timeout: 265 seconds]
queip_ is now known as queip
xco has quit [Quit: Textual IRC Client: www.textualapp.com]
Inline__ has joined #ruby
hutch1 has joined #ruby
Technodrome has joined #ruby
Inline has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
bluetown has quit [Remote host closed the connection]
queip_ has joined #ruby
queip has quit [Ping timeout: 268 seconds]
queip_ is now known as queip
absolutejam2 has quit [Ping timeout: 276 seconds]
bluetown has joined #ruby
salinasc has joined #ruby
sandstrom has joined #ruby
salinasc has quit [Quit: Konversation terminated!]
salinasc has joined #ruby
salinasc has quit [Client Quit]
tsujp has quit [Quit: Textual IRC Client: www.textualapp.com]
salinasc has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
skx86 has joined #ruby
absolutejam2 has joined #ruby
poontangmessiah has joined #ruby
shirak has quit [Ping timeout: 268 seconds]
hutch1 has quit [Quit: WeeChat 2.6]
shirak has joined #ruby
nowhere_man has joined #ruby
Intelo_ has quit [Quit: Leaving]
Intelo has joined #ruby
absolutejam2 has quit [Ping timeout: 276 seconds]
queip has quit [Ping timeout: 240 seconds]
queip has joined #ruby
absolutejam2 has joined #ruby
fanta1 has quit [Quit: fanta1]
absolutejam2 has quit [Ping timeout: 268 seconds]
wymillerlinux has joined #ruby
absolutejam2 has joined #ruby
absolutejam2 has quit [Ping timeout: 265 seconds]
nowhere_man has quit [Ping timeout: 252 seconds]
MinSrodowiska has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
MinSrodowiska has quit [Quit: Bye Bye]
akem__ is now known as akem
contradictioned has quit [Read error: Connection reset by peer]
contradictioned has joined #ruby
johnny56 has quit [Remote host closed the connection]
ellcs has joined #ruby
salinasc has quit [Ping timeout: 240 seconds]
sandstrom has quit [Ping timeout: 252 seconds]
absolutejam2 has joined #ruby
hiroaki has joined #ruby
dinfuehr_ has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
johnny56 has joined #ruby
orbyt_ has joined #ruby
wymillerlinux has quit [Quit: wymillerlinux]
wymillerlinux has joined #ruby
henninb has joined #ruby
henninb has quit [Client Quit]
Esa_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mossplix has joined #ruby
poontangmessiah has quit [Quit: Leaving]
drincruz has quit [Ping timeout: 240 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
brool has joined #ruby
alayde has joined #ruby
dionysus69 has joined #ruby
Rhedd has joined #ruby
<Rhedd> Funny political memes http://www.redpillmemes.com
Rhedd has quit [Client Quit]
<alayde> I have a question in regards to a bit of a learning exercise I'm undergoing- I have a 1000 line file that I'm attempting to parse using four forks. Fork number one takes lines 1-250, fork two takes 251-500, etc. To avoid having to load the whole file into memory I'm using File.foreach, and giving each fork its assigned number of lines to read/process. Unfortunately this seems to result in blocking IO as only
<alayde> one fork can read the file at a time. Is there perhaps a flag I can pass to foreach to allow for non-blocking reads? I've been peruising the IO docs but can't seem to put the pieces together and this is something a bit newer for me to try and tackle in Ruby.
<phaul> personally I would open the file 4 times
<phaul> 4 file descriptors, nothing to do with each other
<phaul> the next problematic bit is knowing where the second,third or fourth thread has to start reading.. You can seek to a byte position. But if the 1000 lines don't infer that information (ie different line sizes) then you don't know in thread 2 where to start from
<havenwood> alayde: lines are variable length?
<alayde> havenwood: They are, yeah.
<phaul> yeah probably the best you can do is count down 250 lines in thread #2, as you don't know the byte position...
xGrind has quit [Quit: Saindo]
<alayde> phaul: that's kind of where I ended up last night
<phaul> right. but if you open 4 file descriptors, you still can make it work, you won#t ate least get the "one fork can read at a time" issue
akemhp_ has joined #ruby
<phaul> won't get at least*
<alayde> phaul: Alright, perfect. I'll head down that path then, which is most helpful. Thank you
<phaul> yw
<alayde> Ideally I wouldn't want to introduce this kind of complexity when parsing a file, but ya know- sometimes you get a crazy idea in your head and have to try it haha
<havenwood> alayde: You could try IO#advice with :sequential fwiw: https://docs.ruby-lang.org/en/2.6.0/IO.html#method-i-advise
absolutejam2 has quit [Ping timeout: 268 seconds]
akem has quit [Ping timeout: 265 seconds]
<alayde> havenwood: Okay, cool. I'll check into that too, see if it can help get me what I'm looking for
<alayde> thank you!
<havenwood> alayde: dunno the boundaries of your experiment, but this reminds me of ioquatix's awesome Fiber-backed async-io lib. You can pair that with Falcon webserver to. have your IO be non-blocking: https://github.com/socketry/async-io
salinasc has joined #ruby
<havenwood> i've bee meaning to try out his fiber/process lib too - looked neat: https://github.com/socketry/process-group
<alayde> Oh nice, I'll have to add that to my list of things to check out too. Admittedly concurrent/parallel programming is not my strong suit so this is all one big learning experience. I'm starting off small, so atm my boundaries are just focus on this 1000 line file
mossplix has quit [Remote host closed the connection]
hiroaki has quit [Ping timeout: 252 seconds]
<alayde> havenwood, phaul: thanks again for your help, I'll wander back in if I have any other questions. Take care
alayde has left #ruby ["WeeChat 2.3"]
<phaul> happy days...
<phaul> havenwood: did you see @ offtopic I signed up for my first rails girls?
<havenwood> phaul: woot!
<phaul> yeah. how's the little one coming along ? I hope everything is in order? when's due?
Ai9zO5AP has quit [Ping timeout: 240 seconds]
BH23 has joined #ruby
AJA4350 has quit [Ping timeout: 276 seconds]
<phaul> btw; sorry if I was too personal...
ur5us has joined #ruby
<havenwood> phaul: All is well afaik! March 12.
<phaul> cool then! exciting times :D
Intelo has quit [Remote host closed the connection]
Ai9zO5AP has joined #ruby
ur5us has quit [Ping timeout: 265 seconds]
mikecmpbll has joined #ruby
Ai9zO5AP has quit [Read error: Connection reset by peer]
Ai9zO5AP has joined #ruby
hiroaki has joined #ruby
Ai9zO5AP has quit [Read error: Connection reset by peer]
MinSrodowiska has joined #ruby
hiroaki has quit [Read error: Connection reset by peer]
hiroaki has joined #ruby
mossplix has joined #ruby
salinasc has quit [Ping timeout: 246 seconds]
Ai9zO5AP has joined #ruby
queip_ has joined #ruby
queip has quit [Ping timeout: 265 seconds]
queip_ is now known as queip
foo66 has joined #ruby
<foo66> Hello....I need help understanding why bundler prebuilts module in my root file
dkmueller has joined #ruby
<phaul> foo66: we are all ears. tell us the details
<foo66> Anyone familiar with bundler and Ruby executables?
<havenwood> foo66: Ask away!
<phaul> probably. or maybe not. just lay out what you are faceing and if anybody can help "they will likely do so"
<foo66> Getting used to freenode ...sorry for my time delay
dkmueller has quit [Quit: WeeChat 2.3]
dkmueller has joined #ruby
<foo66> Also regarding terminal commands:. What is purpose behind Ruby -Ilib
akem__ has joined #ruby
cyclonis_ has quit [Ping timeout: 246 seconds]
<phaul> -Ilib tells ruby to look for files in the said directory when someone does require. It becomes partof the load path which is accessable by $:
<phaul> &>> $:
<rubydoc> # => ["/usr/lib/ruby/site_ruby/2.6.0", "/usr/lib/ruby/site_ruby/2.6.0/x86_64-linux",... check link for more (https://carc.in/#/r/7wcx)
akemhp_ has quit [Ping timeout: 240 seconds]
cyclonis has joined #ruby
<foo66> Phaul, (still noob here) it seems to be the same as say: ruby foo.rb
Intelo has joined #ruby
<havenwood> foo66: It's just like that, but with the -I flag, which is: Used to tell Ruby where to load the library scripts. Directory path will be added to the load-path variable ($:).
<havenwood> foo66: $: is the same as $LOAD_PATH.
<havenwood> (Aliases.)
<havenwood> foo66: See `ruby -h` or `man ruby` for info on -I and other option flags.
dkmueller has quit [Quit: WeeChat 2.3]
akemhp has joined #ruby
<foo66> Ok... I wanted to make sure it didn't have special relevance for executables such as in /foo I am taught to run ruby -Ilib ./bin/foo
<havenwood> foo66: $LOAD_PATH is where #require will look to find code. By adding -I/path/to/dir you make a specific directory available for loading code.
dkmueller has joined #ruby
<foo66> Ok got it thanks
suukim has quit [Quit: Konversation terminated!]
akem__ has quit [Ping timeout: 240 seconds]
akemhp has quit [Read error: Connection reset by peer]
akemhp_ has joined #ruby
<havenwood> foo66: As to your SO question, lib/foo.rb is a RubyGems convention. The file structure should mirror your namespace structure.
<havenwood> foo66: Follow convention for the gem name: https://guides.rubygems.org/name-your-gem/
<foo66> Yes I am aware of this but why does bundler create module Foo
<havenwood> foo66: And use consistent pattern inside lib: https://guides.rubygems.org/patterns/#consistent-naming
<havenwood> foo66: A gem needs a namespace. That namespace should match the gem name and be either a class or module.
<havenwood> foo66: A `foo` gem should have a `lib/foo.rb` that is a `Foo` class or module.
<havenwood> foo66: Bundler uses a module since that's the simplest possible thing. If you need state, switch that to a class.
<havenwood> foo66: With a bundler-scaffolded gem, you'll not use bin/ dir for your executables (that IS the RubyGems patter, but not Bundler).
<havenwood> foo66: Bundler uses bin/ as a helper dir and exe/ for executables.
akemhp_ has quit [Read error: Connection reset by peer]
<havenwood> foo66: The RubyGems. default is `bin` but Bundler switches it to `exe`.
<havenwood> foo66: Check your gemspec file.
<foo66> Ok :. So is that why Module Foo class Error < StandardError;end end breaks my exuctu
akemhp has joined #ruby
AJA4350 has joined #ruby
<havenwood> foo66: Show your code?
<havenwood> foo66: You're likely messing up the executable. We can show you how to fix it.
<havenwood> foo66: Seeing the code would make it way easier for us to assist.
<foo66> It's actually on SO the snippet at least
johnny56_ has joined #ruby
<havenwood> The relevant parts aren't in that snippet.
johnny56 has quit [Ping timeout: 240 seconds]
<havenwood> I'd need to see your gemspec.
bvdw has quit [Read error: Connection reset by peer]
<foo66> Ok is there anywhere I can upload the entire tree it is very small
<havenwood> foo66: Github?
absolutejam2 has joined #ruby
<havenwood> foo66: https://github.com/
mossplix has quit [Remote host closed the connection]
bvdw has joined #ruby
<foo66> Give me a moment...usually I reserve GitHub for decent code lol
<havenwood> foo66: Haha, I don't!
<havenwood> I have tons of dubious code on GitHub.
<havenwood> >.>
queip has quit [Ping timeout: 245 seconds]
<havenwood> Proud I got a star on this one: https://github.com/havenwood/empty
<phaul> 2 :D
<havenwood> hahaha
queip_ has joined #ruby
queip_ is now known as queip
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mossplix has joined #ruby
<foo66> GitHub.com/mepyyeti/foodie
<foo66> Fyi I worry TREMENDOUSLY about my stars on GitHub and rubygems. I actually cover that part of the screen...still learning
<foo66> Pull requests are the worst!!! Complete confidence killers
dkmueller has quit [Ping timeout: 264 seconds]
MinSrodowiska has quit [Quit: Bye Bye]
<havenwood> foo66: I have RubyGems covered well on that one (with gems I didn't author): https://rubygems.org/profiles/havenwood
akemhp_ has joined #ruby
<havenwood> foo66: Here, you set your executable directory to "exe": https://github.com/mepyyeti/foodie/blob/master/foodie.gemspec#L27
Fernando-Basso has quit [Ping timeout: 252 seconds]
<havenwood> foo66: mkdir exe && cd exe && touch foo && chmod +x foo && echo "#!/usr/bin/env ruby" >> foo
<havenwood> foo66: Then you can run the executable with just: bin/foo
<havenwood> foo66: Once you install the gem, you can use just: foo
dkmueller has joined #ruby
akemhp has quit [Ping timeout: 268 seconds]
<havenwood> foo66: Does that make sense?
<foo66> I have to think about this to understand it lol my apologies
<havenwood> foo66: Yeah, PRs are tough but just persevere! I often feel really silly after the first PR review.
<foo66> Conceptually it makes sense.
lucasb has quit [Quit: Connection closed for inactivity]
BH23 has quit [Remote host closed the connection]
<havenwood> foo66: I mistyped above >.>, should have said: Then you can run the executable with just: exe/foo
<foo66> My hiccup is how do I treat exe in my gemspec. I pretty much ignore the ext in my gem file
<foo66> What about if I need to share it with others who maybe run windows or don't have ruby installed
<havenwood> foo66: You need Ruby to run Ruby code, typically. Ruby is preinstalled on macOS and many Linux distros but you'd need to ship Ruby with your code for Windows.
<foo66> Chmod +x is shortform for chmod a+x correct?
<havenwood> foo66: yup
<havenwood> foo66: There are a few solutions for shipping Ruby with your code or packing it into an executable.
<foo66> I always figured exe compiled to machine code
<havenwood> foo66: ruby-packer can do that.
<havenwood> foo66: or there's traveling-ruby: https://github.com/phusion/traveling-ruby
<foo66> Chmod is fantastic...but takes a while to really get a feel for it! I am still working on the number equivalent of chmod
<foo66> Which is easier to interact with packer or traveling? I've heard packer is difficult to wrangle down
<havenwood> foo66: packer is fancier in that you get a single executable. traveling ruby is less magic.
mossplix has quit [Remote host closed the connection]
<havenwood> foo66: Or there's mruby.
<foo66> To run exe/foo I do not have to be in /foo
<havenwood> foo66: MRuby is a subset of Ruby but can be embedded in C and compiled to an executable.
<havenwood> foo66: JRuby can also ship a JAR.
<havenwood> foo66: yes
<havenwood> foo66: Or add exe to your PATH.
Jonopoly has joined #ruby
<havenwood> foo66: When you build the gem, RubyGems will make it available in the RubyGems bin/ dir - which is presumably in your PATH.
<havenwood> foo66: In development, from the gem root directory, you can just: exe/foo
<havenwood> foo66: Once you install the gem, just: foo
<foo66> Gem root is always lib/foo.rb correct?
<havenwood> foo66: Yes, that's the convention for a regular gem. If it's a plugin it might be: lib/other_gem/foo.rb
<havenwood> Which would be a gem named: other_gem-foo
<foo66> But shouldn't it then be ../bin/foo?
<havenwood> foo66: With a Bundler scaffolded gem, you'll not use the bin/ dir at all.
<foo66> Also when u say "When you build the gem, RubyGems will make it available in the RubyGems bin/ dir - " what is IT specifically
<havenwood> foo66: It's a helper dir in Bundler's mind. Neither library code nor executables go in bin/ directory.
henninb has joined #ruby
<havenwood> foo66: IT is the executable files.
<havenwood> foo66: How familiar are you with PATH generally?
henninb has quit [Client Quit]
<foo66> That's in exe as far as bundler is concerned
<havenwood> foo66: yes
conta has joined #ruby
<havenwood> foo66: Bundler changes the default from bin/ to exe/ for the executable directory.
<foo66> I get the occasional hiccups between require_relative and require...but I'm ok I think with PATH
<foo66> I can navigate Linux paths fine...struggle Abit with gems due to conventions
mossplix has joined #ruby
MinSrodowiska has joined #ruby
<havenwood> foo66: Let me give some context unrelated to Ruby. When you run a command from terminal on a posix system, it'll see if there's an alias, a function, shell built-in then it'll look at the $PATH environment variable. If none are found, you'll get something like: command not found
<foo66> Yes I read that I. The docs....don't understand the thinking there...makes it harder for noobs
<havenwood> foo66: PATH is a colon-delimited list of directories to search for the commannd.
henninb has joined #ruby
<havenwood> foo66: See: printenv PATH
<havenwood> foo66: Or: echo $PATH
<foo66> I have successfully edited my $PATH before👏
<havenwood> foo66: It'll check each directory, in order. So if you type `foo` it'll try first/directory/foo and so on for every directory in PATH.
<havenwood> foo66: Check your PATH and see how the RubyGems bin/ directory is there.
<havenwood> foo66: When you install this gem, the files in your exe/ directory will appear in that folder.
<havenwood> foo66: echo $(gem env gemdir)/bin
<havenwood> foo66: echo $PATH
<havenwood> foo66: So, your gemspec is saying to violate the RubyGems convention of bin/ and instead use exe/ for where to look for executables to add to the RubyGems bin/ directory, which is presumably in your PATH.
<havenwood> foo66: I can say more but will stop if that ^ makes sense.
<foo66> My gems are is var/lib/gems/2.3.0/gem which I added to my PATH
<havenwood> foo66: Take a look at this directory: echo $(gem env gemdir)/bin
<havenwood> foo66: That's ^ where gem executable shims live.
<havenwood> That's the directory that should be in your PATH.
mossplix has quit [Read error: Connection reset by peer]
<havenwood> You install your gem, a shim to its executable gets put in that directory. You type `foo` and it finds it there.
InfinityFye has joined #ruby
<foo66> Sorry but spec.bindir = "exe" is necessary correct?
greengriminal has joined #ruby
<foo66> In my gemspec that is
ur5us has joined #ruby
<foo66> How do find gem env gemdir? Specifically.
<havenwood> foo66: type: gem env gemdir
<havenwood> foo66: (from the command line)
<havenwood> foo66: see: gem env -h
<havenwood> foo66: `spec.bindir = "exe"` was generated by Bundler. It changes the default bindir from "bin" to "exe" and nothing else.
<havenwood> It was "bin" and that line makes it "exe" which is what Bundler intended to do because they wanted bin/ for a development purpose. I don't agree with that choice, and think Bundler should default to RubyGems' choice, but not a fight I care to wage with a PR.
mikecmpbll has quit [Quit: inabit. zz.]
<havenwood> I talked about it with rubygems and bundler maintainers at rubyconf. I don't like the idea of adding `./bin` to PATH at all, personally, so I don't care for the Bundler pattern.
<havenwood> A relative path in PATH makes me nervous. I don't like it.
* havenwood grumbles
<foo66> Of course...but I'm reconfirming . Kudos for getting invited to rubyconf. Wish that'd be me lol
InfinityFye has quit [Quit: Leaving]
<havenwood> I've been nine years in a row but haven't been invited once!
<havenwood> foo66: You're free to go! https://rubyconf.org/
<havenwood> foo66: RubyKaigi is fun too, if you can get to Japan.
<foo66> In my `ruby environment` my `executable directory` is /use/local/bin` and it's in my path so I am happy about that
mossplix has joined #ruby
<foo66> My gemdir is /car/lib/gems/2.3.0 but also in my PATH
<foo66> Fyi I remember reading the change from .bin to .exe relates to rspec treating and the sort
<foo66> Testing not treating lol
hutch1 has joined #ruby
Inline__ has quit [Quit: Leaving]
<foo66> Curious:. What is the benefit of an exe if the code still needs to be interpreted by ruby?
Inline has joined #ruby
AJA4351 has joined #ruby
<havenwood> foo66: RubyGems executables aren't compiled into binaries. They run via the interpreter specified via their shebangs.
<havenwood> foo66: That's a common pattern. If you look at git commands, for example, many are compiled but many have shebangs for perl.
<havenwood> foo66: Same with your system commands.
bethhaubert has joined #ruby
bethhaubert has left #ruby [#ruby]
AJA4350 has quit [Ping timeout: 264 seconds]
AJA4351 is now known as AJA4350
blackmesa has joined #ruby
bhaubert has joined #ruby
matheusmoreira has quit [Ping timeout: 265 seconds]
<bhaubert> I have a question about PostGIS
duderonomy has joined #ruby
queip_ has joined #ruby
queip has quit [Ping timeout: 268 seconds]
queip_ is now known as queip
poontangmessiah has joined #ruby
yokel has quit [Ping timeout: 245 seconds]
yokel has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
bitwinery has joined #ruby
bitwinery has quit [Remote host closed the connection]
cd has joined #ruby
bitwinery has joined #ruby
bhaubert has quit [Quit: bhaubert]
matheusmoreira has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
schne1der has quit [Ping timeout: 240 seconds]
cyclonis_ has joined #ruby
shirak has quit [Ping timeout: 250 seconds]
Fernando-Basso has joined #ruby
cyclonis has quit [Ping timeout: 252 seconds]
chalkmonster has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
<foo66> @havenwood I should ask how many mirrors does rubygems have?
AJA4351 has joined #ruby
<havenwood> foo66: Many! I don't know.
wymillerlinux has quit [Remote host closed the connection]
<havenwood> foo66: You can run your own easily.
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<foo66> Actually...that would be amazing
dionysus69 has quit [Ping timeout: 245 seconds]
<foo66> It does make gaging real downloads very hard tho
Technodrome has quit [Ping timeout: 240 seconds]
wymillerlinux has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
bambanx has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
<foo66> @havenwood sorry just realized something...with my ruby executable. If I mkdir exe && touch foo. Why am I still going through bin/foo instead of exe/foo. Unless /bin corresponds to my #! Not my gem tree
<havenwood> foo66: exe/foo only, no bin/
Nicmavr has joined #ruby
<foo66> That makes sense ... And I don't really need #bindir it's set to exe by default
kx has quit [Ping timeout: 240 seconds]
<havenwood> foo66: Or delete contents of bin/ that was scaffolded, delete the bindir line from your gemspec, and use bin/ for executables.
<havenwood> foo66: Your call.
<foo66> Meant #bindir="exe" obviously
<havenwood> yup
<foo66> Or I can rn bin/ to exe/
drincruz has joined #ruby
johnny56 has joined #ruby
<foo66> My understanding is is bundler defaults to exe ...so if no#bindir line, then bundler assumes exe on its own
johnny56_ has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
<havenwood> foo66: It's a RubyGems thing. If you delete the line, it defaults to "bin".
mossplix has quit [Remote host closed the connection]
<havenwood> foo66: Bundler generated the gemspec file, and with that line overwrote the default.
<havenwood> foo66: If you delete the line, the behavior reverts to default, "bin" #bindir.
<havenwood> foo66: Give it a try.
A124 has joined #ruby
A124 has quit [Client Quit]
akem__ has joined #ruby
<foo66> I `mv bin/ exe/` Then `ruby exe/foo` loaderror
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
akemhp_ has quit [Ping timeout: 240 seconds]
cyclonis_ has quit [Ping timeout: 268 seconds]
Esa_ has quit [Ping timeout: 276 seconds]
<havenwood> foo66: Push your changes to GitHub so we can see them?
<havenwood> foo66: It'd not be `ruby exe/foo`, just `exe/foo`.
<havenwood> foo66: From the gem root directory, type: exe/foo
cyclonis has joined #ruby
<foo66> Ok give me a sex
<foo66> Sec***
sagax has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
hutch1 has quit [Remote host closed the connection]
<foo66> Bash: #! : Event not found
hutch1 has joined #ruby
chalkmonster has quit [Client Quit]
<foo66> I fixed the bash error ...🤞
shirak has joined #ruby
ellcs has joined #ruby
jantje has quit [Remote host closed the connection]
henninb has quit [Quit: leaving]
TomyLobo has quit [Read error: Connection reset by peer]
dkmueller has quit [Quit: WeeChat 2.3]
dkmueller has joined #ruby
ellcs has quit [Ping timeout: 264 seconds]
shirak has quit [Ping timeout: 265 seconds]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
TheMoonMaster has quit [Quit: Later!]
foo66 has quit [Remote host closed the connection]
TheMoonMaster has joined #ruby
dbugger has quit [Quit: Leaving]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
salinasc has joined #ruby
davor_ has joined #ruby
davor has quit [Ping timeout: 268 seconds]
davor_ is now known as davor
code_zombie has quit [Quit: Leaving]
hutch1 has quit [Ping timeout: 245 seconds]
hutch1 has joined #ruby
drincruz has quit [Ping timeout: 276 seconds]
clemens3 has quit [Quit: WeeChat 1.6]
hiroaki has quit [Ping timeout: 276 seconds]
dkmueller has quit [Quit: WeeChat 2.3]
Spitfire has quit [Ping timeout: 240 seconds]
xpitr has quit [Ping timeout: 246 seconds]
MzrE has joined #ruby
Spitfire has joined #ruby
Spitfire has joined #ruby
Spitfire has quit [Changing host]
xpitr has joined #ruby
<havenwood> foo, ah, they left
cyclonis has quit [Ping timeout: 268 seconds]
cyclonis_ has joined #ruby
MinSrodowiska has quit [Quit: Bye Bye]
tpanarch1st has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.5]
greengriminal has joined #ruby
greengriminal has quit [Client Quit]
greengriminal has joined #ruby
ElFerna has joined #ruby
teardown has quit [Ping timeout: 268 seconds]
Fernando-Basso has quit [Ping timeout: 265 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]