osgeo-termbase 0.0.1 → 0.0.2

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
2
  SHA256:
3
- metadata.gz: db12b312efde02595ac7f15528c801a3a8214b81ecbabb182f9703fa124f7499
4
- data.tar.gz: e8796a7029e7a1dd935e430a1b458361ed645c2ebbb340ae8cbe9cf2febcf9c9
3
+ metadata.gz: d7bafd03d4736e25d8f71755f850a523e7c35657b5d32f7203ec950e8742188e
4
+ data.tar.gz: 8f06b100a6a41b7c03ca874da3c12b3eadbbc99d6b35ce91de3246b5655852b5
5
5
  SHA512:
6
- metadata.gz: 7cb3dfb165e1c8d9480a2ac478046a3be51f9d55165f3502288df3b7d7b716e5bf192b13a9ce6b280323eed5467efcd98fad656eb3a65ad7497c418670b5ec67
7
- data.tar.gz: ce2b45928f43c767fc0a895f8aeabf8e73a5d9b356ea183ee065183da208801d5d81bbd6bbfdd13814397ba2f77ad45a7afbac99f719ea39dd6a9aeb37b179e0
6
+ metadata.gz: 15473ce3109c5ccab7ced943de668cb98c965fcc77f48d3e396053e10242dd6e4012a31c1a93c75bbb2480447d03d88827a4255440115a1143bf50884410e9db
7
+ data.tar.gz: c23189fbd71141a9b0fcb05f074f1f609a4df7bc38d85ef5c99f88e6f0d0b680a8655790f857b3c7d762ba5f6852d13e5d56c92d87e86598fe068f67dac08781
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- osgeo-termbase (0.1.12)
4
+ osgeo-termbase (0.0.1)
5
5
  relaton (~> 0.5)
6
6
 
7
7
  GEM
@@ -21,7 +21,21 @@ class Csv
21
21
  def concept_collection
22
22
  collection = ConceptCollection.new
23
23
 
24
- CSV.foreach(@filename).each_with_index do |row, i|
24
+ csv_content = File.read(@filename)
25
+
26
+ # Google Sheets always uses \n at the last line end, but \r\n for all other line breaks
27
+ # which causes Ruby's CSV to show this error:
28
+ # CSV::MalformedCSVError: Unquoted fields do not allow \r or \n
29
+ # Here we replace the DOS \r\n with Unix \n
30
+ csv_content = csv_content.gsub(/\r\n/, "\n")
31
+
32
+ puts csv_content
33
+
34
+ CSV.new(
35
+ csv_content,
36
+ liberal_parsing: true,
37
+ skip_blanks: true
38
+ ).each_with_index do |row, i|
25
39
  next if i < 3
26
40
  term = Term.new(
27
41
  id: i - 2,
@@ -35,6 +49,7 @@ class Csv
35
49
  language_code: "eng"
36
50
  )
37
51
 
52
+ puts term.to_hash
38
53
  collection.add_term(term)
39
54
  end
40
55
 
@@ -1,5 +1,5 @@
1
1
  module Osgeo
2
2
  module Termbase
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osgeo-termbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose