Skip to content

Update Ruby version, remove Travis workaround, and add Markdown linter - #100

Merged
jnewbery merged 3 commits into
bitcoinops:masterfrom
harding:2019-01-deps-tests
Jan 15, 2019
Merged

Update Ruby version, remove Travis workaround, and add Markdown linter#100
jnewbery merged 3 commits into
bitcoinops:masterfrom
harding:2019-01-deps-tests

Conversation

@harding

@harding harding commented Jan 9, 2019

Copy link
Copy Markdown
Collaborator

This removes the need for the workaround in 71e9fad by updating Ruby. I chose Ruby 2.5.1 because that's the version used for Ubuntu 18.04 LTS, so users of that system should, in theory, not even need to use rvm to get a Ruby to build site previews. I use Debian, not Ubuntu, so I haven't tested that.

This also adds a lint checker suggested by @practicalswift with a single check for extraneous spaces at the end of a line. I think this is an important rule because some Markdown parsers turn two spaces at the end of a line into a <br> tag, complicating review because whitespace at the end of a line is often invisible. There are plenty of other rules we can add if we want, although I'd prefer to focus on preventing problems rather than enforcing a consistent style.

The short steps to upgrade are:

  1. cd to your checkout
  2. (Optional) Checkout current master, run make all, then run cp -a _site _old_site
  3. Checkout this PR
  4. Then,
rvm install 2.5.1
cd ; cd -
ruby --version
# Should say something like: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
bundle install
make all

Optionally, you can finish by running diff -ru _old_site _site to see how this change affects the build. Besides changing in-file datestamps, the only changes I see are rearragements in the order associative arrays are printed and the README.md file is no longer rendered on the site (as expected).

Note that if you checkout out a branch that uses the previous version of Ruby, you need to exit and re-enter the top-level repository directory to get RVM to select the current Ruby version. You can go to your home directory and back to your last-used directory using: cd ; cd -

On my system, going back to an older version of Ruby causes one of HTMLproofer's dependencies to segfault. This can be resolved by deleting your cached bundler gems (on Linux, try mv ~/.gems /tmp) and then re-running bundle install

@harding
harding force-pushed the 2019-01-deps-tests branch from 47d4d1f to 32b924d Compare January 9, 2019 16:10
Markdown rules say that a line ending with two spaces receives a <br>
tag.  Since spaces at the end of a line are generally invisible, they
make reviews harder, so we use the mdl Markdown linter to warn about any
number of spaces at line end.

If you want to create a <br>, just use a <br> tag manually.
@harding
harding force-pushed the 2019-01-deps-tests branch from 32b924d to f3103ce Compare January 9, 2019 16:15
@jnewbery

jnewbery commented Jan 9, 2019

Copy link
Copy Markdown
Contributor

Looks great. Tested ACK f3103ce.

As suggested here: #99 (comment), I'll merge this after next week's newsletter is merged.

@jnewbery

Copy link
Copy Markdown
Contributor

#101 is merged, so merging this too.

@jnewbery
jnewbery merged commit c3e4518 into bitcoinops:master Jan 15, 2019
bitschmidty pushed a commit that referenced this pull request Mar 19, 2024
* newsletter292zh

* fix style

* Apply suggestions from code review

Co-authored-by: freeyao <johnyao1526@gmail.com>

---------

Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: freeyao <johnyao1526@gmail.com>
harding pushed a commit to harding/bitcoinops.github.io that referenced this pull request Sep 27, 2024
* newsletter292zh

* fix style

* Apply suggestions from code review

Co-authored-by: freeyao <johnyao1526@gmail.com>

---------

Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: freeyao <johnyao1526@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants