kwilczynski has quit []
lunarkitty has quit [Quit: Connection closed for inactivity]
goldfish has joined #ruby
goldfish has quit [Ping timeout: 265 seconds]
shrub has quit []
shrub has joined #ruby
nyuszika7h has quit [Ping timeout: 264 seconds]
ur5us_ has quit [Remote host closed the connection]
nyuszika7h has joined #ruby
ur5us_ has joined #ruby
lunarkitty has joined #ruby
gr33n7007h has quit [Ping timeout: 268 seconds]
gr33n7007h has joined #ruby
motherr has joined #ruby
aesthetikx has joined #ruby
motherr_ has quit [Ping timeout: 252 seconds]
ur5us_ has quit [Ping timeout: 264 seconds]
weaksauce has quit [Read error: Connection reset by peer]
motherr has quit [Quit: zzz]
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
gr33n7007h has quit [Ping timeout: 265 seconds]
ur5us_ has joined #ruby
gr33n7001 has joined #ruby
sdfuiojklqaz has quit [Remote host closed the connection]
adempus_ has joined #ruby
<adempus_> can anyonre recommend a resource/book/library for making command line tools with ruby?
gearnode has quit [Ping timeout: 268 seconds]
adempus_ has quit [Remote host closed the connection]
unyu has quit [Quit: WeeChat 3.2]
lucerne has joined #ruby
sdfuiojklqaz has joined #ruby
sdfuiojklqaz has quit [Ping timeout: 258 seconds]
jmcgnh has quit [Quit: ZNC 1.7.5 - https://znc.in]
jmcgnh has joined #ruby
<nakilon> a book on how to put a file in ./bin
jmcgnh has quit [Quit: ZNC 1.7.5 - https://znc.in]
jmcgnh has joined #ruby
niv has quit [Quit: Powered by LunarBNC: https://LunarBNC.net]
niv has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.5 - https://znc.in]
finsternis has quit [Remote host closed the connection]
jmcgnh has joined #ruby
jmcgnh has quit [Quit: ZNC 1.7.5 - https://znc.in]
jmcgnh has joined #ruby
lucerne has quit [Remote host closed the connection]
ur5us_ has quit [Ping timeout: 264 seconds]
lucerne has joined #ruby
willthechill has quit [Ping timeout: 244 seconds]
jetchisel has quit [Ping timeout: 252 seconds]
jetchisel has joined #ruby
reset has quit [Quit: reset]
lucerne has quit [Remote host closed the connection]
elf_fortrez has joined #ruby
<jhass[m]> tbf it could include various CLI parsing methods, ANSI sequences and curses
<elf_fortrez> sounds good
elf_fortrez has quit [Quit: Client closed]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
teclator has joined #ruby
gr33n7001 has quit [Quit: WeeChat 3.2]
<nakilon> I curse too sometimes
<jhass[m]> I figure it's the most aptly named library ever
lucerne has joined #ruby
Rounin has joined #ruby
gearnode has joined #ruby
lucerne has quit [Remote host closed the connection]
lucerne has joined #ruby
goldfish has joined #ruby
lucerne has quit [Remote host closed the connection]
CoolerX has joined #ruby
<CoolerX> Hi
<CoolerX> I am trying to use a jekyll website
<CoolerX> I did bundle install but it gives an error about versions
<CoolerX> this is the Gemfile https://bpa.st/KRCQ
<CoolerX> these are the versions I have installed https://bpa.st/CF3A
<havenwood> CoolerX: The `gemspec` line also means gems from the gemspec are installed. Those seem like super old deps.
<CoolerX> havenwood, bundler update listen gives error saying it needs bundler 2.1.4
<CoolerX> so I can't update
<CoolerX> yes that
<CoolerX> so what do I do?
<havenwood> CoolerX: gem install bundler --version 2.1.4
<havenwood> CoolerX: bundle __2.1.4__
<CoolerX> I want to use the latest version of bundler as well
<havenwood> If you want to update the Gemfile to Bundler 2: bundle update --bundler
<CoolerX> havenwood, isn't the Gemfile already on bundler v2?
<CoolerX> only the minor version seems to be different
<CoolerX> my bundler is 2.2.20
<CoolerX> and the gemfile requires 2.1.4
<havenwood> CoolerX: You can tell from the Gemfile.lock but not the Gemfile, so I don't know.
<CoolerX> yeah in the gemfile I have
<CoolerX> bundler (~> 2.1.4)
<CoolerX> in the Gemfile.lock
<CoolerX> should I edit it manually?
<CoolerX> or maybe delete the lock file?
<havenwood> CoolerX: The `bundle update` command is for updating the Gemfile.lock
<CoolerX> I tried bundler _2.2.20_ update --bundler
<havenwood> CoolerX: bundle update bundler
<CoolerX> that shows https://bpa.st/GJHA
<havenwood> Using bundler 2.2.20
<CoolerX> havenwood, Could not find gem 'bundler'
<CoolerX> you need to put the --bundler
<havenwood> CoolerX: Well, they're two different commands. If Bundler isn't a dep, you don't need the latter. I don't have your code so I'm guesssing.
<CoolerX> even though it shows success v
<CoolerX> it still gives an error when I try the other commands
<CoolerX> same error as before about requiring 2.1.4
<havenwood> CoolerX: What command are you running?
<CoolerX> havenwood, this is the Gemfile https://bpa.st/KRCQ
<havenwood> CoolerX: Yeah, but it references a gemspec you haven't shown.
<havenwood> CoolerX: What command are you running to get an error?
<CoolerX> this is the Gemfile.lock https://bpa.st/IY3A
<havenwood> CoolerX: You've mentioned an error. What are you running to get that error?
<havenwood> CoolerX: So you need to `bundle update bundler` but you need the version of bundler in your bundle to do so.
<CoolerX> you mean bundler _2.1.4_ update bundler ?
<havenwood> CoolerX: gem install bundler --version 2.1.4 && bundler _2.1.4_ update bundler
involans has joined #ruby
<CoolerX> I already have 2.1.4 installed
<havenwood> CoolerX: You have to manually downgrade your Gemfile.lock since Bundler can't.
<CoolerX> no I want to upgrade
<CoolerX> upgrade to latest bundler
<havenwood> CoolerX: Sure, but you have old Bundler as a dep so you need to first upgrade your dep.
<havenwood> CoolerX: Can you just delete the Gemfile.lock, heh.
<nakilon> tip: just remove specific line from gemfile.lock and proceed
<havenwood> CoolerX: BUNDLED WITH
<havenwood> 2.2.16
<CoolerX> which line?
<havenwood> BUNDLED WITH
<nakilon> oh, this one
<CoolerX> hmm
<CoolerX> it says BUNDLED WITH
<CoolerX> 2.2.20
<CoolerX> should I remove both of those?
<nakilon> try changing bundler version in Gemfile to ~>2.2.0
<nakilon> because I suppose~> can't increment the 1
<CoolerX> nakilon, ok
<CoolerX> now what?
<nakilon> bundle install?
<CoolerX> still asks for 2.1.4 for some reason
<CoolerX> the only place where I can find any reference to 2.1.4 is in a file called just-the-docs.gemspec https://bpa.st/67YQ
<CoolerX> should I edit that too?
<nakilon> yeah, try it
<nakilon> though I'm not sure why you have .gemspec in your code
<nakilon> it looks like a separate gem https://github.com/pmarsceill/just-the-docs
<CoolerX> nakilon, what do you mean?
<CoolerX> nakilon, should the gemspec not be there?
<nakilon> you usually have .gemspec in your code when you are developing the gam
<nakilon> like if you was developing the jekyll, not an application (your website) that uses it
<nakilon> though I never used jekyll and have no idea how it works but it's weird
<CoolerX> hmm
<CoolerX> so I should remove it?
<CoolerX> the website is using the just-the-docs theme
goldfish has quit [Remote host closed the connection]
<nakilon> check if the gemfile.lock has updated -- it should give a hint why you depend on this specific version of the just-the-docs gem
<CoolerX> that's when it was added looking at the git commit history
goldfish has joined #ruby
<nakilon> you aren't supposed to put .gemspec of the gem you depend on into your website -- it looks like you've added the ./vendor to your repo probably
<CoolerX> nakilon, don't even have a vendor
<CoolerX> the just-the-docs.gemspec file is at the root
<CoolerX> not inside any folder
<CoolerX> root of the repo
<nakilon> if you can't stop using this dependency and since I see that they depend on 2.1 in their master branch on github, I suppose havenwood was right that you'll have to downgrade, not upgrade
<nakilon> hmmmm
<nakilon> maybe it's some sort of hack to override the dependency gem gemspec? idk
<nakilon> then try to edit it (change to 2.2) and see if it works
CoolerX has quit [Remote host closed the connection]
CoolerX has joined #ruby
<CoolerX> got dced
<CoolerX> nakilon, downgrade to bundler 2.1.4?
<nakilon> 11:56:06 <nakilon> maybe it's some sort of hack to override the dependency gem gemspec? idk
<nakilon> 11:56:30 <nakilon> then try to edit it (change to 2.2) and see if it works
lucerne has joined #ruby
<CoolerX> ok I reset everything to the latest commit
lunarkitty has quit [Quit: Connection closed for inactivity]
<CoolerX> removed the just-the-docs.gemspec file
<CoolerX> removed the gemspec line from the Gemfile
<CoolerX> and now it works
<CoolerX> bundler install works with v2.2.20
<CoolerX> Thanks
CoolerX has left #ruby [Leaving]
lucerne has quit [Read error: Connection reset by peer]
gigamo has quit [Ping timeout: 272 seconds]
gigamo has joined #ruby
unyu has joined #ruby
lunarkitty has joined #ruby
forvelin has joined #ruby
enyc has joined #ruby
<enyc> uerm -- ** https://www.ruby-lang.org/en/community/ pace needs IRC link updated .....
<enyc> page
<enyc> aha apparently < TheGhostOfFN> enyc, they are aware https://github.com/ruby/www.ruby-lang.org/pull/2663
pyfisch has joined #ruby
jla has joined #ruby
involans has quit [Ping timeout: 252 seconds]
unyu has quit [Quit: WeeChat 3.2]
TomyWork has joined #ruby
jla has quit [Ping timeout: 268 seconds]
sdfuiojklqaz has joined #ruby
jla has joined #ruby
lunarkitty has quit [Quit: Connection closed for inactivity]
cdolan has quit [Ping timeout: 252 seconds]
involans has joined #ruby
goldfish has quit [Ping timeout: 258 seconds]
qunzhong_luxian has joined #ruby
jla has quit [Ping timeout: 265 seconds]
dionys has joined #ruby
chonkbit has joined #ruby
cdolan has joined #ruby
drincruz has joined #ruby
cdolan has quit [Ping timeout: 258 seconds]
finsternis has joined #ruby
willthechill has joined #ruby
jla has joined #ruby
<chonkbit> Thought I might share this as it's proved quite benefical for my own use. I've created an ascii85 encoder/decoding gem with native C extensions that is compatible with the pdf-reader gem. It was taking about 10 minutes to parse hundreds of small pdf files before, now it completes in under a minute.
<chonkbit> Here's my fork of pdf-reader that uses the new ascii85_native gem: https://github.com/AnomalousBit/pdf-reader
<chonkbit> should I consider opening an issue / pull request to pdf-reader for this work? I know some places shy away from native extensions, but the performance benefits are pretty great for my use.
reset has joined #ruby
cdolan has joined #ruby
jimeh has joined #ruby
<adam12> chonkbit: Nice.
TomyWork has quit [Remote host closed the connection]
<chonkbit> thanks buddy.
jimeh has quit [Quit: Reconnecting]
jimeh has joined #ruby
justBull has quit [Remote host closed the connection]
justBull has joined #ruby
qunzhong_luxian has quit [Quit: Textual IRC Client: www.textualapp.com]
qunzhong_luxian has joined #ruby
<adam12> chonkbit: Might be worth opening a PR as a suggested addition. Similar to how `sequel_pg` is recommended in certain scenarios.
cdolan has quit [Ping timeout: 265 seconds]
Ziyan has joined #ruby
goldfish has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
Ziyan has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
Ziyan has joined #ruby
jla has quit [Ping timeout: 258 seconds]
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 265 seconds]
kwilczynski has joined #ruby
<chonkbit> adam12: I'm mostly unsure whether it should be some kind of experimental configuration option where you choose which decoder pdf-reader will use? I'm not sure how optional dependencies work for gems in that situation. I also hesitate to completely replace such a mature library: ascii85 has 25mil downloads, mine has barely seen the light of day. These are points I can bring up in the PR though. Thanks for listening to me talk it
<chonkbit> out.
ikonia has joined #ruby
<ikonia> what defines where bundler will look for gems, I installed bundler from my distro package manager then did a bundler update and let it install what I want, yet a bundler rake complains it can't find racc-1.5.2 (it was installed by bundler) suggesting bundler is looking in the wrong place
<adam12> chonkbit: Is it API compatible with the pure Ruby version? I'd probably just submit a PR to have the class configurable, with it defaulting to the current one. Something around here: https://github.com/yob/pdf-reader/blob/b16b892820cddb21dbbe3703f793870e37240e68/lib/pdf/reader/filter/ascii85.rb#L20
<adam12> ikonia: `bundle env` has some helpful bits in it.
<adam12> ikonia: `bundle show racc` might give you a hint on what's going on.
<adam12> chonkbit: Once you had that, in theory maybe something like PDF::Reader.new(io, ascii85: Ascii85Native) would work.
gr33n7007h has joined #ruby
<adam12> chonkbit: Alternatively, provide an option in ascii85native to clobber the ascii85 namespace :) Ascii85 = Ascii85Native
<ikonia> adam12: that's what's confusing me bundle show racc shows could not find racc-1.5.2 in any of the sources
<ikonia> bundler is the thing that installed racc
<adam12> ikonia: Is racc in your Gemfile?
<ikonia> adam12: ahh, that could be the problem
<chonkbit> Great ideas, adam12.
<ikonia> ok the gems are all in /usr/share/gems/gems
<ikonia> surly I don't need to name each gem in the gemfile
<ikonia> it should be looking in /usr/share/gems
<adam12> ikonia: Did you make the Gemfile or did it come with a project?
<adam12> ikonia: The purpose of Bundler and the Gemfile is to isolate specific versions of gems, to reduce "dependency hell". If the gem isn't listed in Gemfile (or is a transient dependency of one that is), then it won't be available when you run `bundle exec`.
<ikonia> adam12: just made it - there is no project yet
<adam12> ikonia: How did you fill /usr/share/gems?
<ikonia> bundle update
<adam12> After you added racc?
neshpion has joined #ruby
<adam12> The flow is: Add gem to `Gemfile`. Run `bundle` (no bundle update - that's different). Then run your program / script with `bundle exec <script>`.
<ikonia> no, bundle update pulled in everything I needed for the one command I want to run, I ran bundle rake exec and it can't find racc
<adam12> All gems you want to use must be in Gemfile.
<ikonia> ok - so my lack of understanding here is the problem
<ikonia> I assumed from basic reading it worked like pkg_config or $PATH where an environment variable told it where to look and the order
<ikonia> I didn't expect to need to define a gem file to run a single command, I thought that was more for a project defining it's needs and dependencies
<adam12> No, that would be GEM_PATH or GEM_HOME.
<adam12> Bundler is for managing application dependencies.
<ikonia> I've totally missunderstood it then
<adam12> What are you building?
<ikonia> not building anything annoyingly need to run bundle rake exec snapshot against a directory to build a snapshot
<adam12> Ah. What's building a snapshot? Is this a specific project?
<ikonia> yeah a ruby project (funny enough) foreman project
<ikonia> need to snapshot the codebase to use in some of the test suit
<adam12> Is it foreman itself?
<ikonia> yes
<adam12> Did you git clone the codebase?
<ikonia> yes
<ikonia> it's my first time submitting to a ruby project so I'm still getting my head around the testing and process
<adam12> Did you follow this at all? https://www.theforeman.org/manuals/2.5/index.html#3.4InstallFromSource
<ikonia> no, as I don't need to install foreman, that and the dev work has been done
<ikonia> I just need to run the rake command in the source directory of the git repo to build a snapshot
<adam12> Maybe just `gem install rake racc`?
<adam12> then forget about `bundle exec` and use `rake snapshot`
<ikonia> interesting, that seems to error in a better way
<ikonia> thank you
jinie has quit [Quit: ZNC 1.8.2 - https://znc.in]
jinie has joined #ruby
Ziyan_ has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ikonia> appreciated
<adam12> ikonia: cheers
chonkbit has quit [Remote host closed the connection]
<nakilon> imagine you have a script that has the line: require "somelib"
<nakilon> how do you make a testing helper for let's say minitest to run the script against mocked somelib?
<nakilon> how would you make the 'require "somelib"' to require your mock instead of the actual lib
<nakilon> I don't want user to require the mock explicitely -- he should be able to add tests without editing the script, and without wrapping his stuff in modules/methods
<nakilon> running his script as it is should result in more reliable testing
<adam12> nakilon: Modify $LOAD_PATH to have the directory where your own "somelib" exists appear before the original path.
drincruz_ has joined #ruby
<nakilon> yeah, it's the only way I imagine too
* nakilon is going to write tests for his irc bot so it won't need to launch another bot instance to test that it works
<nakilon> need some ircd mock, probably there is still GServer somewhere in stdlib
drincruz has quit [Ping timeout: 252 seconds]
<nakilon> or do I need something else
<nakilon> or it's TCPServer?
<adam12> TCPServer should be fine.
<nakilon> looks like chinch repo is archived
<adam12> I wonder if any Ruby IRC bots are still alive.
<nakilon> can't find if any existing irc bot libraries provided the way to write tests, heh
drincruz has joined #ruby
<nakilon> then my one will be the first...
drincruz_ has quit [Ping timeout: 252 seconds]
<nakilon> I wonder why there is no gem called something like "tcpmock"
<nakilon> to be functionally similar to webmock
<nakilon> not that I'm used to webmock but
teclator has quit [Remote host closed the connection]
<nakilon> or maybe I shouldn't mock the library but mock the irc network instead
<nakilon> so I won't need to sync bot lib with test helper
<caleb> the only interface you need to mock is receiving data from the interface right?
<caleb> so you could just mock the accept/receive methods and send whatever data you want
<caleb> the application will never know the difference
<caleb> I would mock the IRC connection personally
chonkbit has joined #ruby
<nakilon> what's the difference between IO.select and Kernel::select?
<nakilon> caleb I now wonder if I should create TCPServer to mock the IRC network or mock the TCPSocket class to mock the socket
<caleb> I would mock the data being returned over the socket
<caleb> so mock the socket
<nakilon> the latter would need me to somehow mock this call though: Kernel::select([socket], nil, nil, 1)
lunarkitty has joined #ruby
Ziyan has joined #ruby
<nakilon> I imagine it as a two side fork: on the left side there is branching into real libera network calls (that takes time and is what I want to avoid) and the mock, on the right side is branching into specific irc bot script and test for this script
<nakilon> and I feel like these two branching points should as far as possible from each other
<nakilon> the is on the right side: NakiIRCBot.start ($0 == __FILE__ ? "irc.libera.chat" : "localhost"), ...
<nakilon> and it would be mocking the network on the left side
<nakilon> of course there is an argument "you should not test the ruby stdlib" to shift the left branching to the border between NakiIRCBot and TCPSocket
Ziyan has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
drincruz_ has joined #ruby
drincruz has quit [Ping timeout: 252 seconds]
jla has joined #ruby
jla has quit [Ping timeout: 268 seconds]
<caleb> there should be separate tests for that
<caleb> you don't need to mock the network side to tests the scripts
<caleb> they should only be testing the expected output
<caleb> unless you're wanting a full end to end integration test instead of just unit tests
postmodern has joined #ruby
<nakilon> yes I don't want to divide the end-to-end in half before I need it
<nakilon> the only real problem that makes me want to make tests is that connecting to the network is slow and printing test commands in chat is boring
cdolan has joined #ruby
ur5us_ has joined #ruby
chonkbit has quit [Ping timeout: 264 seconds]
mollerup has quit [Read error: Connection reset by peer]
qunzhong_luxian has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gearnode has quit [Ping timeout: 268 seconds]
gearnode has joined #ruby
gearnode has quit [Ping timeout: 244 seconds]
drincruz has joined #ruby
drincruz_ has quit [Ping timeout: 265 seconds]
gr33n7007h has quit [Ping timeout: 258 seconds]
gr33n7007h has joined #ruby
henninb has joined #ruby