taxonifi 0.5.5 → 0.6.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: e1aea1ca5d3bba09864edf09cbc5430ac58f6605a9247371c8245e63220b8a34
4
- data.tar.gz: c1007d26c853d41b9042410d3f206779ff70bcd7a5fbf0073709d33c6577d30e
3
+ metadata.gz: 3ea1c5278c07b5da29b0d47833aa5049ea1bf1a67d8ee0e0457e24642c6afe33
4
+ data.tar.gz: 4e3b2e214b36f2dd861321e9539ff15d0075d4713563b5b170332c55ed51eb37
5
5
  SHA512:
6
- metadata.gz: 4ea36b3f86d07ebb09b860fe64989657b5dff8ad42b0cf66a1f4884497f5d96b8cd72a285d47808b5420ee0d7b838fcfd25e49914646912e31887da9ec3a2b26
7
- data.tar.gz: f061c76e564eb3be9ce29fa47bc6874c3e89eb18d0ba4bcaabf0fc576126cf55e8843a7a00730359b217f8a9e6e1e942b0fb7a6ac1b723cc7a8adee55d43ec12
6
+ metadata.gz: 29a4108207df9f6087a1cc741b226e72ec9273907d5a2e999a316d7fe194a45ccb6c13c9d7594744e510a47939dcc8ccc566bce48798547bd7917e4cdf2dac7d
7
+ data.tar.gz: cbf0e3345cfee7110b79eff07152ba828f69a20be204aba2c7460597b7295fea61aa6791770ad5a90348e9afa28a50d225e68e885912929880fcb5bb295b1dbc
@@ -0,0 +1,41 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ push:
12
+ branches: [ master, ruby3 ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ${{ matrix.os }}
20
+ strategy:
21
+ matrix:
22
+ os: [ubuntu-latest, macos-latest, windows-latest]
23
+ ruby: [2.6, 2.7, 3.0]
24
+
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ - name: Set up Ruby
28
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
29
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
30
+ # uses: ruby/setup-ruby@v1
31
+ uses: ruby/setup-ruby@fdcfbcf14ec9672f6f615cb9589a1bc5dd69d262
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ - name: Install dependencies
35
+ run: bundle install
36
+ - name: Show environment
37
+ run: gem environment
38
+ - name: Run tests
39
+ run: bundle exec rake
40
+ - name: Checking install works
41
+ run: rake install
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 3.0.2
data/Gemfile.lock CHANGED
@@ -1,20 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- taxonifi (0.5.5)
4
+ taxonifi (0.6.0)
5
5
  require_all (~> 3.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- awesome_print (1.8.0)
10
+ awesome_print (1.9.2)
11
11
  builder (3.2.4)
12
- byebug (11.1.1)
13
- power_assert (1.1.5)
14
- rake (13.0.1)
15
- rdoc (6.2.1)
12
+ byebug (11.1.3)
13
+ power_assert (2.0.1)
14
+ psych (4.0.3)
15
+ stringio
16
+ rake (13.0.6)
17
+ rdoc (6.4.0)
18
+ psych (>= 4.0.0)
16
19
  require_all (3.0.0)
17
- test-unit (3.3.5)
20
+ stringio (3.0.1)
21
+ test-unit (3.3.9)
18
22
  power_assert
19
23
 
20
24
  PLATFORMS
@@ -31,4 +35,4 @@ DEPENDENCIES
31
35
  test-unit (~> 3.3.5)
32
36
 
33
37
  BUNDLED WITH
34
- 2.1.4
38
+ 2.2.22
data/README.md CHANGED
@@ -112,11 +112,11 @@ The following is an example that translates a DwC style input format as exported
112
112
  require 'taxonifi'
113
113
  file = File.expand_path(File.join(File.dirname(__FILE__), 'file_fixtures/Lygaeoidea-csv.tsv'))
114
114
 
115
- csv = CSV.read(file, {
115
+ csv = CSV.read(file,
116
116
  headers: true,
117
117
  col_sep: "\t",
118
118
  header_converters: :downcase
119
- } )
119
+ )
120
120
 
121
121
  nc = Taxonifi::Lumper::Lumps::ParentChildNameCollection.name_collection(csv)
122
122
  e = Taxonifi::Export::SpeciesFile.new(:nc => nc, :authorized_user_id => 1)
@@ -131,10 +131,10 @@ Reading files
131
131
  taxonifi feeds on Ruby's CSV. read your files with header true, and downcased, e.g.:
132
132
 
133
133
  ```
134
- csv = CSV.read('input/my_data.tab', {
134
+ csv = CSV.read('input/my_data.tab',
135
135
  headers: true,
136
136
  header_converters: :downcase,
137
- col_sep: "\t" } )
137
+ col_sep: "\t")
138
138
  ```
139
139
 
140
140
  # Code organization
@@ -79,6 +79,7 @@ module Taxonifi
79
79
  # this far? bad
80
80
  # raise RowAssessor::RowAssessorError
81
81
 
82
+ # TODO: add an error message that can be relayed on here and elsewhere
82
83
  raise RowAssessorError
83
84
  end
84
85
 
@@ -1,3 +1,3 @@
1
1
  module Taxonifi
2
- VERSION = "0.5.5"
2
+ VERSION = "0.6.0"
3
3
  end
data/taxonifi.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  s.metadata = { "source_code_uri" => "https://github.com/SpeciesFileGroup/taxonifi" }
30
30
 
31
31
  s.add_dependency "require_all", "~> 3.0"
32
- s.required_ruby_version = '~> 2.6'
32
+ s.required_ruby_version = '>= 2.6', '< 4'
33
33
 
34
34
  s.add_development_dependency "rake", '~> 13.0'
35
35
  s.add_development_dependency "byebug", "~> 11"
data/test/helper.rb CHANGED
@@ -22,16 +22,16 @@ def generic_csv_with_names
22
22
  csv << [6, "3", "Foo bar stuff (Guy, 1921)", "species", "Foo bar blorf (Guy, 1921)"] # initial subspecies rank data had rank blank, assuming they will be called species
23
23
  end
24
24
 
25
- @csv = CSV.parse(@csv_string, {headers: true})
25
+ @csv = CSV.parse(@csv_string, headers: true)
26
26
  end
27
27
 
28
28
  def names
29
29
  file = File.expand_path(File.join(File.dirname(__FILE__), 'file_fixtures/names.csv'))
30
30
 
31
- csv = CSV.read(file, {
31
+ csv = CSV.read(file,
32
32
  headers: true,
33
33
  col_sep: ",",
34
34
  header_converters: :downcase
35
- } )
35
+ )
36
36
  nc = Taxonifi::Lumper.create_name_collection(csv: csv, initial_id: 1)
37
37
  end
@@ -16,11 +16,11 @@ class Test_TaxonifiExports < Test::Unit::TestCase
16
16
  def test_big_file
17
17
  file = File.expand_path(File.join(File.dirname(__FILE__), 'file_fixtures/Lygaeoidea.csv'))
18
18
 
19
- csv = CSV.read(file, {
19
+ csv = CSV.read(file,
20
20
  headers: true,
21
21
  col_sep: ",",
22
22
  header_converters: :downcase
23
- } )
23
+ )
24
24
 
25
25
  nc = Taxonifi::Lumper::Lumps::ParentChildNameCollection.name_collection(csv)
26
26
  nc.generate_ref_collection(1)
@@ -32,11 +32,11 @@ class Test_TaxonifiExports < Test::Unit::TestCase
32
32
  def test_little_file_linkages
33
33
  file = File.expand_path(File.join(File.dirname(__FILE__), 'file_fixtures/Fossil.csv'))
34
34
 
35
- csv = CSV.read(file, {
35
+ csv = CSV.read(file,
36
36
  headers: true,
37
37
  col_sep: ",",
38
38
  header_converters: :downcase
39
- } )
39
+ )
40
40
 
41
41
  nc = Taxonifi::Lumper.create_name_collection(:csv => csv, :initial_id => 1)
42
42
  rc = Taxonifi::Lumper.create_ref_collection(:csv => csv)
@@ -9,7 +9,7 @@ class Test_TaxonifiLumperClump < Test::Unit::TestCase
9
9
  csv << ["Fooidae", "Foo", "bar", "Smith", "1854"]
10
10
  end
11
11
 
12
- @csv = CSV.parse(@csv_string, {headers: true})
12
+ @csv = CSV.parse(@csv_string, headers: true)
13
13
  end
14
14
 
15
15
  def test_new_clump_without_params_can_be_created
@@ -23,7 +23,7 @@ class Test_TaxonifiLumperGeogs < Test::Unit::TestCase
23
23
  # The name_index looks like
24
24
  # {:country => {"Canada" => 0, "USA" => 2, "Utopia" => 5} ... etc.
25
25
 
26
- @csv = CSV.parse(@csv_string, {headers: true})
26
+ @csv = CSV.parse(@csv_string, headers: true)
27
27
  end
28
28
 
29
29
  def _create_a_collection
@@ -9,7 +9,7 @@ class Test_TaxonifiLumperHierarchicalCollection < Test::Unit::TestCase
9
9
  csv << %w{a b c}
10
10
  end
11
11
 
12
- @csv = CSV.parse(@csv_string, {headers: true})
12
+ @csv = CSV.parse(@csv_string, headers: true)
13
13
  end
14
14
 
15
15
  def test_that_create_hierarchical_collection_creates_collection
@@ -48,7 +48,7 @@ class Test_TaxonifiLumperHierarchicalCollection < Test::Unit::TestCase
48
48
  csv << @headers
49
49
  csv << ["a", nil, "c"]
50
50
  end
51
- csv = CSV.parse(csv_string, {headers: true})
51
+ csv = CSV.parse(csv_string, headers: true)
52
52
  c = Taxonifi::Lumper.create_hierarchical_collection(csv, %w{a b c})
53
53
  assert_equal nil, c.collection.first.parent
54
54
  assert_equal "a", c.collection[1].parent.name
@@ -61,7 +61,7 @@ class Test_TaxonifiLumperHierarchicalCollection < Test::Unit::TestCase
61
61
  csv << ["a", "b", "d"]
62
62
  csv << ["e", "b", "f"]
63
63
  end
64
- csv = CSV.parse(csv_string, {headers: true})
64
+ csv = CSV.parse(csv_string, headers: true)
65
65
  c = Taxonifi::Lumper.create_hierarchical_collection(csv, %w{a b c})
66
66
  assert_equal %w{a b c d e b f}, c.collection.collect{|o| o.name}
67
67
  assert_equal 7, c.collection.size
@@ -9,7 +9,7 @@ class Test_TaxonifiLumperNames < Test::Unit::TestCase
9
9
  csv << ["Fooidae", "Foo", "bar", "Smith", "1854"]
10
10
  end
11
11
 
12
- @csv = CSV.parse(@csv_string, {headers: true})
12
+ @csv = CSV.parse(@csv_string, headers: true)
13
13
  end
14
14
 
15
15
  def test_that_setup_setups
@@ -69,7 +69,7 @@ class Test_TaxonifiLumperNames < Test::Unit::TestCase
69
69
  # 1 3 6
70
70
  # 0 4 7
71
71
 
72
- csv = CSV.parse(string, {headers: true})
72
+ csv = CSV.parse(string, headers: true)
73
73
  nc = Taxonifi::Lumper.create_name_collection(:csv => csv)
74
74
 
75
75
  assert_equal nc.collection[2], nc.collection[5].parent
@@ -93,7 +93,7 @@ class Test_TaxonifiLumperNames < Test::Unit::TestCase
93
93
  # 2 bar
94
94
  # 3 foo
95
95
 
96
- csv = CSV.parse(string, {headers: true})
96
+ csv = CSV.parse(string, headers: true)
97
97
  nc = Taxonifi::Lumper.create_name_collection(:csv => csv)
98
98
  assert_equal 2, nc.collection[3].authors.size
99
99
  assert_equal 'Smith', nc.collection[3].authors.first.last_name
@@ -125,7 +125,7 @@ class Test_TaxonifiLumperNames < Test::Unit::TestCase
125
125
  # 1 Foo
126
126
  # 2 bar
127
127
 
128
- csv = CSV.parse(string, {headers: true})
128
+ csv = CSV.parse(string, headers: true)
129
129
  nc = Taxonifi::Lumper.create_name_collection(:csv => csv)
130
130
  assert_equal nil, nc.collection[2].properties['foo']
131
131
  assert_equal "1", nc.collection[2].properties['bar'] # !!! everything converted to String
@@ -149,7 +149,7 @@ class Test_TaxonifiLumperNames < Test::Unit::TestCase
149
149
  # 5 varblorf
150
150
  # 6 varbliff
151
151
 
152
- csv = CSV.parse(string, {headers: true})
152
+ csv = CSV.parse(string, headers: true)
153
153
  nc = Taxonifi::Lumper.create_name_collection(:csv => csv)
154
154
 
155
155
  assert_equal nc.collection[1], nc.collection[2].parent
@@ -14,7 +14,7 @@ class Test_TaxonifiLumperParentChildNameCollection < Test::Unit::TestCase
14
14
  csv << [5, "0", "Bidae", "Family", nil ]
15
15
  end
16
16
 
17
- @csv = CSV.parse(@csv_string, {headers: true})
17
+ @csv = CSV.parse(@csv_string, headers: true)
18
18
  end
19
19
 
20
20
  def create_a_collection
@@ -54,7 +54,7 @@ class Test_TaxonifiLumperParentChildNameCollection < Test::Unit::TestCase
54
54
  # csv << [7, 3, 'Neortholomus (Neortholomus) blorf (Say, 1832)','species']
55
55
  # csv << [8, 3, 'Neortholomus (Neortholomus) blorf (Say, 1832)','species']
56
56
  end
57
- csv = CSV.parse(csv_string, {headers: true})
57
+ csv = CSV.parse(csv_string, headers: true)
58
58
 
59
59
  nc = Taxonifi::Lumper::Lumps::ParentChildNameCollection.name_collection(csv)
60
60
 
@@ -9,7 +9,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
9
9
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
10
10
  end
11
11
 
12
- @csv = CSV.parse(@csv_string, {headers: true})
12
+ @csv = CSV.parse(@csv_string, headers: true)
13
13
  end
14
14
 
15
15
  def test_available_lumps
@@ -23,7 +23,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
23
23
  csv << ["Smith J. and Barnes S."]
24
24
  end
25
25
 
26
- csv = CSV.parse(csv_string, {headers: true})
26
+ csv = CSV.parse(csv_string, headers: true)
27
27
 
28
28
  assert_equal [:citation_basic, :citation_small], Taxonifi::Lumper.intersecting_lumps(csv.headers)
29
29
  assert_equal [], Taxonifi::Lumper.available_lumps(csv.headers)
@@ -56,7 +56,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
56
56
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
57
57
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
58
58
  end
59
- csv = CSV.parse(csv_string, {headers: true})
59
+ csv = CSV.parse(csv_string, headers: true)
60
60
  rc = Taxonifi::Lumper.create_ref_collection(:csv => csv)
61
61
  assert_equal 1, rc.collection.size
62
62
  end
@@ -68,7 +68,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
68
68
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
69
69
  csv << ["Smith J. and Bartes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
70
70
  end
71
- csv = CSV.parse(csv_string, {headers: true})
71
+ csv = CSV.parse(csv_string, headers: true)
72
72
  rc = Taxonifi::Lumper.create_ref_collection(:csv => csv)
73
73
  assert_equal 2, rc.collection.size
74
74
  end
@@ -79,7 +79,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
79
79
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
80
80
  csv << ["Smith J.", "2012", "Foo and bar", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)" ]
81
81
  end
82
- csv = CSV.parse(csv_string, {headers: true})
82
+ csv = CSV.parse(csv_string, headers: true)
83
83
  rc = Taxonifi::Lumper.create_ref_collection(:csv => csv)
84
84
  assert_equal "Foo and bar", rc.object_from_row(1).title
85
85
  end
@@ -90,7 +90,7 @@ class Test_TaxonifiLumperRefs < Test::Unit::TestCase
90
90
  csv << ["Smith J. and Barnes S.", "2012", "Bar and foo", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)", "foo value", 1 ]
91
91
  csv << ["Smith J.", "2012", "Foo and bar", "Journal of Foo", "2", "3", "2-3, 190", nil, "2", "4", "2(4)", nil, "bar value" ]
92
92
  end
93
- csv = CSV.parse(csv_string, {headers: true})
93
+ csv = CSV.parse(csv_string, headers: true)
94
94
  rc = Taxonifi::Lumper.create_ref_collection(:csv => csv)
95
95
 
96
96
  assert_equal "foo value", rc.collection.first.properties['foo']
@@ -14,7 +14,7 @@ class Test_TaxonifiAccessor < Test::Unit::TestCase
14
14
  csv << ["Fooidae", "Bar", nil, "bar", nil, "varbar", "Smith", "1854"] # 5
15
15
  end
16
16
 
17
- @csv = CSV.parse(@csv_string, {headers: true, header_converters: :downcase})
17
+ @csv = CSV.parse(@csv_string, headers: true, header_converters: :downcase)
18
18
  end
19
19
 
20
20
  def test_first_available
@@ -46,7 +46,7 @@ class Test_TaxonifiAccessor < Test::Unit::TestCase
46
46
  csv << headers
47
47
  csv << ["Smith J. and Barnes S."]
48
48
  end
49
- csv = CSV.parse(csv_string, {headers: true})
49
+ csv = CSV.parse(csv_string, headers: true)
50
50
  assert_equal [:citation_basic, :citation_small], Taxonifi::Assessor::RowAssessor.intersecting_lumps_with_data(csv.first)
51
51
  end
52
52
 
@@ -57,7 +57,7 @@ class Test_TaxonifiAccessor < Test::Unit::TestCase
57
57
  csv << ["Smith J. and Barnes S.", 1912, "Foo", "Bar", "3(4)", "1-2"]
58
58
  end
59
59
 
60
- csv = CSV.parse(csv_string, {headers: true})
60
+ csv = CSV.parse(csv_string, headers: true)
61
61
 
62
62
  assert_equal [:citation_small], Taxonifi::Assessor::RowAssessor.lumps_with_data(csv.first)
63
63
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taxonifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Yoder
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2013-03-27 00:00:00.000000000 Z
@@ -132,6 +132,7 @@ extra_rdoc_files:
132
132
  - README.md
133
133
  files:
134
134
  - ".document"
135
+ - ".github/workflows/ruby.yml"
135
136
  - ".gitignore"
136
137
  - ".ruby-version"
137
138
  - ".travis.yml"
@@ -206,23 +207,26 @@ licenses:
206
207
  - MIT
207
208
  metadata:
208
209
  source_code_uri: https://github.com/SpeciesFileGroup/taxonifi
209
- post_install_message:
210
+ post_install_message:
210
211
  rdoc_options: []
211
212
  require_paths:
212
213
  - lib
213
214
  required_ruby_version: !ruby/object:Gem::Requirement
214
215
  requirements:
215
- - - "~>"
216
+ - - ">="
216
217
  - !ruby/object:Gem::Version
217
218
  version: '2.6'
219
+ - - "<"
220
+ - !ruby/object:Gem::Version
221
+ version: '4'
218
222
  required_rubygems_version: !ruby/object:Gem::Requirement
219
223
  requirements:
220
224
  - - ">="
221
225
  - !ruby/object:Gem::Version
222
226
  version: '0'
223
227
  requirements: []
224
- rubygems_version: 3.0.6
225
- signing_key:
228
+ rubygems_version: 3.2.22
229
+ signing_key:
226
230
  specification_version: 4
227
231
  summary: A general purpose framework for scripted handling of taxonomic names or other
228
232
  heirarchical metadata.