Skip to content

Commit

Permalink
Deprecate RACK_ENV in favour of APP_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
svoop authored and dometto committed Apr 16, 2024
1 parent b40af29 commit 1714de6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions LATEST_CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Breaking Changes

* Docker image: removed deprecated automatic activation of --mathjax. Pass '--math mathjax' to continue using mathjax, or '--math' to use KaTeX (see below).
* RACK_ENV is ignored, please use APP_ENV instead (@svoop).

## New features

Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a gi
* Can be displayed in all versions, reverted, etc.
* Gollum strives to be [compatible](https://github.com/gollum/gollum/wiki/5.0-release-notes#compatibility-option) with [GitHub](https://docs.github.com/en/communities/documenting-your-project-with-wikis/about-wikis) and [GitLab](https://docs.gitlab.com/ee/user/project/wiki/#create-or-edit-wiki-pages-locally) wikis.
* Just clone your GitHub/GitLab wiki and view and edit it locally!

* Gollum supports advanced functionality like:
* [UML diagrams](https://github.com/gollum/gollum/wiki#plantuml-diagrams)
* [BibTeX and Citation support](https://github.com/gollum/gollum/wiki/BibTeX-and-Citations)
Expand All @@ -49,7 +49,7 @@ Ruby is best installed either via [RVM](https://rvm.io/) or a package manager of
```
gem install gollum
```

Installation examples for individual systems can be seen [here](https://github.com/gollum/gollum/wiki/Installation).

To run, simply:
Expand Down Expand Up @@ -114,6 +114,13 @@ Gollum can also be run alongside a CAS (Central Authentication Service) SSO (sin

Gollum can also be run as a service. More on that [over here](https://github.com/gollum/gollum/wiki/Gollum-as-a-service).

## ENVIRONMENT

Gollum uses the environment variable `APP_ENV` primarily to control how the underlying Sinatra app behaves:

* `development` – reload the app on every request
* `production` – load the app only once

## CONFIGURATION

Gollum comes with the following command line options:
Expand Down
9 changes: 7 additions & 2 deletions bin/gollum
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ MSG
puts results.empty? ? 'none' : results
exit 0
end

opts.separator ''
opts.separator ' Development:'

Expand Down Expand Up @@ -282,7 +282,12 @@ if options[:irb]
end
else
require 'gollum/app'
Precious::App.set(:environment, ENV.fetch('RACK_ENV', :production).to_sym)
# TODO: Remove RACK_ENV fallback once gollum-7 is released (4 lines)
if ENV['RACK_ENV'] && !ENV['APP_ENV']
warn "[DEPRECATION] RACK_ENV will be ignored as of gollum-6.0.0, please use APP_ENV instead."
ENV['APP_ENV'] = ENV['RACK_ENV']
end
Precious::App.set(:environment, ENV.fetch('APP_ENV', :production).to_sym)
Precious::App.set(:gollum_path, gollum_path)
Precious::App.set(:wiki_options, wiki_options)

Expand Down
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Gollum
Gollum::GIT_ADAPTER = RUBY_PLATFORM == 'java' ? 'rjgit' : 'rugged'
end

ENV['RACK_ENV'] = 'test'
ENV['APP_ENV'] = 'test'
require 'gollum'
require 'gollum/app'

Expand Down

0 comments on commit 1714de6

Please sign in to comment.