Skip to content

Commit 1658c40

Browse files
committed
Improve documentation.
1 parent 926bdfa commit 1658c40

4 files changed

Lines changed: 22 additions & 10 deletions

File tree

ext/gettextpo/gettextpo.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/**
2-
* Copyright (C) 2026 gemmaro
1+
/* Copyright (C) 2026 gemmaro
32
*
43
* This program is free software: you can redistribute it and/or modify
54
* it under the terms of the GNU General Public License as published by
@@ -495,7 +494,7 @@ gettextpo_po_message_m_add_filepos (VALUE self, VALUE file, VALUE start_line)
495494
/**
496495
* call-seq: check_all (iterator, xerror: nil, xerror2: nil)
497496
*
498-
* See also GettextPO::File.read.
497+
* See also GettextPO::File.read for exception error handlings.
499498
*/
500499
VALUE
501500
gettextpo_po_message_m_check_all (int argc, VALUE *argv, VALUE self)
@@ -522,7 +521,7 @@ gettextpo_po_message_m_check_all (int argc, VALUE *argv, VALUE self)
522521
/**
523522
* call-seq: check_format (xerror: nil, xerror2: nil)
524523
*
525-
* See also GettextPO::File.read.
524+
* See also GettextPO::File.read for exception error handlings.
526525
*/
527526
VALUE
528527
gettextpo_po_message_m_check_format (int argc, VALUE *argv, VALUE self)
@@ -580,7 +579,8 @@ gettextpo_po_file_m_initialize (VALUE self)
580579
* +multiline+, and +message_text+. +xerror2+ takes keyword arguments
581580
* +severity+, +message1+, +filename1+, +lineno1+, +column1+,
582581
* +multiline1+, +message_text1+, +message2+, +filename2+, +lineno2+,
583-
* +column2+, +multiline2+, and +message_text2+.
582+
* +column2+, +multiline2+, and +message_text2+. See also GettextPO
583+
* for general exception handlings.
584584
*/
585585
VALUE
586586
gettextpo_po_file_m_read (int argc, VALUE *argv, VALUE klass)
@@ -607,7 +607,7 @@ gettextpo_po_file_m_read (int argc, VALUE *argv, VALUE klass)
607607
/**
608608
* call-seq: write (filename, xerror: nil, xerror2: nil)
609609
*
610-
* See also ::read.
610+
* See also ::read for exception error handlings.
611611
*/
612612
VALUE
613613
gettextpo_po_file_m_write (int argc, VALUE *argv, VALUE self)
@@ -656,7 +656,7 @@ gettextpo_po_file_m_message_iterator (int argc, VALUE *argv, VALUE self)
656656
}
657657

658658
/**
659-
* call-seq: domain_header (domain)
659+
* call-seq: domain_header (domain = nil)
660660
*
661661
* +domain+ can be +nil+ to use a default. Possibly returns +nil+.
662662
*
@@ -675,7 +675,7 @@ gettextpo_po_file_m_domain_header (int argc, VALUE *argv, VALUE self)
675675
/**
676676
* call-seq: check_all (xerror: nil, xerror2: nil)
677677
*
678-
* See also ::read.
678+
* See also ::read for exception error handlings.
679679
*/
680680
VALUE
681681
gettextpo_po_file_m_check_all (int argc, VALUE *argv, VALUE self)
@@ -842,6 +842,8 @@ gettextpo_po_format_list (VALUE self)
842842
* call-seq: format_pretty_name (format)
843843
*
844844
* Possibly returns +nil+.
845+
*
846+
* See also ::formats method for available format types.
845847
*/
846848
VALUE
847849
gettextpo_po_format_pretty_name (VALUE self, VALUE format)

ext/gettextpo/gettextpo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
/**
2-
* Copyright (C) 2026 gemmaro
1+
/* Copyright (C) 2026 gemmaro
32
*
43
* This program is free software: you can redistribute it and/or modify
54
* it under the terms of the GNU General Public License as published by

lib/gettextpo.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020

2121
# The main entrypoints to parse PO files are GettextPO::File.new and
2222
# GettextPO::File.read.
23+
#
24+
# == Error handling
25+
#
26+
# Some functions takes exception error handling paramters like
27+
# +xerror+ and +xerror2+. These parameters expect +Proc+ object which
28+
# takes several parameters. See also the description of
29+
# GettextPO::File.read method. The +severity+ parameter among these
30+
# parameters is either SEVERITY_WARNING, SEVERITY_ERROR, or
31+
# SEVERITY_FATAL_ERROR.
32+
#
2333
module GettextPO
2434
class Error < StandardError; end
2535

lib/gettextpo/version.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
#++
1919

2020
module GettextPO
21+
# Version of this gem.
2122
VERSION = "0.1.0"
2223
end

0 commit comments

Comments
 (0)