super-quick-rb 0.0.1
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 +7 -0
- data/rdoc-8.0.0/CONTRIBUTING.md +195 -0
- data/rdoc-8.0.0/CVE-2013-0256.rdoc +49 -0
- data/rdoc-8.0.0/History.rdoc +1668 -0
- data/rdoc-8.0.0/LEGAL.rdoc +56 -0
- data/rdoc-8.0.0/LICENSE.rdoc +63 -0
- data/rdoc-8.0.0/README.md +236 -0
- data/rdoc-8.0.0/RI.md +842 -0
- data/rdoc-8.0.0/TODO.rdoc +60 -0
- data/rdoc-8.0.0/doc/markup_reference/markdown.md +659 -0
- data/rdoc-8.0.0/doc/markup_reference/rdoc.rdoc +1169 -0
- data/rdoc-8.0.0/exe/rdoc +43 -0
- data/rdoc-8.0.0/exe/ri +12 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/alias.rb +98 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/any_method.rb +387 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/attr.rb +178 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/class_module.rb +969 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/constant.rb +221 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context/section.rb +182 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/context.rb +1238 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/extend.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/include.rb +9 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/method_attr.rb +417 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/mixin.rb +123 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_class.rb +92 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/normal_module.rb +73 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/require.rb +51 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/single_class.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/code_object/top_level.rb +286 -0
- data/rdoc-8.0.0/lib/rdoc/code_object.rb +393 -0
- data/rdoc-8.0.0/lib/rdoc/code_objects.rb +5 -0
- data/rdoc-8.0.0/lib/rdoc/comment.rb +353 -0
- data/rdoc-8.0.0/lib/rdoc/cross_reference.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/encoding.rb +120 -0
- data/rdoc-8.0.0/lib/rdoc/erb_partial.rb +18 -0
- data/rdoc-8.0.0/lib/rdoc/erbio.rb +37 -0
- data/rdoc-8.0.0/lib/rdoc/generator/aliki.rb +200 -0
- data/rdoc-8.0.0/lib/rdoc/generator/darkfish.rb +824 -0
- data/rdoc-8.0.0/lib/rdoc/generator/json_index.rb +284 -0
- data/rdoc-8.0.0/lib/rdoc/generator/markup.rb +196 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/rdoc-8.0.0/lib/rdoc/generator/pot.rb +94 -0
- data/rdoc-8.0.0/lib/rdoc/generator/ri.rb +30 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_head.rhtml +43 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +5 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +17 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +16 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +32 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +6 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +15 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +39 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/class.rhtml +220 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/css/rdoc.css +701 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/index.rhtml +24 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/darkfish.js +140 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/js/search.js +120 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/page.rhtml +19 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +21 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +65 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +72 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/rdoc-8.0.0/lib/rdoc/generator/template/json_index/js/searcher.js +271 -0
- data/rdoc-8.0.0/lib/rdoc/generator.rb +52 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/locale.rb +102 -0
- data/rdoc-8.0.0/lib/rdoc/i18n/text.rb +126 -0
- data/rdoc-8.0.0/lib/rdoc/i18n.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc/known_classes.rb +74 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/entities.rb +2131 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.kpeg +21 -0
- data/rdoc-8.0.0/lib/rdoc/markdown/literals.rb +454 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.kpeg +1315 -0
- data/rdoc-8.0.0/lib/rdoc/markdown.rb +16865 -0
- data/rdoc-8.0.0/lib/rdoc/markup/blank_line.rb +29 -0
- data/rdoc-8.0.0/lib/rdoc/markup/block_quote.rb +14 -0
- data/rdoc-8.0.0/lib/rdoc/markup/document.rb +164 -0
- data/rdoc-8.0.0/lib/rdoc/markup/element.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/markup/formatter.rb +285 -0
- data/rdoc-8.0.0/lib/rdoc/markup/hard_break.rb +34 -0
- data/rdoc-8.0.0/lib/rdoc/markup/heading.rb +170 -0
- data/rdoc-8.0.0/lib/rdoc/markup/include.rb +42 -0
- data/rdoc-8.0.0/lib/rdoc/markup/indented_paragraph.rb +47 -0
- data/rdoc-8.0.0/lib/rdoc/markup/inline_parser.rb +312 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list.rb +101 -0
- data/rdoc-8.0.0/lib/rdoc/markup/list_item.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/markup/paragraph.rb +28 -0
- data/rdoc-8.0.0/lib/rdoc/markup/parser.rb +585 -0
- data/rdoc-8.0.0/lib/rdoc/markup/pre_process.rb +317 -0
- data/rdoc-8.0.0/lib/rdoc/markup/raw.rb +66 -0
- data/rdoc-8.0.0/lib/rdoc/markup/rule.rb +20 -0
- data/rdoc-8.0.0/lib/rdoc/markup/table.rb +64 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_ansi.rb +144 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_bs.rb +86 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html.rb +682 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_crossref.rb +261 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_html_snippet.rb +287 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_joined_paragraph.rb +41 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_label.rb +84 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_markdown.rb +215 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_rdoc.rb +421 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_table_of_contents.rb +88 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_test.rb +77 -0
- data/rdoc-8.0.0/lib/rdoc/markup/to_tt_only.rb +107 -0
- data/rdoc-8.0.0/lib/rdoc/markup/verbatim.rb +83 -0
- data/rdoc-8.0.0/lib/rdoc/markup.rb +219 -0
- data/rdoc-8.0.0/lib/rdoc/options.rb +1412 -0
- data/rdoc-8.0.0/lib/rdoc/parser/c.rb +1227 -0
- data/rdoc-8.0.0/lib/rdoc/parser/changelog.rb +379 -0
- data/rdoc-8.0.0/lib/rdoc/parser/markdown.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rbs.rb +275 -0
- data/rdoc-8.0.0/lib/rdoc/parser/rd.rb +22 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby.rb +1266 -0
- data/rdoc-8.0.0/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/rdoc-8.0.0/lib/rdoc/parser/simple.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/parser/text.rb +11 -0
- data/rdoc-8.0.0/lib/rdoc/parser.rb +298 -0
- data/rdoc-8.0.0/lib/rdoc/rbs_helper.rb +186 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.rb +1706 -0
- data/rdoc-8.0.0/lib/rdoc/rd/block_parser.ry +643 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.rb +1854 -0
- data/rdoc-8.0.0/lib/rdoc/rd/inline_parser.ry +593 -0
- data/rdoc-8.0.0/lib/rdoc/rd.rb +99 -0
- data/rdoc-8.0.0/lib/rdoc/rdoc.rb +724 -0
- data/rdoc-8.0.0/lib/rdoc/ri/driver.rb +1572 -0
- data/rdoc-8.0.0/lib/rdoc/ri/formatter.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/paths.rb +171 -0
- data/rdoc-8.0.0/lib/rdoc/ri/servlet.rb +452 -0
- data/rdoc-8.0.0/lib/rdoc/ri/store.rb +6 -0
- data/rdoc-8.0.0/lib/rdoc/ri/task.rb +71 -0
- data/rdoc-8.0.0/lib/rdoc/ri.rb +21 -0
- data/rdoc-8.0.0/lib/rdoc/rubygems_hook.rb +327 -0
- data/rdoc-8.0.0/lib/rdoc/server.rb +460 -0
- data/rdoc-8.0.0/lib/rdoc/stats/normal.rb +58 -0
- data/rdoc-8.0.0/lib/rdoc/stats/quiet.rb +59 -0
- data/rdoc-8.0.0/lib/rdoc/stats/verbose.rb +44 -0
- data/rdoc-8.0.0/lib/rdoc/stats.rb +484 -0
- data/rdoc-8.0.0/lib/rdoc/store.rb +1205 -0
- data/rdoc-8.0.0/lib/rdoc/task.rb +355 -0
- data/rdoc-8.0.0/lib/rdoc/text.rb +244 -0
- data/rdoc-8.0.0/lib/rdoc/token_stream.rb +104 -0
- data/rdoc-8.0.0/lib/rdoc/tom_doc.rb +257 -0
- data/rdoc-8.0.0/lib/rdoc/version.rb +10 -0
- data/rdoc-8.0.0/lib/rdoc.rb +239 -0
- data/rdoc-8.0.0/lib/rubygems_plugin.rb +14 -0
- data/rdoc-8.0.0/man/ri.1 +249 -0
- data/rdoc-8.0.0/rdoc-logo.svg +43 -0
- data/rdoc-8.0.0/rdoc.gemspec +74 -0
- data/super-quick-rb.gemspec +12 -0
- metadata +257 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# A PO entry in PO
|
|
4
|
+
|
|
5
|
+
class RDoc::Generator::POT::POEntry
|
|
6
|
+
|
|
7
|
+
# The msgid content
|
|
8
|
+
attr_reader :msgid
|
|
9
|
+
|
|
10
|
+
# The msgstr content
|
|
11
|
+
attr_reader :msgstr
|
|
12
|
+
|
|
13
|
+
# The comment content created by translator (PO editor)
|
|
14
|
+
attr_reader :translator_comment
|
|
15
|
+
|
|
16
|
+
# The comment content extracted from source file
|
|
17
|
+
attr_reader :extracted_comment
|
|
18
|
+
|
|
19
|
+
# The locations where the PO entry is extracted
|
|
20
|
+
attr_reader :references
|
|
21
|
+
|
|
22
|
+
# The flags of the PO entry
|
|
23
|
+
attr_reader :flags
|
|
24
|
+
|
|
25
|
+
##
|
|
26
|
+
# Creates a PO entry for +msgid+. Other values can be specified by
|
|
27
|
+
# +options+.
|
|
28
|
+
|
|
29
|
+
def initialize(msgid, options = {})
|
|
30
|
+
@msgid = msgid
|
|
31
|
+
@msgstr = options[:msgstr] || ""
|
|
32
|
+
@translator_comment = options[:translator_comment]
|
|
33
|
+
@extracted_comment = options[:extracted_comment]
|
|
34
|
+
@references = options[:references] || []
|
|
35
|
+
@flags = options[:flags] || []
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
##
|
|
39
|
+
# Returns the PO entry in PO format.
|
|
40
|
+
|
|
41
|
+
def to_s
|
|
42
|
+
entry = ''
|
|
43
|
+
entry += format_translator_comment
|
|
44
|
+
entry += format_extracted_comment
|
|
45
|
+
entry += format_references
|
|
46
|
+
entry += format_flags
|
|
47
|
+
entry += <<-ENTRY
|
|
48
|
+
msgid #{format_message(@msgid)}
|
|
49
|
+
msgstr #{format_message(@msgstr)}
|
|
50
|
+
ENTRY
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# Merges the PO entry with +other_entry+.
|
|
55
|
+
|
|
56
|
+
def merge(other_entry)
|
|
57
|
+
options = {
|
|
58
|
+
:extracted_comment => merge_string(@extracted_comment,
|
|
59
|
+
other_entry.extracted_comment),
|
|
60
|
+
:translator_comment => merge_string(@translator_comment,
|
|
61
|
+
other_entry.translator_comment),
|
|
62
|
+
:references => merge_array(@references,
|
|
63
|
+
other_entry.references),
|
|
64
|
+
:flags => merge_array(@flags,
|
|
65
|
+
other_entry.flags),
|
|
66
|
+
}
|
|
67
|
+
self.class.new(@msgid, options)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
private
|
|
71
|
+
|
|
72
|
+
def format_comment(mark, comment)
|
|
73
|
+
return '' unless comment
|
|
74
|
+
return '' if comment.empty?
|
|
75
|
+
|
|
76
|
+
formatted_comment = ''
|
|
77
|
+
comment.each_line do |line|
|
|
78
|
+
formatted_comment += "#{mark} #{line}"
|
|
79
|
+
end
|
|
80
|
+
formatted_comment += "\n" unless formatted_comment.end_with?("\n")
|
|
81
|
+
formatted_comment
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def format_translator_comment
|
|
85
|
+
format_comment('#', @translator_comment)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def format_extracted_comment
|
|
89
|
+
format_comment('#.', @extracted_comment)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def format_references
|
|
93
|
+
return '' if @references.empty?
|
|
94
|
+
|
|
95
|
+
formatted_references = ''
|
|
96
|
+
@references.sort.each do |file, line|
|
|
97
|
+
formatted_references += "\#: #{file}:#{line}\n"
|
|
98
|
+
end
|
|
99
|
+
formatted_references
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def format_flags
|
|
103
|
+
return '' if @flags.empty?
|
|
104
|
+
|
|
105
|
+
formatted_flags = flags.join(",")
|
|
106
|
+
"\#, #{formatted_flags}\n"
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def format_message(message)
|
|
110
|
+
return "\"#{escape(message)}\"" unless message.include?("\n")
|
|
111
|
+
|
|
112
|
+
formatted_message = '""'
|
|
113
|
+
message.each_line do |line|
|
|
114
|
+
formatted_message += "\n"
|
|
115
|
+
formatted_message += "\"#{escape(line)}\""
|
|
116
|
+
end
|
|
117
|
+
formatted_message
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def escape(string)
|
|
121
|
+
string.gsub(/["\\\t\n]/) do |special_character|
|
|
122
|
+
case special_character
|
|
123
|
+
when "\t"
|
|
124
|
+
"\\t"
|
|
125
|
+
when "\n"
|
|
126
|
+
"\\n"
|
|
127
|
+
else
|
|
128
|
+
"\\#{special_character}"
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
def merge_string(string1, string2)
|
|
134
|
+
[string1, string2].compact.join("\n")
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
def merge_array(array1, array2)
|
|
138
|
+
(array1 + array2).uniq
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# Generates a POT file.
|
|
4
|
+
#
|
|
5
|
+
# Here is a translator work flow with the generator.
|
|
6
|
+
#
|
|
7
|
+
# == Create .pot
|
|
8
|
+
#
|
|
9
|
+
# You create .pot file by pot formatter:
|
|
10
|
+
#
|
|
11
|
+
# % rdoc --format pot
|
|
12
|
+
#
|
|
13
|
+
# It generates doc/rdoc.pot.
|
|
14
|
+
#
|
|
15
|
+
# == Create .po
|
|
16
|
+
#
|
|
17
|
+
# You create .po file from doc/rdoc.pot. This operation is needed only
|
|
18
|
+
# the first time. This work flow assumes that you are a translator
|
|
19
|
+
# for Japanese.
|
|
20
|
+
#
|
|
21
|
+
# You create locale/ja/rdoc.po from doc/rdoc.pot. You can use msginit
|
|
22
|
+
# provided by GNU gettext or rmsginit provided by gettext gem. This
|
|
23
|
+
# work flow uses gettext gem because it is more portable than GNU
|
|
24
|
+
# gettext for Rubyists. Gettext gem is implemented by pure Ruby.
|
|
25
|
+
#
|
|
26
|
+
# % gem install gettext
|
|
27
|
+
# % mkdir -p locale/ja
|
|
28
|
+
# % rmsginit --input doc/rdoc.pot --output locale/ja/rdoc.po --locale ja
|
|
29
|
+
#
|
|
30
|
+
# Translate messages in .po
|
|
31
|
+
#
|
|
32
|
+
# You translate messages in .po by a PO file editor. po-mode.el exists
|
|
33
|
+
# for Emacs users. There are some GUI tools such as GTranslator.
|
|
34
|
+
# There are some Web services such as POEditor and Tansifex. You can
|
|
35
|
+
# edit by your favorite text editor because .po is a text file.
|
|
36
|
+
# Generate localized documentation
|
|
37
|
+
#
|
|
38
|
+
# You can generate localized documentation with locale/ja/rdoc.po:
|
|
39
|
+
#
|
|
40
|
+
# % rdoc --locale ja
|
|
41
|
+
#
|
|
42
|
+
# You can find documentation in Japanese in doc/. Yay!
|
|
43
|
+
#
|
|
44
|
+
# == Update translation
|
|
45
|
+
#
|
|
46
|
+
# You need to update translation when your application is added or
|
|
47
|
+
# modified messages.
|
|
48
|
+
#
|
|
49
|
+
# You can update .po by the following command lines:
|
|
50
|
+
#
|
|
51
|
+
# % rdoc --format pot
|
|
52
|
+
# % rmsgmerge --update locale/ja/rdoc.po doc/rdoc.pot
|
|
53
|
+
#
|
|
54
|
+
# You edit locale/ja/rdoc.po to translate new messages.
|
|
55
|
+
|
|
56
|
+
class RDoc::Generator::POT
|
|
57
|
+
|
|
58
|
+
RDoc::RDoc.add_generator self
|
|
59
|
+
|
|
60
|
+
##
|
|
61
|
+
# Description of this generator
|
|
62
|
+
|
|
63
|
+
DESCRIPTION = 'creates .pot file'
|
|
64
|
+
|
|
65
|
+
##
|
|
66
|
+
# Set up a new .pot generator
|
|
67
|
+
|
|
68
|
+
def initialize(store, options) #:not-new:
|
|
69
|
+
@options = options
|
|
70
|
+
@store = store
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
##
|
|
74
|
+
# Writes .pot to disk.
|
|
75
|
+
|
|
76
|
+
def generate
|
|
77
|
+
po = extract_messages
|
|
78
|
+
pot_path = 'rdoc.pot'
|
|
79
|
+
File.open(pot_path, "w") do |pot|
|
|
80
|
+
pot.print(po.to_s)
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
private
|
|
85
|
+
def extract_messages
|
|
86
|
+
extractor = MessageExtractor.new(@store)
|
|
87
|
+
extractor.extract
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
require_relative 'pot/message_extractor'
|
|
91
|
+
require_relative 'pot/po'
|
|
92
|
+
require_relative 'pot/po_entry'
|
|
93
|
+
|
|
94
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
##
|
|
3
|
+
# Generates ri data files
|
|
4
|
+
|
|
5
|
+
class RDoc::Generator::RI
|
|
6
|
+
|
|
7
|
+
RDoc::RDoc.add_generator self
|
|
8
|
+
|
|
9
|
+
##
|
|
10
|
+
# Description of this generator
|
|
11
|
+
|
|
12
|
+
DESCRIPTION = 'creates ri data files'
|
|
13
|
+
|
|
14
|
+
##
|
|
15
|
+
# Set up a new ri generator
|
|
16
|
+
|
|
17
|
+
def initialize(store, options) #:not-new:
|
|
18
|
+
@options = options
|
|
19
|
+
@store = store
|
|
20
|
+
@store.path = '.'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
##
|
|
24
|
+
# Writes the parsed data store to disk for use by ri.
|
|
25
|
+
|
|
26
|
+
def generate
|
|
27
|
+
@store.save
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|