fair-gettext 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/gettext.gemspec CHANGED
@@ -2,10 +2,9 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fair-gettext}
5
- s.version = "2.0.3"
5
+ s.version = "2.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Masao Mutoh"]
9
8
  s.date = %q{2009-02-06}
10
9
  s.description = %q{Ruby-GetText-Package is a GNU GetText-like program for Ruby. The catalog file(po-file) is same format with GNU GetText. So you can use GNU GetText tools for maintaining.}
11
10
  s.email = %q{mutomasa at gmail.com}
@@ -95,26 +95,29 @@ TITLE
95
95
  def generate_pot(paths) # :nodoc:
96
96
  pomessages = parse(paths)
97
97
  str = ""
98
+ private_str = ""
98
99
 
99
100
  pomessages.each do |target|
100
101
  unless target.to_po_str.include? "[private]"
101
102
  str << target.to_po_str
102
- end
103
- end
104
- str
105
- end
106
-
107
- def generate_private_pot(paths)
108
- pomessages = parse(paths)
109
- private_str = ""
110
-
111
- pomessages.each do |target|
112
- if target.to_po_str.include? "[private]"
103
+ else
113
104
  private_str << target.to_po_str
114
105
  end
115
106
  end
116
- private_str
107
+ [str, private_str]
117
108
  end
109
+
110
+ # def generate_private_pot(paths)
111
+ # pomessages = parse(paths)
112
+ # private_str = ""
113
+ #
114
+ # pomessages.each do |target|
115
+ # if target.to_po_str.include? "[private]"
116
+ # private_str << target.to_po_str
117
+ # end
118
+ #end
119
+ #private_str
120
+ #end
118
121
 
119
122
  def parse(paths) # :nodoc:
120
123
  pomessages = []
@@ -208,20 +211,23 @@ TITLE
208
211
  raise ArgumentError, _("no input files")
209
212
  end
210
213
 
214
+ header = generate_pot_header
215
+ body = generate_pot(paths)
216
+
211
217
  if ((out.is_a? String) and (private_out.is_a? String))
212
218
  File.open(File.expand_path(out), "w+") do |file|
213
- file.puts generate_pot_header
214
- file.puts generate_pot(paths)
219
+ file.puts header
220
+ file.puts body[0]
215
221
  end
216
222
  File.open(File.expand_path(private_out), "w+") do |file|
217
- file.puts generate_pot_header
218
- file.puts generate_private_pot(paths)
223
+ file.puts header
224
+ file.puts body[1]
219
225
  end
220
226
  else
221
- out.puts generate_pot_header
222
- out.puts generate_pot(paths)
223
- private_out.puts generate_pot_header
224
- private_out.puts generate_private_pot(paths)
227
+ out.puts header
228
+ out.puts body[0]
229
+ private_out.puts header
230
+ private_out.puts body[1]
225
231
  end
226
232
  self
227
233
  end
metadata CHANGED
@@ -5,11 +5,11 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 3
9
- version: 2.0.3
8
+ - 4
9
+ version: 2.0.4
10
10
  platform: ruby
11
- authors:
12
- - Masao Mutoh
11
+ authors: []
12
+
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []