<feed xmlns='http://www.w3.org/2005/Atom'>
<title>notmuch/bindings/ruby/init.c, branch debian/0.33-2</title>
<subtitle>thread-based email index, search, and tagging</subtitle>
<id>https://git.notmuchmail.org/git/notmuch/atom?h=debian%2F0.33-2</id>
<link rel='self' href='https://git.notmuchmail.org/git/notmuch/atom?h=debian%2F0.33-2'/>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/'/>
<updated>2021-08-02T16:49:29Z</updated>
<entry>
<title>ruby: split database close and destroy</title>
<updated>2021-08-02T16:49:29Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-07-07T03:45:32Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7415b53fa568a3156ae3e3a47544a4784e024653'/>
<id>urn:sha1:7415b53fa568a3156ae3e3a47544a4784e024653</id>
<content type='text'>
Mirrors the C API: 7864350c (Split notmuch_database_close into two
functions, 2012-04-25).

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: create an actual wrapper struct</title>
<updated>2021-07-18T20:08:42Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-17T19:39:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=02b162116079a0b2e35823e5590a82056d22c8af'/>
<id>urn:sha1:02b162116079a0b2e35823e5590a82056d22c8af</id>
<content type='text'>
Currently Ruby data points directly to a notmuch object (e.g.
notmuch_database_t), since we don't need any extra data that is fine.

However, in the next commit we will need extra data, therefore we create
a new struct notmuch_rb_object_t wrapper which contains nothing but a
pointer to the current pointer (e.g. notmuch_database_t).

This struct is tied to the Ruby object, and is freed when the Ruby
object is freed by the garbage collector.

We do nothing with this wrapper, so no functionality should be changed.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: add keyword arguments to db.query</title>
<updated>2021-06-27T17:13:03Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-24T02:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=814abafc3e4280de115d4bc0ac01f8d026a0a7f9'/>
<id>urn:sha1:814abafc3e4280de115d4bc0ac01f8d026a0a7f9</id>
<content type='text'>
That way we don't need pass them to the query object ourselves.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: use notmuch_exclude_t enum</title>
<updated>2021-05-23T12:05:33Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-01T12:04:46Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=85ae2bcf56021a22a803fbde34baa5050bbb28d9'/>
<id>urn:sha1:85ae2bcf56021a22a803fbde34baa5050bbb28d9</id>
<content type='text'>
It exists since 2013, let's allow it to be used in Ruby.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: new notmuch_rb_object_destroy() helper</title>
<updated>2021-05-17T10:25:14Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-15T21:21:03Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=5f49e3421f5d1f98951b55dd5ba106c2a106aba7'/>
<id>urn:sha1:5f49e3421f5d1f98951b55dd5ba106c2a106aba7</id>
<content type='text'>
The struct used to store the types (rb_data_type_t) contains a "data"
field where we can store whatever we want. I use that field to store a
pointer to the corresponding destroy function. For example
notmuch_rb_database_type contains a pointer to notmuch_database_destroy.

I cast that pointer as a notmuch_status_t (func*)(void *) and call
that function passing the internal object (e.g. notmuch_database_t).

Using the rb_data_type_t data we can call the correct notmuch destroy
function.

Therefore this:

  ret = ((notmuch_status_t (*)(void *)) type-&gt;data) (nm_object);

Is effectively the same as this:

  ret = notmuch_database_destroy (database);

The advantage of doing it this way is that much less code is necesary
since each rb_data_type_t has the corresponding destroy function stored
in it.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: add all data types</title>
<updated>2021-05-17T10:25:14Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-15T21:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=9574fb60991fa81799fbd1d26d41693ca2794e6b'/>
<id>urn:sha1:9574fb60991fa81799fbd1d26d41693ca2794e6b</id>
<content type='text'>
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: move towards more modern RTypedData</title>
<updated>2021-05-17T10:25:14Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-05-15T21:21:01Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=fba9774a81e90a179ccfa810c47a501eaf266e2b'/>
<id>urn:sha1:fba9774a81e90a179ccfa810c47a501eaf266e2b</id>
<content type='text'>
Virtually the whole ruby core moved from RData to RTypeData, let's do so
ourselves too.

Basically the information typically passed through Data_Wrap_Struct is
now stored in a struct rb_data_type_t (mark and free functions). This
has the advantage that more information can be easily added, like the
name of the type, a custom data ponter, and more.

Data_Wrap_Struct is replaced with TypedData_Wrap_Struct, and the
information is stored in a struct rb_data_type_t, rather than passed
as arguments.

Check_Type is replaced with Check_TypedStruct, which is a wrapper for
rb_check_typeddata (with casts).

        #define Check_TypedStruct(v, t)      \
            rb_check_typeddata(RBIMPL_CAST((VALUE)(v)), (t))

We can use rb_check_typeddata directly, just like we use rb_data_object_get
directly.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>ruby: fix ruby 3.1 warnings</title>
<updated>2021-04-19T00:42:43Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2021-04-16T20:27:31Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=62f03b6ab86bdc378198f9c1a86cb51ead289961'/>
<id>urn:sha1:62f03b6ab86bdc378198f9c1a86cb51ead289961</id>
<content type='text'>
  init.c:214:5: warning: ‘rb_cData’ is deprecated: by: rb_cObject.  Will be removed in 3.1. [-Wdeprecated-declarations]

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
</content>
</entry>
<entry>
<title>Use https instead of http where possible</title>
<updated>2016-06-05T11:32:17Z</updated>
<author>
<name>Daniel Kahn Gillmor</name>
<email>dkg@fifthhorseman.net</email>
</author>
<published>2016-06-02T16:26:14Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=6a833a6e83865f6999707cc30768d07e1351c2cb'/>
<id>urn:sha1:6a833a6e83865f6999707cc30768d07e1351c2cb</id>
<content type='text'>
Many of the external links found in the notmuch source can be resolved
using https instead of http.  This changeset addresses as many as i
could find, without touching the e-mail corpus or expected outputs
found in tests.
</content>
</entry>
<entry>
<title>ruby: add bindings for `notmuch_database_get_all_tags`</title>
<updated>2016-05-19T11:02:43Z</updated>
<author>
<name>Ludovic LANGE</name>
<email>ll-notmuchmail@lange.nom.fr</email>
</author>
<published>2016-03-06T11:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.notmuchmail.org/git/notmuch/commit/?id=7e6e23c36e290d4b22b0449766a6ef2107f1ef6c'/>
<id>urn:sha1:7e6e23c36e290d4b22b0449766a6ef2107f1ef6c</id>
<content type='text'>
The Ruby bindings were missing a way to get all the tags of the
database. Now you should be able to access this with the public
instance method `all_tags` of your database object.

Example of use:
    notmuchdb = Notmuch::Database.new path, { :create =&gt; false,
    	:mode =&gt; Notmuch::MODE_READ_ONLY }

    my_tags = notmuchdb.all_tags

    my_tags.each { |tag|
      print tag
    }

    my_tags.destroy!

Amended by db: improve error reporting, add test
</content>
</entry>
</feed>
