Commit 584ffbcc authored by Hleb Valoshka's avatar Hleb Valoshka

Imported Upstream version 3.2.4

parent 4e81ca1f
# News
## 3.2.4: 2017-08-13 {#version-3-2-4}
### Fixes
* Fixed a bug that block parameter is handled as method name.
[GitHub#53][Reported by Renaud Chaput]
### Thanks
* Renaud Chaput
## 3.2.3: 2017-06-24 {#version-3-2-3}
### Improvements
* Disabled unmaintainable Ruby from CI.
[GitHub#48][Reported by JP Hastings-Spital]
* Supported `--enable-frozen-string-literal` `ruby` option.
[GitHub#52][Reported by Pat Allan]
### Thanks
* JP Hastings-Spital
* Pat Allan
## 3.2.2: 2016-04-17 {#version-3-2-2}
### Improvements
......
......@@ -3,7 +3,7 @@
=begin
mo.rb - A simple class for operating GNU MO file.
Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2003-2009 Masao Mutoh
Copyright (C) 2002 Masahiro Sakai, Masao Mutoh
Copyright (C) 2001 Masahiro Sakai
......@@ -43,8 +43,8 @@ module GetText
:trans_sysdep_tab_offset
end
MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde".force_encoding("ASCII-8BIT")
MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95".force_encoding("ASCII-8BIT")
MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde".b
MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95".b
def self.open(arg = nil, output_charset = nil)
result = self.new(output_charset)
......@@ -325,7 +325,7 @@ module GetText
end
def generate_original_string(msgid, options)
string = ""
string = String.new
msgctxt = options.delete(:msgctxt)
msgid_plural = options.delete(:msgid_plural)
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
#
# License: Ruby's or LGPL
......@@ -194,7 +194,7 @@ module GetText
# @return [String] Formatted and joined PO entries. It is used for
# creating .po files.
def to_s(options={})
po_string = ""
po_string = String.new
header_entry = @entries[[nil, ""]]
unless header_entry.nil?
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2010 masone (Christian Felder) <ema@rh-productions.ch>
# Copyright (C) 2009 Masao Mutoh
#
......@@ -83,7 +83,7 @@ module GetText
# @return [void]
def add_comment(new_comment)
if (new_comment and ! new_comment.empty?)
@extracted_comment ||= ""
@extracted_comment ||= String.new
@extracted_comment << "\n" unless @extracted_comment.empty?
@extracted_comment << new_comment
end
......@@ -366,7 +366,7 @@ module GetText
end
def format_comments
formatted_comment = ""
formatted_comment = String.new
if include_translator_comment?
formatted_comment << format_translator_comment
end
......@@ -395,7 +395,7 @@ module GetText
def format_reference_comment
max_line_width = @options[:max_line_width]
formatted_reference = ""
formatted_reference = String.new
if not @entry.references.nil? and not @entry.references.empty?
formatted_reference << REFERENCE_COMMENT_MARK
line_width = 2
......@@ -417,7 +417,7 @@ module GetText
end
def format_flag_comment
formatted_flags = ""
formatted_flags = String.new
@entry.flags.each do |flag|
formatted_flags << format_comment(FLAG_MARK, flag)
end
......@@ -431,7 +431,7 @@ module GetText
def format_comment(mark, comment)
return "" if comment.nil?
formatted_comment = ""
formatted_comment = String.new
comment.each_line do |comment_line|
if comment_line == "\n"
formatted_comment << "#{mark}\n"
......@@ -446,7 +446,7 @@ module GetText
mark = "#~"
return "" if comment.nil?
formatted_comment = ""
formatted_comment = String.new
comment.each_line do |comment_line|
if /\A#[^~]/ =~ comment_line or comment_line.start_with?(mark)
formatted_comment << "#{comment_line.chomp}\n"
......@@ -466,7 +466,7 @@ module GetText
chunks = wrap_message(message)
return empty_formatted_message if chunks.empty?
formatted_message = ""
formatted_message = String.new
if chunks.size > 1 or chunks.first.end_with?("\n")
formatted_message << empty_formatted_message
end
......
......@@ -3,14 +3,14 @@
# po_parser.rb - Generate a .mo
#
# Copyright (C) 2003-2009 Masao Mutoh <mutomasa at gmail.com>
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
#
# You may redistribute it and/or modify it under the same
# license terms as Ruby or LGPL.
#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.11
# This file is automatically generated by Racc 1.4.14
# from Racc grammer file "".
#
......@@ -72,7 +72,7 @@ module_eval(<<'...end po_parser.ry/module_eval...', 'po_parser.ry', 123)
@msgctxt = nil
@msgid_plural = nil
str.strip!
str = str.strip
@q = []
until str.empty? do
case str
......@@ -266,16 +266,16 @@ module_eval(<<'...end po_parser.ry/module_eval...', 'po_parser.ry', 123)
##### State transition tables begin ###
racc_action_table = [
2, 13, 10, 9, 6, 17, 16, 15, 22, 15,
15, 13, 13, 13, 15, 11, 22, 24, 13, 15 ]
2, 11, 10, 9, 6, 17, 16, 15, 22, 15,
13, 13, 15, 13, 13, 15, 22, 24, 13, 15 ]
racc_action_check = [
1, 17, 1, 1, 1, 14, 14, 14, 19, 19,
12, 6, 16, 9, 18, 2, 20, 22, 24, 25 ]
1, 2, 1, 1, 1, 14, 14, 14, 19, 19,
6, 9, 12, 16, 17, 18, 20, 22, 24, 25 ]
racc_action_pointer = [
nil, 0, 15, nil, nil, nil, 4, nil, nil, 6,
nil, nil, 3, nil, 0, nil, 5, -6, 7, 2,
nil, 0, 1, nil, nil, nil, 3, nil, nil, 4,
nil, nil, 5, nil, 0, nil, 6, 7, 8, 2,
10, nil, 9, nil, 11, 12 ]
racc_action_default = [
......@@ -284,15 +284,15 @@ racc_action_default = [
-9, -11, -16, -10, -16, -12 ]
racc_goto_table = [
12, 21, 23, 14, 4, 5, 3, 7, 8, 20,
18, 19, 1, nil, nil, nil, nil, nil, 25 ]
12, 21, 23, 14, 1, 3, 4, 5, 7, 8,
18, 19, 20, nil, nil, nil, nil, nil, 25 ]
racc_goto_check = [
5, 9, 9, 5, 3, 4, 2, 6, 7, 8,
5, 5, 1, nil, nil, nil, nil, nil, 5 ]
5, 9, 9, 5, 1, 2, 3, 4, 6, 7,
5, 5, 8, nil, nil, nil, nil, nil, 5 ]
racc_goto_pointer = [
nil, 12, 5, 3, 4, -6, 6, 7, -10, -18 ]
nil, 4, 4, 5, 6, -6, 7, 8, -7, -18 ]
racc_goto_default = [
nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ]
......
# Copyright (C) 2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2014-2017 Kouhei Sutou <kou@clear-code.com>
#
# License: Ruby's or LGPL
#
......@@ -121,7 +121,7 @@ module GetText
msgstr = header_entry.msgstr
return if msgstr.nil?
new_msgstr = ""
new_msgstr = String.new
msgstr.each_line do |line|
case line
when /\A([\w\-]+):/
......
......@@ -2,7 +2,7 @@
=begin
parser/ruby.rb - parser for ruby script
Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2013-2017 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2003-2009 Masao Mutoh
Copyright (C) 2005 speakillof
Copyright (C) 2001,2002 Yasushi Shoji, Masao Mutoh
......@@ -260,6 +260,8 @@ module GetText
po_entry = nil
end
line_no = tk.line_no.to_s
when RubyToken::TkBITOR
po_entry = nil
when RubyToken::TkSTRING, RubyToken::TkDSTRING
po_entry.set_current_attribute tk.value if po_entry
when RubyToken::TkPLUS, RubyToken::TkNL
......@@ -291,7 +293,7 @@ module GetText
if last_comment.empty?
comment1 = tk.value.lstrip
if comment_to_be_extracted?(comment1)
last_comment << comment1
last_comment += comment1
end
else
last_comment += "\n"
......
=begin
version - version information of gettext
Copyright (C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
Copyright (C) 2005-2009 Masao Mutoh
You may redistribute it and/or modify it under the same
......@@ -9,5 +9,5 @@
=end
module GetText
VERSION = "3.2.2"
VERSION = "3.2.4"
end
......@@ -6,10 +6,10 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: gettext 3.2.2\n"
"Project-Id-Version: gettext 3.2.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-04-17 23:55+0900\n"
"PO-Revision-Date: 2016-04-17 23:55+0900\n"
"POT-Creation-Date: 2017-08-13 21:55+0900\n"
"PO-Revision-Date: 2017-08-13 21:55+0900\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
......
......@@ -3,7 +3,7 @@
# po_parser.ry - ruby version of msgfmt
#
# Copyright (C) 2002-2008 Masao Mutoh <mutomasa at gmail.com>
# Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2013 Haruka Yoshihara <yoshihara@clear-code.com>
#
# You may redistribute it and/or modify it under the same
......@@ -170,7 +170,7 @@ require "gettext/po"
@msgctxt = nil
@msgid_plural = nil
str.strip!
str = str.strip
@q = []
until str.empty? do
case str
......
# Copyright (C) 2017 Kouhei Sutou <kou@clear-code.com>
#
# License: Ruby's or LGPL
#
# This library is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
module Fixtures
module Method_
class BlockParameter
include GetText
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
def message
message_generator = lambda do |_|
"this is not a translate target message"
end
message_generator.call(nil)
end
end
end
end
......@@ -221,6 +221,12 @@ class TestRubyParser < Test::Unit::TestCase
path)
end
def test_block_parameter
path = "block_parameter.rb"
assert_parse([],
path)
end
private
def fixture_path(*components)
super("_", *components)
......
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Haruka Yoshihara <yoshihara@clear-code.com>
# Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
# Copyright (C) 2012-2017 Kouhei Sutou <kou@clear-code.com>
#
# License: Ruby's or LGPL
#
......@@ -101,7 +101,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\\n"
EOF
if have_plural_forms
header << "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"
header += "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"
end
header
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment