Skip to content

Commit

Permalink
getting started!
Browse files Browse the repository at this point in the history
  • Loading branch information
rinasergeeva committed Oct 31, 2022
0 parents commit 35ec461
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gemfiles/*.lock
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rules "~MD013", "~MD033", "~MD034", "~MD026"
12 changes: 12 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require:
- standard/cop/semantic_blocks
- rubocop-md

inherit_gem:
standard: config/base.yml

Standard/SemanticBlocks:
Enabled: false

Lint/DuplicateMethods:
Enabled: false
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# TestProfの日本語マニュアル

[ホームページ](https://test-prof.evilmartians.io/)でご確認ください。

## Linters

We try to keep our documentation both correct and _stylish_ using the following tools:

- [mdl](https://github.com/markdownlint/markdownlint) (Markdown linter, Ruby edition)
- RuboCop with [rubocop-md](https://github.com/rubocop-hq/rubocop-md) and [standard](https://github.com/testdouble/standard) (Ruby code snippets style checking)

### Install `mdl`

```sh
gem install mdl
```

### Install StandardRB and `rubocop-md`

```sh
gem install standard
gem install rubocop-md
```
23 changes: 23 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
* [入門](/getting_started.md)

* 性能解析
* [RubyProfとの統合](/profilers/ruby_prof.md)
* [StackProfとの統合](/profilers/stack_prof.md)
* [Event Profiler](/profilers/event_prof.md)
* [Tag Profiler](/profilers/tag_prof.md)
* [Factory Doctor](/profilers/factory_doctor.md)
* [Factory Profiler](/profilers/factory_prof.md)
* [RSpecDissect Profiler](/profilers/rspec_dissect.md)

* レシピー
* [`before_all`](/recipes/before_all.md)
* [`let_it_be`](/recipes/let_it_be.md)
* [AnyFixture](/recipes/any_fixture.md)
* [FactoryDefault](/recipes/factory_default.md)
* [FactoryAllStub](/recipes/factory_all_stub.md)
* [RSpec Stamp](/recipes/rspec_stamp.md)
* [テストのサンプリング](/recipes/tests_sampling.md)
* [Railsのログ出力](/recipes/logging.md)

* その他
* [RuboCopのコップ](/misc/rubocop.md)
67 changes: 67 additions & 0 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 入門

## 前提条件

対応しているRubyのバージョン

* Ruby (MRI) >= 2.5.0
* Ruby 2.2の場合は、TestProf < 0.7.0、
* Ruby 2.3の場合は、TestProf ~> 0.7.0、
* Ruby 2.4の場合は、TestProf < 0.12.0 を使用してください。

* JRuby >= 9.1.0.0(一部のツールはバージョン 9.2.7+ が必要)

RSpecの場合は、対応のバージョンは >=3.5.0 です。もっと古いRSpecには TestProf < 0.8.0 が必要です。

## インストール

ジェム「`test-prof`」を追加してください。

```ruby
group :test do
gem "test-prof"
end
```

これでインストールが終わりです!

## 設定

TestProfは、全ツールで使用されるいくつかのグローバル設定があります。

```ruby
TestProf.configure do |config|
# レポートなどを保存するフォルダー (デフォルトは'tmp/test_prof')
config.output_dir = "tmp/test_prof"

# レポートファイルの名前ににタイムスタンプを付ける
config.timestamps = true

# 出力をハイライトする
config.color = true

# ログ出力の宛先(ファイルまたはSTDOUT)
config.output = $stdout

# カスタムのロガーインスタンスを指定することもできます
config.logger = MyLogger.new
end
```

### レポート区別用の識別子

また、「`TEST_PROF_REPORT`」という環境変数を使用して、レポート名に識別子を追加することができます。これは、異なるセットアップでのレポートを比較したい場合に便利です。

**例:** `bootsnap`を使う場合と使わない場合のロード時間を[`stackprof`](./profilers/stack_prof.md)で比較してみましょう。

```sh
# 一番目のレポートに、「-with-bootsnap」を付けます
$ TEST_STACK_PROF=boot TEST_PROF_REPORT=with-bootsnap bundle exec rake
$ #=> StackProf report generated: tmp/test_prof/stack-prof-report-wall-raw-boot-with-bootsnap.dump

# 二番目のレポートは、bootnapを無効にし、名前に「-no-bootsnap」を付けて作成します
$ TEST_STACK_PROF=boot TEST_PROF_REPORT=no-bootsnap bundle exec rake
$ #=> StackProf report generated: tmp/test_prof/stack-prof-report-wall-raw-boot-no-bootsnap.dump
```

これで、分かりやすい名前の2つのレポートができました。
4 changes: 4 additions & 0 deletions gemfiles/rubocop.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org" do
gem "rubocop-md", "~> 0.3"
gem "standard", "~> 0.2.0"
end

0 comments on commit 35ec461

Please sign in to comment.