editor_learner 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +42 -0
- data/LICENSE.txt +21 -0
- data/README.md +79 -0
- data/Rakefile +6 -0
- data/answer.rb +1 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/.ipynb_checkpoints/Untitled-checkpoint.ipynb +177 -0
- data/docs/.ipynb_checkpoints/Untitled1-checkpoint.ipynb +6 -0
- data/docs/.ipynb_checkpoints/final_reserch-checkpoint.ipynb +75 -0
- data/docs/Untitled.ipynb +167 -0
- data/docs/final_reserch.ipynb +75 -0
- data/editor_learner.gemspec +40 -0
- data/exe/editor_learner +4 -0
- data/h.rb +14 -0
- data/lib/.DS_Store +0 -0
- data/lib/answer.rb +1 -0
- data/lib/editor_learner/version.rb +3 -0
- data/lib/editor_learner.rb +123 -0
- data/lib/new_terminal +25 -0
- data/lib/question/.DS_Store +0 -0
- data/lib/question/ruby_1/1.rb +6 -0
- data/lib/question/ruby_1/2.rb +11 -0
- data/lib/question/ruby_1/3.rb +16 -0
- data/lib/question/ruby_1/4.rb +19 -0
- data/lib/question/ruby_2/1.rb +11 -0
- data/lib/question/ruby_3/1.rb +11 -0
- data/lib/question/ruby_3/2.rb +22 -0
- data/lib/question/test/1.rb +1 -0
- data/lib/question/test/2.rb +1 -0
- data/lib/question/test/3.rb +1 -0
- data/lib/question/test/4.rb +1 -0
- data/lib/question.rb +1 -0
- data/lib/random_check_question/1.rb +11 -0
- data/lib/random_check_question/2.rb +9 -0
- data/lib/random_check_question/3.rb +2 -0
- data/lib/random_check_question/4.rb +5 -0
- data/lib/random_h.rb +14 -0
- data/lib/sequential_check_question/ruby_1/1.rb +11 -0
- data/lib/sequential_check_question/ruby_1/2.rb +16 -0
- data/lib/sequential_check_question/ruby_1/3.rb +19 -0
- data/lib/sequential_check_question/ruby_1/q.rb +19 -0
- data/lib/sequential_check_question/ruby_2/1.rb +19 -0
- data/lib/sequential_check_question/ruby_2/2.rb +21 -0
- data/lib/sequential_check_question/ruby_2/3.rb +25 -0
- data/lib/sequential_check_question/ruby_2/q.rb +19 -0
- data/lib/sequential_check_question/ruby_3/1.rb +11 -0
- data/lib/sequential_check_question/ruby_3/2.rb +16 -0
- data/lib/sequential_check_question/ruby_3/3.rb +15 -0
- data/lib/sequential_check_question/ruby_3/q.rb +11 -0
- data/lib/sequential_check_question/ruby_4/1.rb +11 -0
- data/lib/sequential_check_question/ruby_4/2.rb +14 -0
- data/lib/sequential_check_question/ruby_4/3.rb +14 -0
- data/lib/sequential_check_question/ruby_5/1.rb +18 -0
- data/lib/sequential_check_question/ruby_5/2.rb +29 -0
- data/lib/sequential_check_question/ruby_5/3.rb +27 -0
- data/lib/sequential_check_question/ruby_6/1.rb +10 -0
- data/lib/sequential_check_question/ruby_6/2.rb +23 -0
- data/lib/sequential_check_question/ruby_6/3.rb +34 -0
- data/lib/sequential_h.rb +13 -0
- data/question.rb +19 -0
- data/workshop/#answer.rb# +1 -0
- data/workshop/answer.rb +0 -0
- data/workshop/question.rb +0 -0
- data/workshop/random_h.rb +14 -0
- data/workshop/ruby_1/1.rb +11 -0
- data/workshop/ruby_1/2.rb +11 -0
- data/workshop/ruby_1/3.rb +0 -0
- data/workshop/ruby_1/q.rb +16 -0
- data/workshop/ruby_1/sequential_h.rb +13 -0
- data/workshop/ruby_2/1.rb +0 -0
- data/workshop/ruby_2/2.rb +0 -0
- data/workshop/ruby_2/3.rb +0 -0
- data/workshop/ruby_2/q.rb +0 -0
- data/workshop/ruby_2/sequential_h.rb +13 -0
- data/workshop/ruby_3/1.rb +0 -0
- data/workshop/ruby_3/2.rb +0 -0
- data/workshop/ruby_3/3.rb +0 -0
- data/workshop/ruby_3/q.rb +0 -0
- data/workshop/ruby_3/sequential_h.rb +13 -0
- data/workshop/ruby_4/1.rb +0 -0
- data/workshop/ruby_4/2.rb +0 -0
- data/workshop/ruby_4/3.rb +0 -0
- data/workshop/ruby_4/q.rb +0 -0
- data/workshop/ruby_4/sequential_h.rb +13 -0
- data/workshop/ruby_5/1.rb +18 -0
- data/workshop/ruby_5/2.rb +0 -0
- data/workshop/ruby_5/3.rb +0 -0
- data/workshop/ruby_5/q.rb +18 -0
- data/workshop/ruby_5/sequential_h.rb +13 -0
- data/workshop/ruby_6/1.rb +0 -0
- data/workshop/ruby_6/2.rb +0 -0
- data/workshop/ruby_6/3.rb +0 -0
- data/workshop/ruby_6/q.rb +0 -0
- data/workshop/ruby_6/sequential_h.rb +13 -0
- metadata +242 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
puts fizz_buzz(1)
|
14
|
+
puts fizz_buzz(2)
|
15
|
+
puts fizz_buzz(3)
|
16
|
+
puts fizz_buzz(4)
|
17
|
+
puts fizz_buzz(5)
|
18
|
+
puts fizz_buzz(6)
|
19
|
+
puts fizz_buzz(15)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
puts fizz_buzz(1)
|
14
|
+
puts fizz_buzz(2)
|
15
|
+
puts fizz_buzz(3)
|
16
|
+
puts fizz_buzz(4)
|
17
|
+
puts fizz_buzz(5)
|
18
|
+
puts fizz_buzz(6)
|
19
|
+
puts fizz_buzz(15)
|
@@ -0,0 +1,19 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
puts fizz_buzz(1)
|
14
|
+
puts fizz_buzz(2)
|
15
|
+
puts fizz_buzz(3)
|
16
|
+
puts fizz_buzz(4)
|
17
|
+
puts fizz_buzz(5)
|
18
|
+
puts fizz_buzz(6)
|
19
|
+
puts fizz_buzz(15)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'minitest/autorun'
|
14
|
+
|
15
|
+
class FizzBuzzTest < Minitest::Test
|
16
|
+
def test_fizz_buzz
|
17
|
+
assert_equal '1', fizz_buzz(1)
|
18
|
+
assert_equal '2', fizz_buzz(2)
|
19
|
+
assert_equal 'Fizz', fizz_buzz(3)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'minitest/autorun'
|
14
|
+
|
15
|
+
class FizzBuzzTest < Minitest::Test
|
16
|
+
def test_fizz_buzz
|
17
|
+
assert_equal '1', fizz_buzz(1)
|
18
|
+
assert_equal '2', fizz_buzz(2)
|
19
|
+
assert_equal 'Fizz', fizz_buzz(3)
|
20
|
+
assert_equal '4', fizz_buzz(4)
|
21
|
+
assert_equal 'Buzz', fizz_buzz(5)
|
22
|
+
assert_equal 'Fizz', fizz_buzz(6)
|
23
|
+
assert_equal 'Fizz Buzz', fizz_buzz(15)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
puts fizz_buzz(1)
|
14
|
+
puts fizz_buzz(2)
|
15
|
+
puts fizz_buzz(3)
|
16
|
+
puts fizz_buzz(4)
|
17
|
+
puts fizz_buzz(5)
|
18
|
+
puts fizz_buzz(6)
|
19
|
+
puts fizz_buzz(15)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class RgbTest < Minitest::Test
|
4
|
+
def test_to_hex
|
5
|
+
assert_equal '#000000', to_hex(0, 0, 0)
|
6
|
+
assert_equal '#ffffff', to_hex(255, 255, 255)
|
7
|
+
assert_equal '#043c78', to_hex(4, 60, 120)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hex(r, g, b)
|
12
|
+
'#' +
|
13
|
+
r.to_s(16).rjust(2, '0') +
|
14
|
+
g.to_s(16).rjust(2, '0') +
|
15
|
+
b.to_s(16).rjust(2, '0')
|
16
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class RgbTest < Minitest::Test
|
4
|
+
def test_to_hex
|
5
|
+
assert_equal '#000000', to_hex(0, 0, 0)
|
6
|
+
assert_equal '#ffffff', to_hex(255, 255, 255)
|
7
|
+
assert_equal '#043c78', to_hex(4, 60, 120)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def to_hex(r, g, b)
|
12
|
+
[r, g, b].inject('#') do |hex, n|
|
13
|
+
hex + n.to_s(16).rjust(2, '0')
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertLengthTest < Minitest::Test
|
4
|
+
def test_convert_length
|
5
|
+
assert_equal 39.37, convert_length(1, 'm', 'in')
|
6
|
+
assert_equal 0.03, convert_length(1, 'in', 'm')
|
7
|
+
assert_equal 10670.73, convert_length(35000, 'ft', 'm')
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def convert_length(length, unit_from, unit_to)
|
12
|
+
units = { 'm' => 1.0, 'ft' => 3.28, 'in' => 39.37 }
|
13
|
+
(length / units[unit_from] * units[unit_to]).round(2)
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertLengthTest < Minitest::Test
|
4
|
+
def test_convert_length
|
5
|
+
assert_equal 39.37, convert_length(1, from: :m, to: :in)
|
6
|
+
assert_equal 0.38, convert_length(15, from: :in, to: :m)
|
7
|
+
assert_equal 10670.73, convert_length(35000, from: :ft, to: :m)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def convert_length(length, from: :m, to: :m)
|
12
|
+
units = { m: 1.0, ft: 3.28, in: 39.37 }
|
13
|
+
(length / units[from] * units[to]).round(2)
|
14
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertHashSyntaxTest < Minitest::Test
|
4
|
+
def test_convert_hash_syntax
|
5
|
+
assert_equal '{}', convert_hash_syntax('{}')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
old_syntax = <<TEXT
|
10
|
+
{
|
11
|
+
:name => 'Alice'
|
12
|
+
:age => 20,
|
13
|
+
:gender => female
|
14
|
+
}
|
15
|
+
TEXT
|
16
|
+
def convert_hash_syntax(old_syntax)
|
17
|
+
old_syntax
|
18
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertHashSyntaxTest < Minitest::Test
|
4
|
+
def test_convert_hash_syntax
|
5
|
+
old_syntax = <<~TEXT
|
6
|
+
{
|
7
|
+
:name => 'Alice'
|
8
|
+
:age => 20,
|
9
|
+
:gender => :female
|
10
|
+
}
|
11
|
+
TEXT
|
12
|
+
expected = <<~TEXT
|
13
|
+
{
|
14
|
+
name: 'Alice'
|
15
|
+
age: 20,
|
16
|
+
gender: :female
|
17
|
+
}
|
18
|
+
TEXT
|
19
|
+
assert_equal expected, convert_hash_syntax(old_syntax)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def convert_hash_syntax(old_syntax)
|
24
|
+
old_syntax
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertHashSyntaxTest < Minitest::Test
|
4
|
+
def test_convert_hash_syntax
|
5
|
+
old_syntax = <<~TEXT
|
6
|
+
{
|
7
|
+
:name => 'Alice'
|
8
|
+
:age => 20,
|
9
|
+
:gender => :female
|
10
|
+
}
|
11
|
+
TEXT
|
12
|
+
expected = <<~TEXT
|
13
|
+
{
|
14
|
+
name: 'Alice'
|
15
|
+
age: 20,
|
16
|
+
gender: :female
|
17
|
+
}
|
18
|
+
TEXT
|
19
|
+
actual = convert_hash_syntax(old_syntax)
|
20
|
+
puts actual
|
21
|
+
assert_equal expected, actual
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def convert_hash_syntax(old_syntax)
|
26
|
+
old_syntax.gsub(/:(w+) *=> */, '\1: ')
|
27
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class GateTest < Minitest::Test
|
4
|
+
def test_gate
|
5
|
+
umeda = Gate.new(:umeda)
|
6
|
+
juso = Gate.new(:juso)
|
7
|
+
ticket = Ticket.new(150)
|
8
|
+
umeda.enter(ticket)
|
9
|
+
assert juso.exit(ticket)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
class Gate
|
14
|
+
def initialize(name)
|
15
|
+
@name = name
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Ticket
|
20
|
+
def initialize(fare)
|
21
|
+
@fare = fare
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class GateTest < Minitest::Test
|
4
|
+
def setup
|
5
|
+
@umeda = Gate.new(:umeda)
|
6
|
+
@juso = Gate.new(:juso)
|
7
|
+
@mikuri = Gate.new(:mikuri)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_umeda_to_juso
|
11
|
+
ticket = Ticket.new(150)
|
12
|
+
@umeda.enter(ticket)
|
13
|
+
assert @juso.exit(ticket)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class Gate
|
18
|
+
def initialize(name)
|
19
|
+
@name = name
|
20
|
+
end
|
21
|
+
|
22
|
+
def enter(ticket)
|
23
|
+
end
|
24
|
+
|
25
|
+
def exit(ticket)
|
26
|
+
true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class Ticket
|
31
|
+
def initialize(fare)
|
32
|
+
@fare = fare
|
33
|
+
end
|
34
|
+
end
|
data/lib/sequential_h.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
data/question.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
def fizz_buzz(n)
|
2
|
+
if n % 15 == 0
|
3
|
+
'Fizz Buzz'
|
4
|
+
elsif n % 3 == 0
|
5
|
+
'Fizz'
|
6
|
+
elsif n % 5 == 0
|
7
|
+
'Buzz'
|
8
|
+
else
|
9
|
+
n.to_s
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
puts fizz_buzz(1)
|
14
|
+
puts fizz_buzz(2)
|
15
|
+
puts fizz_buzz(3)
|
16
|
+
puts fizz_buzz(4)
|
17
|
+
puts fizz_buzz(5)
|
18
|
+
puts fizz_buzz(6)
|
19
|
+
puts fizz_buzz(15)
|
@@ -0,0 +1 @@
|
|
1
|
+
country
|
data/workshop/answer.rb
ADDED
File without changes
|
File without changes
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# to open q.rb
|
2
|
+
# c-x 2: split window vertically
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open a.rb as above
|
5
|
+
# c-x 3: split window horizontally
|
6
|
+
# c-x c-f: find file and input a.rb
|
7
|
+
# move the other window
|
8
|
+
# c-x o: other windw
|
9
|
+
# then edit a.rb as q.rb
|
10
|
+
|
11
|
+
# c-a: move ahead
|
12
|
+
# c-d: delete character
|
13
|
+
# c-x c-s: save file
|
14
|
+
# c-x c-c: quit edit
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertHashSyntaxTest < Minitest::Test
|
4
|
+
def test_convert_hash_syntax
|
5
|
+
assert_equal '{}', convert_hash_syntax('{}')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
old_syntax = <<TEXT
|
10
|
+
{
|
11
|
+
:name => 'Alice'
|
12
|
+
:age => 20,
|
13
|
+
:gender => female
|
14
|
+
}
|
15
|
+
TEXT
|
16
|
+
def convert_hash_syntax(old_syntax)
|
17
|
+
old_syntax
|
18
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
|
3
|
+
class ConvertHashSyntaxTest < Minitest::Test
|
4
|
+
def test_convert_hash_syntax
|
5
|
+
assert_equal '{}', convert_hash_syntax('{}')
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
old_syntax = <<TEXT
|
10
|
+
{
|
11
|
+
:name => 'Alice'
|
12
|
+
:age => 20,
|
13
|
+
:gender => female
|
14
|
+
}
|
15
|
+
TEXT
|
16
|
+
def convert_hash_syntax(old_syntax)
|
17
|
+
old_syntax
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#to open q.rb
|
2
|
+
# c-x 2: find file and input q.rb
|
3
|
+
# c-x c-f: find file and input q.rb
|
4
|
+
# open 1~3.rb as above
|
5
|
+
# c-x 3: split find file and input 1~3.rb
|
6
|
+
# move the other window
|
7
|
+
# c-x o: other window
|
8
|
+
# then edit 1~3.rb q.rb
|
9
|
+
|
10
|
+
# c-a:move ahead
|
11
|
+
# c-d: delete character
|
12
|
+
# c-x c-s: save file
|
13
|
+
# c-x c-c: quit edit
|