Switch to Pygments for syntax highlighting
This commit is contained in:
parent
96a6491043
commit
1d11401a1e
2
Gemfile
2
Gemfile
|
@ -13,6 +13,8 @@ gem "jekyll", "~> 3.6.2"
|
|||
# This is the default theme for new Jekyll sites. You may change this to anything you like.
|
||||
gem "minima", "~> 2.0", git: 'https://github.com/rfwatson/minima-2col'
|
||||
|
||||
gem "pygments.rb"
|
||||
|
||||
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
|
||||
# uncomment the line below. To upgrade, run `bundle update github-pages`.
|
||||
# gem "github-pages", group: :jekyll_plugins
|
||||
|
|
|
@ -46,9 +46,12 @@ GEM
|
|||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
ruby_dep (~> 1.2)
|
||||
mercenary (0.3.6)
|
||||
multi_json (1.13.1)
|
||||
pathutil (0.16.1)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (3.0.1)
|
||||
pygments.rb (1.2.1)
|
||||
multi_json (>= 1.0.0)
|
||||
rb-fsevent (0.10.2)
|
||||
rb-inotify (0.9.10)
|
||||
ffi (>= 0.5.0, < 2)
|
||||
|
@ -70,6 +73,7 @@ DEPENDENCIES
|
|||
jekyll-seo-tag
|
||||
jekyll-stealthy-share!
|
||||
minima (~> 2.0)!
|
||||
pygments.rb
|
||||
tzinfo-data
|
||||
|
||||
BUNDLED WITH
|
||||
|
|
|
@ -24,6 +24,7 @@ permalink: /blog/:year/:month/:day/:title/
|
|||
google_analytics: UA-8059487-21
|
||||
disqus:
|
||||
shortname: netflux
|
||||
highlighter: pygments
|
||||
|
||||
# Build settings
|
||||
markdown: kramdown
|
||||
|
|
|
@ -12,12 +12,12 @@ Hot on the heels of [thes](/blog/2018/01/16/thes-gem/) is another Ruby gem: this
|
|||
|
||||
The middleware needs only the most minimal configuration. For example, here it is being configured to strip the `client_id` parameter from incoming requests, based on some assumed application-level logic:
|
||||
|
||||
```ruby
|
||||
{% highlight ruby %}
|
||||
use Rack::FilterParam, {
|
||||
param: :client_id,
|
||||
if: -> (value) { should_I_do_it?(value) }
|
||||
}
|
||||
```
|
||||
{% endhighlight %}
|
||||
|
||||
When the application method `should_I_do_it?` returns a truthy value, the `client_id` parameter is stripped from the request, which is then passed upstream.
|
||||
|
||||
|
|
|
@ -22,17 +22,17 @@ The gem adds a single Rake task to your Rails application. When you run the task
|
|||
|
||||
To install the gem, just add it to your Gemfile:
|
||||
|
||||
```ruby
|
||||
{% highlight ruby %}
|
||||
group :development do
|
||||
gem 'routing_report'
|
||||
end
|
||||
```
|
||||
{% endhighlight %}
|
||||
|
||||
And discover unwanted routes and actions by running the Rake task:
|
||||
|
||||
```bash
|
||||
{% highlight bash %}
|
||||
rake routing_report:run
|
||||
```
|
||||
{% endhighlight %}
|
||||
|
||||
Here is the report for the popular open source Rails app [GitLab](https://gitlab.com/gitlab-org/gitlab-ce):
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ While researching the most appropriate solution, I discovered a useful tool. [`p
|
|||
|
||||
Once I'd found it, using it in the RSpec container's entrypoint script was simple:
|
||||
|
||||
```bash
|
||||
{% highlight bash %}
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
@ -32,4 +32,4 @@ done
|
|||
|
||||
bundle exec rake db:reset
|
||||
bundle exec rspec $@
|
||||
```
|
||||
{% endhighlight %}
|
||||
|
|
|
@ -141,3 +141,4 @@ img.profile {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue