ruby_learner 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/contents/questions/sequential_check/section_10/part_1/lib/answer.rb +5 -7
- data/contents/questions/sequential_check/section_10/part_1/lib/sentence.org +10 -8
- data/contents/questions/sequential_check/section_10/part_1/lib/workplace.rb +1 -1
- data/contents/questions/sequential_check/section_10/part_1/spec/workplace_spec.rb +4 -4
- data/contents/questions/sequential_check/section_10/part_2/lib/answer.rb +6 -7
- data/contents/questions/sequential_check/section_10/part_2/lib/sentence.org +9 -7
- data/contents/questions/sequential_check/section_10/part_2/lib/workplace.rb +1 -1
- data/contents/questions/sequential_check/section_10/part_2/spec/workplace_spec.rb +4 -9
- data/contents/questions/sequential_check/section_10/part_3/lib/answer.rb +12 -0
- data/contents/questions/sequential_check/section_10/part_3/lib/sentence.org +8 -0
- data/contents/questions/sequential_check/section_10/part_3/lib/workplace.rb +1 -0
- data/contents/questions/sequential_check/{section_6/part_4 → section_10/part_3}/spec/spec_helper.rb +0 -0
- data/contents/questions/sequential_check/section_10/part_3/spec/workplace_spec.rb +10 -0
- data/contents/questions/sequential_check/section_2/foo/nbar/nbaz/n +0 -0
- data/contents/questions/sequential_check/section_2/part_3/lib/answer.rb +3 -6
- data/contents/questions/sequential_check/section_2/part_3/lib/sentence.org +2 -0
- data/contents/questions/sequential_check/section_2/part_3/lib/workplace.rb +0 -4
- data/contents/questions/sequential_check/section_2/part_3/spec/workplace_spec.rb +8 -7
- data/contents/questions/sequential_check/section_3/part_2/lib/answer.rb +3 -5
- data/contents/questions/sequential_check/section_3/part_2/lib/workplace.rb +0 -4
- data/contents/questions/sequential_check/section_3/part_2/spec/workplace_spec.rb +8 -7
- data/contents/questions/sequential_check/section_4/part_2/lib/answer.rb +2 -2
- data/contents/questions/sequential_check/section_4/part_2/lib/workplace.rb +1 -1
- data/contents/questions/sequential_check/section_4/part_3/lib/answer.rb +8 -10
- data/contents/questions/sequential_check/section_4/part_3/lib/sentence.org +1 -0
- data/contents/questions/sequential_check/section_4/part_3/lib/workplace.rb +1 -3
- data/contents/questions/sequential_check/section_4/part_3/spec/workplace_spec.rb +6 -7
- data/contents/questions/sequential_check/section_6/part_2/lib/answer.rb +9 -4
- data/contents/questions/sequential_check/section_6/part_2/lib/sentence.org +35 -2
- data/contents/questions/sequential_check/section_6/part_2/lib/workplace.rb +2 -0
- data/contents/questions/sequential_check/section_6/part_2/spec/workplace_spec.rb +9 -10
- data/contents/questions/sequential_check/section_6/part_3/lib/answer.rb +5 -5
- data/contents/questions/sequential_check/section_6/part_3/lib/sentence.org +44 -5
- data/contents/questions/sequential_check/section_6/part_3/lib/workplace.rb +3 -0
- data/contents/questions/sequential_check/section_6/part_3/spec/workplace_spec.rb +2 -2
- data/contents/questions/sequential_check/section_7/part_1/lib/answer.rb +5 -3
- data/contents/questions/sequential_check/section_7/part_1/lib/sentence.org +22 -16
- data/contents/questions/sequential_check/section_7/part_1/spec/workplace_spec.rb +8 -8
- data/contents/questions/sequential_check/section_7/part_2/lib/answer.rb +6 -6
- data/contents/questions/sequential_check/section_7/part_2/lib/sentence.org +23 -22
- data/contents/questions/sequential_check/section_7/part_2/spec/workplace_spec.rb +11 -5
- data/contents/questions/sequential_check/section_7/part_3/lib/answer.rb +13 -0
- data/contents/questions/sequential_check/section_7/part_3/lib/sentence.org +24 -0
- data/contents/questions/sequential_check/section_7/part_3/lib/workplace.rb +4 -0
- data/contents/questions/sequential_check/section_7/part_3/spec/spec_helper.rb +100 -0
- data/contents/questions/sequential_check/section_7/part_3/spec/workplace_spec.rb +15 -0
- data/contents/questions/sequential_check/section_8/part_1/lib/answer.rb +11 -6
- data/contents/questions/sequential_check/section_8/part_1/lib/sentence.org +66 -10
- data/contents/questions/sequential_check/section_8/part_1/lib/workplace.rb +10 -0
- data/contents/questions/sequential_check/section_8/part_1/spec/workplace_spec.rb +28 -9
- data/contents/questions/sequential_check/section_8/part_2/lib/answer.rb +14 -0
- data/contents/questions/sequential_check/section_8/part_2/lib/sentence.org +80 -0
- data/contents/questions/sequential_check/section_8/part_2/lib/workplace.rb +1 -0
- data/contents/questions/sequential_check/section_8/part_2/spec/spec_helper.rb +100 -0
- data/contents/questions/sequential_check/section_8/part_2/spec/workplace_spec.rb +34 -0
- data/contents/questions/sequential_check/section_8/part_3/lib/answer.rb +20 -0
- data/contents/questions/sequential_check/section_8/part_3/lib/sentence.org +80 -0
- data/contents/questions/sequential_check/section_8/part_3/lib/workplace.rb +11 -0
- data/contents/questions/sequential_check/section_8/part_3/spec/spec_helper.rb +100 -0
- data/contents/questions/sequential_check/section_8/part_3/spec/workplace_spec.rb +34 -0
- data/contents/questions/sequential_check/section_9/part_1/lib/answer.rb +9 -4
- data/contents/questions/sequential_check/section_9/part_1/lib/sentence.org +93 -4
- data/contents/questions/sequential_check/section_9/part_1/spec/workplace_spec.rb +14 -5
- data/contents/questions/sequential_check/section_9/part_2/lib/answer.rb +8 -5
- data/contents/questions/sequential_check/section_9/part_2/lib/sentence.org +92 -10
- data/contents/questions/sequential_check/section_9/part_2/spec/workplace_spec.rb +14 -5
- data/contents/questions/sequential_check/section_9/part_3/lib/answer.rb +7 -9
- data/contents/questions/sequential_check/section_9/part_3/lib/sentence.org +93 -4
- data/contents/questions/sequential_check/section_9/part_3/spec/workplace_spec.rb +14 -5
- data/lib/ruby_learner/sequential_main.rb +25 -12
- data/lib/ruby_learner/version.rb +1 -1
- metadata +26 -7
- data/contents/questions/sequential_check/section_6/part_4/lib/answer.rb +0 -9
- data/contents/questions/sequential_check/section_6/part_4/lib/sentence.org +0 -12
- data/contents/questions/sequential_check/section_6/part_4/lib/workplace.rb +0 -1
- data/contents/questions/sequential_check/section_6/part_4/spec/workplace_spec.rb +0 -9
@@ -1,10 +1,19 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require "open3"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
|
5
|
+
|
6
|
+
RSpec.describe "regular-exp-check" do
|
7
|
+
it 'given "R8uby, Hello\n", return "match\n"' do
|
8
|
+
stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb", :stdin_data=>"R8uby, Hello\n")
|
9
|
+
expect { puts stdout }.to output("match.\n").to_stdout
|
10
|
+
end
|
11
|
+
it 'given "A9 is Hello\n", return "match\n"' do
|
12
|
+
stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb", :stdin_data=> "A9 is Hello\n")
|
13
|
+
expect { puts stdout }.to output("match.\n").to_stdout
|
14
|
+
end
|
15
|
+
it 'given "Ruby, tanaka\n", return "not match\n"' do
|
16
|
+
stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb", :stdin_data=>"Ruby, tanaka\n")
|
17
|
+
expect { puts stdout }.to output("not match.\n").to_stdout
|
9
18
|
end
|
10
19
|
end
|
@@ -55,13 +55,12 @@ class SequentialMain
|
|
55
55
|
puts "section_3\t 1~3\t standard_I/O summary"
|
56
56
|
puts "section_4\t 1~3\t comparisons & conditionals"
|
57
57
|
puts "section_5\t 1~3\t loop_methods"
|
58
|
-
puts "section_6\t 1~
|
59
|
-
puts "section_7\t 1~
|
60
|
-
puts "section_8\t 1~
|
61
|
-
puts "section_9\t 1~3\t
|
62
|
-
puts "section_10\t 1~2\t
|
63
|
-
puts "section_11\t 1~2\t
|
64
|
-
puts "section_12\t 1~2\t library"
|
58
|
+
puts "section_6\t 1~3\t array & hash & symbol"
|
59
|
+
puts "section_7\t 1~3\t function"
|
60
|
+
puts "section_8\t 1~3\t class"
|
61
|
+
puts "section_9\t 1~3\t regular_expression"
|
62
|
+
puts "section_10\t 1~2\t file_operation"
|
63
|
+
puts "section_11\t 1~2\t library"
|
65
64
|
end
|
66
65
|
|
67
66
|
def get_final_history()
|
@@ -141,9 +140,6 @@ class SequentialMain
|
|
141
140
|
elsif final_par == 2
|
142
141
|
next_sec = 6
|
143
142
|
next_par = 3
|
144
|
-
elsif final_par == 3
|
145
|
-
next_sec = 6
|
146
|
-
next_par = 4
|
147
143
|
else
|
148
144
|
next_sec = 7
|
149
145
|
next_par = 1
|
@@ -152,13 +148,24 @@ class SequentialMain
|
|
152
148
|
if final_par == 1
|
153
149
|
next_sec = 7
|
154
150
|
next_par = 2
|
151
|
+
elsif final_par == 2
|
152
|
+
next_sec = 7
|
153
|
+
next_par = 3
|
155
154
|
else
|
156
155
|
next_sec = 8
|
157
156
|
next_par = 1
|
158
157
|
end
|
159
158
|
elsif final_sec == 8
|
160
|
-
|
161
|
-
|
159
|
+
if final_par == 1
|
160
|
+
next_sec = 8
|
161
|
+
next_par = 2
|
162
|
+
elsif final_par == 2
|
163
|
+
next_sec = 8
|
164
|
+
next_par = 3
|
165
|
+
else
|
166
|
+
next_sec = 9
|
167
|
+
next_par = 1
|
168
|
+
end
|
162
169
|
elsif final_sec == 9
|
163
170
|
if final_par == 1
|
164
171
|
next_sec = 9
|
@@ -174,6 +181,9 @@ class SequentialMain
|
|
174
181
|
if final_par == 1
|
175
182
|
next_sec = 10
|
176
183
|
next_par = 2
|
184
|
+
elsif final_par == 2
|
185
|
+
next_sec = 10
|
186
|
+
next_par = 3
|
177
187
|
else
|
178
188
|
next_sec = 11
|
179
189
|
next_par = 1
|
@@ -182,6 +192,9 @@ class SequentialMain
|
|
182
192
|
if final_par == 1
|
183
193
|
next_sec = 11
|
184
194
|
next_par = 2
|
195
|
+
elsif final_par == 2
|
196
|
+
next_sec = 11
|
197
|
+
next_par = 3
|
185
198
|
else
|
186
199
|
next_sec = 1
|
187
200
|
next_par = 1
|
data/lib/ruby_learner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_learner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takaki Otsu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,6 +165,11 @@ files:
|
|
165
165
|
- contents/questions/sequential_check/section_10/part_2/lib/workplace.rb
|
166
166
|
- contents/questions/sequential_check/section_10/part_2/spec/spec_helper.rb
|
167
167
|
- contents/questions/sequential_check/section_10/part_2/spec/workplace_spec.rb
|
168
|
+
- contents/questions/sequential_check/section_10/part_3/lib/answer.rb
|
169
|
+
- contents/questions/sequential_check/section_10/part_3/lib/sentence.org
|
170
|
+
- contents/questions/sequential_check/section_10/part_3/lib/workplace.rb
|
171
|
+
- contents/questions/sequential_check/section_10/part_3/spec/spec_helper.rb
|
172
|
+
- contents/questions/sequential_check/section_10/part_3/spec/workplace_spec.rb
|
168
173
|
- contents/questions/sequential_check/section_11/part_1/lib/answer.rb
|
169
174
|
- contents/questions/sequential_check/section_11/part_1/lib/sentence.org
|
170
175
|
- contents/questions/sequential_check/section_11/part_1/lib/workplace.rb
|
@@ -175,6 +180,10 @@ files:
|
|
175
180
|
- contents/questions/sequential_check/section_11/part_2/lib/workplace.rb
|
176
181
|
- contents/questions/sequential_check/section_11/part_2/spec/spec_helper.rb
|
177
182
|
- contents/questions/sequential_check/section_11/part_2/spec/workplace_spec.rb
|
183
|
+
- |
|
184
|
+
contents/questions/sequential_check/section_2/foo
|
185
|
+
bar
|
186
|
+
baz
|
178
187
|
- contents/questions/sequential_check/section_2/part_1/lib/answer.rb
|
179
188
|
- contents/questions/sequential_check/section_2/part_1/lib/sentence.org
|
180
189
|
- contents/questions/sequential_check/section_2/part_1/lib/workplace.rb
|
@@ -250,11 +259,6 @@ files:
|
|
250
259
|
- contents/questions/sequential_check/section_6/part_3/lib/workplace.rb
|
251
260
|
- contents/questions/sequential_check/section_6/part_3/spec/spec_helper.rb
|
252
261
|
- contents/questions/sequential_check/section_6/part_3/spec/workplace_spec.rb
|
253
|
-
- contents/questions/sequential_check/section_6/part_4/lib/answer.rb
|
254
|
-
- contents/questions/sequential_check/section_6/part_4/lib/sentence.org
|
255
|
-
- contents/questions/sequential_check/section_6/part_4/lib/workplace.rb
|
256
|
-
- contents/questions/sequential_check/section_6/part_4/spec/spec_helper.rb
|
257
|
-
- contents/questions/sequential_check/section_6/part_4/spec/workplace_spec.rb
|
258
262
|
- contents/questions/sequential_check/section_7/part_1/lib/answer.rb
|
259
263
|
- contents/questions/sequential_check/section_7/part_1/lib/sentence.org
|
260
264
|
- contents/questions/sequential_check/section_7/part_1/lib/workplace.rb
|
@@ -265,11 +269,26 @@ files:
|
|
265
269
|
- contents/questions/sequential_check/section_7/part_2/lib/workplace.rb
|
266
270
|
- contents/questions/sequential_check/section_7/part_2/spec/spec_helper.rb
|
267
271
|
- contents/questions/sequential_check/section_7/part_2/spec/workplace_spec.rb
|
272
|
+
- contents/questions/sequential_check/section_7/part_3/lib/answer.rb
|
273
|
+
- contents/questions/sequential_check/section_7/part_3/lib/sentence.org
|
274
|
+
- contents/questions/sequential_check/section_7/part_3/lib/workplace.rb
|
275
|
+
- contents/questions/sequential_check/section_7/part_3/spec/spec_helper.rb
|
276
|
+
- contents/questions/sequential_check/section_7/part_3/spec/workplace_spec.rb
|
268
277
|
- contents/questions/sequential_check/section_8/part_1/lib/answer.rb
|
269
278
|
- contents/questions/sequential_check/section_8/part_1/lib/sentence.org
|
270
279
|
- contents/questions/sequential_check/section_8/part_1/lib/workplace.rb
|
271
280
|
- contents/questions/sequential_check/section_8/part_1/spec/spec_helper.rb
|
272
281
|
- contents/questions/sequential_check/section_8/part_1/spec/workplace_spec.rb
|
282
|
+
- contents/questions/sequential_check/section_8/part_2/lib/answer.rb
|
283
|
+
- contents/questions/sequential_check/section_8/part_2/lib/sentence.org
|
284
|
+
- contents/questions/sequential_check/section_8/part_2/lib/workplace.rb
|
285
|
+
- contents/questions/sequential_check/section_8/part_2/spec/spec_helper.rb
|
286
|
+
- contents/questions/sequential_check/section_8/part_2/spec/workplace_spec.rb
|
287
|
+
- contents/questions/sequential_check/section_8/part_3/lib/answer.rb
|
288
|
+
- contents/questions/sequential_check/section_8/part_3/lib/sentence.org
|
289
|
+
- contents/questions/sequential_check/section_8/part_3/lib/workplace.rb
|
290
|
+
- contents/questions/sequential_check/section_8/part_3/spec/spec_helper.rb
|
291
|
+
- contents/questions/sequential_check/section_8/part_3/spec/workplace_spec.rb
|
273
292
|
- contents/questions/sequential_check/section_9/part_1/lib/answer.rb
|
274
293
|
- contents/questions/sequential_check/section_9/part_1/lib/sentence.org
|
275
294
|
- contents/questions/sequential_check/section_9/part_1/lib/workplace.rb
|
@@ -1 +0,0 @@
|
|
1
|
-
# section_6/part_4/workplace.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
require "open3"
|
2
|
-
|
3
|
-
RSpec.describe "array" do
|
4
|
-
it 'put some datas' do
|
5
|
-
workshop = "#{ENV['HOME']}/.ruby_learner/workshop"
|
6
|
-
stdout, stderr, status = Open3.capture3("ruby #{workshop}/lib/workplace.rb")
|
7
|
-
expect { puts stdout }.to output("[3, 1, 4, 1, 5]\n3\n1\n4\n1\n5\n").to_stdout
|
8
|
-
end
|
9
|
-
end
|