rdoc 8.0.0 → 8.1.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.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -3
  3. data/RI.md +75 -75
  4. data/exe/rdoc +2 -2
  5. data/lib/rdoc/code_object/alias.rb +71 -69
  6. data/lib/rdoc/code_object/any_method.rb +305 -303
  7. data/lib/rdoc/code_object/attr.rb +150 -148
  8. data/lib/rdoc/code_object/class_module.rb +798 -792
  9. data/lib/rdoc/code_object/constant.rb +175 -173
  10. data/lib/rdoc/code_object/context/section.rb +142 -138
  11. data/lib/rdoc/code_object/context.rb +926 -958
  12. data/lib/rdoc/code_object/extend.rb +7 -5
  13. data/lib/rdoc/code_object/include.rb +7 -5
  14. data/lib/rdoc/code_object/method_attr.rb +326 -319
  15. data/lib/rdoc/code_object/mixin.rb +97 -95
  16. data/lib/rdoc/code_object/normal_class.rb +77 -78
  17. data/lib/rdoc/code_object/normal_module.rb +61 -59
  18. data/lib/rdoc/code_object/require.rb +23 -39
  19. data/lib/rdoc/code_object/single_class.rb +21 -19
  20. data/lib/rdoc/code_object/top_level.rb +212 -219
  21. data/lib/rdoc/code_object.rb +305 -303
  22. data/lib/rdoc/comment.rb +275 -273
  23. data/lib/rdoc/cross_reference.rb +192 -190
  24. data/lib/rdoc/encoding.rb +105 -103
  25. data/lib/rdoc/erb_partial.rb +13 -11
  26. data/lib/rdoc/erbio.rb +29 -27
  27. data/lib/rdoc/generator/aliki.rb +161 -153
  28. data/lib/rdoc/generator/darkfish.rb +645 -635
  29. data/lib/rdoc/generator/json_index.rb +233 -229
  30. data/lib/rdoc/generator/markup.rb +164 -146
  31. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  32. data/lib/rdoc/generator/pot/po.rb +52 -51
  33. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  34. data/lib/rdoc/generator/pot.rb +85 -81
  35. data/lib/rdoc/generator/ri.rb +23 -19
  36. data/lib/rdoc/generator/template/aliki/DESIGN.md +6 -4
  37. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  38. data/lib/rdoc/generator/template/aliki/_head.rhtml +10 -10
  39. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  40. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  41. data/lib/rdoc/generator/template/aliki/css/rdoc.css +207 -178
  42. data/lib/rdoc/generator/template/aliki/js/aliki.js +60 -84
  43. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  44. data/lib/rdoc/generator.rb +48 -46
  45. data/lib/rdoc/i18n/locale.rb +99 -95
  46. data/lib/rdoc/i18n/text.rb +109 -105
  47. data/lib/rdoc/i18n.rb +7 -5
  48. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  49. data/lib/rdoc/markdown.kpeg +15 -11
  50. data/lib/rdoc/markdown.rb +40 -47
  51. data/lib/rdoc/markup/block_quote.rb +12 -8
  52. data/lib/rdoc/markup/document.rb +127 -123
  53. data/lib/rdoc/markup/formatter.rb +219 -215
  54. data/lib/rdoc/markup/include.rb +33 -29
  55. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  56. data/lib/rdoc/markup/inline_parser.rb +281 -277
  57. data/lib/rdoc/markup/list.rb +80 -88
  58. data/lib/rdoc/markup/list_item.rb +73 -85
  59. data/lib/rdoc/markup/paragraph.rb +23 -19
  60. data/lib/rdoc/markup/parser.rb +501 -497
  61. data/lib/rdoc/markup/pre_process.rb +283 -279
  62. data/lib/rdoc/markup/raw.rb +2 -2
  63. data/lib/rdoc/markup/rule.rb +16 -12
  64. data/lib/rdoc/markup/to_ansi.rb +143 -139
  65. data/lib/rdoc/markup/to_bs.rb +72 -68
  66. data/lib/rdoc/markup/to_html.rb +594 -565
  67. data/lib/rdoc/markup/to_html_crossref.rb +234 -230
  68. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  69. data/lib/rdoc/markup/to_joined_paragraph.rb +36 -32
  70. data/lib/rdoc/markup/to_label.rb +63 -59
  71. data/lib/rdoc/markup/to_markdown.rb +212 -208
  72. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  73. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  74. data/lib/rdoc/markup/to_test.rb +60 -56
  75. data/lib/rdoc/markup/to_tt_only.rb +84 -80
  76. data/lib/rdoc/markup/verbatim.rb +62 -58
  77. data/lib/rdoc/markup.rb +198 -196
  78. data/lib/rdoc/options.rb +1063 -1061
  79. data/lib/rdoc/parser/c.rb +1039 -1037
  80. data/lib/rdoc/parser/changelog.rb +319 -315
  81. data/lib/rdoc/parser/markdown.rb +17 -13
  82. data/lib/rdoc/parser/rbs.rb +239 -235
  83. data/lib/rdoc/parser/rd.rb +17 -13
  84. data/lib/rdoc/parser/ruby.rb +1245 -1124
  85. data/lib/rdoc/parser/ruby_colorizer.rb +263 -213
  86. data/lib/rdoc/parser/simple.rb +31 -27
  87. data/lib/rdoc/parser/text.rb +12 -8
  88. data/lib/rdoc/parser.rb +228 -220
  89. data/lib/rdoc/rbs_helper.rb +1 -1
  90. data/lib/rdoc/rd/inline.rb +57 -53
  91. data/lib/rdoc/rd.rb +90 -88
  92. data/lib/rdoc/rdoc.rb +500 -491
  93. data/lib/rdoc/ri/driver.rb +1140 -1135
  94. data/lib/rdoc/ri/formatter.rb +7 -3
  95. data/lib/rdoc/ri/paths.rb +140 -136
  96. data/lib/rdoc/ri/servlet.rb +354 -350
  97. data/lib/rdoc/ri/store.rb +4 -2
  98. data/lib/rdoc/ri/task.rb +55 -51
  99. data/lib/rdoc/ri.rb +14 -12
  100. data/lib/rdoc/rubygems_hook.rb +183 -181
  101. data/lib/rdoc/server.rb +349 -347
  102. data/lib/rdoc/stats/normal.rb +46 -42
  103. data/lib/rdoc/stats/quiet.rb +39 -35
  104. data/lib/rdoc/stats/verbose.rb +35 -31
  105. data/lib/rdoc/stats.rb +365 -363
  106. data/lib/rdoc/store.rb +888 -902
  107. data/lib/rdoc/task.rb +260 -256
  108. data/lib/rdoc/text.rb +135 -133
  109. data/lib/rdoc/token_stream.rb +101 -93
  110. data/lib/rdoc/tom_doc.rb +203 -201
  111. data/lib/rdoc/version.rb +1 -1
  112. metadata +4 -5
  113. data/lib/rdoc/markdown/literals.kpeg +0 -21
  114. data/lib/rdoc/markdown/literals.rb +0 -454
@@ -1,196 +1,214 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Handle common RDoc::Markup tasks for various CodeObjects
4
- #
5
- # This module is loaded by generators. It allows RDoc's CodeObject tree to
6
- # avoid loading generator code to improve startup time for +ri+.
2
+ module RDoc
3
+ module Generator
4
+ ##
5
+ # Handle common RDoc::Markup tasks for various CodeObjects
6
+ #
7
+ # This module is loaded by generators. It allows RDoc's CodeObject tree to
8
+ # avoid loading generator code to improve startup time for +ri+.
9
+
10
+ module Markup
11
+
12
+ ##
13
+ # Generates a relative URL from this object's path to +target_path+
14
+
15
+ def aref_to(target_path)
16
+ ::RDoc::Markup::ToHtml.gen_relative_url path, target_path
17
+ end
18
+
19
+ ##
20
+ # Generates a relative URL from +from_path+ to this object's path
21
+
22
+ def as_href(from_path)
23
+ ::RDoc::Markup::ToHtml.gen_relative_url from_path, path
24
+ end
25
+
26
+ ##
27
+ # Handy wrapper for marking up this object's comment
28
+
29
+ def description
30
+ markup @comment
31
+ end
32
+
33
+ ##
34
+ # Creates an RDoc::Markup::ToHtmlCrossref formatter
35
+
36
+ def formatter
37
+ return @formatter if defined? @formatter
38
+
39
+ options = @store.options
40
+ this = Context === self ? self : @parent
41
+
42
+ @formatter = ::RDoc::Markup::ToHtmlCrossref.new(
43
+ this.path, this,
44
+ pipe: options.pipe,
45
+ output_decoration: options.output_decoration,
46
+ hyperlink_all: options.hyperlink_all,
47
+ show_hash: options.show_hash,
48
+ autolink_excluded_words: options.autolink_excluded_words || [],
49
+ warn_missing_rdoc_ref: options.warn_missing_rdoc_ref
50
+ )
51
+ @formatter.code_object = self
52
+ @formatter
53
+ end
54
+
55
+ ##
56
+ # Build a webcvs URL starting for the given +url+ with +full_path+ appended
57
+ # as the destination path. If +url+ contains '%s' +full_path+ will be
58
+ # will replace the %s using sprintf on the +url+.
59
+
60
+ def cvs_url(url, full_path)
61
+ if /%s/ =~ url
62
+ sprintf url, full_path
63
+ else
64
+ url + full_path
65
+ end
66
+ end
67
+
68
+ ##
69
+ # The preferred URL for this object.
70
+
71
+ def canonical_url
72
+ options = @store.options
73
+ if path
74
+ File.join(options.canonical_root, path.to_s)
75
+ else
76
+ options.canonical_root
77
+ end
78
+ end
7
79
 
8
- module RDoc::Generator::Markup
9
-
10
- ##
11
- # Generates a relative URL from this object's path to +target_path+
12
-
13
- def aref_to(target_path)
14
- RDoc::Markup::ToHtml.gen_relative_url path, target_path
15
- end
16
-
17
- ##
18
- # Generates a relative URL from +from_path+ to this object's path
19
-
20
- def as_href(from_path)
21
- RDoc::Markup::ToHtml.gen_relative_url from_path, path
22
- end
23
-
24
- ##
25
- # Handy wrapper for marking up this object's comment
26
-
27
- def description
28
- markup @comment
29
- end
30
-
31
- ##
32
- # Creates an RDoc::Markup::ToHtmlCrossref formatter
33
-
34
- def formatter
35
- return @formatter if defined? @formatter
36
-
37
- options = @store.options
38
- this = RDoc::Context === self ? self : @parent
39
-
40
- @formatter = RDoc::Markup::ToHtmlCrossref.new(
41
- this.path, this,
42
- pipe: options.pipe,
43
- output_decoration: options.output_decoration,
44
- hyperlink_all: options.hyperlink_all,
45
- show_hash: options.show_hash,
46
- autolink_excluded_words: options.autolink_excluded_words || [],
47
- warn_missing_rdoc_ref: options.warn_missing_rdoc_ref
48
- )
49
- @formatter.code_object = self
50
- @formatter
51
- end
52
-
53
- ##
54
- # Build a webcvs URL starting for the given +url+ with +full_path+ appended
55
- # as the destination path. If +url+ contains '%s' +full_path+ will be
56
- # will replace the %s using sprintf on the +url+.
57
-
58
- def cvs_url(url, full_path)
59
- if /%s/ =~ url then
60
- sprintf url, full_path
61
- else
62
- url + full_path
63
- end
64
- end
65
-
66
- ##
67
- # The preferred URL for this object.
68
-
69
- def canonical_url
70
- options = @store.options
71
- if path
72
- File.join(options.canonical_root, path.to_s)
73
- else
74
- options.canonical_root
75
80
  end
76
81
  end
77
-
78
82
  end
79
83
 
80
- class RDoc::CodeObject
84
+ module RDoc
85
+ class CodeObject
81
86
 
82
- include RDoc::Generator::Markup
87
+ include Generator::Markup
83
88
 
89
+ end
84
90
  end
85
91
 
86
- class RDoc::AnyMethod
92
+ module RDoc
93
+ class AnyMethod
87
94
 
88
- ##
89
- # Creates an HTML link to the superclass method called by this method.
95
+ ##
96
+ # Creates an HTML link to the superclass method called by this method.
90
97
 
91
- def superclass_method_link
92
- target = superclass_method
93
- return unless target
98
+ def superclass_method_link
99
+ target = superclass_method
100
+ return unless target
94
101
 
95
- html_formatter = formatter
96
- name = target.full_name
102
+ html_formatter = formatter
103
+ name = target.full_name
97
104
 
98
- html_formatter.link name, html_formatter.convert_string(name)
99
- end
105
+ html_formatter.link name, html_formatter.convert_string(name)
106
+ end
100
107
 
108
+ end
101
109
  end
102
110
 
103
- class RDoc::MethodAttr
111
+ module RDoc
112
+ class MethodAttr
104
113
 
105
- ##
106
- # Prepend +src+ with line numbers.
114
+ ##
115
+ # Prepend +src+ with line numbers.
107
116
 
108
- def add_line_numbers(src)
109
- return if src.empty? || !line
110
- start_line = line
111
- end_line = start_line + src.count("\n")
112
- number_digits = end_line.to_s.length
117
+ def add_line_numbers(src)
118
+ return if src.empty? || !line
119
+ start_line = line
120
+ end_line = start_line + src.count("\n")
121
+ number_digits = end_line.to_s.length
113
122
 
114
- current_line = start_line
115
- src.gsub!(/^/) do
116
- res = "<span class=\"line-num\">#{current_line.to_s.rjust(number_digits)}</span> "
123
+ current_line = start_line
124
+ src.gsub!(/^/) do
125
+ res = "<span class=\"line-num\">#{current_line.to_s.rjust(number_digits)}</span> "
117
126
 
118
- current_line += 1
119
- res
127
+ current_line += 1
128
+ res
129
+ end
120
130
  end
121
- end
122
131
 
123
- ##
124
- # Prepend +src+ with a comment that declares its location in the source.
132
+ ##
133
+ # Prepend +src+ with a comment that declares its location in the source.
125
134
 
126
- def add_location_comment(src)
127
- path = CGI.escapeHTML(file.relative_name)
128
- if options.line_numbers && !src.empty?
129
- src.prepend("<span class=\"ruby-comment\"># File #{path}</span>\n")
130
- else
131
- src.prepend("<span class=\"ruby-comment\"># File #{path}, line #{line}</span>\n")
135
+ def add_location_comment(src)
136
+ path = CGI.escapeHTML(file.relative_name)
137
+ if options.line_numbers && !src.empty?
138
+ src.prepend("<span class=\"ruby-comment\"># File #{path}</span>\n")
139
+ else
140
+ src.prepend("<span class=\"ruby-comment\"># File #{path}, line #{line}</span>\n")
141
+ end
132
142
  end
133
- end
134
143
 
135
- ##
136
- # Turns the method's token stream into HTML.
137
- #
138
- # Prepends line numbers if +options.line_numbers+ is true.
144
+ ##
145
+ # Turns the method's token stream into HTML.
146
+ #
147
+ # Prepends line numbers if +options.line_numbers+ is true.
139
148
 
140
- def markup_code
141
- return '' if !@token_stream
149
+ def markup_code
150
+ return '' unless token_stream
142
151
 
143
- src = RDoc::TokenStream.to_html @token_stream
152
+ src = TokenStream.to_html token_stream
144
153
 
145
- # dedent the source
146
- common_indent = src.length
147
- src.scan(/^ *(?=\S)/) do |whitespace|
148
- common_indent = whitespace.length if whitespace.length < common_indent
149
- break if common_indent == 0
150
- end
151
- src.gsub!(/^#{' ' * common_indent}/, '') if common_indent > 0
154
+ # dedent the source
155
+ common_indent = src.length
156
+ src.scan(/^ *(?=\S)/) do |whitespace|
157
+ common_indent = whitespace.length if whitespace.length < common_indent
158
+ break if common_indent == 0
159
+ end
160
+ src.gsub!(/^#{' ' * common_indent}/, '') if common_indent > 0
161
+
162
+ if source_language == 'ruby'
163
+ add_line_numbers(src) if options.line_numbers
164
+ add_location_comment(src)
165
+ end
152
166
 
153
- if source_language == 'ruby'
154
- add_line_numbers(src) if options.line_numbers
155
- add_location_comment(src)
167
+ src
156
168
  end
157
169
 
158
- src
159
170
  end
160
-
161
171
  end
162
172
 
163
- class RDoc::ClassModule
173
+ module RDoc
174
+ class ClassModule
164
175
 
165
- ##
166
- # Handy wrapper for marking up this class or module's comment
176
+ ##
177
+ # Handy wrapper for marking up this class or module's comment
167
178
 
168
- def description
169
- markup @comment_location
170
- end
179
+ def description
180
+ markup @comment_location
181
+ end
171
182
 
183
+ end
172
184
  end
173
185
 
174
- class RDoc::Context::Section
186
+ module RDoc
187
+ class Context
188
+ class Section
175
189
 
176
- include RDoc::Generator::Markup
190
+ include Generator::Markup
177
191
 
192
+ end
193
+ end
178
194
  end
179
195
 
180
- class RDoc::TopLevel
196
+ module RDoc
197
+ class TopLevel
181
198
 
182
- ##
183
- # Returns a URL for this source file on some web repository. Use the -W
184
- # command line option to set.
199
+ ##
200
+ # Returns a URL for this source file on some web repository. Use the -W
201
+ # command line option to set.
185
202
 
186
- def cvs_url
187
- url = @store.options.webcvs
203
+ def cvs_url
204
+ url = @store.options.webcvs
188
205
 
189
- if /%s/ =~ url then
190
- url % @relative_name
191
- else
192
- url + @relative_name
206
+ if /%s/ =~ url
207
+ url % @relative_name
208
+ else
209
+ url + @relative_name
210
+ end
193
211
  end
194
- end
195
212
 
213
+ end
196
214
  end
@@ -1,68 +1,74 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Extracts message from RDoc::Store
2
+ module RDoc
3
+ module Generator
4
+ class POT
5
+ ##
6
+ # Extracts message from RDoc::Store
4
7
 
5
- class RDoc::Generator::POT::MessageExtractor
8
+ class MessageExtractor
6
9
 
7
- ##
8
- # Creates a message extractor for +store+.
10
+ ##
11
+ # Creates a message extractor for +store+.
9
12
 
10
- def initialize(store)
11
- @store = store
12
- @po = RDoc::Generator::POT::PO.new
13
- end
13
+ def initialize(store)
14
+ @store = store
15
+ @po = Generator::POT::PO.new
16
+ end
14
17
 
15
- ##
16
- # Extracts messages from +store+, stores them into
17
- # RDoc::Generator::POT::PO and returns it.
18
+ ##
19
+ # Extracts messages from +store+, stores them into
20
+ # RDoc::Generator::POT::PO and returns it.
18
21
 
19
- def extract
20
- @store.all_classes_and_modules.each do |klass|
21
- extract_from_klass(klass)
22
- end
23
- @po
24
- end
22
+ def extract
23
+ @store.all_classes_and_modules.each do |klass|
24
+ extract_from_klass(klass)
25
+ end
26
+ @po
27
+ end
25
28
 
26
- private
29
+ private
27
30
 
28
- def extract_from_klass(klass)
29
- extract_text(klass.comment_location, klass.full_name)
31
+ def extract_from_klass(klass)
32
+ extract_text(klass.comment_location, klass.full_name)
30
33
 
31
- klass.each_section do |section, constants, attributes|
32
- extract_text(section.title, "#{klass.full_name}: section title")
33
- section.comments.each do |comment|
34
- extract_text(comment, "#{klass.full_name}: #{section.title}")
35
- end
36
- end
34
+ klass.each_section do |section, constants, attributes|
35
+ extract_text(section.title, "#{klass.full_name}: section title")
36
+ section.comments.each do |comment|
37
+ extract_text(comment, "#{klass.full_name}: #{section.title}")
38
+ end
39
+ end
37
40
 
38
- klass.constants.each do |constant|
39
- extract_text(constant.comment, constant.full_name)
40
- end
41
+ klass.constants.each do |constant|
42
+ extract_text(constant.comment, constant.full_name)
43
+ end
41
44
 
42
- klass.attributes.each do |attribute|
43
- extract_text(attribute.comment, attribute.full_name)
44
- end
45
+ klass.attributes.each do |attribute|
46
+ extract_text(attribute.comment, attribute.full_name)
47
+ end
45
48
 
46
- klass.each_method do |method|
47
- extract_text(method.comment, method.full_name)
48
- end
49
- end
49
+ klass.each_method do |method|
50
+ extract_text(method.comment, method.full_name)
51
+ end
52
+ end
50
53
 
51
- def extract_text(text, comment, location = nil)
52
- return if text.nil?
54
+ def extract_text(text, comment, location = nil)
55
+ return if text.nil?
53
56
 
54
- options = {
55
- :extracted_comment => comment,
56
- :references => [location].compact,
57
- }
58
- i18n_text = RDoc::I18n::Text.new(text)
59
- i18n_text.extract_messages do |part|
60
- @po.add(entry(part[:paragraph], options))
61
- end
62
- end
57
+ options = {
58
+ :extracted_comment => comment,
59
+ :references => [location].compact,
60
+ }
61
+ i18n_text = I18n::Text.new(text)
62
+ i18n_text.extract_messages do |part|
63
+ @po.add(entry(part[:paragraph], options))
64
+ end
65
+ end
63
66
 
64
- def entry(msgid, options)
65
- RDoc::Generator::POT::POEntry.new(msgid, options)
66
- end
67
+ def entry(msgid, options)
68
+ Generator::POT::POEntry.new(msgid, options)
69
+ end
67
70
 
71
+ end
72
+ end
73
+ end
68
74
  end
@@ -1,55 +1,53 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # Generates a PO format text
2
+ module RDoc
3
+ module Generator
4
+ class POT
5
+ ##
6
+ # Generates a PO format text
4
7
 
5
- class RDoc::Generator::POT::PO
8
+ class PO
6
9
 
7
- ##
8
- # Creates an object that represents PO format.
10
+ ##
11
+ # Creates an object that represents PO format.
9
12
 
10
- def initialize
11
- @entries = {}
12
- add_header
13
- end
13
+ def initialize
14
+ @entries = {}
15
+ add_header
16
+ end
14
17
 
15
- ##
16
- # Adds a PO entry to the PO.
18
+ ##
19
+ # Adds a PO entry to the PO.
17
20
 
18
- def add(entry)
19
- existing_entry = @entries[entry.msgid]
20
- if existing_entry
21
- entry = existing_entry.merge(entry)
22
- end
23
- @entries[entry.msgid] = entry
24
- end
21
+ def add(entry)
22
+ existing_entry = @entries[entry.msgid]
23
+ if existing_entry
24
+ entry = existing_entry.merge(entry)
25
+ end
26
+ @entries[entry.msgid] = entry
27
+ end
25
28
 
26
- ##
27
- # Returns PO format text for the PO.
29
+ ##
30
+ # Returns PO format text for the PO.
28
31
 
29
- def to_s
30
- po = ''
31
- sort_entries.each do |entry|
32
- po += "\n" unless po.empty?
33
- po += entry.to_s
34
- end
35
- po
36
- end
32
+ def to_s
33
+ sort_entries.map(&:to_s).join("\n")
34
+ end
37
35
 
38
- private
36
+ private
39
37
 
40
- def add_header
41
- add(header_entry)
42
- end
38
+ def add_header
39
+ add(header_entry)
40
+ end
43
41
 
44
- def header_entry
45
- comment = <<-COMMENT
42
+ def header_entry
43
+ comment = <<-COMMENT
46
44
  SOME DESCRIPTIVE TITLE.
47
45
  Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
48
46
  This file is distributed under the same license as the PACKAGE package.
49
47
  FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
50
48
  COMMENT
51
49
 
52
- content = <<-CONTENT
50
+ content = <<-CONTENT
53
51
  Project-Id-Version: PACKAGE VERSEION
54
52
  Report-Msgid-Bugs-To:
55
53
  PO-Revision-Date: YEAR-MO_DA HO:MI+ZONE
@@ -62,23 +60,26 @@ Content-Transfer-Encoding: 8bit
62
60
  Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;
63
61
  CONTENT
64
62
 
65
- options = {
66
- :msgstr => content,
67
- :translator_comment => comment,
68
- :flags => ['fuzzy'],
69
- }
70
- RDoc::Generator::POT::POEntry.new('', options)
71
- end
63
+ options = {
64
+ :msgstr => content,
65
+ :translator_comment => comment,
66
+ :flags => ['fuzzy'],
67
+ }
68
+ Generator::POT::POEntry.new('', options)
69
+ end
72
70
 
73
- def sort_entries
74
- headers, messages = @entries.values.partition do |entry|
75
- entry.msgid.empty?
76
- end
77
- # TODO: sort by location
78
- sorted_messages = messages.sort_by do |entry|
79
- entry.msgid
71
+ def sort_entries
72
+ headers, messages = @entries.values.partition do |entry|
73
+ entry.msgid.empty?
74
+ end
75
+ # TODO: sort by location
76
+ sorted_messages = messages.sort_by do |entry|
77
+ entry.msgid
78
+ end
79
+ headers + sorted_messages
80
+ end
81
+
82
+ end
80
83
  end
81
- headers + sorted_messages
82
84
  end
83
-
84
85
  end