iso 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 67580a57cc7aa0030257ef3d0ac4f08285b54427
4
- data.tar.gz: 4ca858da5af2c1c7356b8886acf81796116ace9a
2
+ SHA256:
3
+ metadata.gz: 73ac639564aea0ff8452e12700723542ab0680976c594a8a4def9428cc8272e1
4
+ data.tar.gz: 94221235e9d9b87c784b206c3567d3a4cd1d90704ebadadd39fdb67ab68c29c0
5
5
  SHA512:
6
- metadata.gz: 4195557514964da4afeca0319618ca40ecba136ee4ee214d3111dbe12ba235adb99d648fb75692c3e22158315145e11c5461ab54359ebfda85c1b1a7789ec8f1
7
- data.tar.gz: 95705a4875ffb1d12a499a7f6e8978495fa81d986460e25ccd80cb0439549f7149e2a7ce5f187c06fa56576aead7a8c666ba3ba9b514fcbfcc22843b590d0a0f
6
+ metadata.gz: 6d2ebc1de12710b1bb3f7ed9e899e007a62fea609cd0d998b112ca32450b9932f6d1c56c4647e9bc37de02d2074fc8da88a67ddc104972ff88982e2b4bef2c50
7
+ data.tar.gz: 60fa2d39c8a44039dc3291d5ac6772b29cbc611ad95b7dbfa4f051cbabed04a9aa0d5530a48502c620d961933e47dcbed9d011e1d3094aa24bded9ee2b9c824f
data/Gemfile CHANGED
@@ -3,10 +3,10 @@ source "http://rubygems.org"
3
3
  gem "i18n"
4
4
 
5
5
  group :development do
6
- gem "rspec", "~> 2.8.0"
7
- gem "rdoc", "~> 3.12"
8
- gem "bundler", "~> 1.2.0"
9
- gem "jeweler", "~> 1.8.4"
6
+ gem "rspec", "~> 3.9"
7
+ gem "rdoc", "~> 6.2"
8
+ gem "bundler", "~> 2.0"
9
+ gem "jeweler", "~> 2.3"
10
10
  gem "guard-rspec"
11
11
  gem "localeapp"
12
12
  end
@@ -1,62 +1,137 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- diff-lcs (1.1.3)
5
- ffi (1.1.5)
6
- git (1.2.5)
7
- gli (2.1.0)
8
- guard (1.3.2)
9
- listen (>= 0.4.2)
10
- thor (>= 0.14.6)
11
- guard-rspec (1.2.1)
12
- guard (>= 1.1)
13
- i18n (0.6.1)
14
- jeweler (1.8.4)
15
- bundler (~> 1.0)
4
+ addressable (2.4.0)
5
+ builder (3.2.3)
6
+ coderay (1.1.2)
7
+ concurrent-ruby (1.1.5)
8
+ descendants_tracker (0.0.4)
9
+ thread_safe (~> 0.3, >= 0.3.1)
10
+ diff-lcs (1.3)
11
+ domain_name (0.5.20190701)
12
+ unf (>= 0.0.5, < 1.0.0)
13
+ faraday (0.9.2)
14
+ multipart-post (>= 1.2, < 3)
15
+ ffi (1.11.3)
16
+ formatador (0.2.5)
17
+ git (1.5.0)
18
+ github_api (0.16.0)
19
+ addressable (~> 2.4.0)
20
+ descendants_tracker (~> 0.0.4)
21
+ faraday (~> 0.8, < 0.10)
22
+ hashie (>= 3.4)
23
+ mime-types (>= 1.16, < 3.0)
24
+ oauth2 (~> 1.0)
25
+ gli (2.19.0)
26
+ guard (2.16.1)
27
+ formatador (>= 0.2.4)
28
+ listen (>= 2.7, < 4.0)
29
+ lumberjack (>= 1.0.12, < 2.0)
30
+ nenv (~> 0.1)
31
+ notiffany (~> 0.0)
32
+ pry (>= 0.9.12)
33
+ shellany (~> 0.0)
34
+ thor (>= 0.18.1)
35
+ guard-compat (1.2.1)
36
+ guard-rspec (4.7.3)
37
+ guard (~> 2.1)
38
+ guard-compat (~> 1.1)
39
+ rspec (>= 2.99.0, < 4.0)
40
+ hashie (4.0.0)
41
+ highline (2.0.3)
42
+ http-accept (1.7.0)
43
+ http-cookie (1.0.3)
44
+ domain_name (~> 0.5)
45
+ i18n (1.7.0)
46
+ concurrent-ruby (~> 1.0)
47
+ jeweler (2.3.9)
48
+ builder
49
+ bundler
16
50
  git (>= 1.2.5)
51
+ github_api (~> 0.16.0)
52
+ highline (>= 1.6.15)
53
+ nokogiri (>= 1.5.10)
54
+ psych
17
55
  rake
18
56
  rdoc
19
- json (1.7.5)
20
- listen (0.4.7)
21
- rb-fchange (~> 0.0.5)
22
- rb-fsevent (~> 0.9.1)
23
- rb-inotify (~> 0.8.8)
24
- localeapp (0.5.2)
57
+ semver2
58
+ json (2.2.0)
59
+ jwt (2.2.1)
60
+ listen (3.2.0)
61
+ rb-fsevent (~> 0.10, >= 0.10.3)
62
+ rb-inotify (~> 0.9, >= 0.9.10)
63
+ localeapp (3.1.2)
25
64
  gli
26
- i18n
27
- json
28
- rest-client
29
- ya2yaml
30
- mime-types (1.19)
31
- rake (0.9.2.2)
32
- rb-fchange (0.0.5)
33
- ffi
34
- rb-fsevent (0.9.1)
35
- rb-inotify (0.8.8)
36
- ffi (>= 0.5.0)
37
- rdoc (3.12)
38
- json (~> 1.4)
39
- rest-client (1.6.7)
40
- mime-types (>= 1.16)
41
- rspec (2.8.0)
42
- rspec-core (~> 2.8.0)
43
- rspec-expectations (~> 2.8.0)
44
- rspec-mocks (~> 2.8.0)
45
- rspec-core (2.8.0)
46
- rspec-expectations (2.8.0)
47
- diff-lcs (~> 1.1.2)
48
- rspec-mocks (2.8.0)
49
- thor (0.16.0)
50
- ya2yaml (0.31)
65
+ i18n (>= 0.7, < 2)
66
+ json (>= 1.7.7)
67
+ rest-client (>= 1.8.0)
68
+ lumberjack (1.0.13)
69
+ method_source (0.9.2)
70
+ mime-types (2.99.3)
71
+ mini_portile2 (2.4.0)
72
+ multi_json (1.14.1)
73
+ multi_xml (0.6.0)
74
+ multipart-post (2.1.1)
75
+ nenv (0.3.0)
76
+ netrc (0.11.0)
77
+ nokogiri (1.10.6)
78
+ mini_portile2 (~> 2.4.0)
79
+ notiffany (0.1.3)
80
+ nenv (~> 0.1)
81
+ shellany (~> 0.0)
82
+ oauth2 (1.4.2)
83
+ faraday (>= 0.8, < 2.0)
84
+ jwt (>= 1.0, < 3.0)
85
+ multi_json (~> 1.3)
86
+ multi_xml (~> 0.5)
87
+ rack (>= 1.2, < 3)
88
+ pry (0.12.2)
89
+ coderay (~> 1.1.0)
90
+ method_source (~> 0.9.0)
91
+ psych (3.1.0)
92
+ rack (2.0.7)
93
+ rake (13.0.1)
94
+ rb-fsevent (0.10.3)
95
+ rb-inotify (0.10.0)
96
+ ffi (~> 1.0)
97
+ rdoc (6.2.0)
98
+ rest-client (2.1.0)
99
+ http-accept (>= 1.7.0, < 2.0)
100
+ http-cookie (>= 1.0.2, < 2.0)
101
+ mime-types (>= 1.16, < 4.0)
102
+ netrc (~> 0.8)
103
+ rspec (3.9.0)
104
+ rspec-core (~> 3.9.0)
105
+ rspec-expectations (~> 3.9.0)
106
+ rspec-mocks (~> 3.9.0)
107
+ rspec-core (3.9.0)
108
+ rspec-support (~> 3.9.0)
109
+ rspec-expectations (3.9.0)
110
+ diff-lcs (>= 1.2.0, < 2.0)
111
+ rspec-support (~> 3.9.0)
112
+ rspec-mocks (3.9.0)
113
+ diff-lcs (>= 1.2.0, < 2.0)
114
+ rspec-support (~> 3.9.0)
115
+ rspec-support (3.9.0)
116
+ semver2 (3.4.2)
117
+ shellany (0.0.1)
118
+ thor (0.20.3)
119
+ thread_safe (0.3.6)
120
+ unf (0.1.4)
121
+ unf_ext
122
+ unf_ext (0.0.7.6)
51
123
 
52
124
  PLATFORMS
53
125
  ruby
54
126
 
55
127
  DEPENDENCIES
56
- bundler (~> 1.2.0)
128
+ bundler (~> 2.0)
57
129
  guard-rspec
58
130
  i18n
59
- jeweler (~> 1.8.4)
131
+ jeweler (~> 2.3)
60
132
  localeapp
61
- rdoc (~> 3.12)
62
- rspec (~> 2.8.0)
133
+ rdoc (~> 6.2)
134
+ rspec (~> 3.9)
135
+
136
+ BUNDLED WITH
137
+ 2.0.2
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # iso
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/tigrish/iso.png)](http://travis-ci.org/tigrish/iso)
3
+ [![Build Status](https://travis-ci.org/Locale/iso.svg?branch=master)](https://travis-ci.org/Locale/iso)
4
4
 
5
5
  This project is a ruby implementation of ISO 639-1 alpha2 and ISO 3166-1. It includes definitions of all two letter language and region codes.
6
6
 
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
20
20
  gem.summary = %Q{A ruby implementation of ISO}
21
21
  gem.description = %Q{A subset of the ISO spec implemented in ruby}
22
22
  gem.email = "chris@tigrish.com"
23
- gem.authors = ["Christopher Dell"]
23
+ gem.authors = ["Christopher Dell", "Thibault Dalban"]
24
24
  # dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.2
1
+ 0.3.0
@@ -94,6 +94,7 @@ hr:
94
94
  ht:
95
95
  hu:
96
96
  plural_rule_names:
97
+ - one
97
98
  - other
98
99
  hy:
99
100
  hz:
@@ -2,18 +2,18 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: iso 0.2.2 ruby lib
5
+ # stub: iso 0.3.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
- s.name = "iso"
9
- s.version = "0.2.2"
8
+ s.name = "iso".freeze
9
+ s.version = "0.3.0"
10
10
 
11
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
- s.require_paths = ["lib"]
13
- s.authors = ["Christopher Dell"]
14
- s.date = "2016-07-13"
15
- s.description = "A subset of the ISO spec implemented in ruby"
16
- s.email = "chris@tigrish.com"
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib".freeze]
13
+ s.authors = ["Christopher Dell".freeze, "Thibault Dalban".freeze]
14
+ s.date = "2019-12-04"
15
+ s.description = "A subset of the ISO spec implemented in ruby".freeze
16
+ s.email = "chris@tigrish.com".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "LICENSE.txt",
19
19
  "README.md"
@@ -48,39 +48,39 @@ Gem::Specification.new do |s|
48
48
  "spec/lib/iso/un/region_spec.rb",
49
49
  "spec/spec_helper.rb"
50
50
  ]
51
- s.homepage = "http://github.com/tigrish/iso"
52
- s.licenses = ["MIT"]
53
- s.rubygems_version = "2.4.6"
54
- s.summary = "A ruby implementation of ISO"
51
+ s.homepage = "http://github.com/tigrish/iso".freeze
52
+ s.licenses = ["MIT".freeze]
53
+ s.rubygems_version = "3.0.6".freeze
54
+ s.summary = "A ruby implementation of ISO".freeze
55
55
 
56
56
  if s.respond_to? :specification_version then
57
57
  s.specification_version = 4
58
58
 
59
59
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
60
- s.add_runtime_dependency(%q<i18n>, [">= 0"])
61
- s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
62
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
63
- s.add_development_dependency(%q<bundler>, ["~> 1.2.0"])
64
- s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
65
- s.add_development_dependency(%q<guard-rspec>, [">= 0"])
66
- s.add_development_dependency(%q<localeapp>, [">= 0"])
60
+ s.add_runtime_dependency(%q<i18n>.freeze, [">= 0"])
61
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9"])
62
+ s.add_development_dependency(%q<rdoc>.freeze, ["~> 6.2"])
63
+ s.add_development_dependency(%q<bundler>.freeze, ["~> 2.0"])
64
+ s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3"])
65
+ s.add_development_dependency(%q<guard-rspec>.freeze, [">= 0"])
66
+ s.add_development_dependency(%q<localeapp>.freeze, [">= 0"])
67
67
  else
68
- s.add_dependency(%q<i18n>, [">= 0"])
69
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
70
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
71
- s.add_dependency(%q<bundler>, ["~> 1.2.0"])
72
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
73
- s.add_dependency(%q<guard-rspec>, [">= 0"])
74
- s.add_dependency(%q<localeapp>, [">= 0"])
68
+ s.add_dependency(%q<i18n>.freeze, [">= 0"])
69
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.9"])
70
+ s.add_dependency(%q<rdoc>.freeze, ["~> 6.2"])
71
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.0"])
72
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.3"])
73
+ s.add_dependency(%q<guard-rspec>.freeze, [">= 0"])
74
+ s.add_dependency(%q<localeapp>.freeze, [">= 0"])
75
75
  end
76
76
  else
77
- s.add_dependency(%q<i18n>, [">= 0"])
78
- s.add_dependency(%q<rspec>, ["~> 2.8.0"])
79
- s.add_dependency(%q<rdoc>, ["~> 3.12"])
80
- s.add_dependency(%q<bundler>, ["~> 1.2.0"])
81
- s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
82
- s.add_dependency(%q<guard-rspec>, [">= 0"])
83
- s.add_dependency(%q<localeapp>, [">= 0"])
77
+ s.add_dependency(%q<i18n>.freeze, [">= 0"])
78
+ s.add_dependency(%q<rspec>.freeze, ["~> 3.9"])
79
+ s.add_dependency(%q<rdoc>.freeze, ["~> 6.2"])
80
+ s.add_dependency(%q<bundler>.freeze, ["~> 2.0"])
81
+ s.add_dependency(%q<jeweler>.freeze, ["~> 2.3"])
82
+ s.add_dependency(%q<guard-rspec>.freeze, [">= 0"])
83
+ s.add_dependency(%q<localeapp>.freeze, [">= 0"])
84
84
  end
85
85
  end
86
86
 
data/lib/iso.rb CHANGED
@@ -2,8 +2,8 @@ require 'i18n'
2
2
  I18n.load_path << Dir[File.join(File.expand_path(File.dirname(__FILE__) + '/../locales'), '*.yml')]
3
3
  I18n.load_path.flatten!
4
4
 
5
- require 'iso/tag'
6
- require 'iso/subtag'
7
- require 'iso/language'
8
- require 'iso/region'
9
- require 'iso/un/region'
5
+ require_relative 'iso/tag'
6
+ require_relative 'iso/subtag'
7
+ require_relative 'iso/language'
8
+ require_relative 'iso/region'
9
+ require_relative 'iso/un/region'
@@ -4,50 +4,50 @@ describe ISO::Language do
4
4
  let(:language) { ISO::Language.new('de', name: 'German') }
5
5
 
6
6
  it "is a ISO Subtag" do
7
- language.should be_kind_of(ISO::Subtag)
7
+ expect(language).to be_kind_of(ISO::Subtag)
8
8
  end
9
9
 
10
10
  it "has a code" do
11
- language.code.should == 'de'
11
+ expect(language.code).to eq 'de'
12
12
  end
13
13
 
14
14
  it "has a name" do
15
- language.name.should == 'German'
15
+ expect(language.name).to eq 'German'
16
16
  end
17
17
 
18
18
  describe "#plural_rule_names" do
19
19
  it "defaults to %w(one other)" do
20
- language.plural_rule_names.should == ISO::Language::DEFAULT_PLURAL_RULE_NAMES
20
+ expect(language.plural_rule_names).to eq ISO::Language::DEFAULT_PLURAL_RULE_NAMES
21
21
  end
22
22
 
23
23
  it "is overwriteable" do
24
24
  language = ISO::Language.new('ja', plural_rule_names: ['other'])
25
- language.plural_rule_names.should == ['other']
25
+ expect(language.plural_rule_names).to eq ['other']
26
26
  end
27
27
  end
28
28
 
29
29
  describe "#direction" do
30
30
  it "defaults to 'ltr'" do
31
- language.direction.should == 'ltr'
31
+ expect(language.direction).to eq 'ltr'
32
32
  end
33
33
 
34
34
  it "is overwriteable" do
35
35
  language = ISO::Language.new('ar', direction: :rtl)
36
- language.direction.should == :rtl
36
+ expect(language.direction).to eq :rtl
37
37
  end
38
38
  end
39
39
 
40
40
  describe ".identify(full_code)" do
41
41
  it "identifies from 'de'" do
42
- ISO::Language.identify('de').should == ISO::Language.new('de')
42
+ expect(ISO::Language.identify('de')).to eq ISO::Language.new('de')
43
43
  end
44
44
 
45
45
  it "identifies from 'fr-CH'" do
46
- ISO::Language.identify('fr-CH').should == ISO::Language.new('fr')
46
+ expect(ISO::Language.identify('fr-CH')).to eq ISO::Language.new('fr')
47
47
  end
48
48
 
49
49
  it "returns nil when it can't identify" do
50
- ISO::Language.identify('csb').should be_nil
50
+ expect(ISO::Language.identify('csb')).to be_nil
51
51
  end
52
52
  end
53
53
  end
@@ -4,28 +4,28 @@ describe ISO::Region do
4
4
  let(:region) { ISO::Region.new('FR', name: 'France') }
5
5
 
6
6
  it "is a ISO Subtag" do
7
- region.should be_kind_of(ISO::Subtag)
7
+ expect(region).to be_kind_of(ISO::Subtag)
8
8
  end
9
9
 
10
10
  it "has a code" do
11
- region.code.should == 'FR'
11
+ expect(region.code).to eq 'FR'
12
12
  end
13
13
 
14
14
  it "has a name" do
15
- region.name.should == 'France'
15
+ expect(region.name).to eq 'France'
16
16
  end
17
17
 
18
18
  describe ".identify(full_code)" do
19
19
  it "identifies from 'fr-CH'" do
20
- ISO::Region.identify('fr-CH').should == ISO::Region.find('CH')
20
+ expect(ISO::Region.identify('fr-CH')).to eq ISO::Region.find('CH')
21
21
  end
22
22
 
23
23
  it "identifies from 'es_MX" do
24
- ISO::Region.identify('es_MX').should == ISO::Region.find('MX')
24
+ expect(ISO::Region.identify('es_MX')).to eq ISO::Region.find('MX')
25
25
  end
26
26
 
27
27
  it "returns nil when it can't identify" do
28
- ISO::Region.identify('gsw').should be_nil
28
+ expect(ISO::Region.identify('gsw')).to be_nil
29
29
  end
30
30
  end
31
31
  end
@@ -12,11 +12,11 @@ end
12
12
  describe ISO::Subtag do
13
13
  describe "#==(object)" do
14
14
  it "returns true when both have the same code" do
15
- ISO::Region.find('SY').should == ISO::Region.find('SY')
15
+ expect(ISO::Region.find('SY')).to eq ISO::Region.find('SY')
16
16
  end
17
17
 
18
18
  it "returns false when they have different codes" do
19
- ISO::Region.find('FR').should_not == ISO::Region.find('GB')
19
+ expect(ISO::Region.find('FR')).to_not eq ISO::Region.find('GB')
20
20
  end
21
21
  end
22
22
 
@@ -25,13 +25,13 @@ describe ISO::Subtag do
25
25
  let(:mars) { ISO::Subtag.new('MRS') }
26
26
 
27
27
  it 'will accept a name option' do
28
- I18n.should_not_receive(:t)
29
- fake_region.name.should == 'This is a lie'
28
+ expect(I18n).to_not receive(:t)
29
+ expect(fake_region.name).to eq 'This is a lie'
30
30
  end
31
31
 
32
32
  it 'falls back to the translation' do
33
- I18n.should_receive(:t).with('MRS', scope: 'vendor.iso').and_return('Mars')
34
- mars.name.should == 'Mars'
33
+ expect(I18n).to receive(:t).with('MRS', scope: 'vendor.iso').and_return('Mars')
34
+ expect(mars.name).to eq 'Mars'
35
35
  end
36
36
 
37
37
  end
@@ -39,41 +39,41 @@ describe ISO::Subtag do
39
39
  describe "#full_name" do
40
40
  it "is composed of the code and the name" do
41
41
  full_name = Subtag.find('fr').full_name
42
- full_name.should match(/fr/)
43
- full_name.should match(/French/)
42
+ expect(full_name).to match(/fr/)
43
+ expect(full_name).to match(/French/)
44
44
  end
45
45
  end
46
46
 
47
47
  describe ".all" do
48
48
  it "gets its definition from the DEFINITIONS_FILE" do
49
49
  subtags = Subtag.all
50
- subtags[0].should == Subtag.find('en')
51
- subtags[1].should == Subtag.find('fr')
52
- subtags[2].should == Subtag.find('de')
50
+ expect(subtags[0]).to eq Subtag.find('en')
51
+ expect(subtags[1]).to eq Subtag.find('fr')
52
+ expect(subtags[2]).to eq Subtag.find('de')
53
53
  end
54
54
  end
55
55
 
56
56
  describe ".find(code)" do
57
57
  it "finds a subtag by code" do
58
58
  subtag = Subtag.find('de')
59
- subtag.code.should == 'de'
60
- subtag.name.should == 'German'
59
+ expect(subtag.code).to eq 'de'
60
+ expect(subtag.name).to eq 'German'
61
61
  end
62
62
 
63
63
  it "returns nil when no language can be found" do
64
- Subtag.find('xxxx').should be_nil
64
+ expect(Subtag.find('xxxx')).to be_nil
65
65
  end
66
66
  end
67
67
 
68
68
  describe ".default" do
69
69
  it "finds from DEFAULT_CODE" do
70
- Subtag.default.should == Subtag.find('fr')
70
+ expect(Subtag.default).to eq Subtag.find('fr')
71
71
  end
72
72
  end
73
73
 
74
74
  describe ".codes" do
75
75
  it "returns an array of all codes" do
76
- Subtag.codes.should == %w(en fr de)
76
+ expect(Subtag.codes).to eq %w(en fr de)
77
77
  end
78
78
  end
79
79
  end
@@ -4,90 +4,90 @@ describe ISO::Tag do
4
4
  describe ".new(code)" do
5
5
  it "returns a tag containing the language and region" do
6
6
  tag = ISO::Tag.new('en-MX')
7
- tag.language.code.should == 'en'
8
- tag.region.code.should == 'MX'
7
+ expect(tag.language.code).to eq 'en'
8
+ expect(tag.region.code).to eq 'MX'
9
9
  end
10
10
 
11
11
  it "returns a tag containing the language and UN region" do
12
12
  tag = ISO::Tag.new('en-419')
13
- tag.language.code.should == 'en'
14
- tag.region.code.should == '419'
13
+ expect(tag.language.code).to eq 'en'
14
+ expect(tag.region.code).to eq '419'
15
15
  end
16
16
 
17
17
  it "returns a tag containing the language only" do
18
18
  tag = ISO::Tag.new('en-XXXXXX')
19
- tag.language.code.should == 'en'
20
- tag.region.should be_nil
19
+ expect(tag.language.code).to eq 'en'
20
+ expect(tag.region).to be_nil
21
21
  end
22
22
 
23
23
  it "returns a tag containing the region only" do
24
24
  tag = ISO::Tag.new('gsw-CH')
25
- tag.language.should be_nil
26
- tag.region.code.should == 'CH'
25
+ expect(tag.language).to be_nil
26
+ expect(tag.region.code).to eq 'CH'
27
27
  end
28
-
28
+
29
29
  it "returns a tag containing the UN region only" do
30
30
  tag = ISO::Tag.new('gsw-419')
31
- tag.language.should be_nil
32
- tag.region.code.should == '419'
31
+ expect(tag.language).to be_nil
32
+ expect(tag.region.code).to eq '419'
33
33
  end
34
34
 
35
35
  it "returns a tag containing no language or region" do
36
36
  tag = ISO::Tag.new('csb-XXXXXX')
37
- tag.language.should be_nil
38
- tag.region.should be_nil
37
+ expect(tag.language).to be_nil
38
+ expect(tag.region).to be_nil
39
39
  end
40
40
  end
41
41
 
42
42
  describe "#codes" do
43
43
  it "returns an array containing each subtag's code" do
44
- ISO::Tag.new('en-US').codes.should == %w(en US)
44
+ expect(ISO::Tag.new('en-US').codes).to eq %w(en US)
45
45
  end
46
46
  end
47
47
 
48
48
  describe "#subtags" do
49
49
  it "returns an array containing the language" do
50
50
  tag = ISO::Tag.new('fr')
51
- tag.subtags.size.should == 1
52
- tag.subtags.first.should be_kind_of(ISO::Language)
53
- tag.subtags.first.code.should == 'fr'
51
+ expect(tag.subtags.size).to eq 1
52
+ expect(tag.subtags.first).to be_kind_of(ISO::Language)
53
+ expect(tag.subtags.first.code).to eq 'fr'
54
54
  end
55
55
 
56
56
  it "returns an array containing the language and the region" do
57
57
  tag = ISO::Tag.new('fr-CH')
58
- tag.subtags.size.should == 2
58
+ expect(tag.subtags.size).to eq 2
59
59
 
60
- tag.subtags.first.should be_kind_of(ISO::Language)
61
- tag.subtags.first.code.should == 'fr'
60
+ expect(tag.subtags.first).to be_kind_of(ISO::Language)
61
+ expect(tag.subtags.first.code).to eq 'fr'
62
62
 
63
- tag.subtags.last.should be_kind_of(ISO::Region)
64
- tag.subtags.last.code.should == 'CH'
63
+ expect(tag.subtags.last).to be_kind_of(ISO::Region)
64
+ expect(tag.subtags.last.code).to eq 'CH'
65
65
  end
66
66
  end
67
67
 
68
68
  describe "#valid?" do
69
69
  it "returns true when a valid language is supplied" do
70
- ISO::Tag.new('da').should be_valid
70
+ expect(ISO::Tag.new('da')).to be_valid
71
71
  end
72
72
 
73
73
  it "returns true when a valid language and region are supplied" do
74
- ISO::Tag.new('da-AT').should be_valid
74
+ expect(ISO::Tag.new('da-AT')).to be_valid
75
75
  end
76
76
 
77
77
  it "returns true when a valid language an UN region are supplied" do
78
- ISO::Tag.new('es-419').should be_valid
78
+ expect(ISO::Tag.new('es-419')).to be_valid
79
79
  end
80
80
 
81
81
  it "returns false when no code is supplied" do
82
- ISO::Tag.new('').should_not be_valid
82
+ expect(ISO::Tag.new('')).to_not be_valid
83
83
  end
84
84
 
85
85
  it "returns false when supplied language is invalid" do
86
- ISO::Tag.new('lol').should_not be_valid
86
+ expect(ISO::Tag.new('lol')).to_not be_valid
87
87
  end
88
88
 
89
89
  it "returns false when supplied region is invalid" do
90
- ISO::Tag.new('en-lol').should_not be_valid
90
+ expect(ISO::Tag.new('en-lol')).to_not be_valid
91
91
  end
92
92
 
93
93
  end
@@ -6,33 +6,33 @@ describe ISO::UN::Region do
6
6
 
7
7
  describe "#iso_code" do
8
8
  it "returns the corresponding iso code" do
9
- has_iso.iso_code.should == 'AF'
9
+ expect(has_iso.iso_code).to eq 'AF'
10
10
  end
11
11
 
12
12
  it "returns nil when there is no corresponding iso code" do
13
- no_iso.iso_code.should be_nil
13
+ expect(no_iso.iso_code).to be_nil
14
14
  end
15
15
  end
16
16
 
17
17
  describe "#name" do
18
18
  it "uses the correct scope when there is an iso code" do
19
- has_iso.name.should == 'Afghanistan'
19
+ expect(has_iso.name).to eq 'Afghanistan'
20
20
  end
21
21
 
22
22
  it "uses the correct scope when there is no iso code" do
23
- no_iso.name.should == 'Africa'
23
+ expect(no_iso.name).to eq 'Africa'
24
24
  end
25
25
  end
26
26
 
27
27
  describe ".identify(full_code)" do
28
28
  it "identifies from 'es-419'" do
29
29
  region = ISO::UN::Region.identify('es-419')
30
- region.should_not be_nil
31
- region.should == ISO::UN::Region.find('419')
30
+ expect(region).to_not be_nil
31
+ expect(region).to eq ISO::UN::Region.find('419')
32
32
  end
33
33
 
34
34
  it "returns nil when it can't identify" do
35
- ISO::UN::Region.identify('gsw').should be_nil
35
+ expect(ISO::UN::Region.identify('gsw')).to be_nil
36
36
  end
37
37
  end
38
38
  end
metadata CHANGED
@@ -1,111 +1,112 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Dell
8
+ - Thibault Dalban
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-07-13 00:00:00.000000000 Z
12
+ date: 2019-12-04 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: i18n
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - '>='
18
+ - - ">="
18
19
  - !ruby/object:Gem::Version
19
20
  version: '0'
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - '>='
25
+ - - ">="
25
26
  - !ruby/object:Gem::Version
26
27
  version: '0'
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: rspec
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - ~>
32
+ - - "~>"
32
33
  - !ruby/object:Gem::Version
33
- version: 2.8.0
34
+ version: '3.9'
34
35
  type: :development
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - ~>
39
+ - - "~>"
39
40
  - !ruby/object:Gem::Version
40
- version: 2.8.0
41
+ version: '3.9'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: rdoc
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - ~>
46
+ - - "~>"
46
47
  - !ruby/object:Gem::Version
47
- version: '3.12'
48
+ version: '6.2'
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - ~>
53
+ - - "~>"
53
54
  - !ruby/object:Gem::Version
54
- version: '3.12'
55
+ version: '6.2'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: bundler
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
- - - ~>
60
+ - - "~>"
60
61
  - !ruby/object:Gem::Version
61
- version: 1.2.0
62
+ version: '2.0'
62
63
  type: :development
63
64
  prerelease: false
64
65
  version_requirements: !ruby/object:Gem::Requirement
65
66
  requirements:
66
- - - ~>
67
+ - - "~>"
67
68
  - !ruby/object:Gem::Version
68
- version: 1.2.0
69
+ version: '2.0'
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: jeweler
71
72
  requirement: !ruby/object:Gem::Requirement
72
73
  requirements:
73
- - - ~>
74
+ - - "~>"
74
75
  - !ruby/object:Gem::Version
75
- version: 1.8.4
76
+ version: '2.3'
76
77
  type: :development
77
78
  prerelease: false
78
79
  version_requirements: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - ~>
81
+ - - "~>"
81
82
  - !ruby/object:Gem::Version
82
- version: 1.8.4
83
+ version: '2.3'
83
84
  - !ruby/object:Gem::Dependency
84
85
  name: guard-rspec
85
86
  requirement: !ruby/object:Gem::Requirement
86
87
  requirements:
87
- - - '>='
88
+ - - ">="
88
89
  - !ruby/object:Gem::Version
89
90
  version: '0'
90
91
  type: :development
91
92
  prerelease: false
92
93
  version_requirements: !ruby/object:Gem::Requirement
93
94
  requirements:
94
- - - '>='
95
+ - - ">="
95
96
  - !ruby/object:Gem::Version
96
97
  version: '0'
97
98
  - !ruby/object:Gem::Dependency
98
99
  name: localeapp
99
100
  requirement: !ruby/object:Gem::Requirement
100
101
  requirements:
101
- - - '>='
102
+ - - ">="
102
103
  - !ruby/object:Gem::Version
103
104
  version: '0'
104
105
  type: :development
105
106
  prerelease: false
106
107
  version_requirements: !ruby/object:Gem::Requirement
107
108
  requirements:
108
- - - '>='
109
+ - - ">="
109
110
  - !ruby/object:Gem::Version
110
111
  version: '0'
111
112
  description: A subset of the ISO spec implemented in ruby
@@ -116,8 +117,8 @@ extra_rdoc_files:
116
117
  - LICENSE.txt
117
118
  - README.md
118
119
  files:
119
- - .document
120
- - .rspec
120
+ - ".document"
121
+ - ".rspec"
121
122
  - Gemfile
122
123
  - Gemfile.lock
123
124
  - Guardfile
@@ -154,17 +155,16 @@ require_paths:
154
155
  - lib
155
156
  required_ruby_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - '>='
158
+ - - ">="
158
159
  - !ruby/object:Gem::Version
159
160
  version: '0'
160
161
  required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  requirements:
162
- - - '>='
163
+ - - ">="
163
164
  - !ruby/object:Gem::Version
164
165
  version: '0'
165
166
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.4.6
167
+ rubygems_version: 3.0.6
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: A ruby implementation of ISO