iso639 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -4
- data/lib/iso639.rb +3 -2
- data/lib/iso639/language.rb +4 -0
- data/lib/iso639/version.rb +1 -1
- data/test/language_test.rb +6 -0
- metadata +1 -1
data/README.md
CHANGED
@@ -29,7 +29,7 @@ $ gem install iso639
|
|
29
29
|
require "iso639"
|
30
30
|
|
31
31
|
# Lookup by alpha-2 codes
|
32
|
-
Iso639["en"] # =>
|
32
|
+
Iso639["en"] # => "English"
|
33
33
|
Iso639["en"].alpha2 # => "en"
|
34
34
|
Iso639["en"].alpha3 # => "eng"
|
35
35
|
Iso639["en"].alpha3_bibliographic # => "eng"
|
@@ -39,7 +39,7 @@ Iso639["en"].english_name # => "English"
|
|
39
39
|
Iso639["en"].french_name # => "anglais"
|
40
40
|
|
41
41
|
# Lookup by alpha-3-bibliographic codes
|
42
|
-
Iso639["fre"] # =>
|
42
|
+
Iso639["fre"] # => "French"
|
43
43
|
Iso639["fre"].alpha2 # => "fr"
|
44
44
|
Iso639["fre"].alpha3 # => "fre"
|
45
45
|
Iso639["fre"].alpha3_bibliographic # => "fre"
|
@@ -49,7 +49,7 @@ Iso639["fre"].english_name # => "French"
|
|
49
49
|
Iso639["fre"].french_name # => "français"
|
50
50
|
|
51
51
|
# Lookup by alpha-3-terminology codes
|
52
|
-
Iso639["fra"] # =>
|
52
|
+
Iso639["fra"] # => "French"
|
53
53
|
Iso639["fra"].alpha2 # => "fr"
|
54
54
|
Iso639["fra"].alpha3 # => "fre"
|
55
55
|
Iso639["fra"].alpha3_bibliographic # => "fre"
|
@@ -59,7 +59,7 @@ Iso639["fra"].english_name # => "French"
|
|
59
59
|
Iso639["fra"].french_name # => "français"
|
60
60
|
|
61
61
|
# Lookup by name
|
62
|
-
Iso639["German"] # =>
|
62
|
+
Iso639["German"] # => "German"
|
63
63
|
Iso639["German"].alpha2 # => "de"
|
64
64
|
Iso639["German"].alpha3 # => "ger"
|
65
65
|
Iso639["German"].alpha3_bibliographic # => "ger"
|
data/lib/iso639.rb
CHANGED
@@ -11,7 +11,7 @@ require "iso639/insensitive_hash"
|
|
11
11
|
#
|
12
12
|
# Examples
|
13
13
|
#
|
14
|
-
# Iso639["en"] # =>
|
14
|
+
# Iso639["en"] # => "English"
|
15
15
|
# Iso639["en"].alpha2 # => "en"
|
16
16
|
# Iso639["en"].alpha3 # => "eng"
|
17
17
|
# Iso639["en"].alpha3_bibliographic # => "eng"
|
@@ -20,7 +20,7 @@ require "iso639/insensitive_hash"
|
|
20
20
|
# Iso639["en"].english_name # => "English"
|
21
21
|
# Iso639["en"].french_name # => "anglais"
|
22
22
|
#
|
23
|
-
# Iso639["German"] # =>
|
23
|
+
# Iso639["German"] # => "German"
|
24
24
|
# Iso639["German"].alpha2 # => "de"
|
25
25
|
# Iso639["German"].alpha3 # => "ger"
|
26
26
|
# Iso639["German"].alpha3_bibliographic # => "ger"
|
@@ -51,6 +51,7 @@ module Iso639
|
|
51
51
|
#
|
52
52
|
# Examples
|
53
53
|
#
|
54
|
+
# Iso639["en"] # => "English"
|
54
55
|
# Iso639["en"].alpha3 # => "eng"
|
55
56
|
# Iso639["English"].alpha2 # => "en"
|
56
57
|
# Iso639["FRENCH"].alpha3 # => "fre"
|
data/lib/iso639/language.rb
CHANGED
data/lib/iso639/version.rb
CHANGED
data/test/language_test.rb
CHANGED
@@ -33,6 +33,12 @@ describe Iso639::Language do
|
|
33
33
|
assert_nil lang.french_name
|
34
34
|
end
|
35
35
|
|
36
|
+
it "should return english name for #to_s" do
|
37
|
+
lang = Iso639::Language.new "", "", "", "English", ""
|
38
|
+
assert_equal "English", lang.to_s
|
39
|
+
assert_equal "English", "#{lang}"
|
40
|
+
end
|
41
|
+
|
36
42
|
it "should not be mutable" do
|
37
43
|
lang = Iso639::Language.new("eng", nil, "en", "English", "anglais").freeze
|
38
44
|
begin
|