fortio-namelist 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NOTE.md +8 -4
- data/README.md +58 -43
- data/fortio-namelist.gemspec +2 -1
- data/lib/fortio-namelist/fortran_namelist.rb +3 -3
- data/lib/fortio-namelist/fortran_namelist.tab.rb +157 -144
- data/lib/fortio-namelist/fortran_namelist.y +22 -16
- data/spec/array_spec.rb +36 -36
- data/spec/empty_spec.rb +9 -9
- data/spec/identifier_spec.rb +15 -15
- data/spec/scalar_spec.rb +70 -70
- data/spec/structure_spec.rb +70 -46
- metadata +17 -3
data/spec/structure_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "fortio-namelist"
|
2
2
|
require "rspec-power_assert"
|
3
3
|
|
4
|
-
describe FortIO::Namelist do
|
4
|
+
describe "FortIO::Namelist" do
|
5
5
|
|
6
6
|
example "newline enumeration" do
|
7
7
|
input = %{
|
@@ -12,11 +12,11 @@ describe FortIO::Namelist do
|
|
12
12
|
/
|
13
13
|
}
|
14
14
|
nml = FortIO::Namelist.read(input)
|
15
|
-
is_asserted_by { nml.has_key?
|
16
|
-
is_asserted_by { nml[
|
17
|
-
is_asserted_by { nml[
|
18
|
-
is_asserted_by { nml[
|
19
|
-
is_asserted_by { nml[
|
15
|
+
is_asserted_by { nml.has_key? :example }
|
16
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
17
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
18
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
19
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
20
20
|
end
|
21
21
|
|
22
22
|
example "space enumeration" do
|
@@ -24,11 +24,11 @@ describe FortIO::Namelist do
|
|
24
24
|
&example a = 1 ab = 2 abc = 3 /
|
25
25
|
}
|
26
26
|
nml = FortIO::Namelist.read(input)
|
27
|
-
is_asserted_by { nml.has_key?
|
28
|
-
is_asserted_by { nml[
|
29
|
-
is_asserted_by { nml[
|
30
|
-
is_asserted_by { nml[
|
31
|
-
is_asserted_by { nml[
|
27
|
+
is_asserted_by { nml.has_key? :example }
|
28
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
29
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
30
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
31
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
32
32
|
end
|
33
33
|
|
34
34
|
example "space enumeration 2" do
|
@@ -38,11 +38,11 @@ describe FortIO::Namelist do
|
|
38
38
|
/
|
39
39
|
}
|
40
40
|
nml = FortIO::Namelist.read(input)
|
41
|
-
is_asserted_by { nml.has_key?
|
42
|
-
is_asserted_by { nml[
|
43
|
-
is_asserted_by { nml[
|
44
|
-
is_asserted_by { nml[
|
45
|
-
is_asserted_by { nml[
|
41
|
+
is_asserted_by { nml.has_key? :example }
|
42
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
43
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
44
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
45
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
46
46
|
end
|
47
47
|
|
48
48
|
example "comma enumeration" do
|
@@ -50,11 +50,11 @@ describe FortIO::Namelist do
|
|
50
50
|
&example a = 1, ab = 2, abc = 3 /
|
51
51
|
}
|
52
52
|
nml = FortIO::Namelist.read(input)
|
53
|
-
is_asserted_by { nml.has_key?
|
54
|
-
is_asserted_by { nml[
|
55
|
-
is_asserted_by { nml[
|
56
|
-
is_asserted_by { nml[
|
57
|
-
is_asserted_by { nml[
|
53
|
+
is_asserted_by { nml.has_key? :example }
|
54
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
55
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
56
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
57
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
58
58
|
end
|
59
59
|
|
60
60
|
example "comma enumeration 2" do
|
@@ -64,11 +64,11 @@ describe FortIO::Namelist do
|
|
64
64
|
/
|
65
65
|
}
|
66
66
|
nml = FortIO::Namelist.read(input)
|
67
|
-
is_asserted_by { nml.has_key?
|
68
|
-
is_asserted_by { nml[
|
69
|
-
is_asserted_by { nml[
|
70
|
-
is_asserted_by { nml[
|
71
|
-
is_asserted_by { nml[
|
67
|
+
is_asserted_by { nml.has_key? :example }
|
68
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
69
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
70
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
71
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
72
72
|
end
|
73
73
|
|
74
74
|
example "comma newline enumeration" do
|
@@ -80,11 +80,11 @@ describe FortIO::Namelist do
|
|
80
80
|
/
|
81
81
|
}
|
82
82
|
nml = FortIO::Namelist.read(input)
|
83
|
-
is_asserted_by { nml.has_key?
|
84
|
-
is_asserted_by { nml[
|
85
|
-
is_asserted_by { nml[
|
86
|
-
is_asserted_by { nml[
|
87
|
-
is_asserted_by { nml[
|
83
|
+
is_asserted_by { nml.has_key? :example }
|
84
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
85
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
86
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
87
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
88
88
|
end
|
89
89
|
|
90
90
|
example "last comma is permitted" do
|
@@ -96,11 +96,11 @@ describe FortIO::Namelist do
|
|
96
96
|
/
|
97
97
|
}
|
98
98
|
nml = FortIO::Namelist.read(input)
|
99
|
-
is_asserted_by { nml.has_key?
|
100
|
-
is_asserted_by { nml[
|
101
|
-
is_asserted_by { nml[
|
102
|
-
is_asserted_by { nml[
|
103
|
-
is_asserted_by { nml[
|
99
|
+
is_asserted_by { nml.has_key? :example }
|
100
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
101
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
102
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
103
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
104
104
|
end
|
105
105
|
|
106
106
|
example "comma space hybrid" do
|
@@ -111,11 +111,11 @@ describe FortIO::Namelist do
|
|
111
111
|
/
|
112
112
|
}
|
113
113
|
nml = FortIO::Namelist.read(input)
|
114
|
-
is_asserted_by { nml.has_key?
|
115
|
-
is_asserted_by { nml[
|
116
|
-
is_asserted_by { nml[
|
117
|
-
is_asserted_by { nml[
|
118
|
-
is_asserted_by { nml[
|
114
|
+
is_asserted_by { nml.has_key? :example }
|
115
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
116
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
117
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
118
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
119
119
|
end
|
120
120
|
|
121
121
|
example "space before and after equal symbol" do
|
@@ -127,11 +127,35 @@ describe FortIO::Namelist do
|
|
127
127
|
/
|
128
128
|
}
|
129
129
|
nml = FortIO::Namelist.read(input)
|
130
|
-
is_asserted_by { nml.has_key?
|
131
|
-
is_asserted_by { nml[
|
132
|
-
is_asserted_by { nml[
|
133
|
-
is_asserted_by { nml[
|
134
|
-
is_asserted_by { nml[
|
130
|
+
is_asserted_by { nml.has_key? :example }
|
131
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
132
|
+
is_asserted_by { nml[:example].keys.size == 3 }
|
133
|
+
is_asserted_by { nml[:example].keys == [:a,:ab,:abc] }
|
134
|
+
is_asserted_by { nml[:example].values == [1,2,3] }
|
135
|
+
end
|
136
|
+
|
137
|
+
example "newline before and after equal symbol" do
|
138
|
+
input = %{
|
139
|
+
&example
|
140
|
+
a =
|
141
|
+
1
|
142
|
+
b
|
143
|
+
= 2
|
144
|
+
c
|
145
|
+
=
|
146
|
+
3
|
147
|
+
,
|
148
|
+
d
|
149
|
+
=
|
150
|
+
4
|
151
|
+
/
|
152
|
+
}
|
153
|
+
nml = FortIO::Namelist.read(input)
|
154
|
+
is_asserted_by { nml.has_key? :example }
|
155
|
+
is_asserted_by { nml[:example].is_a? Hash }
|
156
|
+
is_asserted_by { nml[:example].keys.size == 4 }
|
157
|
+
is_asserted_by { nml[:example].keys == [:a,:b,:c,:d] }
|
158
|
+
is_asserted_by { nml[:example].values == [1,2,3,4] }
|
135
159
|
end
|
136
160
|
|
137
161
|
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fortio-namelist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroki Motoyoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
12
|
-
dependencies:
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: racc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.5'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.5'
|
13
27
|
description: " A library for reading/writing fortran namelist file\n"
|
14
28
|
email: ''
|
15
29
|
executables: []
|