platform_sh_rails 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/platform_sh_rails.rb +17 -4
- data/lib/platform_sh_rails/version.rb +1 -1
- metadata +2 -4
- data/bin/platform_rails_env +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a08d7fbbad6ecb31111fc0275a112c069967c634
|
4
|
+
data.tar.gz: 522c96b9842afc5247a4537450ce2e46895db070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c48f43d0b41e0ef5e7ddb77658302ba673038f6c822bde4ccce68e6589c5e185b5cb087cd94b7c9c40a49cebccd357ef4b81ef7eb4d4a9e561d53355012aefdc
|
7
|
+
data.tar.gz: 3ce1b9ce33c721bc345bd6564468963ab9e9bd24fe3e9fa08a0de64832feb735d06ea01e254dbf51d6c5450f40bb5e2580b4c9f2e8f42b452f9f7460cac64881
|
data/lib/platform_sh_rails.rb
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
require "platform_sh_rails/version"
|
2
2
|
require "platform_sh"
|
3
3
|
|
4
|
-
class
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
class PlatformSHRailtie < Rails::Railtie
|
5
|
+
config.before_configuration do
|
6
|
+
if ENV['TMPDIR'].nil?
|
7
|
+
ENV['TMPDIR']="/tmp"
|
8
|
+
end
|
9
|
+
if PlatformSH::on_platform? && !PlatformSH::is_build_environment?
|
10
|
+
ENV['DATABASE_URL']=PlatformSH::guess_database_url
|
11
|
+
end
|
12
|
+
if PlatformSH::on_platform? && PlatformSH::is_build_environment?
|
13
|
+
ENV['DB_ADAPTER']="nulldb"
|
14
|
+
ENV['DATABASE_URL']="nulldb://localhost/nulldb?pool=5"
|
15
|
+
end
|
16
|
+
ENV['RAILS_SERVE_STATIC_FILES']="true"
|
17
|
+
ENV['RAILS_LOG_TO_STDOUT']="true"
|
18
|
+
ENV['SECRET_KEY_BASE']=ENV['PLATFORM_PROJECT_ENTROPY']
|
19
|
+
end
|
20
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: platform_sh_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ori Pekelman
|
@@ -83,8 +83,7 @@ dependencies:
|
|
83
83
|
description: Platform.sh rails helper gem to ease interacting with the environment
|
84
84
|
email:
|
85
85
|
- ori@platform.sh
|
86
|
-
executables:
|
87
|
-
- platform_rails_env
|
86
|
+
executables: []
|
88
87
|
extensions: []
|
89
88
|
extra_rdoc_files: []
|
90
89
|
files:
|
@@ -96,7 +95,6 @@ files:
|
|
96
95
|
- README.md
|
97
96
|
- Rakefile
|
98
97
|
- bin/console
|
99
|
-
- bin/platform_rails_env
|
100
98
|
- bin/setup
|
101
99
|
- lib/platform_sh_rails.rb
|
102
100
|
- lib/platform_sh_rails/version.rb
|
data/bin/platform_rails_env
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require "platform_sh"
|
3
|
-
if ENV['TMPDIR']
|
4
|
-
puts "export TMPDIR=/tmp"
|
5
|
-
end
|
6
|
-
if PlatformSH::on_platform? && !PlatformSH::is_build_environment?
|
7
|
-
puts "export DATABASE_URL=\"#{PlatformSH::guess_database_url}\""
|
8
|
-
end
|
9
|
-
if PlatformSH::on_platform? && PlatformSH::is_build_environment?
|
10
|
-
puts "export DB_ADAPTER=nulldb"
|
11
|
-
puts "DATABASE_URL=nulldb://localhost/nulldb?pool=5"
|
12
|
-
end
|
13
|
-
puts '
|
14
|
-
RAILS_SERVE_STATIC_FILES=true
|
15
|
-
RAILS_LOG_TO_STDOUT=true
|
16
|
-
SECRET_KEY_BASE=$PLATFORM_PROJECT_ENTROPY
|
17
|
-
'
|