Skip to content

Commit a1ddd91

Browse files
authored
Adding makefile for auto-generating PDF (#106)
* Adding makefile for auto-generating PDF * Updating adoc
1 parent 6b93011 commit a1ddd91

11 files changed

+1013
-63
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77

88
.bazelrc.user
99
user.bazelrc
10+
.readme.adoc

.readme

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=Ruby Rules® for Bazel
2+
:subtitle: Version %VERSION%
3+
:doctype: book
4+
:source-highlighter: rouge
5+
:rouge-style: base16.monokai
6+
:toclevels: 5
7+
:toc:
8+
:sectnums: 9
9+
:icons: font
10+
:license: apache

.rules_version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.4.1
1+
0.5.0

CHANGELOG.md

+15-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
## [Unreleased](https://github.com/bazelruby/rules_ruby/tree/HEAD)
44

5-
[Full Changelog](https://github.com/bazelruby/rules_ruby/compare/v0.4.1...HEAD)
5+
[Full Changelog](https://github.com/bazelruby/rules_ruby/compare/v0.5.0...HEAD)
66

77
**Closed issues:**
88

9-
- ruby\_binary - how to package up runfiles dir [\#101](https://github.com/bazelruby/rules_ruby/issues/101)
10-
- `warning: string literal in condition` from generated wrapper [\#87](https://github.com/bazelruby/rules_ruby/issues/87)
11-
- ruby\_rspec specs argument not resolved [\#79](https://github.com/bazelruby/rules_ruby/issues/79)
12-
- ruby\_test and ruby\_rspec rules use system ruby [\#63](https://github.com/bazelruby/rules_ruby/issues/63)
9+
- bin/setup Failure [\#95](https://github.com/bazelruby/rules_ruby/issues/95)
10+
- Setup script attempts to delete ~/.rbenv if rbenv is installed with Homebrew [\#81](https://github.com/bazelruby/rules_ruby/issues/81)
1311

1412
**Merged pull requests:**
1513

14+
- Massive upgrade of everything at once ;-\) [\#105](https://github.com/bazelruby/rules_ruby/pull/105) ([kigster](https://github.com/kigster))
1615
- Support ruby 3 [\#103](https://github.com/bazelruby/rules_ruby/pull/103) ([mmizutani](https://github.com/mmizutani))
1716
- Bump nokogiri from 1.11.2 to 1.11.5 in /examples/simple\_rails\_api [\#99](https://github.com/bazelruby/rules_ruby/pull/99) ([dependabot[bot]](https://github.com/apps/dependabot))
1817
- Bump nokogiri from 1.10.10 to 1.11.2 in /examples/simple\_rails\_api [\#94](https://github.com/bazelruby/rules_ruby/pull/94) ([dependabot[bot]](https://github.com/apps/dependabot))
@@ -22,6 +21,17 @@
2221
- Remove print statements from ruby\_runtime.bzl [\#84](https://github.com/bazelruby/rules_ruby/pull/84) ([adzenith](https://github.com/adzenith))
2322
- Document path argument to ruby\_test [\#80](https://github.com/bazelruby/rules_ruby/pull/80) ([sayrer](https://github.com/sayrer))
2423

24+
## [v0.5.0](https://github.com/bazelruby/rules_ruby/tree/v0.5.0) (2021-07-08)
25+
26+
[Full Changelog](https://github.com/bazelruby/rules_ruby/compare/v0.4.1...v0.5.0)
27+
28+
**Closed issues:**
29+
30+
- ruby\_binary - how to package up runfiles dir [\#101](https://github.com/bazelruby/rules_ruby/issues/101)
31+
- `warning: string literal in condition` from generated wrapper [\#87](https://github.com/bazelruby/rules_ruby/issues/87)
32+
- ruby\_rspec specs argument not resolved [\#79](https://github.com/bazelruby/rules_ruby/issues/79)
33+
- ruby\_test and ruby\_rspec rules use system ruby [\#63](https://github.com/bazelruby/rules_ruby/issues/63)
34+
2535
## [v0.4.1](https://github.com/bazelruby/rules_ruby/tree/v0.4.1) (2020-08-10)
2636

2737
[Full Changelog](https://github.com/bazelruby/rules_ruby/compare/v0.4.0...v0.4.1)

Makefile

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# vim: tabstop=8
2+
# vim: shiftwidth=8
3+
# vim: noexpandtab
4+
5+
# grep '^[a-z\-]*:' Makefile | cut -d: -f 1 | tr '\n' ' '
6+
.PHONY: help update-changelog update-readme update
7+
8+
red := \033[0;31m
9+
bold := \033[1;45m
10+
yellow := \033[0;33m
11+
blue := \033[0;34m
12+
green := \033[0;35m
13+
clear := \033[0m
14+
15+
RUBY_VERSION := $(shell cat .ruby-version)
16+
RULES_VERSION := $(shell cat .rules_version)
17+
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
18+
19+
# see: https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile/18137056#18137056
20+
SCREEN_WIDTH := 100
21+
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
22+
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
23+
PATH := $(shell echo "$(HOME)/.rbenv/shims:$(PATH)")
24+
25+
help: ## Prints help message auto-generated from the comments.
26+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
27+
28+
update: update-changelog update-readme ## Runs all of the updates, add locally modiofied files to git.
29+
30+
update-changelog: ## Auto-generate the doc/CHANGELOG (requires GITHUB_TOKEN env var set)
31+
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Regenerating CHANGELOG....$(clear)\n"
32+
@bash -c "$(BASHMATIC_HOME)/bin/regen-changelog"
33+
34+
update-readme: ## Generate the PDF version of the README
35+
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting README.md into the ASCIIDOC...$(clear)\n"
36+
@bash -c "command -v kramdoc || gem install kramdoc; kramdoc README.md"
37+
@rm -fv README.pdf
38+
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting ASCIIDOC into the PDF...$(clear)\n"
39+
@mv README.adoc .readme.adoc
40+
@cat .readme .readme.adoc | sed -E "s/source,bazel/source,python/g; s/%VERSION%/$(RULES_VERSION)/g" > README.adoc
41+
@$(BASHMATIC_HOME)/bin/adoc2pdf README.adoc
42+
@git add README.pdf
43+
@open README.pdf
44+
45+

0 commit comments

Comments
 (0)