Skip to content

Commit ff5edcf

Browse files
committed
RVM and Debian 12
Full support to RVM Signed-off-by: Rodrigo Nardi <rnardi@netdef.org>
1 parent 940b2fe commit ff5edcf

4 files changed

Lines changed: 16 additions & 20 deletions

File tree

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ gem 'octokit', '~> 9.1'
2020
# Web Framework
2121
gem 'sinatra'
2222

23-
gem 'rack'
23+
gem 'rack', '3.1.7'
24+
25+
gem 'rackup'
2426

2527
# ActiveRecord
2628
gem 'otr-activerecord', '~> 2.3'

Gemfile.lock

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ GEM
9797
rack (>= 3.0.0)
9898
rack-test (2.1.0)
9999
rack (>= 1.3)
100+
rackup (2.1.0)
101+
rack (>= 3)
102+
webrick (~> 1.8)
100103
rainbow (3.1.1)
101104
rake (13.2.1)
102105
regexp_parser (2.9.2)
@@ -159,6 +162,7 @@ GEM
159162
addressable (>= 2.8.0)
160163
crack (>= 0.3.2)
161164
hashdiff (>= 0.4.0, < 2.0.0)
165+
webrick (1.8.1)
162166

163167
PLATFORMS
164168
ruby
@@ -178,8 +182,9 @@ DEPENDENCIES
178182
otr-activerecord (~> 2.3)
179183
pg (~> 1.5, >= 1.5.3)
180184
puma
181-
rack
185+
rack (= 3.1.7)
182186
rack-test
187+
rackup
183188
rake
184189
rspec
185190
rubocop (= 1.56.1)

config.ru

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
#
99
# frozen_string_literal: true
1010

11-
require_relative 'app/github_app'
12-
require_relative 'config/delayed_job'
13-
14-
require 'puma'
11+
require 'rack'
12+
require 'rackup'
1513
require 'rack/handler/puma'
1614
require 'rack/session/cookie'
15+
require 'securerandom'
16+
17+
require_relative 'app/github_app'
18+
require_relative 'config/delayed_job'
1719

1820
File.write('.session.key', SecureRandom.hex(32))
1921

@@ -24,7 +26,7 @@ pids << spawn("RACK_ENV=#{ENV.fetch('RACK_ENV', 'development')} rake jobs:work Q
2426

2527
use Rack::Session::Cookie, secret: File.read('.session.key'), same_site: true, max_age: 86_400
2628

27-
Rack::Handler::Puma.run Rack::URLMap.new('/' => GithubApp)
29+
Rackup::Handler::Puma.run Rack::URLMap.new('/' => GithubApp)
2830

2931
pids.each do |pid|
3032
Process.kill('TERM', pid.to_i)

database_loader.rb

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
require 'active_record'
1212
require 'otr-activerecord'
1313

14-
module OTR
15-
module ActiveRecord
16-
class << self
17-
alias original_configure_from_file! configure_from_file!
18-
19-
def configure_from_file!(file)
20-
config = YAML.safe_load_file(file, permitted_classes: [Symbol], aliases: true)
21-
::ActiveRecord::Base.configurations = config
22-
end
23-
end
24-
end
25-
end
26-
2714
OTR::ActiveRecord.db_dir = 'db'
2815
OTR::ActiveRecord.migrations_paths = ['db/migrate']
2916
OTR::ActiveRecord.configure_from_file! 'config/database.yml'

0 commit comments

Comments
 (0)