gettextpo 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile +10 -0
- data/ext/gettextpo/gettextpo.c +19 -0
- data/lib/gettextpo/version.rb +1 -1
- data/mrblib/mrb_gettextpo_common.rb +35 -0
- metadata +3 -24
- data/.clang-format +0 -1
- data/.clangd +0 -2
- data/.dir-locals.el +0 -6
- data/.env.example +0 -2
- data/.envrc +0 -31
- data/.rdoc_options +0 -14
- data/build_config.rb +0 -27
- data/include/mrb_gettextpo.h +0 -24
- data/manifest.scm +0 -43
- data/mrbgem.rake +0 -24
- data/mrblib/mrb_gettextpo.rb +0 -58
- data/mrblib/mrb_gettextpo_version.rb +0 -23
- data/sig/gettextpo.rbs +0 -4
- data/src/mrb_gettextpo.c +0 -942
- data/test.cruby/gettextpo_test.rb +0 -53
- data/test.cruby/resources/a.po +0 -1
- data/test.cruby/resources/bad.po +0 -20
- data/test.cruby/resources/filepos.po +0 -3
- data/test.cruby/resources/format.po +0 -3
- data/test.cruby/resources/ok.po +0 -16
- data/test.cruby/test_helper.rb +0 -21
- data/test.cruby/tmp/.keep +0 -0
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Copyright (C) 2026 gemmaro
|
|
4
|
-
#
|
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
|
-
require_relative "test_helper"
|
|
19
|
-
|
|
20
|
-
class GettextPOTest < Test::Unit::TestCase
|
|
21
|
-
def load_tests(name)
|
|
22
|
-
path = File.join(__dir__, "../test/#{name}.rb")
|
|
23
|
-
instance_eval(File.read(path), path)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
test 'common with mruby' do
|
|
27
|
-
%w[
|
|
28
|
-
check
|
|
29
|
-
file
|
|
30
|
-
filepos
|
|
31
|
-
flag
|
|
32
|
-
format
|
|
33
|
-
header
|
|
34
|
-
message
|
|
35
|
-
message_iterator
|
|
36
|
-
version
|
|
37
|
-
].each do |target|
|
|
38
|
-
load_tests(target)
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
def _create_message_and_drop_file
|
|
43
|
-
file = GettextPO::File.new
|
|
44
|
-
iterator = file.message_iterator
|
|
45
|
-
iterator.insert("msgid1", "msgstr1")
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
test "dangling pointer" do
|
|
49
|
-
message = _create_message_and_drop_file
|
|
50
|
-
GC.start(full_mark: true, immediate_sweep: true)
|
|
51
|
-
assert_equal "msgid1", message.msgid
|
|
52
|
-
end
|
|
53
|
-
end
|
data/test.cruby/resources/a.po
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a
|
data/test.cruby/resources/bad.po
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# SOME DESCRIPTIVE TITLE.
|
|
2
|
-
# Copyright (C) YEAR Free Software Foundation, Inc.
|
|
3
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
4
|
-
#
|
|
5
|
-
#, fuzzy
|
|
6
|
-
msgid ""
|
|
7
|
-
msgstr ""
|
|
8
|
-
"Project-Id-Version: PACKAGE VERSION\n"
|
|
9
|
-
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
|
|
10
|
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
11
|
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
12
|
-
"MIME-Version: 1.0\n"
|
|
13
|
-
"Content-Type: text/plain; charset=UTF-8\n"
|
|
14
|
-
"Content-Transfer-Encoding: 8bit\n"
|
|
15
|
-
|
|
16
|
-
msgid "msgid1"
|
|
17
|
-
msgstr "msgstr1"
|
|
18
|
-
|
|
19
|
-
msgid "msgid1"
|
|
20
|
-
msgstr "msgstr1"
|
data/test.cruby/resources/ok.po
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# SOME DESCRIPTIVE TITLE.
|
|
2
|
-
# Copyright (C) YEAR Free Software Foundation, Inc.
|
|
3
|
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
4
|
-
#
|
|
5
|
-
msgid ""
|
|
6
|
-
msgstr ""
|
|
7
|
-
"Project-Id-Version: Ruby GettextPO\n"
|
|
8
|
-
"PO-Revision-Date: 2026-03-07 13:29+0900\n"
|
|
9
|
-
"Last-Translator: gemmaro <gemmaro.dev@gmail.com>\n"
|
|
10
|
-
"Language-Team: none\n"
|
|
11
|
-
"MIME-Version: 1.0\n"
|
|
12
|
-
"Content-Type: text/plain; charset=UTF-8\n"
|
|
13
|
-
"Content-Transfer-Encoding: 8bit\n"
|
|
14
|
-
|
|
15
|
-
msgid "msgid1"
|
|
16
|
-
msgstr "msgstr1"
|
data/test.cruby/test_helper.rb
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Copyright (C) 2026 gemmaro
|
|
4
|
-
#
|
|
5
|
-
# This program is free software: you can redistribute it and/or modify
|
|
6
|
-
# it under the terms of the GNU General Public License as published by
|
|
7
|
-
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
-
# (at your option) any later version.
|
|
9
|
-
#
|
|
10
|
-
# This program is distributed in the hope that it will be useful,
|
|
11
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
# GNU General Public License for more details.
|
|
14
|
-
#
|
|
15
|
-
# You should have received a copy of the GNU General Public License
|
|
16
|
-
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
-
|
|
18
|
-
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
|
19
|
-
require "gettextpo"
|
|
20
|
-
|
|
21
|
-
require "test-unit"
|
data/test.cruby/tmp/.keep
DELETED
|
File without changes
|