Skip to content

Commit

Permalink
Ruby 2.3.2. RACK_ENV=deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Nov 19, 2016
1 parent 40a8dfa commit f4b3ff3
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .dockerenv.example
@@ -1,4 +1,4 @@
RACK_ENV=production
RACK_ENV=deployment

REDIS_URL=redis://redis:6379

Expand Down
15 changes: 10 additions & 5 deletions .irbrc
@@ -1,10 +1,15 @@
prefix = ENV["RACK_ENV"] || "development"
env = (ENV["IRB_PROMPT"] || ENV["RACK_ENV"] || "unknown").upcase
if env == "PRODUCTION" or env == "DEPLOYMENT"
color = "31"
else
color = "33"
end

IRB.conf[:PROMPT][:CUSTOM] = {
PROMPT_I: "%03n \e[31m#{prefix} >>\e[0m ",
PROMPT_N: "%03n \e[1;33m#{prefix} >>\e[0m ",
PROMPT_I: "%03n \e[#{color}m#{env} >>\e[0m ",
PROMPT_N: "%03n \e[#{color}m#{env} \e[1;33m>>\e[0m ",
PROMPT_S: nil,
PROMPT_C: "%03n \e[33m#{prefix} ?>\e[0m ",
RETURN: "\e[32m=>\e[0m %s\n"
PROMPT_C: "%03n \e[#{color}m#{env} \e[33m?>\e[0m ",
RETURN: "\e[#{color}m#{env} \e[32m=>\e[0m %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
2 changes: 1 addition & 1 deletion .ruby-version
@@ -1 +1 @@
2.3.1
2.3.2
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source "https://rubygems.org"

ruby "2.3.1"
ruby "~> 2.3.0"

gem "rack"
gem "sinatra"
Expand Down
30 changes: 15 additions & 15 deletions Gemfile.lock
Expand Up @@ -6,10 +6,11 @@ GEM
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.4.0)
airbrake (5.5.0)
airbrake-ruby (~> 1.5)
airbrake-ruby (1.5.0)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
airbrake (5.6.1)
airbrake-ruby (~> 1.6)
airbrake-ruby (1.6.0)
backports (3.6.8)
better_errors (2.1.1)
coderay (>= 1.0.0)
Expand All @@ -24,10 +25,10 @@ GEM
debug_inspector (0.0.2)
dotenv (2.1.1)
erubis (2.7.0)
faraday (0.9.2)
faraday (0.10.0)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
faraday_middleware (0.10.1)
faraday (>= 0.7.4, < 1.0)
feedjira (2.0.0)
faraday (~> 0.9)
faraday_middleware (~> 0.9)
Expand All @@ -47,14 +48,12 @@ GEM
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
newrelic_rpm (3.16.3.323)
nokogiri (1.6.8)
newrelic_rpm (3.17.1.326)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
opengraph_parser (0.2.3)
addressable
nokogiri
pkg-config (1.1.7)
powder (0.3.0)
thor (>= 0.11.5)
pry (0.10.4)
Expand All @@ -64,19 +63,20 @@ GEM
pry-remote (0.1.8)
pry (~> 0.9)
slop (~> 3.0)
public_suffix (2.0.4)
puma (3.6.0)
rack (1.6.4)
rack (1.6.5)
rack-protection (1.5.3)
rack
rack-ssl-enforcer (0.2.9)
rack-test (0.6.3)
rack (>= 1.0)
rake (11.3.0)
redis (3.3.1)
redis (3.3.2)
redis-namespace (1.5.2)
redis (~> 3.0, >= 3.0.4)
sax-machine (1.3.2)
secure_headers (3.4.1)
secure_headers (3.5.1)
useragent
sinatra (1.4.7)
rack (~> 1.5)
Expand Down Expand Up @@ -133,4 +133,4 @@ RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.13.2
1.13.6
7 changes: 3 additions & 4 deletions Vagrantfile
Expand Up @@ -2,8 +2,7 @@ $setup_env = <<SCRIPT
# To unset variables when restarting, set them to an empty string
export RBENV_ROOT=/home/vagrant/.rbenv
export PATH=$RBENV_ROOT/bin:$RBENV_ROOT/shims:$PATH
export RACK_ENV=production
export RAILS_ENV=production
export RACK_ENV=deployment
export LOG_ENABLED=1
export REDIS_URL=redis://localhost:6379/3
Expand Down Expand Up @@ -148,8 +147,8 @@ else
git clone https://github.com/rkh/rbenv-update.git $RBENV_ROOT/plugins/rbenv-update
fi
rbenv install 2.3.0
rbenv global 2.3.0
rbenv install 2.3.2
rbenv global 2.3.2
gem install bundler
Expand Down
2 changes: 1 addition & 1 deletion app.json
Expand Up @@ -8,7 +8,7 @@
"addons": ["heroku-redis"],
"keywords": ["rss"],
"env": {
"RACK_ENV": "production",
"RACK_ENV": "deployment",
"TWITTER_ACCESS_TOKEN": {
"description": "(Optional) Your Twitter access token. Read the README.md to learn how to generate this from the consumer key and consumer secret.",
"required": false
Expand Down
2 changes: 1 addition & 1 deletion bin/prod_server
@@ -1,2 +1,2 @@
#!/bin/bash
RACK_ENV=production bundle exec puma -C config/puma.rb "$@"
RACK_ENV=deployment bundle exec puma -C config/puma.rb "$@"
4 changes: 2 additions & 2 deletions config/application.rb
Expand Up @@ -4,7 +4,7 @@
Bundler.require(:default, ENV["RACK_ENV"])

# uncomment to get production error pages in development
# set :environment, :production
# set :environment, :deployment

configure do
use Rack::SslEnforcer, only_hosts: /\.herokuapp\.com$/
Expand All @@ -15,7 +15,7 @@
settings.add_charset << "application/atom+xml"
end

configure :production do
configure :deployment do
set :static_cache_control, [:public, :max_age => 86400]
end

Expand Down

0 comments on commit f4b3ff3

Please sign in to comment.