grosser-pomo 0.5.0 → 0.5.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.
- data/VERSION.yml +1 -1
- data/lib/pomo/translation.rb +1 -1
- data/spec/pomo/po_file_spec.rb +29 -22
- metadata +9 -10
data/VERSION.yml
CHANGED
data/lib/pomo/translation.rb
CHANGED
data/spec/pomo/po_file_spec.rb
CHANGED
@@ -2,33 +2,40 @@ require File.expand_path("../spec_helper", File.dirname(__FILE__))
|
|
2
2
|
|
3
3
|
include Pomo
|
4
4
|
describe Pomo::PoFile do
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
describe :parse do
|
6
|
+
it "parses nothing" do
|
7
|
+
PoFile.parse("").should be_empty
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
it "parses a simple msgid and msgstr" do
|
11
|
+
t = PoFile.parse(%Q(msgid "xxx"\nmsgstr "yyy"))
|
12
|
+
t[0].to_hash.should == {:msgid=>'xxx',:msgstr=>'yyy'}
|
13
|
+
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
it "parses a simple msgid and msg with additional whitespace" do
|
16
|
+
t = PoFile.parse(%Q( msgid "xxx" \n msgstr "yyy" ))
|
17
|
+
t[0].to_hash.should == {:msgid=>'xxx',:msgstr=>'yyy'}
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
it "parses an empty msgid with text (gettext meta data)" do
|
21
|
+
t = PoFile.parse(%Q(msgid ""\nmsgstr "PLURAL FORMS"))
|
22
|
+
t[0].to_hash.should == {:msgid=>'',:msgstr=>'PLURAL FORMS'}
|
23
|
+
end
|
23
24
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
it "parses a multiline msgid/msgstr" do
|
26
|
+
t = PoFile.parse(%Q(msgid "xxx"\n"aaa"\n\n\nmsgstr ""\n"bbb"))
|
27
|
+
t[0].to_hash.should == {:msgid=>'xxxaaa',:msgstr=>'bbb'}
|
28
|
+
end
|
28
29
|
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
it "parses simple comments" do
|
31
|
+
t = PoFile.parse(%Q(#test\nmsgid "xxx"\nmsgstr "yyy"))
|
32
|
+
t[0].to_hash.should == {:msgid=>'xxx',:msgstr=>'yyy',:comment=>"test\n"}
|
33
|
+
end
|
34
|
+
|
35
|
+
it "parses comments above msgstr" do
|
36
|
+
t = PoFile.parse(%Q(#test\nmsgid "xxx"\n#another\nmsgstr "yyy"))
|
37
|
+
t[0].to_hash.should == {:msgid=>'xxx',:msgstr=>'yyy',:comment=>"test\nanother\n"}
|
38
|
+
end
|
32
39
|
end
|
33
40
|
|
34
41
|
describe "instance interface" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grosser-pomo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-01 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -19,23 +19,20 @@ executables: []
|
|
19
19
|
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.markdown
|
24
24
|
files:
|
25
25
|
- README.markdown
|
26
26
|
- VERSION.yml
|
27
|
-
- lib/pomo
|
28
27
|
- lib/pomo.rb
|
29
28
|
- lib/pomo/mo_file.rb
|
30
29
|
- lib/pomo/po_file.rb
|
31
30
|
- lib/pomo/translation.rb
|
32
|
-
- spec/files
|
33
31
|
- spec/files/complex.mo
|
34
32
|
- spec/files/empty.mo
|
35
33
|
- spec/files/plural.mo
|
36
34
|
- spec/files/singular.mo
|
37
35
|
- spec/files/singular_2.mo
|
38
|
-
- spec/pomo
|
39
36
|
- spec/pomo/mo_file_spec.rb
|
40
37
|
- spec/pomo/po_file_spec.rb
|
41
38
|
- spec/pomo/translation_spec.rb
|
@@ -47,7 +44,6 @@ has_rdoc: true
|
|
47
44
|
homepage: http://github.com/grosser/pomo
|
48
45
|
post_install_message:
|
49
46
|
rdoc_options:
|
50
|
-
- --inline-source
|
51
47
|
- --charset=UTF-8
|
52
48
|
require_paths:
|
53
49
|
- lib
|
@@ -70,5 +66,8 @@ rubygems_version: 1.2.0
|
|
70
66
|
signing_key:
|
71
67
|
specification_version: 2
|
72
68
|
summary: "Ruby/Gettext: A .po and .mo file parser/generator"
|
73
|
-
test_files:
|
74
|
-
|
69
|
+
test_files:
|
70
|
+
- spec/pomo/po_file_spec.rb
|
71
|
+
- spec/pomo/translation_spec.rb
|
72
|
+
- spec/pomo/mo_file_spec.rb
|
73
|
+
- spec/spec_helper.rb
|