Skip to content

Commit

Permalink
Adding makefile for auto-generating PDF (#106)
Browse files Browse the repository at this point in the history
* Adding  makefile for auto-generating PDF

* Updating adoc
  • Loading branch information
kigster authored Jul 8, 2021
1 parent 6b93011 commit a1ddd91
Show file tree
Hide file tree
Showing 11 changed files with 1,013 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

.bazelrc.user
user.bazelrc
.readme.adoc
10 changes: 10 additions & 0 deletions .readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
=Ruby Rules® for Bazel
:subtitle: Version %VERSION%
:doctype: book
:source-highlighter: rouge
:rouge-style: base16.monokai
:toclevels: 5
:toc:
:sectnums: 9
:icons: font
:license: apache
2 changes: 1 addition & 1 deletion .rules_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.1
0.5.0
20 changes: 15 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

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

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

**Closed issues:**

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

**Merged pull requests:**

- Massive upgrade of everything at once ;-\) [\#105](https://github.com/bazelruby/rules_ruby/pull/105) ([kigster](https://github.com/kigster))
- Support ruby 3 [\#103](https://github.com/bazelruby/rules_ruby/pull/103) ([mmizutani](https://github.com/mmizutani))
- 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))
- 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))
Expand All @@ -22,6 +21,17 @@
- Remove print statements from ruby\_runtime.bzl [\#84](https://github.com/bazelruby/rules_ruby/pull/84) ([adzenith](https://github.com/adzenith))
- Document path argument to ruby\_test [\#80](https://github.com/bazelruby/rules_ruby/pull/80) ([sayrer](https://github.com/sayrer))

## [v0.5.0](https://github.com/bazelruby/rules_ruby/tree/v0.5.0) (2021-07-08)

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

**Closed issues:**

- ruby\_binary - how to package up runfiles dir [\#101](https://github.com/bazelruby/rules_ruby/issues/101)
- `warning: string literal in condition` from generated wrapper [\#87](https://github.com/bazelruby/rules_ruby/issues/87)
- ruby\_rspec specs argument not resolved [\#79](https://github.com/bazelruby/rules_ruby/issues/79)
- ruby\_test and ruby\_rspec rules use system ruby [\#63](https://github.com/bazelruby/rules_ruby/issues/63)

## [v0.4.1](https://github.com/bazelruby/rules_ruby/tree/v0.4.1) (2020-08-10)

[Full Changelog](https://github.com/bazelruby/rules_ruby/compare/v0.4.0...v0.4.1)
Expand Down
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# vim: tabstop=8
# vim: shiftwidth=8
# vim: noexpandtab

# grep '^[a-z\-]*:' Makefile | cut -d: -f 1 | tr '\n' ' '
.PHONY: help update-changelog update-readme update

red := \033[0;31m
bold := \033[1;45m
yellow := \033[0;33m
blue := \033[0;34m
green := \033[0;35m
clear := \033[0m

RUBY_VERSION := $(shell cat .ruby-version)
RULES_VERSION := $(shell cat .rules_version)
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')

# see: https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile/18137056#18137056
SCREEN_WIDTH := 100
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MAKEFILE_PATH))))
PATH := $(shell echo "$(HOME)/.rbenv/shims:$(PATH)")

help: ## Prints help message auto-generated from the comments.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

update: update-changelog update-readme ## Runs all of the updates, add locally modiofied files to git.

update-changelog: ## Auto-generate the doc/CHANGELOG (requires GITHUB_TOKEN env var set)
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Regenerating CHANGELOG....$(clear)\n"
@bash -c "$(BASHMATIC_HOME)/bin/regen-changelog"

update-readme: ## Generate the PDF version of the README
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting README.md into the ASCIIDOC...$(clear)\n"
@bash -c "command -v kramdoc || gem install kramdoc; kramdoc README.md"
@rm -fv README.pdf
@printf "\n$(bold) 👉 $(red)$(clear) $(green)Converting ASCIIDOC into the PDF...$(clear)\n"
@mv README.adoc .readme.adoc
@cat .readme .readme.adoc | sed -E "s/source,bazel/source,python/g; s/%VERSION%/$(RULES_VERSION)/g" > README.adoc
@$(BASHMATIC_HOME)/bin/adoc2pdf README.adoc
@git add README.pdf
@open README.pdf


Loading

0 comments on commit a1ddd91

Please sign in to comment.