rabbit-slide-kou-rubykaigi-2019 2019.4.19.2 → 2019.4.19.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config.yaml +1 -1
- data/csv.rab +8 -255
- data/pdf/rubykaigi-2019-csv.pdf +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f63569cfbf858370fb8e21235d2639725722194770966730d77be352a3450b1
|
4
|
+
data.tar.gz: 5da2ef8c92d97533cf4caf0d695f3dc6b1c0fc7ae5286147cb78715deb93d9e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cb473bb4b60f80b644ce4a62949f6e9861fd22e0177a55866cef08e5a3d3d7a4333f8aedef28b10d21b73cb3214f0326dbcfe36c0bae274f8d7f11c41dc551b
|
7
|
+
data.tar.gz: bf814da29f3cfa036ef43b3dc21a7f420c55bbb0fb2d647335746b2d5843473437fc42c66d5a1c11bc3e3c7f049b417dcf70d91617ff8043f22eb0dfa0098baa
|
data/config.yaml
CHANGED
data/csv.rab
CHANGED
@@ -538,149 +538,6 @@ Keep backward compatibility\n
|
|
538
538
|
* To keep developing\n
|
539
539
|
(('note:継続的な開発するため'))
|
540
540
|
|
541
|
-
= How to reconstruct test (1)\n(('note:テストを整理する方法(1)'))
|
542
|
-
|
543
|
-
One assertion\n
|
544
|
-
than\n
|
545
|
-
multiple assertions\n
|
546
|
-
(('note:複数アサーションより一発アサーション'))
|
547
|
-
|
548
|
-
= One assertion\n(('note:一発アサーション'))
|
549
|
-
|
550
|
-
# rouge ruby
|
551
|
-
|
552
|
-
# Multiple assertions
|
553
|
-
CSV.foreach do |row|
|
554
|
-
assert_equal(@rows.shift, row)
|
555
|
-
end
|
556
|
-
# One assertion
|
557
|
-
rows = CSV.foreach.to_a
|
558
|
-
assert_equal(@rows, rows)
|
559
|
-
|
560
|
-
= Why\n(('note:理由'))
|
561
|
-
|
562
|
-
Easy to debug\n
|
563
|
-
on failure\n
|
564
|
-
(('note:失敗時にデバッグしやすい'))
|
565
|
-
|
566
|
-
= On failure: Multiple assertions\n(('note:失敗時:複数アサーション'))
|
567
|
-
|
568
|
-
# rouge ruby
|
569
|
-
|
570
|
-
rows = [1, 2, 3]
|
571
|
-
[1, 4, 3].each do |row|
|
572
|
-
assert_equal(rows.shift, row)
|
573
|
-
end
|
574
|
-
# <2> expected but was
|
575
|
-
# <4>
|
576
|
-
# Is the N-th row wrong?
|
577
|
-
|
578
|
-
= On failure: One assertion\n(('note:失敗時:一発アサーション'))
|
579
|
-
|
580
|
-
# rouge ruby
|
581
|
-
|
582
|
-
rows = [1, 2, 3]
|
583
|
-
assert_equal(rows, [1, 4, 3])
|
584
|
-
# <[1, 2, 3]> expected but was
|
585
|
-
# <[1, 4, 3]>
|
586
|
-
# diff:
|
587
|
-
# ? [1, 2, 3]
|
588
|
-
# ? 4
|
589
|
-
|
590
|
-
= How to reconstruct test (2)\n(('note:テストを整理する方法(2)'))
|
591
|
-
|
592
|
-
Multiple tests\n
|
593
|
-
than\n
|
594
|
-
one test\n
|
595
|
-
(('note:一発テストより複数テスト'))
|
596
|
-
|
597
|
-
= One test\n(('note:一発テスト'))
|
598
|
-
|
599
|
-
# rouge ruby
|
600
|
-
|
601
|
-
# How many checks in this test?
|
602
|
-
def test_open_and_close
|
603
|
-
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
604
|
-
assert_not_nil(csv)
|
605
|
-
assert_instance_of(CSV, csv)
|
606
|
-
assert_not_predicate(csv, :closed?)
|
607
|
-
csv.close
|
608
|
-
assert_predicate(csv, :closed?)
|
609
|
-
|
610
|
-
ret = CSV.open(@path) do |new_csv|
|
611
|
-
csv = new_csv
|
612
|
-
assert_instance_of(CSV, new_csv)
|
613
|
-
"Return value."
|
614
|
-
end
|
615
|
-
assert_predicate(csv, :closed?)
|
616
|
-
assert_equal("Return value.", ret)
|
617
|
-
end
|
618
|
-
|
619
|
-
= Multiple tests (1)\n(('note:複数テスト(1)'))
|
620
|
-
|
621
|
-
# rouge ruby
|
622
|
-
|
623
|
-
def test_closed?
|
624
|
-
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
625
|
-
assert_not_nil(csv)
|
626
|
-
assert_instance_of(CSV, csv)
|
627
|
-
assert_not_predicate(csv, :closed?)
|
628
|
-
csv.close
|
629
|
-
assert_predicate(csv, :closed?)
|
630
|
-
end
|
631
|
-
|
632
|
-
= Needless assertions\n(('note:必要のないアサーション'))
|
633
|
-
|
634
|
-
# rouge ruby
|
635
|
-
|
636
|
-
def test_closed?
|
637
|
-
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
638
|
-
assert_not_nil(csv) # <- Needless
|
639
|
-
assert_instance_of(CSV, csv) # <- Needless
|
640
|
-
assert_not_predicate(csv, :closed?) # <- This can detect
|
641
|
-
csv.close
|
642
|
-
assert_predicate(csv, :closed?)
|
643
|
-
end
|
644
|
-
|
645
|
-
= Multiple tests (1)\n(('note:複数テスト(1)'))
|
646
|
-
|
647
|
-
# rouge ruby
|
648
|
-
|
649
|
-
def test_closed?
|
650
|
-
csv = CSV.open(@path, "r+", col_sep: "\t", row_sep: "\r\n")
|
651
|
-
assert_not_predicate(csv, :closed?)
|
652
|
-
csv.close
|
653
|
-
assert_predicate(csv, :closed?)
|
654
|
-
end
|
655
|
-
|
656
|
-
= Multiple tests (2)\n(('note:複数テスト(2)'))
|
657
|
-
|
658
|
-
# rouge ruby
|
659
|
-
|
660
|
-
def test_open_auto_close
|
661
|
-
csv = nil
|
662
|
-
CSV.open(@input.path) do |new_csv|
|
663
|
-
csv = new_csv
|
664
|
-
end
|
665
|
-
assert_predicate(csv, :closed?)
|
666
|
-
end
|
667
|
-
|
668
|
-
= Multiple tests (3)\n(('note:複数テスト(3)'))
|
669
|
-
|
670
|
-
# rouge ruby
|
671
|
-
|
672
|
-
def test_open_block_return_value
|
673
|
-
return_value = CSV.open(@input.path) do
|
674
|
-
"Return value."
|
675
|
-
end
|
676
|
-
assert_equal("Return value.", return_value)
|
677
|
-
end
|
678
|
-
|
679
|
-
= Why\n(('note:理由'))
|
680
|
-
|
681
|
-
Easy to maintain\n
|
682
|
-
(('note:メンテナンスしやすい'))
|
683
|
-
|
684
541
|
= Easy to maintenance\n(('note:メンテナンスしやすい状態'))
|
685
542
|
|
686
543
|
* Easy to understand each test\n
|
@@ -690,48 +547,6 @@ Easy to maintain\n
|
|
690
547
|
* Focusing a failed case is easy to debug\n
|
691
548
|
(('note:失敗したケースに集中できるとデバッグしやすい'))
|
692
549
|
|
693
|
-
= How to reconstruct test (4)\n(('note:テストを整理する方法(4)'))
|
694
|
-
|
695
|
-
Simplify\n
|
696
|
-
(('note:単純にする'))
|
697
|
-
|
698
|
-
= Test writing\n(('note:書き込みテスト'))
|
699
|
-
|
700
|
-
# rouge ruby
|
701
|
-
|
702
|
-
lines = [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
|
703
|
-
CSV.open(@path, "wb", headers: true) do |csv|
|
704
|
-
csv << lines.first.keys
|
705
|
-
lines.each {|line| csv << line}
|
706
|
-
end
|
707
|
-
CSV.open(@path, "rb", headers: true) do |csv|
|
708
|
-
csv.each {|line| assert_equal(lines.shift, line.to_hash)}
|
709
|
-
end
|
710
|
-
|
711
|
-
= Simplify\n(('note:単純にする'))
|
712
|
-
|
713
|
-
# rouge ruby
|
714
|
-
|
715
|
-
CSV.open(@path, "wb", headers: true) do |csv|
|
716
|
-
csv << [:a, :b, :c] # Use literal
|
717
|
-
csv << {a: 1, b: 2, c: 3} # Use literal
|
718
|
-
csv << {a: 4, b: 5, c: 6} # Use literal
|
719
|
-
end
|
720
|
-
# Use literal and don't parse
|
721
|
-
assert_equal(<<-CSV, File.read(@path, mode: "rb"))
|
722
|
-
a,b,c
|
723
|
-
1,2,3
|
724
|
-
4,5,6
|
725
|
-
CSV
|
726
|
-
|
727
|
-
= Summary: Test\n(('note:まとめ:テスト'))
|
728
|
-
|
729
|
-
* Important for keeping backward compat.\n
|
730
|
-
(('note:互換性を維持するために重要'))
|
731
|
-
* Keep tests easy to maintain\n
|
732
|
-
for continuous development\n
|
733
|
-
(('note:継続的に開発するためにメンテナンスしやすいテストを維持'))
|
734
|
-
|
735
550
|
= Benchmark\n(('note:ベンチマーク'))
|
736
551
|
|
737
552
|
* Important to detect\n
|
@@ -743,36 +558,14 @@ Simplify\n
|
|
743
558
|
Fully-featured benchmark driver for Ruby 3x3\n
|
744
559
|
(('note:Ruby 3x3のために必要な機能が揃っているベンチマークツール'))
|
745
560
|
|
746
|
-
=
|
747
|
-
|
748
|
-
* Accurate Measurement\n
|
749
|
-
(('note:正確な計測'))
|
750
|
-
* Pluggable & Fully Featured\n
|
751
|
-
(('note:プラガブルだし必要な機能が揃っている'))
|
752
|
-
* Flexible Interface\n
|
753
|
-
(('note:柔軟なインターフェイス'))
|
754
|
-
|
755
|
-
= Accurate Measurement\n(('note:正確な計測'))
|
561
|
+
= benchmark_driver gem in csv
|
756
562
|
|
757
|
-
*
|
758
|
-
(('note
|
759
|
-
*
|
760
|
-
(('note
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
= Pluggable & Fully Featured\n(('note:プラガブルだし必要な機能が揃っている'))
|
765
|
-
|
766
|
-
* Runner and output format are\n
|
767
|
-
all pluggable\n
|
768
|
-
(('note:実行モジュールと出力モジュールはすべてプラガブル'))
|
769
|
-
|
770
|
-
= Flexible Interface\n(('note:柔軟なインターフェイス'))
|
771
|
-
|
772
|
-
* YAML input to easily manage structured benchmark set\n
|
773
|
-
(('note:構造化されたベンチマークセットを管理しやすいYAMLによる入力'))
|
774
|
-
* Comparing multiple Ruby binaries, even with miniruby\n
|
775
|
-
(('note:minirubyも含む複数Rubyバイナリーを使った比較'))
|
563
|
+
* YAML input is easy to use\n
|
564
|
+
(('note:YAMLによる入力が便利'))
|
565
|
+
* Can compare multiple gem versions\n
|
566
|
+
(('note:複数のgemのバージョンで比較可能'))
|
567
|
+
* To detect performance regression\n
|
568
|
+
(('note:性能劣化を検出するため'))
|
776
569
|
|
777
570
|
= Benchmark for each gem version\n(('note:gemのバージョン毎のベンチマーク'))
|
778
571
|
|
@@ -793,7 +586,7 @@ Fully-featured benchmark driver for Ruby 3x3\n
|
|
793
586
|
* parse_{quote_char_nil,strip}.yaml
|
794
587
|
* read.yaml, shift.yaml, write.yaml
|
795
588
|
|
796
|
-
=
|
589
|
+
= Benchmark as a starting point\n(('note:出発点としてのベンチマーク'))
|
797
590
|
|
798
591
|
* Join csv developing!\n
|
799
592
|
(('note:csvの開発に参加しよう!'))
|
@@ -811,23 +604,6 @@ Fully-featured benchmark driver for Ruby 3x3\n
|
|
811
604
|
Default gemified\n
|
812
605
|
(('note:デフォルトgem化'))
|
813
606
|
|
814
|
-
= Default gem\n(('note:デフォルトgem'))
|
815
|
-
|
816
|
-
* Similar to plain standard library\n
|
817
|
-
(('note:通常の標準添付ライブラリーと似ている'))
|
818
|
-
* Similar to bundled gem\n
|
819
|
-
(('note:バンドルgemと似ている'))
|
820
|
-
|
821
|
-
= Plain standard library\n(('note:通常の標準添付ライブラリー'))
|
822
|
-
|
823
|
-
* Can use it just by (({require}))\n
|
824
|
-
(('note:(({require}))するだけで使える'))
|
825
|
-
* Can use it without entry in (({Gemfile}))\n
|
826
|
-
(('note:(({Gemfile}))に書かなくても使える'))
|
827
|
-
* Can't upgrade it by (({gem}))\n
|
828
|
-
(('note:(({gem}))でアップグレードできない'))
|
829
|
-
* e.g.: dRuby
|
830
|
-
|
831
607
|
= Default gem\n(('note:デフォルトgem'))
|
832
608
|
|
833
609
|
* Can use it just by (({require}))\n
|
@@ -837,29 +613,6 @@ Default gemified\n
|
|
837
613
|
(('note:(({Gemfile}))に書かなくても使えるけど古い'))
|
838
614
|
* Can upgrade it by (({gem}))\n
|
839
615
|
(('note:(({gem}))でアップグレードできる'))
|
840
|
-
* e.g.: csv
|
841
|
-
|
842
|
-
= Bundled gem\n(('note:バンドルgem'))
|
843
|
-
|
844
|
-
* Can use it just by (({require}))\n
|
845
|
-
(('note:(({require}))するだけで使える'))
|
846
|
-
* Can't use it without entry in (({Gemfile}))\n
|
847
|
-
(('note:(({Gemfile}))に書かないと使えない'))
|
848
|
-
* Can upgrade it by (({gem}))\n
|
849
|
-
(('note:(({gem}))でアップグレードできる'))
|
850
|
-
* e.g.: test-unit
|
851
|
-
|
852
|
-
= Summary: Library types\n(('note:まとめ:ライブラリーの種類'))
|
853
|
-
|
854
|
-
# RT
|
855
|
-
|
856
|
-
, Plain, Default, Bundled
|
857
|
-
|
858
|
-
(({require})), Yes, Yes, Yes
|
859
|
-
(({Gemfile})), Yes, Yes(*1), No
|
860
|
-
Upgrade, No, Yes, Yes
|
861
|
-
|
862
|
-
(*1) Bundled version is used
|
863
616
|
|
864
617
|
= How to use improved csv?\n(('note:改良されたcsvを使う方法'))
|
865
618
|
|
data/pdf/rubykaigi-2019-csv.pdf
CHANGED
Binary file
|