carray-io-csv 0.9.0 → 0.9.1

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: 62bb651dde7c1b298668b3248497cae5ae1099b4f8c9a09ed8927167860ec489
4
- data.tar.gz: 67886d1e087cd637f1d143f8fb97d68f2437f2b2076941211084981cadd6a0e0
3
+ metadata.gz: c9cb40651d13b603f919dced66f36937c7b116381be98f4d2e27ce9bf69608c4
4
+ data.tar.gz: 8b5c8cc847d24dc3ba46b1969da7f2ede0fdcc18646577db32883a7a8b70b9e1
5
5
  SHA512:
6
- metadata.gz: c332f91806db558da7678e8210ad42d1050a037f5b63f048e785f95e862b14fa7dbc4b5be0764676f2135f4ee553b4703a38d59619177b854f9ef156cc1eefc0
7
- data.tar.gz: 62f26d4f25c025611b62e781d9456f51d71f70a1635edbb109530e0b2e3427b0aea8b1848e896fbed9b88188480b13cdd62dec0ff099e8ed41762de1ea005869
6
+ metadata.gz: f3bfe3db49f4c1ce530bf5a640d9ba4d6fd3f2673ee813fa3b2de778de86fbf9ec1618e3a5a2fbd0883b981159a92329f0ea9ec9b81df938b606c36199aa6462
7
+ data.tar.gz: 6ccb47ecd46ecacac1c13dba205206527d2ac4692226c1659cc9f1affe60bd8f6a45e1c6899b960a1d1f0b7a2591a3fc4933193b29f77376b6ffa8ed62939da5
@@ -1,5 +1,5 @@
1
1
  Gem::Specification::new do |s|
2
- version = "0.9.0"
2
+ version = "0.9.1"
3
3
  files = Dir.glob("**/*") - [
4
4
  Dir.glob("carray-io-csv-*.gem"),
5
5
  Dir.glob("test/**/*"),
@@ -13,7 +13,7 @@ Gem::Specification::new do |s|
13
13
  CSV interface for CArray
14
14
  HERE
15
15
  s.version = version
16
- s.licenses = ['MIT']
16
+ s.license = 'MIT'
17
17
  s.author = "Hiroki Motoyoshi"
18
18
  s.email = ""
19
19
  s.homepage = 'https://github.com/himotoyoshi/carray-io-csv'
@@ -66,7 +66,6 @@
66
66
  # data.to_csv([io|string]) { ... definitions ... }
67
67
  #
68
68
 
69
- require "carray/io/table"
70
69
  require "stringio"
71
70
  require "rcsv"
72
71
  require "strscan"
@@ -142,7 +141,7 @@ module CA
142
141
  @header = header
143
142
  @note = note
144
143
  }
145
- @table.extend(CA::TableMethods)
144
+ @table.extend(CArray::TableMethods)
146
145
  @table.column_names = header["names"]
147
146
  class << @table
148
147
  attr_reader :note
@@ -562,15 +561,13 @@ class CArray
562
561
  end
563
562
  end
564
563
 
565
- def save_csv (file, option = {}, rs: $/, sep: ",", fill: "", mode: "w", &block)
566
- option = {:sep=>sep, :rs=>rs, :fill=>fill, :mode=>mode}.update(option)
567
- writer = CA::CSVWriter.new(option[:sep], option[:rs], option[:fill], &block)
568
- return writer.write_file(self, file, option[:mode])
564
+ def save_csv (file, rs: $/, sep: ",", fill: "", mode: "w", &block)
565
+ writer = CA::CSVWriter.new(sep, rs, fill, &block)
566
+ return writer.write_file(self, file, mode)
569
567
  end
570
568
 
571
- def to_csv (io="", option ={}, rs: $/, sep: ",", fill: "", &block)
572
- option = {:sep=>sep, :rs=>rs, :fill=>fill}.update(option)
573
- writer = CA::CSVWriter.new(option[:sep], option[:rs], option[:fill], &block)
569
+ def to_csv (io="", rs: $/, sep: ",", fill: "", &block)
570
+ writer = CA::CSVWriter.new(sep, rs, fill, &block)
574
571
  case io
575
572
  when IO, StringIO
576
573
  return writer.write_io(self, io)
@@ -579,7 +576,7 @@ class CArray
579
576
  end
580
577
  end
581
578
 
582
- def to_tabular (option = {})
579
+ def to_tabular (**option)
583
580
  option = {:sep=>" ", :names=>nil}.update(option)
584
581
  if option[:names]
585
582
  names = option[:names]
@@ -592,6 +589,5 @@ class CArray
592
589
  length = table.convert{|s| s.length}.max(0)
593
590
  table.map_with_index! {|s, idx| s.rjust(length[idx[1]]) }.to_csv.gsub(/,/,sep)
594
591
  end
595
-
596
592
  end
597
593
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carray-io-csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroki Motoyoshi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-16 00:00:00.000000000 Z
11
+ date: 2020-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carray
@@ -67,8 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubyforge_project:
71
- rubygems_version: 2.7.7
70
+ rubygems_version: 3.1.2
72
71
  signing_key:
73
72
  specification_version: 4
74
73
  summary: CSV interface for CArray