Skip to content

Commit 54a695b

Browse files
committed
[skip-ci] upate doc
1 parent f549bf4 commit 54a695b

2 files changed

Lines changed: 36 additions & 24 deletions

File tree

README.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ Proof of Concept
88

99
## How to use
1010

11-
Add `ruby_register_toolchains` into your `WORKSPACE` file
11+
Add `ruby_rules_dependencies` and `ruby_register_toolchains` into your
12+
`WORKSPACE` file.
1213

1314
```python
1415
git_repository(
1516
name = "com_github_yugui_rules_ruby",
1617
remote = "https://github.com/yugui/rules_ruby.git",
17-
commit = "e791736837e9b880d7984ae949f479c7ce51b5f3",
18+
tag = "v0.1.0",
1819
)
1920

2021
load(
2122
"@com_github_yugui_rules_ruby//ruby:deps.bzl",
22-
"ruby_rules_dependencies",
2323
"ruby_register_toolchains",
24+
"ruby_rules_dependencies",
2425
)
2526

2627
ruby_rules_dependencies()
@@ -31,22 +32,29 @@ ruby_register_toolchains()
3132
Add `ruby_library`, `ruby_binary` or `ruby_test` into your `BUILD.bazel` files.
3233

3334
```python
35+
load(
36+
"@com_github_yugui_rules_ruby//ruby:def.bzl",
37+
"ruby_binary",
38+
"ruby_library",
39+
"ruby_test",
40+
)
41+
3442
ruby_library(
35-
name = "foo",
36-
srcs = ["lib/foo.rb"],
37-
includes = ["lib"],
43+
name = "foo",
44+
srcs = ["lib/foo.rb"],
45+
includes = ["lib"],
3846
)
3947

4048
ruby_binary(
41-
name = "bar",
42-
srcs = ["bin/bar"],
43-
deps = [":foo"],
49+
name = "bar",
50+
srcs = ["bin/bar"],
51+
deps = [":foo"],
4452
)
4553

4654
ruby_test(
47-
name = "foo_test",
48-
srcs = ["test/foo_test.rb"],
49-
deps = [":foo"],
55+
name = "foo_test",
56+
srcs = ["test/foo_test.rb"],
57+
deps = [":foo"],
5058
)
5159
```
5260

@@ -291,31 +299,35 @@ Example: `WORKSPACE`:
291299
git_repository(
292300
name = "com_github_yugui_rules_ruby",
293301
remote = "https://github.com/yugui/rules_ruby.git",
294-
commit = "8378a0ba19ab7c6d751c440bc016d9af76da656c",
302+
tag = "v0.1.0",
295303
)
296304

297305
load(
298-
"@com_github_yugui_rules_ruby//ruby:def.bzl",
299-
"ruby_register_toolchains",
300-
"bundle_install"
306+
"@com_github_yugui_rules_ruby//ruby:deps.bzl",
307+
"ruby_register_toolchains",
308+
"ruby_rules_dependencies",
301309
)
302310

303311
ruby_register_toolchains()
304312

313+
ruby_register_toolchains()
314+
315+
load("@com_github_yugui_rules_ruby//ruby:def.bzl", "bundle_install")
316+
305317
bundle_install(
306-
name = "gems",
307-
gemfile = "Gemfile",
308-
gemfile_lock = "Gemfile.lock",
318+
name = "gems",
319+
gemfile = "//:Gemfile",
320+
gemfile_lock = "//:Gemfile.lock",
309321
)
310322
```
311323

312324
Example: `lib/BUILD.bazel`:
313325

314326
```python
315327
ruby_library(
316-
name = "foo",
317-
srcs = ["foo.rb"],
318-
deps = ["@gems//:libs"],
328+
name = "foo",
329+
srcs = ["foo.rb"],
330+
deps = ["@gems//:libs"],
319331
)
320332
```
321333

examples/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ local_repository(
1212
# git_repository(
1313
# name = "com_github_yugui_rules_ruby",
1414
# remote = "https://github.com/yugui/rules_ruby.git",
15-
# tag = "v0.0.1",
15+
# tag = "v0.1.0",
1616
# )
1717

1818
load(
@@ -29,7 +29,7 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
2929

3030
bazel_skylib_workspace()
3131

32-
load("@com_github_yugui_rules_ruby//ruby/private:bundle.bzl", "bundle_install")
32+
load("@com_github_yugui_rules_ruby//ruby:def.bzl", "bundle_install")
3333

3434
bundle_install(
3535
name = "bundle",

0 commit comments

Comments
 (0)