ruby-rice / rice

Ruby Interface for C++ Extensions
http://ruby-rice.github.io/
Other
378 stars 63 forks source link

Documentation #187

Closed mvastola closed 1 year ago

mvastola commented 1 year ago

Hi, First of all, thanks for this great gem. I just started playing with it, and if you don't mind I had a few minor nitpicks that came as I am trying to debug something.

Specifically, I'm currently trying to fix an error*, and was looking at the documentation re: STL documentation.

I know these are minor, but the last one at least made me actually try making this (albeit illogical) change on the off chance it would fix my problem.

Thanks again!


* Off topic (and no pressure), but here it is if you have any immediate ideas. (I haven't given up on figuring it out myself yet, so not making another ticket for it just yet.)

  terminate called after throwing an instance of 'std::invalid_argument'
what():  Type is not defined with Rice: std::vector<SimpleBLE::Adapter, std::allocator<SimpleBLE::Adapter> >
  Aborted (core dumped)

** Looks like just typoed it once and that happened to be in markup you reused elsewhere as a template.

jasonroelofs commented 1 year ago

Ah, sure enough, thanks for pointing these out, I will get them fixed.

As for your error, that often comes from trying to use a type conversion before it's defined. Order of operations gets important here. However hard to say more without seeing the code in question, if that's possible.

mvastola commented 1 year ago

I figured out the error. It was dumb. I forgot to include rice/stl.hpp, which was dumb, but I guess there isn't a good way to alert about that error.

Having another issue with callbacks/segfaults right now, which will be fun to debug :upside_down_face: . Might have questions at some point.

If you're interested, just put up what I've done at https://github.com/mvastola/SimpleRbBLE. I'm really excited by how little code it took to get this working to the extent that it is. Not stable or anything, but much further than I had hoped for for the time I put in.

mvastola commented 1 year ago

Disregard. Making a separate issue.

Oh, (let me know if I should make an issue for this): I'm not sure why, but there seems to be an issue with the published gem (forcing me to use git): lib/rice.rb seems to be missing from the version installed by gem/bundle.

Just in case you weren't aware.

mvastola@vastdesk:~/tmp$ gem unpack rice && ls -l rice-4.1.0/lib/ && rm -Rf rice-4.1.0
Unpacked gem: '/tmp/mvastola/rice-4.1.0'
total 12
-rw-r--r-- 1 mvastola mvastola 4322 Aug 13 20:47 mkmf-rice.rb
-rw-r--r-- 1 mvastola mvastola   36 Aug 13 20:47 version.rb
jasonroelofs commented 1 year ago

These fixes have been applied. Thanks!