asciibuild
is available on Ruby Gems by just installing from the internet:
gem install asciibuild
asciibuild
is packaged as a gem. Build and install it from source using gem build
and gem install
. For convenience, there is a make
target that will perform both steps.
git clone git@github.com:jbrisbin/asciibuild.git
cd asciibuild
make gem
Or you can perform the steps separately.
gem build asciibuild.gemspec
gem install asciibuild-*.gem
Building asciibuild
can be done with bundler. The included Gemfile contains the necessary configuration to build and install asciibuild
using a simple bundle install
.
> make install rm -Rf *.gem vendor *.log metastore_db Dockerfile Gemfile.lock gem uninstall -x asciibuild bundle install Fetching gem metadata from https://rubygems.org/......... Fetching version metadata from https://rubygems.org/. Resolving dependencies... Using asciidoctor 1.5.4 Using mustache 1.0.3 Using posix-spawn 0.3.11 Using yajl-ruby 1.2.1 Using bundler 1.13.1 Using pygments.rb 0.6.3 Using asciibuild 0.1.0 from source at `.` Bundle complete! 4 Gemfile dependencies, 7 gems now installed. Use `bundle show [gemname]` to see where a bundled gem is installed.
This installs the necessary dependencies, as well as the asciibuild
gem with bundler. In order to execute asciibuild
installed this way, you must invoke it with bundle exec asciibuild
. An example invocation can be found in the Makefile. See the USAGE document for more on running asciibuild
.
If you’re using rbenv
[1] or rvm
[2] to manage your Ruby environments, then it may not matter to you to have asciibuild
installed globally. As an alternative to installing asciibuild
globally, you can use a Docker image to process documents (assuming the image contains anything you’re likely to need to run from any of your listing blocks like bash
, python
, or what have you).
Note
|
This is an asciibuild -enabled file. You can change the variables defined here by passing -a flags when running asciibuild on this file.
|
-
workdir = /tmp/asciibuild
FROM alpine RUN apk add --no-cache bash make build-base ruby ruby-rdoc ruby-irb ruby-bundler ruby-dev py-pip docker RUN pip install pygments RUN mkdir -p {{workdir}} COPY . {{workdir}}/ WORKDIR {{workdir}} RUN bundle install RUN gem build asciibuild.gemspec RUN gem install ./asciibuild-*.gem -l RUN rm -Rf {{workdir}} RUN apk del build-base make ruby-dev VOLUME /usr/src WORKDIR /usr/src ENTRYPOINT ["asciibuild"]
Build the Docker image that can run asciibuild
by using docker build
:
docker build -t asciibuild .
If you’ve bootstrapped asciibuild
by running one of Building with gem or Building with Bundler to install it, you can later run the build with asciibuild
on this file.
asciibuild doc/BUILD.adoc
bundle exec asciibuild doc/BUILD.adoc
For documentation on how to run asciibuild
after it’s installed, see the USAGE document.