Skip to content
This repository was archived by the owner on Mar 16, 2020. It is now read-only.

Commit 931fe63

Browse files
committed
change config to run with heroku
1 parent 6b012ed commit 931fe63

File tree

9 files changed

+52
-21
lines changed

9 files changed

+52
-21
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ rerun.txt
55
database.yml
66
.bundle
77
.rvmrc
8-
config/config.yml
9-
capybara-*
8+
capybara-*
9+
.env

Gemfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
source :rubygems
22

33
# Server requirements (defaults to WEBrick)
4-
# gem 'thin'
4+
gem 'unicorn'
55
# gem 'mongrel'
66

77
# Project requirements
@@ -16,20 +16,20 @@ gem 'activerecord', :require => "active_record"
1616
gem 'pg'
1717

1818
# Test requirements
19-
gem 'rspec', :group => "test"
20-
gem 'rack-test', :require => "rack/test", :group => "test"
21-
gem 'capybara', group: :test
22-
gem 'launchy', group: :test
23-
gem 'database_cleaner', group: :test
24-
gem 'webmock', group: :test
19+
group "test" do
20+
gem 'rspec'
21+
gem 'rack-test', :require => "rack/test"
22+
gem 'capybara'
23+
gem 'launchy'
24+
gem 'database_cleaner'
25+
gem 'webmock'
26+
end
27+
28+
group "development" do
29+
gem 'foreman'
30+
gem 'heroku'
31+
end
2532

2633
# Padrino Stable Gem
2734
gem 'padrino', '0.10.5'
2835

29-
# Or Padrino Edge
30-
# gem 'padrino', :git => 'git://github.com/padrino/padrino-framework.git'
31-
32-
# Or Individual Gems
33-
# %w(core gen helpers cache mailer admin).each do |g|
34-
# gem 'padrino-' + g, '0.10.5'
35-
# end

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ GEM
3333
multipart-post (~> 1.1)
3434
rack (~> 1.1)
3535
ffi (1.0.11)
36+
foreman (0.26.1)
37+
term-ansicolor (~> 1.0.5)
38+
thor (>= 0.13.6)
3639
grit (2.4.1)
3740
diff-lcs (~> 1.1)
3841
mime-types (~> 1.15)
42+
heroku (2.19.2)
43+
launchy (>= 0.3.2)
44+
rest-client (~> 1.6.1)
45+
rubyzip
46+
term-ansicolor (~> 1.0.5)
3947
http_router (0.10.2)
4048
rack (>= 1.0.0)
4149
url_mount (~> 0.2.1)
4250
i18n (0.6.0)
51+
kgio (2.6.0)
4352
koala (1.3.0)
4453
faraday (~> 0.7.0)
4554
multi_json (~> 1.0)
@@ -91,7 +100,10 @@ GEM
91100
rack
92101
rack-test (0.6.1)
93102
rack (>= 1.0)
103+
raindrops (0.8.0)
94104
rake (0.9.2.2)
105+
rest-client (1.6.7)
106+
mime-types (>= 1.16)
95107
rspec (2.8.0)
96108
rspec-core (~> 2.8.0)
97109
rspec-expectations (~> 2.8.0)
@@ -112,12 +124,17 @@ GEM
112124
tilt (~> 1.3, >= 1.3.3)
113125
sinatra-flash (0.3.0)
114126
sinatra (>= 1.0.0)
127+
term-ansicolor (1.0.7)
115128
thor (0.14.6)
116129
tilt (1.3.3)
117130
treetop (1.4.10)
118131
polyglot
119132
polyglot (>= 0.3.1)
120133
tzinfo (0.3.31)
134+
unicorn (4.1.1)
135+
kgio (~> 2.4)
136+
rack
137+
raindrops (~> 0.6)
121138
url_mount (0.2.1)
122139
rack
123140
webmock (1.7.10)
@@ -134,6 +151,8 @@ DEPENDENCIES
134151
capybara
135152
database_cleaner
136153
erubis
154+
foreman
155+
heroku
137156
koala
138157
launchy
139158
oauth2
@@ -143,4 +162,5 @@ DEPENDENCIES
143162
rake
144163
rspec
145164
sinatra-flash
165+
unicorn
146166
webmock

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

app/app.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ class CobotFb < Padrino::Application
5656
# end
5757
#
5858
class Config
59-
@config = YAML.load(File.open(File.dirname(__FILE__) + "/../config/config.yml"))
59+
@config = {
60+
fb_app_id: ENV['FB_APP_ID'],
61+
fb_app_key: ENV['FB_APP_KEY'],
62+
cobot_app_id: ENV['COBOT_APP_ID'],
63+
cobot_app_key: ENV['COBOT_APP_KEY']
64+
}
6065

6166
def self.[](key)
6267
@config[key.to_s]

app/controllers/fb_plans.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
CobotFb.controller do
33

4+
# fb calling
45
post '/' do
56
signed_page_params = auth.parse_signed_request(params[:signed_request])["page"]
67
fb_page_id = signed_page_params["id"]

config/config.yml.example

Lines changed: 0 additions & 4 deletions
This file was deleted.

config/unicorn.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
worker_processes 3 # amount of unicorn workers to spin up
2+
timeout 10 # restarts workers that hang for 30 seconds

example.env

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# set your config and rename to '.env' to set config
2+
# use 'heroku plugins:install git://github.com/ddollar/heroku-config.git' to manage this
3+
FB_APP_ID=id of fb app
4+
FB_APP_KEY=key of fb app
5+
COBOT_APP_ID=cobot app id
6+
COBOT_APP_KEY=cobot app key

0 commit comments

Comments
 (0)