human_languages 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/README.adoc +4 -3
- data/lib/languages/language.rb +5 -5
- data/lib/languages/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 489b4489fe9b7876f89b546cac2af3dd117c332abae8ef2c1b377333a9104ba2
|
4
|
+
data.tar.gz: d77024e2dde0ab3406c8af9ed9232a8db3e231bb744162036371d77bedfa58a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34cb96b079be9f1e2fcd51310bbb6b765eb66c03b9fb3890275ec0ff1963aa4b39812957ebc62ce69565cb0ca8ef44fd8e0816c1a6c19c7d61d9fd8d1907149b
|
7
|
+
data.tar.gz: aed1c7282a4690314f226e50acdc13a31f03231deb1619c842e854d1af1ff97564d3fd4c19a58a63edcd62b7c9078899b28b4cebd6f9f6403fc3be6d213c6ebb
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.6.0] - 2022-06-08
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
- Name of gem `languages` -> `human_languages`
|
15
|
+
- Language's attribute `scope` is now a Symbol (previously String)
|
16
|
+
- Language's attribute `type` is now a Symbol (previously String)
|
17
|
+
|
10
18
|
## [0.5.0] - 2022-06-06
|
11
19
|
|
12
20
|
### Changed
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
|
4
|
+
human_languages (0.5.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
rake (13.0.6)
|
16
16
|
regexp_parser (2.5.0)
|
17
17
|
rexml (3.2.5)
|
18
|
-
rubocop (1.30.
|
18
|
+
rubocop (1.30.1)
|
19
19
|
parallel (~> 1.10)
|
20
20
|
parser (>= 3.1.0.0)
|
21
21
|
rainbow (>= 2.2.2, < 4.0)
|
@@ -37,10 +37,10 @@ PLATFORMS
|
|
37
37
|
x86_64-linux
|
38
38
|
|
39
39
|
DEPENDENCIES
|
40
|
-
|
40
|
+
human_languages!
|
41
41
|
minitest (~> 5.0)
|
42
42
|
rake (~> 13.0)
|
43
|
-
rubocop (~> 1.
|
43
|
+
rubocop (~> 1.30)
|
44
44
|
rubocop-minitest (~> 0.20.0)
|
45
45
|
rubocop-rake (~> 0.6.0)
|
46
46
|
|
data/README.adoc
CHANGED
@@ -3,7 +3,7 @@ Benno Bielmeier
|
|
3
3
|
:source-language: ruby
|
4
4
|
|
5
5
|
image:https://api.reuse.software/badge/github.com/bbenno/languages[link="https://api.reuse.software/info/github.com/bbenno/languages", alt="REUSE status"]
|
6
|
-
image:https://
|
6
|
+
image:https://badge.fury.io/rb/human_languages.svg["Gem Version", link="https://badge.fury.io/rb/human_languages"]
|
7
7
|
|
8
8
|
image:https://img.shields.io/maintenance/yes/2022[Maintenance]
|
9
9
|
image:https://github.com/bbenno/languages/actions/workflows/main.yml/badge.svg[link="https://github.com/bbenno/languages/actions/workflows/main.yml"]
|
@@ -91,6 +91,7 @@ Languages.all.select { |l| %w[ancient historical].include?(l.type) }
|
|
91
91
|
=== Data Objects
|
92
92
|
|
93
93
|
The `Language` objects have a simple read-only interface:
|
94
|
+
|
94
95
|
[source]
|
95
96
|
----
|
96
97
|
language = Language[:fr]
|
@@ -100,8 +101,8 @@ language.alpha2 # => :fr (alias for #iso639_1)
|
|
100
101
|
language.alpha3 # => :fra (alias for #iso639_3)
|
101
102
|
language.alpha3_bibliographic # => :fre (alias for #iso_639_2b)
|
102
103
|
language.alpha3_terminology # => :fra (alias for #iso_639_2t)
|
103
|
-
language.type # =>
|
104
|
-
language.scope # =>
|
104
|
+
language.type # => :living
|
105
|
+
language.scope # => :individual
|
105
106
|
|
106
107
|
language.extinct? # => false
|
107
108
|
language.living? # => true
|
data/lib/languages/language.rb
CHANGED
@@ -7,13 +7,13 @@ module Languages
|
|
7
7
|
|
8
8
|
attr_reader :iso639_1, :iso639_2b, :iso639_2t, :iso639_3, :scope, :type, :name # , :comment
|
9
9
|
|
10
|
-
def initialize(csv_attributes) # rubocop:disable Metrics/AbcSize
|
10
|
+
def initialize(csv_attributes) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
|
11
11
|
@iso639_3 = csv_attributes.fetch(:id).to_sym
|
12
12
|
@iso639_2b = csv_attributes.fetch(:part2b)&.to_sym
|
13
13
|
@iso639_2t = csv_attributes.fetch(:part2t)&.to_sym
|
14
14
|
@iso639_1 = csv_attributes.fetch(:part1)&.to_sym
|
15
|
-
@scope = SCOPES.detect { |s| s.chr.upcase == csv_attributes.fetch(:scope) }
|
16
|
-
@type = TYPES.detect { |t| t.chr.upcase == csv_attributes.fetch(:language_type) }
|
15
|
+
@scope = SCOPES.detect { |s| s.chr.upcase == csv_attributes.fetch(:scope) }&.to_sym
|
16
|
+
@type = TYPES.detect { |t| t.chr.upcase == csv_attributes.fetch(:language_type) }&.to_sym
|
17
17
|
@name = csv_attributes.fetch(:ref_name)
|
18
18
|
# @comment = csv_attributes.fetch(:comment)
|
19
19
|
end
|
@@ -32,7 +32,7 @@ module Languages
|
|
32
32
|
|
33
33
|
TYPES.each do |type|
|
34
34
|
define_method "#{type}?" do
|
35
|
-
self.type == type
|
35
|
+
self.type == type.to_sym
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -41,7 +41,7 @@ module Languages
|
|
41
41
|
method_name = scope.end_with?('language') ? scope : "#{scope}_language"
|
42
42
|
|
43
43
|
define_method "#{method_name}?" do
|
44
|
-
self.scope == scope
|
44
|
+
self.scope == scope.to_sym
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
data/lib/languages/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: human_languages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benno Bielmeier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ISO 639-3 is a set of codes that defines three-letter identifiers for
|
14
14
|
all known human languages.
|
@@ -41,6 +41,7 @@ metadata:
|
|
41
41
|
source_code_uri: https://github.com/bbenno/languages
|
42
42
|
changelog_uri: https://github.com/bbenno/languages/blob/HEAD/CHANGELOG.md
|
43
43
|
rubygems_mfa_required: 'true'
|
44
|
+
github_repo: git@github.com:bbenno/languages.git
|
44
45
|
post_install_message:
|
45
46
|
rdoc_options: []
|
46
47
|
require_paths:
|