cosvon 0.0.0.2 → 0.0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +9 -7
- data/CHANGELOG.md +3 -0
- data/lib/cosvon.rb +15 -9
- data/spec/cosvon_spec.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ec2eded8df132928a91123bd716c38ac751e3eb
|
4
|
+
data.tar.gz: 2cd209470911f510ca04a3f5e7449e2f1d458b59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6288ad48208cf41d91f8c88a7ac49993c4be3bc1d5f2bd210af9a9d30c6a16026f0fd48a9bc14e94d4761c7592e715e47d3d6468b7c951baee126578d12c837a
|
7
|
+
data.tar.gz: 4949e1dfb96784a6e7387139dd2113763cc9dae4f2293805e9df7629ce33881025c910f6cfe125b023848205223a4e0b3ef561edbb8cad4dec563b3bb32f59a1
|
data/.travis.yml
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
language: ruby
|
2
|
-
before_install:
|
3
|
-
- gem update --system 2.1.11
|
4
|
-
- gem --version
|
5
2
|
rvm:
|
6
3
|
- 1.8.7
|
7
4
|
- ree
|
@@ -9,17 +6,22 @@ rvm:
|
|
9
6
|
- 1.9.3
|
10
7
|
- 2.0.0
|
11
8
|
- 2.1.0
|
12
|
-
- 2.1.
|
13
|
-
- 2.
|
9
|
+
- 2.1.7
|
10
|
+
- 2.2.0
|
11
|
+
- 2.2.3
|
14
12
|
- ruby-head
|
15
13
|
- jruby-18mode
|
16
14
|
- jruby-19mode
|
17
15
|
- jruby-20mode
|
18
16
|
- jruby-21mode
|
19
17
|
- jruby-head
|
20
|
-
- rbx-2
|
21
|
-
- rbx-2.2.3
|
18
|
+
- rbx-2
|
22
19
|
matrix:
|
23
20
|
allow_failures:
|
24
21
|
- rvm: ruby-head
|
25
22
|
- rvm: jruby-head
|
23
|
+
- rvm: jruby-18mode
|
24
|
+
- rvm: jruby-19mode
|
25
|
+
- rvm: jruby-20mode
|
26
|
+
- rvm: jruby-21mode
|
27
|
+
- rvm: rbx-2
|
data/CHANGELOG.md
CHANGED
data/lib/cosvon.rb
CHANGED
@@ -8,7 +8,7 @@ class CoSVON
|
|
8
8
|
HSALSKCAB='―ソЫ噂浬欺圭構蚕十申曾箪貼能表暴予禄兔喀媾彌拿杤歃濬畚秉綵臀藹觸軆鐔饅鷭偆砡'
|
9
9
|
|
10
10
|
# VERSION string
|
11
|
-
VERSION='0.0.0.
|
11
|
+
VERSION='0.0.0.3'
|
12
12
|
|
13
13
|
# parses csv string into 2D array. quoted commas/LFs and escaped quotations are supported.
|
14
14
|
def self.csv(s,__opt=Hash.new)
|
@@ -19,9 +19,10 @@ class CoSVON
|
|
19
19
|
quote=false
|
20
20
|
backslash=0
|
21
21
|
cur=''
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
linebreak=nil
|
23
|
+
s.each_char{|c|
|
24
|
+
#if c=="\r" #ignore CR
|
25
|
+
if c==opt[:quote_char]
|
25
26
|
if !quoted #start of quote
|
26
27
|
quoted=true
|
27
28
|
elsif !quote #end of quote? Let's determine using next char
|
@@ -45,11 +46,14 @@ class CoSVON
|
|
45
46
|
quoted=false
|
46
47
|
end
|
47
48
|
end
|
48
|
-
if c=="\n"&&!quoted
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
if (c=="\n"||c=="\r")&&!quoted
|
50
|
+
if !linebreak||linebreak==c
|
51
|
+
line<<cur
|
52
|
+
cur=''
|
53
|
+
csv<<line
|
54
|
+
line=[]
|
55
|
+
linebreak=c
|
56
|
+
end
|
53
57
|
elsif c==opt[:col_sep]&&!quoted
|
54
58
|
line<<cur
|
55
59
|
cur=''
|
@@ -63,6 +67,8 @@ class CoSVON
|
|
63
67
|
end
|
64
68
|
end
|
65
69
|
}
|
70
|
+
line<<cur if !cur.empty?
|
71
|
+
csv<<line if !line.empty?
|
66
72
|
csv
|
67
73
|
end
|
68
74
|
|
data/spec/cosvon_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cosvon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cielavenir
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.0.14
|
95
|
+
rubygems_version: 2.0.14.1
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Comma Separated Value Object Notation
|