strain-code 0.3.11 → 0.4.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d58f651a19a791169bbda604bd4fa18d3d10874fb02ad5849fffb2f509b5719
4
- data.tar.gz: 704bb4235a78d1d9f85077d45703e409a789e297c611870b2770b0d9b364e9d1
3
+ metadata.gz: 7e88171ba33da2d21304d3775a65587d5eff1433004c810cb0967d26c3fd97f4
4
+ data.tar.gz: e809e1b56e29da5be3fab50ade2fa9ada1503a4fd6e992d5e841d1cab18368bb
5
5
  SHA512:
6
- metadata.gz: e692a2ffa8a83da90425b3c4ed2a74b2c8440434e367bc844c6fd6c842d8a40c339fa45118f5f6278cdb298354240ff6376a93db4ad6c5fa19c250c774e6c505
7
- data.tar.gz: 6941837c007984b7ae598ee904c77ee50eeb43aa1c45b6c3e1e2223f43379a7d9d4ded03d73b4e414798ecf9823fc5af4f868ba05dea3af5754dff1a19d21aa2
6
+ metadata.gz: c49e95e5eb52a7ecb34357606ba85b47a7ca8e64059ee3a25646a04a1b69ac926d7a9cbee8840994c3b83a732e03cb297d9881df0326098c400fdc90b53870a6
7
+ data.tar.gz: f2f8390e5d6d8de91478e1bbae94a40690983b770be200e91d633f2387bd7cd6d7e1d392924b42f1889652b5a10bc533d87011be7baab9371d7f6eee557d0076
data/data/catalogues.yaml CHANGED
@@ -5,6 +5,9 @@
5
5
  # matches a catalogue code
6
6
  # - name_en: Name of the culture collection in English, if +name+ is spelled in
7
7
  # a different language
8
+ # - number_tr: A two-string array indicating that characters in the first list
9
+ # should be replaced by those in the second list prior to passing the number
10
+ # to the `url_pattern`
8
11
  # - organization: Name of the organization generating the catalogue. If a
9
12
  # well-known acronym exists, this field should start with this acronym
10
13
  # followed by colon (:) and the spelled-out name of the organization
@@ -116,6 +119,14 @@ catalogues:
116
119
  organization: Czech Academy of Sciences
117
120
  country_code: CZ
118
121
  url_pattern: "https://ccala.butbn.cas.cz/strain/%s"
122
+ - codes: [ CCAP ]
123
+ name: "Culture Collection of Algae & Protozoa"
124
+ organization: "SAMS: Scottish Association for Marine Science"
125
+ country_code: UK
126
+ url: "https://www.ccap.ac.uk/"
127
+ number_tr: ["/", "-"]
128
+ url_pattern: "https://www.ccap.ac.uk/catalogue/strain-%s"
129
+ _examples: [ CCAP 1460/5 ]
119
130
  - codes: [ CCM ]
120
131
  name: Czech Collection of Microorganisms
121
132
  organization: Masaryk University
@@ -389,7 +400,8 @@ catalogues:
389
400
  name: National Institute for Environmental Studies Collection
390
401
  organization: National Institute for Environmental Studies
391
402
  country_code: JP
392
- url_pattern: "https://mcc.nies.go.jp/numberSearch.do?strainNumber=%s"
403
+ url: "https://mcc.nbrp.jp/index_en.html"
404
+ _examples: [ NIES 204 ]
393
405
  - codes: [ NRC, NRCC ]
394
406
  country_code: CA
395
407
  name: Division of Biological Sciences, National Research Council of Canada
@@ -26,7 +26,7 @@ class StrainCode::Catalogue
26
26
  end
27
27
 
28
28
  attr_accessor :codes, :country_code, :name, :name_en, :organization
29
- attr_accessor :url, :url_pattern
29
+ attr_accessor :number_tr, :url, :url_pattern
30
30
 
31
31
  def initialize(hash)
32
32
  hash.each { |k, v| self.send("#{k}=", v) unless k =~ /^_/ }
@@ -18,7 +18,10 @@ class StrainCode::Number
18
18
  end
19
19
 
20
20
  def url
21
- catalogue.url_pattern % accession if catalogue&.url_pattern
21
+ return unless catalogue&.url_pattern && accession
22
+
23
+ acc = catalogue&.number_tr ? accession.tr(*catalogue.number_tr) : accession
24
+ catalogue.url_pattern % acc
22
25
  end
23
26
 
24
27
  def catalogue
@@ -1,5 +1,5 @@
1
1
  class StrainCode
2
- VERSION = '0.3.11'
2
+ VERSION = '0.4.0'
3
3
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
4
4
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
5
5
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strain-code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luis M. Rodriguez-R