<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]
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>
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]
<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>
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
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…]