From bc2c17ffe45fc43ba42b650285d66739e911bb0c Mon Sep 17 00:00:00 2001 From: sue445 Date: Sat, 11 Jul 2015 22:42:05 +0900 Subject: [PATCH 1/3] Support heroku deploy button --- Gemfile | 2 ++ Gemfile.lock | 5 +++++ README.md | 2 ++ app.json | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 app.json diff --git a/Gemfile b/Gemfile index 9ce3860..c89136d 100644 --- a/Gemfile +++ b/Gemfile @@ -14,6 +14,8 @@ gem 'simple_form' gem 'coveralls', require: false +gem 'pg', group: :postgresql + group :development do # better_errors 2.0 requires Ruby 2.0 or higher gem 'better_errors', '1.1.0' diff --git a/Gemfile.lock b/Gemfile.lock index cca8c33..08852f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -102,6 +102,7 @@ GEM omniauth-openid (1.0.1) omniauth (~> 1.0) rack-openid (~> 1.3.1) + pg (0.18.2) pry (0.10.1) coderay (~> 1.1.0) method_source (~> 0.8.1) @@ -224,6 +225,7 @@ DEPENDENCIES magic_encoding mizuno omniauth-openid + pg pry-rails rails (= 4.0.13) rails_autolink @@ -238,3 +240,6 @@ DEPENDENCIES thin twitter-bootstrap-rails uglifier (>= 1.0.3) + +BUNDLED WITH + 1.10.5 diff --git a/README.md b/README.md index c456668..8f9861d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Many companies and organizations use Gistub for sharing code snippets safely in [![Coverage Status](https://coveralls.io/repos/seratch/gistub/badge.png?branch=develop)](https://coveralls.io/r/seratch/gistub?branch=develop) [![Code Climate](https://codeclimate.com/github/seratch/gistub.png)](https://codeclimate.com/github/seratch/gistub) +[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) + ## How to use `master` branch is always the lastest stable version. diff --git a/app.json b/app.json new file mode 100644 index 0000000..a8a2066 --- /dev/null +++ b/app.json @@ -0,0 +1,43 @@ +{ + "name": "Gistub", + "description": "Sharing code snippets in-house", + "keywords": ["gist"], + "scripts": { + "postdeploy": "bundle exec rake db:create db:migrate" + }, + "env": { + "BUNDLE_WITHOUT": { + "description": "bundle install --without ", + "value": "test:development" + }, + "GISTUB_APP_NAME": { + "description": "variable to customize header", + "value": "", + "required": false + }, + "GISTUB_OPENID_IDENTIFIER": { + "description": "specify auth server instead of Google OpenID", + "value": "", + "required": false + }, + "GISTUB_AUTO_LINK": { + "description": "whether enabling rails_autolink", + "value": "true", + "required": false + }, + "GISTUB_ALLOWS_ANONYMOUS": { + "description": "whether enabling anonymous post", + "value": "false", + "required": false + }, + "GISTUB_SECRET_TOKEN": { + "generator": "secret" + }, + "GISTUB_SECRET_KEY_BASE": { + "generator": "secret" + } + }, + "addons": [ + "papertrail" + ] +} From 0ff707861c99a15faa9da9cf3bdbfce1af8c596d Mon Sep 17 00:00:00 2001 From: sue445 Date: Sat, 11 Jul 2015 23:59:01 +0900 Subject: [PATCH 2/3] If blank, use default value because received blank string from app.json --- app/views/layouts/application.html.erb | 2 +- config/initializers/omniauth.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 414251d..60dd459 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,4 +1,4 @@ -<% app_name = ENV['GISTUB_APP_NAME'] || 'Gistub' %> +<% app_name = ENV['GISTUB_APP_NAME'].presence || 'Gistub' %> diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb index 034a398..736672a 100644 --- a/config/initializers/omniauth.rb +++ b/config/initializers/omniauth.rb @@ -2,6 +2,6 @@ Rails.application.config.middleware.use OmniAuth::Builder do require 'openid/store/filesystem' provider :open_id, - :identifier => ENV['GISTUB_OPENID_IDENTIFIER'] || 'https://www.google.com/accounts/o8/id', + :identifier => ENV['GISTUB_OPENID_IDENTIFIER'].presence || 'https://www.google.com/accounts/o8/id', :store => OpenID::Store::Filesystem.new("#{Rails.root}/tmp/openid") end From 5c1b33f55c8f82d330abe4d37c32c11a23ba3299 Mon Sep 17 00:00:00 2001 From: sue445 Date: Sun, 12 Jul 2015 01:03:44 +0900 Subject: [PATCH 3/3] don't bundle install pg on travis because jruby-19mode can not build pg --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index aa149da..76e46e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ rvm: - 2.1.5 # TODO: tests on Ruby 2.2.0 # - 2.2.0 +bundler_args: --without postgresql env: - DB=sqlite script: